def RefreshBagSlotWindow(self): #2) Inside this func search: self.wndItem.RefreshSlot() if self.wndBelt: self.wndBelt.RefreshSlot() #3) Before make a new line and paste: if app.ENABLE_CHANGELOOK_SYSTEM: slotClNumberChecked = 0 if not constInfo.IS_AUTO_POTION(itemVnum): if app.ENABLE_HIGHLIGHT_SYSTEM: if not slotNumber in self.listHighlightedSlot: self.wndItem.DeactivateSlot(i) else: self.wndItem.DeactivateSlot(i) for q in xrange(changelook.WINDOW_MAX_MATERIALS): (isHere, iCell) = changelook.GetAttachedItem(q) if isHere: if iCell == slotNumber: self.wndItem.ActivateSlot(i, (238.00 / 255.0), (11.00 / 255.0), (11.00 / 255.0), 1.0) if not slotNumber in self.listAttachedCl: self.listAttachedCl.append(slotNumber) slotClNumberChecked = 1 else: if slotNumber in self.listAttachedCl and not slotClNumberChecked: self.wndItem.DeactivateSlot(i) self.listAttachedCl.remove(slotNumber)
def OnPressAccept(self): (isHere, iCell) = changelook.GetAttachedItem(1) if not isHere: return dialog = uiCommon.QuestionDialog() dialog.SetText(localeInfo.CHANGE_LOOK_CHANGE_ITEM) dialog.SetAcceptEvent(ui.__mem_func__(self.OnAccept)) dialog.SetCancelEvent(ui.__mem_func__(self.OnCancelAccept)) dialog.Open() self.dialog = dialog
def Refresh(self): for i in xrange(changelook.WINDOW_MAX_MATERIALS): self.slot.ClearSlot(i) (isHere, iCell) = changelook.GetAttachedItem(i) if isHere: self.slot.SetItemSlot(i, player.GetItemIndex(iCell), 1) self.passItemSlot.ClearSlot(0) (isHere, iCell) = changelook.GetAttachedPassItem() if isHere: self.passItemSlot.SetItemSlot(0, player.GetItemIndex(iCell), 1) self.cost.SetText( localeInfo.CHANGE_LOOK_COST % (localeInfo.AddPointToNumberString(changelook.GetCost())))
def OverInItem(self, selectedSlotPos): if self.tooltipItem: (isHere, iCell) = changelook.GetAttachedItem(selectedSlotPos) if isHere: self.tooltipItem.SetInventoryItem(iCell)
def RefreshBagSlotWindow(self): getItemVNum=player.GetItemIndex getItemCount=player.GetItemCount setItemVNum=self.wndItem.SetItemSlot for i in xrange(player.INVENTORY_PAGE_SIZE*4): slotNumber = self.__InventoryLocalSlotPosToGlobalSlotPos(i) itemCount = getItemCount(slotNumber) if 0 == itemCount: self.wndItem.ClearSlot(i) continue elif 1 == itemCount: itemCount = 0 itemVnum = getItemVNum(slotNumber) setItemVNum(i, itemVnum, itemCount) if app.ENABLE_CHANGELOOK_SYSTEM: itemTransmutedVnum = player.GetItemTransmutation(slotNumber) if itemTransmutedVnum: self.wndItem.DisableCoverButton(i) else: self.wndItem.EnableCoverButton(i) if constInfo.IS_AUTO_POTION(itemVnum): metinSocket = [player.GetItemMetinSocket(slotNumber, j) for j in xrange(player.METIN_SOCKET_MAX_NUM)] if slotNumber >= player.INVENTORY_PAGE_SIZE: slotNumber -= player.INVENTORY_PAGE_SIZE isActivated = 0 != metinSocket[0] if isActivated: self.wndItem.ActivateSlot(slotNumber) potionType = 0; if constInfo.IS_AUTO_POTION_HP(itemVnum): potionType = player.AUTO_POTION_TYPE_HP elif constInfo.IS_AUTO_POTION_SP(itemVnum): potionType = player.AUTO_POTION_TYPE_SP usedAmount = int(metinSocket[1]) totalAmount = int(metinSocket[2]) player.SetAutoPotionInfo(potionType, isActivated, (totalAmount - usedAmount), totalAmount, self.__InventoryLocalSlotPosToGlobalSlotPos(i)) else: self.wndItem.DeactivateSlot(i) if app.ENABLE_SASH_SYSTEM: slotNumberChecked = 0 if not constInfo.IS_AUTO_POTION(itemVnum): self.wndItem.DeactivateSlot(i) for j in xrange(sash.WINDOW_MAX_MATERIALS): (isHere, iCell) = sash.GetAttachedItem(j) if isHere: if iCell == slotNumber: self.wndItem.ActivateSlot(i, (238.00 / 255.0), (11.00 / 255.0), (11.00 / 255.0), 1.0) if not slotNumber in self.listAttachedSashs: self.listAttachedSashs.append(slotNumber) slotNumberChecked = 1 else: if slotNumber in self.listAttachedSashs and not slotNumberChecked: self.wndItem.DeactivateSlot(i) self.listAttachedSashs.remove(slotNumber) if app.ENABLE_CHANGELOOK_SYSTEM: slotClNumberChecked = 0 if not constInfo.IS_AUTO_POTION(itemVnum): self.wndItem.DeactivateSlot(i) for q in xrange(changelook.WINDOW_MAX_MATERIALS): (isHere, iCell) = changelook.GetAttachedItem(q) if isHere: if iCell == slotNumber: self.wndItem.ActivateSlot(i, (238.00 / 255.0), (11.00 / 255.0), (11.00 / 255.0), 1.0) if not slotNumber in self.listAttachedCl: self.listAttachedCl.append(slotNumber) slotClNumberChecked = 1 else: if slotNumber in self.listAttachedCl and not slotClNumberChecked: self.wndItem.DeactivateSlot(i) self.listAttachedCl.remove(slotNumber) else: self.wndItem.DeactivateSlot(slotNumber) self.wndItem.RefreshSlot() if self.wndBelt: self.wndBelt.RefreshSlot()
def Refresh(self): for i in xrange(changelook.WINDOW_MAX_MATERIALS): self.slot.ClearSlot(i) (isHere, iCell) = changelook.GetAttachedItem(i) if isHere: self.slot.SetItemSlot(i, player.GetItemIndex(iCell), 1)