noisiv 1
noisiv
Manwe Work 1
Manwe Work
Scarlet 1
Scarlet
Bvural41 1
Bvural41
mavzermete 1
mavzermete
Hikaye Ekle

Envanter item arama (Highlight uyumlu)

  • Konuyu başlatan Konuyu başlatan qDESTAN
  • Başlangıç tarihi Başlangıç tarihi
  • Cevaplar Cevaplar 16
  • Görüntüleme Görüntüleme 2K

HERAKLES Otomatik Avlı kalıcı sunucu. 19 Haziran'da açılıyor. Atius & Wizard güvencesiyle hemen kayıt ol, ön kayıt ödülleri aktif. HEMEN TIKLA!

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

[CODE lang="python" title="uiinventory.py"]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"
},[/CODE]
 

En Çok Reaksiyon Alan Mesajlar

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

[CODE lang="python" title="uiinventory.py"]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"
},[/CODE]
Paylaşım için teşekkürler.
İki halini de yaptık geçiş yapılabilir istenildiği takdirde. Aradığın itemi bütün page'lerde highlight içerisine alıyor fakat first hangi page'deyse ona odaklanıp ilk onun yerini gösteriyor. Taşıman sürüklemen veya kullanman aramayı temizlemedikçe highlight'ı bozmuyor.

Öğeyi görmek için üye olmalısınız.
İşlevsel olan bu şekli elinize sağlık diğeri teoride güzel pratikte işkence
0604_223814.jpg
 
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

[CODE lang="python" title="uiinventory.py"]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"
},[/CODE]
Paylaşım için teşekkürler.
 

Şu an konuyu görüntüleyenler (Toplam : 0, Üye: 0, Misafir: 0)

Geri
Üst