ENABLE_MOUSEWHEEL_EVENT - Envanter Sayfa Değiştirme

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

Admin

Metin2Lobby
Yönetici
Founder
Katılım
6 Mayıs 2022
Mesajlar
52,647
Ticaret : 1 / 0 / 0
<a href=" " class="link link--external" target="_blank" rel="nofollow ugc noopener" data-proxy-href="/proxy.php?link=https%3A%2F%2Fi.gyazo.com%2Fe00f853800314e2ede505e22c75c3582.gif&amp;hash=f04b3960e0fcf209fcf4f08acf080e6a"> </a>​

NOT marty in mouse whell sistemine uyarlı bu kod kendinizinkine uyarlayabilirsiniz.

Kod:
uiinventory py aç bul class InventoryWindow(ui.ScriptWindow):        içinde bul            def __del__(self):         ui.ScriptWindow.__del__(self)                altına ekle            def OnMouseWheel(self, delta):         if not hasattr(app, 'ENABLE_MOUSEWHEEL_EVENT') or not app.ENABLE_MOUSEWHEEL_EVENT:             return False         # 1: down, -1: up (typical convention)         page_count = len(self.inventoryTab)         if page_count &lt;= 1:             return False         new_page = self.inventoryPageIndex         if delta &lt; 0:             new_page = (self.inventoryPageIndex + 1) % page_count         elif delta &gt; 0:             new_page = (self.inventoryPageIndex - 1 + page_count) % page_count         if new_page != self.inventoryPageIndex:             self.SetInventoryPage(new_page)         return True uisafebox.py class SafeboxWindow(ui.ScriptWindow): bul     def __del__(self):         ui.ScriptWindow.__del__(self) altına ekle     def OnMouseWheel(self, delta):         if not hasattr(app, 'ENABLE_MOUSEWHEEL_EVENT') or not app.ENABLE_MOUSEWHEEL_EVENT:             return False         # 1: down, -1: up (typical convention)         page_count = len(self.pageButtonList)         if page_count &lt;= 1:             return False         new_page = self.curPageIndex         if delta &lt; 0:             new_page = (self.curPageIndex + 1) % page_count         elif delta &gt; 0:             new_page = (self.curPageIndex - 1 + page_count) % page_count         if new_page != self.curPageIndex:             self.SelectPage(new_page)         return True class MallWindow(ui.ScriptWindow): bul     def __del__(self):         ui.ScriptWindow.__del__(self) altına ekle     def OnMouseWheel(self, delta):         if not hasattr(app, 'ENABLE_MOUSEWHEEL_EVENT') or not app.ENABLE_MOUSEWHEEL_EVENT:             return False         # 1: down, -1: up (typical convention)         page_count = len(self.pageButtonList)         if page_count &lt;= 1:             return False         new_page = self.curPageIndex         if delta &lt; 0:             new_page = (self.curPageIndex + 1) % page_count         elif delta &gt; 0:             new_page = (self.curPageIndex - 1 + page_count) % page_count         if new_page != self.curPageIndex:             self.SelectPage(new_page)         return True

ENABLE_MOUSEWHEEL_EVENT - Envanter Sayfa Değiştirme

Metin2 özel sunucularında kullanıcı deneyimini artırmak için birçok küçük ama etkili değişiklik yapılabilir. Bunlardan birisi envanter sayfaları arasında fare tekerleği ile geçiş yapabilme özelliğidir. Bu özellik ENABLE_MOUSEWHEEL_EVENT olarak bilinir ve C++ kaynak koda eklenerek kullanıcı dostu bir arayüz sağlanır.

Envanter Sayfa Geçiş Sistemi Nedir?
Metin2 oyununda envanter oldukça geniş bir alandır ve 4 farklı sayfadan oluşur. Oyuncular eşyalarını bu sayfalarda organize ederler. Varsayılan sistemde, sayfalar arasında geçiş sadece butonlarla mümkündür. Ancak bazı oyuncular daha hızlı ve kolay bir geçiş yöntemi arar. İşte burada fare tekerleği devreye girer.

Fare Tekerleği ile Sayfa Geçiş Nasıl Çalışır?
Bu sistem sayesinde, oyuncu fareyle envanter penceresinin üzerine geldiğinde fare tekerleğini kullanarak sayfa değiştirebilir. Yukarı kaydırma bir önceki sayfaya, aşağı kaydırma ise bir sonraki sayfaya yönlendirir. Bu, kullanıcıya zaman kazandırır ve daha akıcı bir oynanış sağlar.

