uiinventory.py:
Python
self.costumeButton = self.GetChild2("CostumeButton") arat
#############
self.searchInput = self.GetChild("ItemSearchInput")
self.searchButton = self.GetChild("SearchButton")
self.searchInput.SetReturnEvent(ui.__mem_func__(self.OnSearchItem))
self.searchButton.SetEvent(ui.__mem_func__(self.ToggleSearchInput))
self.shiftedWidgets = [
self.GetChild("ItemSlot"),
self.GetChild("Inventory_Tab_01"),
self.GetChild("Inventory_Tab_02"),
self.GetChild("Inventory_Tab_03"),
self.GetChild("Inventory_Tab_04"),
self.GetChild("Equipment_Base"),
# gerekiyorsa ekle: Money_Slot, TitleBar vb. ya da kendine göre düzenle
]
self.searchInputShown = False
#############
def SetItemSlotVnum(self, slotNumber): arat
üstüne ekle
def OnSearchItem(self):
searchText = self.searchInput.GetText().lower()
self.liHighlightedItems = []
if not searchText:
self.wndItem.RefreshSlot()
return
for page in xrange(player.INVENTORY_PAGE_COUNT): # Sayfa sayısı kadar döner
for localSlotIndex in xrange(player.INVENTORY_PAGE_SIZE):
globalSlotIndex = page * player.INVENTORY_PAGE_SIZE + localSlotIndex
itemVNum = player.GetItemIndex(globalSlotIndex)
if itemVNum == 0:
continue
item.SelectItem(itemVNum)
itemName = item.GetItemName().lower()
if searchText in itemName:
self.HighlightSlot(globalSlotIndex)
self.__RefreshHighlights()
InventoryWindow sınıfının içerinde arat
def Close(self):
self.Hide()
altına ekle
def ToggleSearchInput(self):
if self.searchInputShown:
self.searchInput.Hide()
for widget in self.shiftedWidgets:
x, y = widget.GetLocalPosition()
widget.SetPosition(x, y - 25)
self.searchInputShown = False
else:
self.searchInput.Show()
self.searchInput.SetFocus()
for widget in self.shiftedWidgets:
x, y = widget.GetLocalPosition()
widget.SetPosition(x, y + 25)
self.searchInputShown = True
inventorywindowex.py aç
height 590
"children" :
(
## Inventory, Equipment Slots
{
"name" : "board",
"type" : "board",
"style" : ("attach",),
"x" : 0,
"y" : 0,
"width" : 176,
"height" : 590,
"children" :
(
<<< bu kısıma >>>
{
"name": "ItemSearchBackground",
"type": "image",
"x": 10,
"y": 35,
"image": "d:/ymir work/ui/public/parameter_slot_03.sub",
},
{
"name": "ItemSearchInput",
"type": "editline",
"x": 12,
"y": 35,
"width": 106,
"height": 14,
"input_limit": 50,
"text": "",
"style": ("ltr",),
"text_color": 0xffffffff
},
<<<< >>>>> ekle
## Title
## Item Slot arat altına ekle
{
"name": "SearchButton",
"type": "button",
"x": 10,
"y": 5,
"default_image": "d:/ymir work/ui/public/close_button_01.sub",
"over_image": "d:/ymir work/ui/public/close_button_02.sub",
"down_image": "d:/ymir work/ui/public/close_button_03.sub",
"text": "",
"tooltip_text": "Item Ara"
},
Daha Çok Göster
envanterde item arama geliştirilebilir görünüm açısından pek bi göz alıcılığı yok ama arayanlar için yönerge olabilir