Envanter item arama (Highlight uyumlu)

  • Konbuyu başlatan Konbuyu başlatan Admin
  • Başlangıç tarihi Başlangıç tarihi
  • Cevaplar Cevaplar 0
  • Görüntüleme Görüntüleme 83

Admin

Metin2Lobby
Yönetici
Founder
Katılım
6 Mayıs 2022
Mesajlar
52,647
Ticaret : 1 / 0 / 0
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

Kod:
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"                     },

Envanter Item Arama Sistemi (Highlight Uyumlu)
Metin2 özel sunucularında kullanıcı deneyimini artırmak için geliştirilen envanter item arama sistemi, oyuncuların envanterindeki nesneleri hızlı ve kolay şekilde bulmasını sağlar. Bu sistem genellikle Highlight ile uyumlu çalışacak şekilde tasarlanır ve kullanıcı dostu bir arayüz sunar. Bu yazıda, bu sistemin nasıl çalıştığını, nasıl entegre edileceğini ve C++ veya Python tabanlı sistemlerde nasıl geliştirileceğini detaylıca ele alacağız.

Neden Envanter Item Arama Sistemine İhtiyaç Var?
Metin2 gibi MMORPG oyunlarında oyuncular, envanterlerinde çok sayıda farklı item barındırabilir. Özellikle uzun süredir oynayan oyuncuların envanterinde yüzlerce item bulunabilir. Bu durumda belirli bir itemi bulmak zaman alıcı olabilir. Bu problemi çözmek için geliştirilen envanter item arama sistemi sayesinde, oyuncular sadece birkaç harf yazarak aradıkları itemi anında görebilirler.

Sistem Özellikleri
- Anlık arama: Oyuncu yazmaya başladıkça sonuçlar filtrelenir.
- Highlight ile uyumlu: Sistem,.Highlight arayüzüne entegre edilerek daha estetik bir kullanım sunar.
- C++ veya Python destekli: Geliştiriciler hem game-side hem de client-side üzerinde çalışabilir.
- UI Script uyumlu: Metin2'nin eski UI yapısı olan uiscript ile de çalışabilir.

Python Tarafında Uygulama Örneği
Python tarafında geliştirilecek olan bu sistem genellikle py root klasöründe tanımlanır. UIScript üzerinden envanter penceresine bir 'search box' eklenir. Kullanıcı bir şey yazdığında, bu metin karşılaştırılır ve eşleşen itemler vurgulanır veya listelenir. Bu işlem sırasında item isimleri DB'den alınarak karşılaştırma yapılır.

Dikkat Edilmesi Gerekenler
- Performans: Büyük miktarda item içeren envanterlerde sistem yavaşlamamalıdır.
- Hafıza kullanımı: Arama fonksiyonları optimize edilmelidir.
- Highlight entegrasyonu: Görsel uyum sağlanmalıdır.

Geliştirme Adımları
1. UIScript dosyasında arama kutusu tanımlanır.
2. Python kök dosyalarında arama fonksiyonu yazılır.
3. Item isimleri DB ile karşılaştırılır.
4. Eşleşen itemler Highlight sistemine aktarılır.

Sonuç
Envanter item arama sistemi, Metin2 özel sunucularında kullanıcı memnuniyetini ciddi anlamda artırabilecek küçük ama etkili bir özelliktir. Doğru uygulandığında hem performans hem de kullanıcı dostu bir arayüz sağlar. C++ veya Python bilen geliştiriciler, bu sistemi kendi sunucularına kolayca entegre edebilir.


Inventory Item Search System (Highlight Compatible)
The inventory item search system, designed to enhance the user experience on Metin2 private servers, allows players to quickly and easily find items in their inventory. This system is typically designed to work seamlessly with Highlight and offers a user-friendly interface. In this article, we will examine in detail how this system works, how to integrate it, and how it can be developed within C++ or Python-based systems.

Why Is an Inventory Item Search System Needed?
In MMORPG games like Metin2, players may hold numerous different items in their inventories. Particularly for long-time players, there can be hundreds of items in their inventory, making it time-consuming to locate a specific one. With the inventory item search system, players can instantly see the item they are looking for by typing just a few characters.

System Features
- Real-time search: Results are filtered as soon as the player starts typing.
- Highlight compatible: The system integrates with the Highlight interface for a more aesthetic appearance.
- Supports C++ or Python: Developers can work on both the game-side and client-side implementations.
- Compatible with UI Script: Works with Metin2's legacy UI system, uiscript.

Python-Side Implementation Example
This system, developed on the Python side, is generally defined within the py root folder. A 'search box' is added to the inventory window via UIScript. As the user types, the input is compared against item names, which are then highlighted or listed. During this process, item names are retrieved from the database for comparison.

Important Considerations
- Performance: The system should not slow down even with inventories containing large numbers of items.
- Memory usage: Search functions must be optimized.
- Highlight integration: Visual consistency must be maintained.

Development Steps
1. Define a search box in the UIScript file.
2. Write the search function in Python root files.
3. Compare item names with the database.
4. Pass matching items to the Highlight system.

Conclusion
The inventory item search system is a small but impactful feature that can significantly increase user satisfaction on Metin2 private servers. When implemented correctly, it provides both performance and a user-friendly interface. Developers familiar with C++ or Python can easily integrate this system into their own servers.
 

Şuan Bu Konuyu Görüntüleyen Kullanıcılar (Toplam : 0, Üye : 0, Misafir : 0)

Benzer konular

Geri
Üst Alt