[Python] Normal Pet Aktif Efekti İçin Taskbar Uyarlaması

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

Admin

Metin2Lobby
Yönetici
Founder
Katılım
6 Mayıs 2022
Mesajlar
52,647
Ticaret : 1 / 0 / 0

uiTaskbar.py Açın ve Aratın:

Kod:
## QuickSlot     def RefreshQuickSlot(self):

Altında Arayınız:

Kod:
if player.SLOT_TYPE_INVENTORY == Type:                     itemIndex = player.GetItemIndex(Position)                     itemCount = player.GetItemCount(Position)                     if itemCount <= 1:                         itemCount = 0                     if constInfo.IS_AUTO_POTION(itemIndex):                         metinSocket = [player.GetItemMetinSocket(Position, j) for j in xrange(player.METIN_SOCKET_MAX_NUM)]                         if 0 != int(metinSocket[0]):                             slot.ActivateSlot(slotNumber)                         else:                             slot.DeactivateSlot(slotNumber)

Altına Ekle:

Kod:
if itemIndex >= 53001 and itemIndex <= 53343:                         metinSocket = [int(player.GetItemMetinSocket(Position, j)) for j in xrange(player.METIN_SOCKET_MAX_NUM)]                         if 0 != int(metinSocket[1]):                             slot.ActivateSlot(slotNumber)                             #slot.SetSlotDiffuseColor(i, wndMgr.COLOR_TYPE_DARK_TURQUOISE)                         else:                             slot.DeactivateSlot(slotNumber)

Ben Efekte Renk Verebiliyorum Fakat Sizde Olmayabilir Düşüncesi İle Onu Yorum Satırı Yaptım. Eğer Sizde Varsa Aktif Edebilirsiniz.

Benim Protodaki Petlerim 53001'den Başlıyor 53343'e Kadar Arasında Hiçbir Farlı Item Olmaksızın.
Kendinize Göre Değiştiriniz.

KANIT:

139538_39ba99f65b64164ca204aa8a7d77ff60.png


Hata Düzeltmesi:

F1 F2 F3 ve F4'de SetSlotDiffuseColor Etkisizdi Bu Nedenle Şu Şekilde Yapın.


slot.SetSlotDiffuseColor(slotNumber, wndMgr.COLOR_TYPE_DARK_TURQUOISE)





[Python] Normal Pet Aktif Efekti İçin Taskbar Uyarlaması


Metin2 özel sunucularında kullanıcı deneyimini artırmak için geliştirilen sistemlerden birisi de pet efektleridir. Bu efektler, oyuncuların karakterlerine ait evcil hayvanların normal durumlarda aktif etkilerini göstermesini sağlar. Bu yazıda, Python tabanlı GUI üzerinde çalışan bir taskbar uyarlamasının nasıl yapılacağını ve bu uyarlamada normal pet aktif efekti özelliğinin nasıl entegre edileceğini ele alacağız.

Pet Sistemine Genel Bakış
Metin2 özel sunucularında pet sistemleri, oyuncuların seviye atladıkça veya belirli görevleri tamamladıklarında kazandıkları sadık yoldaşlardır. Bu sistemler genellikle C++ tabanlı sunucu tarafında tanımlanır. Ancak, pet efektlerinin görsel olarak kullanıcıya aktarılması için client-side geliştirme gerekir. Burada devreye Python GUI ve uiscript dosyaları girer.

Taskbar Nedir?
Taskbar, oyuncuların ekranında sürekli görünen bir paneldir. Bu panel sayesinde oyuncular karakterlerinin durumu, pet efektleri, bufflar gibi bilgilere kolayca ulaşabilirler. Normal pet aktif efekti için bu taskbar üzerinde özel bir simge veya animasyon tanımlanabilir. Bu işlem, genellikle py root dizininde bulunan GUI dosyalarında yapılır.

Python ile Taskbar Uyarlaması Nasıl Yapılır?
Python ile taskbar üzerinde pet efekti gösterimi için öncelikle mevcut GUI yapısı incelenmelidir. uiscript dosyası içinde taskbar bileşeni tanımlıdır. Bu bileşene yeni bir slot veya icon eklenebilir. Örneğin:

Kod:
[COLOR=green]def AddPetEffectSlot(self):[BR][/BR]    petSlot = uiBar.Slot(...)  # Yeni slot nesnesi[BR][/BR]    petSlot.SetPosition(200, 20)  # Taskbar üzerinde konum[BR][/BR]    petSlot.Show()[/COLOR]


Önemli Not: Bu işlem sırasında client src üzerinde değişiklik yapılması gerekebilir. Özellikle pet_effect_manager.py gibi dosyalar üzerinde çalışmak önemlidir.

