radiobutton tooltip güncellemesi (Mitsi simya için veya nerede kullanırsan)

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

Admin

Metin2Lobby
Yönetici
Founder
Katılım
6 Mayıs 2022
Mesajlar
52,647
Ticaret : 1 / 0 / 0
radiobutton'larda tooltip göstermek için ekstra bir güncelleme (mitsi simya ile geldi sanırım official cliente.)
Aynı mantıkda diğer tüm radiobuttonlarada eklenebilir ;)

6C58Ha.png


Kod:
// Arat:     void CRadioButton::OnMouseOverIn()     {         if (!IsEnable())             return;         if (!m_isPressed)         {             SetCurrentVisual(&m_overVisual);         } // Altına ekle:         PyCallClassMemberFunc(m_poHandler, "OnMouseOverIn", BuildEmptyTuple()); // Arat:     void CRadioButton::OnMouseOverOut()     {         if (!IsEnable())             return;         if (!m_isPressed)         {             SetCurrentVisual(&m_upVisual);         } // Altına ekle:         PyCallClassMemberFunc(m_poHandler, "OnMouseOverOut", BuildEmptyTuple());

Kod:
# Arat:         self.SetWindowName("DragonSoulWindow")         self.__LoadWindow() # Üstüne ekle: self.toolTip = uiToolTip.ToolTip() # Arat:         self.inventoryTab[0].Down() # Üstüne ekle:         for i in range(0,len(self.inventoryTab)):             self.inventoryTab[i].SetOverEvent( ui.__mem_func__(self.__ButtonOverIn), i )             self.inventoryTab[i].SetOverOutEvent( ui.__mem_func__(self.__ButtonOverOut), i ) # Arat:         self.activateButton.SetUp() # Altına ekle:     def __ButtonOverIn(self, i):         import wndMgr         tooltipList = ["İşlenmemiş","Yontulmuş","Ender","Antika","Efsanevi","Mitsi"]         tooltip = tooltipList[i]                arglen = len(str(tooltip))         pos_x, pos_y = wndMgr.GetMousePosition()                self.toolTip.ClearToolTip()         self.toolTip.SetThinBoardSize(11 * arglen)         self.toolTip.SetToolTipPosition(pos_x, pos_y - 30)         self.toolTip.AppendTextLine(tooltip)         self.toolTip.Show()            def __ButtonOverOut(self, idx):         self.toolTip.Hide()

Metin2 Mitsi Simya Sistemi İçin RadioButton Tooltip Güncellemesi


Metin2 özel sunucularında gelişmiş kullanıcı arayüzü (UI) deneyimi sağlamak, oyuncuların daha kolay ve etkileşimli bir oyun yaşamamasını sağlar. Bu bağlamda Mitsi Simya sistemi gibi modüler sistemlerde, özellikle radyo butonları (RadioButton) üzerine gelindiğinde gösterilen araç ipuçları (tooltip) oldukça önemli bir rol oynar. Bu yazıda, Mitsi Simya sistemi için bir RadioButton tooltip güncellemesi nasıl yapılır, hangi dosyalarda değişiklik yapılmalı, C++ ve Python tabanlı yapılar nasıl entegre edilmeli ele alacağız.

Mitsi Simya Sistemi Nedir?
Mitsi Simya sistemi, Metin2 özel sunucularında popüler olan, oyuncuların farklı simya tariflerini seçip bunları uygulayabileceği gelişmiş bir UI sistemidir. Bu sistem genellikle Python tabanlı UI dosyalarıyla çalışır ve uiscript, py root, pack yapıları üzerinden özelleştirilir. Simya sistemine erişim genellikle bir pencere üzerinden sağlanır ve bu pencere içinde simya tariflerini temsil eden radyo butonları yer alır.

Tooltip Nedir ve Neden Önemlidir?
Tooltip, bir arayüz öğesinin üzerine gelindiğinde görünen kısa açıklama kutusudur. Metin2'de tooltip, oyuncuların butonların ne işe yaradığını hızlıca anlamasını sağlar. Özellikle simya gibi karmaşık sistemlerde doğru tooltip kullanımı, kullanıcı deneyimini ciddi anlamda artırır. Mitsi Simya sisteminde her simya tarifi farklı bir fonksiyon barındırabilir; bu yüzden her radyo butonuna özel tooltip tanımlamak önemlidir.

Python GUI ve UI Script Üzerinde Tooltip Tanımı
Python GUI dosyalarında (py root), Mitsi Simla UI dosyası genellikle 'uiscript' klasörü altında bulunur. Bu dosyada radyo butonları tanımlanırken, her birine özel tooltip eklemek mümkündür. Örneğin bir RadioButton tanımı şöyle yapılır:

Kod:
alchemyradio = ui.RadioButton()[BR][/BR]alchemyradio.SetUp([COLOR=red]'simya_buton_adi'[/COLOR], [COLOR=red]'resim_normal'[/COLOR], [COLOR=red]'resim_uzerine_gelme'[/COLOR], [COLOR=red]'resim_basili'[/COLOR])[BR][/BR]alchemyradio.SetToolTipText([COLOR=red]'Bu simya efektini aktif eder.'[/COLOR])


