def UnselectItemSlot(self, selectedSlotPos): if constInfo.GET_ITEM_QUESTION_DIALOG_STATUS() == 1: return if shop.IsPrivateShop(): self.AskBuyItem(selectedSlotPos) else: net.SendShopBuyPacket(self.__GetRealIndex(selectedSlotPos))
def SelectItemSlot(self, selectedSlotPos): if constInfo.GET_ITEM_QUESTION_DIALOG_STATUS() == 1: return isAttached = mouseModule.mouseController.isAttached() selectedSlotPos = self.__GetRealIndex(selectedSlotPos) if isAttached: self.SellAttachedItem() else: if True == shop.IsMainPlayerPrivateShop(): return curCursorNum = app.GetCursor() if app.BUY == curCursorNum: self.AskBuyItem(selectedSlotPos) elif app.SELL == curCursorNum: chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.SHOP_SELL_INFO) else: selectedItemID = shop.GetItemID(selectedSlotPos) itemCount = shop.GetItemCount(selectedSlotPos) type = player.SLOT_TYPE_SHOP if shop.IsPrivateShop(): type = player.SLOT_TYPE_PRIVATE_SHOP mouseModule.mouseController.AttachObject( self, type, selectedSlotPos, selectedItemID, itemCount) mouseModule.mouseController.SetCallBack( "INVENTORY", ui.__mem_func__(self.DropToInventory)) snd.PlaySound("sound/ui/pick.wav")
def SelectEmptySlot(self, slotIndex): try: if (constInfo.GET_ITEM_QUESTION_DIALOG_STATUS() == 1): return if (mouseModule.mouseController.isAttached()): attachedSlotType = mouseModule.mouseController.GetAttachedType() attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber() mouseModule.mouseController.DeattachObject() if (player.SLOT_TYPE_INVENTORY != attachedSlotType and player.SLOT_TYPE_DRAGON_SOUL_INVENTORY != attachedSlotType): return attachedInvenType = player.SlotTypeToInvenType(attachedSlotType) itemVnum = player.GetItemIndex(attachedInvenType, attachedSlotPos) item.SelectItem(itemVnum) if (item.IsAntiFlag(item.ANTIFLAG_GIVE) or item.IsAntiFlag(item.ANTIFLAG_MYSHOP)): chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.OFFLINE_SHOP_CANNOT_SELL_ITEM) return priceInputBoard = uiCommon.MoneyInputDialog() priceInputBoard.SetTitle(item.GetItemName() + "'s price") priceInputBoard.SetAcceptEvent(ui.__mem_func__(self.AcceptInputPrice)) priceInputBoard.SetCancelEvent(ui.__mem_func__(self.CancelInputPrice)) priceInputBoard.Open() self.priceInputBoard = priceInputBoard self.priceInputBoard.bDisplayPos = slotIndex self.priceInputBoard.bPos = attachedSlotPos except Exception, e: import dbg dbg.TraceError("Exception : SelectEmptySlot, %s" %(e))
def SelectItemSlot(self, itemSlotIndex): if constInfo.GET_ITEM_QUESTION_DIALOG_STATUS() == 1: return itemSlotIndex = self.__InventoryLocalSlotPosToGlobalSlotPos(itemSlotIndex) if mouseModule.mouseController.isAttached(): attachedSlotType = mouseModule.mouseController.GetAttachedType() attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber() attachedItemVID = mouseModule.mouseController.GetAttachedItemIndex() if player.SLOT_TYPE_INVENTORY == attachedSlotType: self.__DropSrcItemToDestItemInInventory(attachedItemVID, attachedSlotPos, itemSlotIndex) mouseModule.mouseController.DeattachObject() else: curCursorNum = app.GetCursor() if app.SELL == curCursorNum: self.__SellItem(itemSlotIndex) elif app.BUY == curCursorNum: chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.SHOP_BUY_INFO) elif app.IsPressed(app.DIK_LALT): link = player.GetItemLink(itemSlotIndex) ime.PasteString(link) elif app.IsPressed(app.DIK_LSHIFT): itemCount = player.GetItemCount(itemSlotIndex) if itemCount > 1: self.dlgPickMoney.SetTitleName(localeInfo.PICK_ITEM_TITLE) self.dlgPickMoney.SetAcceptEvent(ui.__mem_func__(self.OnPickItem)) self.dlgPickMoney.Open(itemCount) self.dlgPickMoney.itemGlobalSlotIndex = itemSlotIndex #else: #selectedItemVNum = player.GetItemIndex(itemSlotIndex) #mouseModule.mouseController.AttachObject(self, player.SLOT_TYPE_INVENTORY, itemSlotIndex, selectedItemVNum) elif app.IsPressed(app.DIK_LCONTROL): itemIndex = player.GetItemIndex(itemSlotIndex) if True == item.CanAddToQuickSlotItem(itemIndex): player.RequestAddToEmptyLocalQuickSlot(player.SLOT_TYPE_INVENTORY, itemSlotIndex) else: chat.AppendChat(chat.CHAT_TYPE_INFO, localeInfo.QUICKSLOT_REGISTER_DISABLE_ITEM) else: selectedItemVNum = player.GetItemIndex(itemSlotIndex) itemCount = player.GetItemCount(itemSlotIndex) mouseModule.mouseController.AttachObject(self, player.SLOT_TYPE_INVENTORY, itemSlotIndex, selectedItemVNum, itemCount) if self.__IsUsableItemToItem(selectedItemVNum, itemSlotIndex): self.wndItem.SetUseMode(True) else: self.wndItem.SetUseMode(False) snd.PlaySound("sound/ui/pick.wav")
def Hide(self): if constInfo.GET_ITEM_QUESTION_DIALOG_STATUS(): self.OnCloseQuestionDialog() return if None != self.tooltipItem: self.tooltipItem.HideToolTip() if self.wndCostume: self.isOpenedCostumeWindowWhenClosingInventory = self.wndCostume.IsShow() # 인벤토리 창이 닫힐 때 코스츔이 열려 있었는가? self.wndCostume.Close() if app.ENABLE_BIOLOG_SYSTEM: if self.wndCollect: self.isOpenedCollectWindowWhenClosingInventory = self.wndCollect.IsOpeningInventory() print "Is opening Biolog Inventory", self.isOpenedCollectWindowWhenClosingInventory self.wndCollect.Close() if self.wndBelt: self.isOpenedBeltWindowWhenClosingInventory = self.wndBelt.IsOpeningInventory() # 인벤토리 창이 닫힐 때 벨트 인벤토리도 열려 있었는가? print "Is Opening Belt Inven?? ", self.isOpenedBeltWindowWhenClosingInventory self.wndBelt.Close() if self.dlgPickMoney: self.dlgPickMoney.Close() wndMgr.Hide(self.hWnd)
def UseItemSlot(self, slotIndex): if constInfo.GET_ITEM_QUESTION_DIALOG_STATUS(): return slotIndex = self.__InventoryLocalSlotPosToGlobalSlotPos(slotIndex) if app.ENABLE_DRAGON_SOUL_SYSTEM: if self.wndDragonSoulRefine.IsShow(): self.wndDragonSoulRefine.AutoSetItem((player.INVENTORY, slotIndex), 1) return if app.ENABLE_SASH_SYSTEM: if self.isShowSashWindow(): sash.Add(player.INVENTORY, slotIndex, 255) return if app.ENABLE_CHANGELOOK_SYSTEM: if self.isShowChangeLookWindow(): if player.GetItemIndex(slotIndex) == changelook.PASS_ITEM_VNUM_1 or player.GetItemIndex(slotIndex) == changelook.PASS_ITEM_VNUM_2: # chat.AppendChat(chat.CHAT_TYPE_INFO, "AddPassItem %d" % player.GetItemIndex(slotIndex)) changelook.AddPassItem(player.INVENTORY, slotIndex, 255) else: changelook.Add(player.INVENTORY, slotIndex, 255) return self.__UseItem(slotIndex) mouseModule.mouseController.DeattachObject() self.OverOutItem()
def UnselectItemSlot(self, selectedSlotPos): import constInfo, chat if constInfo.BlockItemsSystem["Block"] == 1: chat.AppendChat(1, "Sicherheitssystem Aktiviert.") return if constInfo.GET_ITEM_QUESTION_DIALOG_STATUS() == 1: return if shop.IsPrivateShop(): self.AskBuyItem(selectedSlotPos) else: GFHhg54GHGhh45GHGH.SendShopBuyPacket( self.__GetRealIndex(selectedSlotPos))
def SelectEmptySlot(self, selectedSlotPos): if constInfo.GET_ITEM_QUESTION_DIALOG_STATUS() == 1: return selectedSlotPos = self.__InventoryLocalSlotPosToGlobalSlotPos( selectedSlotPos) if mouseModule.mouseController.isAttached(): attachedSlotType = mouseModule.mouseController.GetAttachedType() attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber( ) attachedItemCount = mouseModule.mouseController.GetAttachedItemCount( ) attachedItemIndex = mouseModule.mouseController.GetAttachedItemIndex( ) if player.SLOT_TYPE_INVENTORY == attachedSlotType: itemCount = player.GetItemCount(attachedSlotPos) attachedCount = mouseModule.mouseController.GetAttachedItemCount( ) self.__SendMoveItemPacket(attachedSlotPos, selectedSlotPos, attachedCount) if item.IsRefineScroll(attachedItemIndex): self.wndItem.SetUseMode(False) elif player.SLOT_TYPE_PRIVATE_SHOP == attachedSlotType: mouseModule.mouseController.RunCallBack("INVENTORY") elif player.SLOT_TYPE_OFFLINE_SHOP == attachedSlotType: mouseModule.mouseController.RunCallBack("INVENTORY") elif player.SLOT_TYPE_SHOP == attachedSlotType: net.SendShopBuyPacket(attachedSlotPos) elif player.SLOT_TYPE_SAFEBOX == attachedSlotType: if player.ITEM_MONEY == attachedItemIndex: net.SendSafeboxWithdrawMoneyPacket( mouseModule.mouseController.GetAttachedItemCount()) snd.PlaySound("sound/ui/money.wav") else: net.SendSafeboxCheckoutPacket(attachedSlotPos, selectedSlotPos) elif player.SLOT_TYPE_MALL == attachedSlotType: net.SendMallCheckoutPacket(attachedSlotPos, selectedSlotPos) mouseModule.mouseController.DeattachObject()
def UnselectItemSlot(self, selectedSlotPos): if (constInfo.GET_ITEM_QUESTION_DIALOG_STATUS() == 1): return itemIndex = shop.GetOfflineShopItemID(selectedSlotPos) item.SelectItem(itemIndex) itemName = item.GetItemName() priceInputBoard = uiCommon.MoneyInputDialog() priceInputBoard.SetTitle(itemName + "Yeni fiyat") priceInputBoard.SetAcceptEvent(ui.__mem_func__(self.AcceptInputPrice)) priceInputBoard.SetCancelEvent(ui.__mem_func__(self.CancelInputPrice)) priceInputBoard.Open() self.priceInputBoard = priceInputBoard self.priceInputBoard.pos = selectedSlotPos
def UnselectItemSlot(self, selectedSlotPos): if (constInfo.GET_ITEM_QUESTION_DIALOG_STATUS() == 1): return itemIndex = shop.GetOfflineShopItemID(selectedSlotPos) item.SelectItem(itemIndex) itemName = item.GetItemName() questionDialog = uiCommon.QuestionDialog() questionDialog.SetText(localeInfo.DO_YOU_WANT_TO_REMOVE_ITEM % (itemName)) questionDialog.SetAcceptEvent(lambda arg = True : self.AnswerRemoveItem(arg)) questionDialog.SetCancelEvent(lambda arg = False : self.AnswerRemoveItem(arg)) questionDialog.Open() questionDialog.pos = selectedSlotPos self.questionDialog = questionDialog constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(1)
def SelectItemSlot(self, selectedSlotPos): if (constInfo.GET_ITEM_QUESTION_DIALOG_STATUS() == 1): return isAttached = mouseModule.mouseController.isAttached() if (not isAttached): curCursorNum = app.GetCursor() if (app.BUY == curCursorNum): net.SendOfflineShopBuyPacket(selectedSlotPos) else: selectedItemID = shop.GetOfflineShopItemID(selectedSlotPos) itemCount = shop.GetOfflineShopItemCount(selectedSlotPos) type = player.SLOT_TYPE_OFFLINE_SHOP mouseModule.mouseController.AttachObject(self, type, selectedSlotPos, selectedItemID, itemCount) mouseModule.mouseController.SetCallBack("INVENTORY", ui.__mem_func__(self.DropToInventory)) snd.PlaySound("sound/ui/pick.wav")
def UseItemSlot(self, slotIndex): curCursorNum = app.GetCursor() if app.SELL == curCursorNum: return if constInfo.GET_ITEM_QUESTION_DIALOG_STATUS(): return slotIndex = self.__InventoryLocalSlotPosToGlobalSlotPos(slotIndex) if app.ENABLE_DRAGON_SOUL_SYSTEM: if self.wndDragonSoulRefine.IsShow(): self.wndDragonSoulRefine.AutoSetItem((player.INVENTORY, slotIndex), 1) return self.__UseItem(slotIndex) mouseModule.mouseController.DeattachObject() self.OverOutItem()
def Open(self, mode): if FALSE == self.isLoaded: self.__LoadScript() self.__Initialize() if constInfo.GET_ITEM_QUESTION_DIALOG_STATUS() == 1: chat.AppendChat( chat.CHAT_TYPE_INFO, "Du kannst das Gildenlager nicht oeffnen, solange du ein Item droppst." ) self.Close() return if mouseModule.mouseController.isAttached(): chat.AppendChat( chat.CHAT_TYPE_INFO, "Du kannst das Gildenlager nicht oeffnen, solange du ein Item haelst." ) self.Close() return constInfo.GUILDSTORAGE["open"] = 1 self.StandartInterface() ## clear the slots for i in range(120): self.GuildStorage["slots"].ClearSlot(i) if mode == 0: self.Adminpanel["btn_Admin"].Hide() self.Logs["btn_Logs"].Hide() else: self.Adminpanel["btn_Admin"].Show() self.Logs["btn_Logs"].Show() (self.xGuildStorageStart, self.yGuildStorageStart, z) = fgGHGjjFHJghjfFG1545gGG.GetMainCharacterPosition() self.SetTop() self.Show()
def UnselectItemSlot(self, selectedSlotPos): if (constInfo.GET_ITEM_QUESTION_DIALOG_STATUS() == 1): return self.AskBuyItem(selectedSlotPos)
def UnselectItemSlot(self, selectedSlotPos): if (constInfo.GET_ITEM_QUESTION_DIALOG_STATUS() == 1): return net.SendOfflineShopTakeItem(selectedSlotPos) net.SendRefreshUnsoldItems();