Normal Pet Aktif Efekti Mantığı
Normal pet aktif efekti, petin aktif olduğu sürece kullanıcıya bildirim olarak görünmelidir. Bu efekt, genellikle buff olarak düşünülür. Bu nedenle, pet aktif edildiğinde effectAgent üzerinden bir efekt çalıştırılır. Aynı zamanda bu efektin taskbar üzerinde de bir görsel temsili olmalıdır.

Taskbar Icon Dinamikliği
Taskbar üzerindeki pet efekti ikonu, petin aktif ya da pasif olmasına göre değişmelidir. Bu dinamiklik, python tarafında timer veya event handler ile sağlanabilir. Örnek bir yapı şu şekilde olabilir:

Kod:
[COLOR=green]def UpdatePetIcon(self):[BR][/BR]    if player.GetPetActive():[BR][/BR]        self.petSlot.LoadImage('pet_active_icon.dds')[BR][/BR]    else:[BR][/BR]        self.petSlot.LoadImage('pet_inactive_icon.dds')[/COLOR]


Sunucu Tarafı Entegrasyonu
C++ server src üzerinde yapılan pet efekt tanımları, game server programming kapsamında db core ile entegre edilmelidir. Sunucu tarafında petin aktif edilip edilmediği bilgisi, client'e aktarılmalı ki Python GUI bu bilgiyi okuyarak taskbar üzerinde gerekli güncellemeleri yapabilsin.

Sonuç
Python ile taskbar üzerinde normal pet aktif efekti gösterimi, kullanıcı deneyimini ciddi anlamda artırır. Bu işlem için hem client hem de server tarafında küçük değişiklikler gerekebilir. Metin2lobby.com olarak bu gibi gelişmiş sistemlerin nasıl kurulduğunu paylaşmaya devam ediyoruz.


[Python] Taskbar Customization for Normal Pet Active Effect


To enhance user experience on Metin2 private servers, one of the systems developed is pet effects. These effects allow the active effects of pets belonging to players to be displayed during normal states. In this article, we will discuss how to implement a taskbar adaptation based on Python GUI and how the normal pet active effect feature can be integrated into it.

Overview of Pet Systems
In Metin2 private servers, pet systems are loyal companions obtained by players when they level up or complete certain quests. These systems are typically defined on the server-side using C++. However, visual representation of pet effects to the user requires client-side development. This is where Python GUI and uiscript files come into play.

What Is a Taskbar?
Taskbar is a panel constantly visible on the player's screen. It allows players to quickly access information such as character status, pet effects, buffs, etc. For the normal pet active effect, a special icon or animation can be defined on this taskbar. This process is usually performed within GUI files located in the py root directory.

How to Customize Taskbar with Python?
To display pet effects on the taskbar with Python, first, the current GUI structure must be analyzed. The taskbar component is defined inside the uiscript file. A new slot or icon can be added to this component. For example:

Kod:
[COLOR=green]def AddPetEffectSlot(self):[BR][/BR]    petSlot = uiBar.Slot(...)  # New slot object[BR][/BR]    petSlot.SetPosition(200, 20)  # Position on taskbar[BR][/BR]    petSlot.Show()[/COLOR]


Important Note: Modifications to the client src may be required during this process. Particularly, working on files like pet_effect_manager.py is important.

Logic of Normal Pet Active Effect
Normal pet active effect should appear as a notification to the user while the pet is active. This effect is generally considered as a buff. Therefore, when the pet is activated, an effect runs via effectAgent. Additionally, this effect should have a visual representation on the taskbar.

Taskbar Icon Dynamism
The pet effect icon on the taskbar should change depending on whether the pet is active or inactive. This dynamism can be achieved on the Python side using a timer or event handler. An example structure could look like this:

Kod:
[COLOR=green]def UpdatePetIcon(self):[BR][/BR]    if player.GetPetActive():[BR][/BR]        self.petSlot.LoadImage('pet_active_icon.dds')[BR][/BR]    else:[BR][/BR]        self.petSlot.LoadImage('pet_inactive_icon.dds')[/COLOR]


Server-Side Integration
Pet effect definitions made on the C++ server src must be integrated with the db core as part of game server programming. Information about whether the pet is active must be transferred to the client so that Python GUI can read this information and perform necessary updates on the taskbar.

Conclusion
Displaying normal pet active effects on the taskbar with Python significantly enhances user experience. This process may require minor changes on both client and server sides. At Metin2lobby.com, we continue to share how such advanced systems are implemented.
 

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

Benzer konular

Geri
Üst Alt