C++ Kaynak Kod Tarafında Tooltip Dinamikleştirme
Metin2 sunucu tarafında (server src), simya sistemi ile ilgili veriler genellikle DB ile yönetilir. C++ kodlarında tooltip metinleri sabit olarak değil, dinamik olarak veritabanından alınabilir. Örneğin, bir simya ID'sine göre tooltip metni çekilebilir ve Python tarafına gönderilerek UI üzerinde gösterilebilir. Bu sayede adminler simya açıklamalarını kolayca değiştirebilir.

Py GUI ile Tooltip Güncelleme
Py GUI kullanarak, Mitsi Simya sistemindeki radyo butonları için tooltip metinlerini gerçek zamanlı güncelleyebiliriz. Bunun için Python tarafında bir fonksiyon yazmak ve UI nesnesinin SetToolTipText metodunu çağırmak yeterlidir:

Kod:
def UpdateToolTip(self, button_id, new_tooltip):[BR][/BR]    if button_id in self.radioButtons:[BR][/BR]        self.radioButtons[button_id].SetToolTipText(new_tooltip)


Paketleme ve Sunucuya Entegrasyon
Hazırlanan tooltip güncellemeleri, client src ve pack yapıları ile paketlenerek oyunculara dağıtılır. Sunucu tarafında C++ kodlar güncellenmeli, DB kısmında gerekli tablolar mevcutsa genişletilmeli ya da yeni tablolar eklenmelidir. Auth ve game server yapıları da bu değişikliklere göre yeniden derlenmelidir (compile).

Sonuç
Mitsi Simya sisteminde RadioButton tooltip güncellemesi yapmak, hem kullanıcı dostu bir arayüz hem de dinamik içerik sunumu açısından büyük fayda sağlar. Python GUI, UI Script, C++ server src ve DB yapılarını bir araya getirerek güçlü bir simya sistemi oluşturulabilir. Metin2 özel sunucularında bu tür geliştirmeler, oyuncu memnuniyetini ve oyun içi deneyimi ciddi şekilde artırır. Bu yazıda anlatılan adımlar, Metin2 geliştiricileri için kapsamlı bir yol haritası niteliğindedir.


RadioButton Tooltip Update for Mitsi Alchemy System (or wherever you use it)


Providing an advanced user interface (UI) experience on Metin2 private servers helps players enjoy a more intuitive and interactive gameplay. In this context, tooltips shown when hovering over radio buttons in modular systems like the Mitsi Alchemy system play a crucial role. This article will cover how to implement a tooltip update for the Mitsi Alchemy system, which files need modification, and how C++ and Python-based structures can be integrated.

What Is the Mitsi Alchemy System?
The Mitsi Alchemy system is a popular module in Metin2 private servers that allows players to select different alchemy recipes and apply them. This system typically operates through Python-based UI files and is customized using uiscript, py root, and pack structures. Access to the alchemy system is usually provided via a window containing radio buttons representing each alchemy recipe.

What Is a Tooltip and Why Is It Important?
A tooltip is a small information box that appears when hovering over a UI element. In Metin2, tooltips help players quickly understand what a button does. Especially in complex systems like alchemy, proper tooltip usage significantly enhances the player experience. Each radio button in the Mitsi Alchemy system may represent a unique function, making custom tooltips essential.

Defining Tooltips in Python GUI and UI Script
In Python GUI files (py root), the Mitsi Alchemy UI file is generally located within the 'uiscript' folder. When defining radio buttons, custom tooltips can be added to each one. For example:

Kod:
alchemyradio = ui.RadioButton()[BR][/BR]alchemyradio.SetUp([COLOR=red]'alchemy_button_name'[/COLOR], [COLOR=red]'image_normal'[/COLOR], [COLOR=red]'image_hover'[/COLOR], [COLOR=red]'image_pressed'[/COLOR])[BR][/BR]alchemyradio.SetToolTipText([COLOR=red]'Activates this alchemy effect.'[/COLOR])


Dynamic Tooltips in C++ Source Code
On the server side (server src), alchemy-related data is usually managed through the database. In C++ code, tooltip texts can be fetched dynamically from the database rather than being hardcoded. For instance, tooltip text can be retrieved based on an alchemy ID and sent to the Python side for display on the UI, allowing administrators to easily modify alchemy descriptions.

Updating Tooltips with Py GUI
Using Py GUI, we can update tooltip texts for radio buttons in the Mitsi Alchemy system in real-time. To do this, write a function in Python and call the SetToolTipText method of the UI object:

Kod:
def UpdateToolTip(self, button_id, new_tooltip):[BR][/BR]    if button_id in self.radioButtons:[BR][/BR]        self.radioButtons[button_id].SetToolTipText(new_tooltip)


Packaging and Server Integration
The prepared tooltip updates should be packaged using client src and pack structures for distribution to players. On the server side, C++ codes must be updated, and if necessary, new tables should be added or existing ones extended in the database. Auth and game server structures should also be recompiled accordingly.

Conclusion
Implementing a tooltip update for radio buttons in the Mitsi Alchemy system offers significant benefits in terms of user-friendly interfaces and dynamic content delivery. By combining Python GUI, UI Script, C++ server src, and DB structures, a robust alchemy system can be built. Such improvements in Metin2 private servers greatly enhance player satisfaction and in-game experience. The steps outlined in this article serve as a comprehensive guide for Metin2 developers.
 

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

Benzer konular

Geri
Üst Alt