Nasıl Uygulanır?
Bu özelliği aktif etmek için C++ tabanlı game server source üzerinde değişiklik yapılması gerekir. Özellikle UI envanter sınıfı üzerinde bir event fonksiyonu tanımlanarak fare tekerleği hareketleri yakalanır. Bu işlem sırasında 'mousewheel' eventi dinlenir ve buna göre envanter sayfası değiştirilir.

Teknik Açıklamalar
Oyun istemcisi (client) üzerinden UI Script dosyalarında, genellikle envanter sınıfına özel bir 'OnMouseWheel' fonksiyonu eklenir. Bu fonksiyon, fare tekerleği hareketini algılayıp, mevcut sayfayı kontrol ederek bir sonraki veya önceki sayfaya geçiş yaptırır. Bu işlem sırasında UI yeniden çizimi (refresh) de yapılır ki kullanıcı değişikliği görsel olarak fark etsin.

Avantajları Nelerdir?
• Kullanıcı dostu bir arayüz sağlar.
• Oyuncuların envanterde daha hızlı gezmesini sağlar.
• Oyun içi zaman tasarrufu sağlar.
• Geliştirilmiş UI/UX deneyimi sunar.

Sunucu Tarafında Yapılabilecek Ekstra Ayarlar
Bu özellik, sunucu sahiplerinin tercihine göre açılıp kapatılabilir. Bazı sunucularda bu tarz küçük değişiklikler oyuncu memnuniyetini artırırken, diğerlerinde standart sistem tercih edilebilir. ENABLE_MOUSEWHEEL_EVENT tanımı, config dosyasında bir flag olarak tutulabilir ve aktif edilip kapatılabilir.

Sonuç
Metin2 özel sunucularında kullanıcı deneyimini artırmak için küçük ama etkili değişiklikler önemlidir. ENABLE_MOUSEWHEEL_EVENT sistemi, envanter yönetimi konusunda büyük kolaylık sağlar. C++ kaynak kod üzerinde yapılan bu değişiklik, oyuncuların daha keyifli vakit geçirmesini sağlar. Bu gibi geliştirmeler, sunucunuzun rekabet avantajını da artırabilir.


ENABLE_MOUSEWHEEL_EVENT - Inventory Page Switching

In Metin2 private servers, many small yet effective changes can be made to enhance user experience. One such feature is the ability to switch between inventory pages using the mouse wheel. This feature is known as ENABLE_MOUSEWHEEL_EVENT and can be implemented by adding code to the C++ source for a more user-friendly interface.

What is the Inventory Page Switch System?
In Metin2, the inventory is a large space consisting of four different pages. Players organize their items across these pages. By default, switching between pages is only possible via buttons. However, some players seek faster and easier navigation methods. This is where the mouse wheel comes into play.

How Does Mouse Wheel Page Switching Work?
With this system, players can use the mouse wheel to navigate between pages while hovering over the inventory window. Scrolling up moves to the previous page, and scrolling down moves to the next one. This saves time for the user and provides a smoother gameplay experience.

How Is It Implemented?
To activate this feature, modifications must be made to the C++ based game server source code. Specifically, an event function is defined within the UI inventory class to capture mouse wheel movements. During this process, the 'mousewheel' event is listened to, and the inventory page is changed accordingly.

Technical Notes
Within the client-side UI Script files, usually an 'OnMouseWheel' function is added to the inventory class. This function detects mouse wheel movement, checks the current page, and switches to the next or previous page. During this process, the UI is refreshed so that the user visually notices the change.

What Are Its Advantages?
• Provides a user-friendly interface.
• Allows players to browse the inventory faster.
• Saves in-game time.
• Offers improved UI/UX experience.

Additional Server-Side Settings
This feature can be toggled on or off according to server owner preferences. In some servers, such minor changes increase player satisfaction, while others prefer the standard system. The ENABLE_MOUSEWHEEL_EVENT definition can be stored as a flag in a config file and enabled or disabled accordingly.

Conclusion
Small but impactful changes are important for improving user experience in Metin2 private servers. The ENABLE_MOUSEWHEEL_EVENT system significantly eases inventory management. Modifications made to the C++ source code allow players to enjoy the game more. Such improvements may also boost your server's competitive advantage.
 

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

Benzer konular

Geri
Üst Alt