forked from metin2/client
Added game files from TMP4
This commit is contained in:
@ -125,7 +125,7 @@ class BeltInventoryWindow(ui.ScriptWindow):
|
||||
def __del__(self):
|
||||
ui.ScriptWindow.__del__(self)
|
||||
|
||||
def Show(self, openBeltSlot = False):
|
||||
def Show(self, openBeltSlot = FALSE):
|
||||
self.__LoadWindow()
|
||||
self.RefreshSlot()
|
||||
|
||||
@ -146,13 +146,15 @@ class BeltInventoryWindow(ui.ScriptWindow):
|
||||
self.wndBeltInventoryLayer.Show()
|
||||
self.expandBtn.Hide()
|
||||
|
||||
self.AdjustPositionAndSize()
|
||||
if localeInfo.IsARABIC() == 0:
|
||||
self.AdjustPositionAndSize()
|
||||
|
||||
def CloseInventory(self):
|
||||
self.wndBeltInventoryLayer.Hide()
|
||||
self.expandBtn.Show()
|
||||
|
||||
self.AdjustPositionAndSize()
|
||||
if localeInfo.IsARABIC() == 0:
|
||||
self.AdjustPositionAndSize()
|
||||
|
||||
## <20><><EFBFBD><EFBFBD> <20>κ<EFBFBD><CEBA>丮 <20><>ġ<EFBFBD><C4A1> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> BASE <20><>ġ<EFBFBD><C4A1> <20><><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD>.. <20><><EFBFBD><EFBFBD> <20>ϵ<EFBFBD><CFB5>ڵ<EFBFBD><DAB5>ϱ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>..
|
||||
def GetBasePosition(self):
|
||||
@ -193,12 +195,17 @@ class BeltInventoryWindow(ui.ScriptWindow):
|
||||
self.expandBtn.SetEvent(ui.__mem_func__(self.OpenInventory))
|
||||
self.minBtn.SetEvent(ui.__mem_func__(self.CloseInventory))
|
||||
|
||||
if localeInfo.IsARABIC() :
|
||||
self.expandBtn.SetPosition(self.expandBtn.GetWidth() - 2, 15)
|
||||
self.wndBeltInventoryLayer.SetPosition(self.wndBeltInventoryLayer.GetWidth() - 5, 0)
|
||||
self.minBtn.SetPosition(self.minBtn.GetWidth() + 3, 15)
|
||||
|
||||
for i in xrange(item.BELT_INVENTORY_SLOT_COUNT):
|
||||
slotNumber = item.BELT_INVENTORY_SLOT_START + i
|
||||
wndBeltInventorySlot.SetCoverButton(slotNumber, "d:/ymir work/ui/game/quest/slot_button_01.sub",\
|
||||
"d:/ymir work/ui/game/quest/slot_button_01.sub",\
|
||||
"d:/ymir work/ui/game/quest/slot_button_01.sub",\
|
||||
"d:/ymir work/ui/game/belt_inventory/slot_disabled.tga", False, False)
|
||||
"d:/ymir work/ui/game/belt_inventory/slot_disabled.tga", FALSE, FALSE)
|
||||
|
||||
except:
|
||||
import exception
|
||||
@ -220,7 +227,7 @@ class BeltInventoryWindow(ui.ScriptWindow):
|
||||
for i in xrange(item.BELT_INVENTORY_SLOT_COUNT):
|
||||
slotNumber = item.BELT_INVENTORY_SLOT_START + i
|
||||
self.wndBeltInventorySlot.SetItemSlot(slotNumber, getItemVNum(slotNumber), player.GetItemCount(slotNumber))
|
||||
self.wndBeltInventorySlot.SetAlwaysRenderCoverButton(slotNumber, True)
|
||||
self.wndBeltInventorySlot.SetAlwaysRenderCoverButton(slotNumber, TRUE)
|
||||
|
||||
avail = "0"
|
||||
|
||||
@ -249,7 +256,9 @@ class InventoryWindow(ui.ScriptWindow):
|
||||
|
||||
def __init__(self):
|
||||
ui.ScriptWindow.__init__(self)
|
||||
self.OpenBoniSwitcherEvent = lambda : None
|
||||
|
||||
self.isOpenedBeltWindowWhenClosingInventory = 0 # <20>κ<EFBFBD><CEBA>丮 <20><><EFBFBD><EFBFBD> <20><> <20><>Ʈ <20>κ<EFBFBD><CEBA>丮<EFBFBD><E4B8AE> <20><><EFBFBD><EFBFBD><EFBFBD>־<EFBFBD><D6BE><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>-_-; <20><><EFBFBD>̹<EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
|
||||
self.__LoadWindow()
|
||||
|
||||
def __del__(self):
|
||||
@ -423,6 +432,9 @@ class InventoryWindow(ui.ScriptWindow):
|
||||
self.equipmentTab = []
|
||||
|
||||
def Hide(self):
|
||||
if constInfo.GET_ITEM_QUESTION_DIALOG_STATUS():
|
||||
self.OnCloseQuestionDialog()
|
||||
return
|
||||
if None != self.tooltipItem:
|
||||
self.tooltipItem.HideToolTip()
|
||||
|
||||
@ -437,8 +449,6 @@ class InventoryWindow(ui.ScriptWindow):
|
||||
|
||||
if self.dlgPickMoney:
|
||||
self.dlgPickMoney.Close()
|
||||
|
||||
self.OnCloseQuestionDialog()
|
||||
|
||||
wndMgr.Hide(self.hWnd)
|
||||
|
||||
@ -509,8 +519,7 @@ class InventoryWindow(ui.ScriptWindow):
|
||||
mouseModule.mouseController.AttachObject(self, player.SLOT_TYPE_INVENTORY, itemSlotIndex, selectedItemVNum, count)
|
||||
|
||||
def __InventoryLocalSlotPosToGlobalSlotPos(self, local):
|
||||
|
||||
if player.IsEquipmentSlot(local) or player.IsCostumeSlot(local) or player.IsBeltInventorySlot(local):
|
||||
if player.IsEquipmentSlot(local) or player.IsCostumeSlot(local) or (app.ENABLE_NEW_EQUIPMENT_SYSTEM and player.IsBeltInventorySlot(local)):
|
||||
return local
|
||||
|
||||
return self.inventoryPageIndex*player.INVENTORY_PAGE_SIZE + local
|
||||
@ -602,13 +611,14 @@ class InventoryWindow(ui.ScriptWindow):
|
||||
def SetItemToolTip(self, tooltipItem):
|
||||
self.tooltipItem = tooltipItem
|
||||
|
||||
def SellItem(self):
|
||||
if self.sellingSlotitemIndex == player.GetItemIndex(self.sellingSlotNumber):
|
||||
if self.sellingSlotitemCount == player.GetItemCount(self.sellingSlotNumber):
|
||||
net.SendShopSellPacketNew(self.sellingSlotNumber, self.questionDialog.count)
|
||||
snd.PlaySound("sound/ui/money.wav")
|
||||
self.OnCloseQuestionDialog()
|
||||
|
||||
def SellItem(self):
|
||||
if self.sellingSlotitemIndex == player.GetItemIndex(self.sellingSlotNumber):
|
||||
if self.sellingSlotitemCount == player.GetItemCount(self.sellingSlotNumber):
|
||||
## <20><>ȥ<EFBFBD><C8A5><EFBFBD><EFBFBD> <20>ȸ<EFBFBD><C8B8><EFBFBD> <20>ϴ<EFBFBD> <20><><EFBFBD><EFBFBD> <20>߰<EFBFBD><DFB0>ϸ鼭 <20><><EFBFBD><EFBFBD> type <20>߰<EFBFBD>
|
||||
net.SendShopSellPacketNew(self.sellingSlotNumber, self.questionDialog.count, player.INVENTORY)
|
||||
snd.PlaySound("sound/ui/money.wav")
|
||||
self.OnCloseQuestionDialog()
|
||||
|
||||
def OnDetachMetinFromItem(self):
|
||||
if None == self.questionDialog:
|
||||
return
|
||||
@ -618,14 +628,16 @@ class InventoryWindow(ui.ScriptWindow):
|
||||
self.OnCloseQuestionDialog()
|
||||
|
||||
def OnCloseQuestionDialog(self):
|
||||
if self.questionDialog:
|
||||
self.questionDialog.Close()
|
||||
|
||||
if not self.questionDialog:
|
||||
return
|
||||
|
||||
self.questionDialog.Close()
|
||||
self.questionDialog = None
|
||||
constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(0)
|
||||
|
||||
## Slot Event
|
||||
def SelectEmptySlot(self, selectedSlotPos):
|
||||
if constInfo.GET_ITEM_DROP_QUESTION_DIALOG_STATUS() == 1:
|
||||
if constInfo.GET_ITEM_QUESTION_DIALOG_STATUS() == 1:
|
||||
return
|
||||
|
||||
selectedSlotPos = self.__InventoryLocalSlotPosToGlobalSlotPos(selectedSlotPos)
|
||||
@ -666,7 +678,7 @@ class InventoryWindow(ui.ScriptWindow):
|
||||
mouseModule.mouseController.DeattachObject()
|
||||
|
||||
def SelectItemSlot(self, itemSlotIndex):
|
||||
if constInfo.GET_ITEM_DROP_QUESTION_DIALOG_STATUS() == 1:
|
||||
if constInfo.GET_ITEM_QUESTION_DIALOG_STATUS() == 1:
|
||||
return
|
||||
|
||||
itemSlotIndex = self.__InventoryLocalSlotPosToGlobalSlotPos(itemSlotIndex)
|
||||
@ -729,8 +741,8 @@ class InventoryWindow(ui.ScriptWindow):
|
||||
def __DropSrcItemToDestItemInInventory(self, srcItemVID, srcItemSlotPos, dstItemSlotPos):
|
||||
if srcItemSlotPos == dstItemSlotPos:
|
||||
return
|
||||
|
||||
if item.IsRefineScroll(srcItemVID):
|
||||
|
||||
elif item.IsRefineScroll(srcItemVID):
|
||||
self.RefineItem(srcItemSlotPos, dstItemSlotPos)
|
||||
self.wndItem.SetUseMode(False)
|
||||
|
||||
@ -774,6 +786,16 @@ class InventoryWindow(ui.ScriptWindow):
|
||||
self.sellingSlotitemCount = itemCount
|
||||
|
||||
item.SelectItem(itemIndex)
|
||||
## <20><>Ƽ <20>÷<EFBFBD><C3B7><EFBFBD> <20>˻<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>߰<EFBFBD>
|
||||
## 20140220
|
||||
if item.IsAntiFlag(item.ANTIFLAG_SELL):
|
||||
popup = uiCommon.PopupDialog()
|
||||
popup.SetText(localeInfo.SHOP_CANNOT_SELL_ITEM)
|
||||
popup.SetAcceptEvent(self.__OnClosePopupDialog)
|
||||
popup.Open()
|
||||
self.popup = popup
|
||||
return
|
||||
|
||||
itemPrice = item.GetISellItemPrice()
|
||||
|
||||
if item.Is1GoldItem():
|
||||
@ -790,6 +812,11 @@ class InventoryWindow(ui.ScriptWindow):
|
||||
self.questionDialog.SetCancelEvent(ui.__mem_func__(self.OnCloseQuestionDialog))
|
||||
self.questionDialog.Open()
|
||||
self.questionDialog.count = itemCount
|
||||
|
||||
constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(1)
|
||||
|
||||
def __OnClosePopupDialog(self):
|
||||
self.pop = None
|
||||
|
||||
def RefineItem(self, scrollSlotPos, targetSlotPos):
|
||||
|
||||
@ -965,7 +992,7 @@ class InventoryWindow(ui.ScriptWindow):
|
||||
return True
|
||||
elif "USE_PUT_INTO_ACCESSORY_SOCKET" == useType:
|
||||
if self.__CanPutAccessorySocket(dstSlotPos, srcItemVNum):
|
||||
return True;
|
||||
return TRUE;
|
||||
elif "USE_PUT_INTO_BELT_SOCKET" == useType:
|
||||
dstItemVNum = player.GetItemIndex(dstSlotPos)
|
||||
print "USE_PUT_INTO_BELT_SOCKET", srcItemVNum, dstItemVNum
|
||||
@ -1088,12 +1115,11 @@ class InventoryWindow(ui.ScriptWindow):
|
||||
return True
|
||||
|
||||
def UseItemSlot(self, slotIndex):
|
||||
|
||||
curCursorNum = app.GetCursor()
|
||||
if app.SELL == curCursorNum:
|
||||
return
|
||||
return
|
||||
|
||||
if constInfo.GET_ITEM_DROP_QUESTION_DIALOG_STATUS():
|
||||
if constInfo.GET_ITEM_QUESTION_DIALOG_STATUS():
|
||||
return
|
||||
|
||||
slotIndex = self.__InventoryLocalSlotPosToGlobalSlotPos(slotIndex)
|
||||
@ -1102,14 +1128,11 @@ class InventoryWindow(ui.ScriptWindow):
|
||||
if self.wndDragonSoulRefine.IsShow():
|
||||
self.wndDragonSoulRefine.AutoSetItem((player.INVENTORY, slotIndex), 1)
|
||||
return
|
||||
|
||||
|
||||
self.__UseItem(slotIndex)
|
||||
mouseModule.mouseController.DeattachObject()
|
||||
self.OverOutItem()
|
||||
|
||||
def SetOpenBoniSwitcherEvent(self, event):
|
||||
self.OpenBoniSwitcherEvent = ui.__mem_func__(event)
|
||||
|
||||
def __UseItem(self, slotIndex):
|
||||
ItemVNum = player.GetItemIndex(slotIndex)
|
||||
item.SelectItem(ItemVNum)
|
||||
@ -1120,19 +1143,19 @@ class InventoryWindow(ui.ScriptWindow):
|
||||
self.questionDialog.SetCancelEvent(ui.__mem_func__(self.__UseItemQuestionDialog_OnCancel))
|
||||
self.questionDialog.Open()
|
||||
self.questionDialog.slotIndex = slotIndex
|
||||
|
||||
|
||||
constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(1)
|
||||
|
||||
else:
|
||||
self.__SendUseItemPacket(slotIndex)
|
||||
#net.SendItemUsePacket(slotIndex)
|
||||
|
||||
def __UseItemQuestionDialog_OnCancel(self):
|
||||
self.OnCloseQuestionDialog()
|
||||
|
||||
def __UseItemQuestionDialog_OnAccept(self):
|
||||
self.__SendUseItemPacket(self.questionDialog.slotIndex)
|
||||
|
||||
if self.questionDialog:
|
||||
self.questionDialog.Close()
|
||||
self.questionDialog = None
|
||||
self.OnCloseQuestionDialog()
|
||||
|
||||
def __SendUseItemToItemPacket(self, srcSlotPos, dstSlotPos):
|
||||
# <20><><EFBFBD>λ<EFBFBD><CEBB><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ִ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
|
Reference in New Issue
Block a user