Ufak Tatlışlık # Ekran Görüntüsü Bildirimi

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

Admin

Metin2Lobby
Yönetici
Founder
Katılım
6 Mayıs 2022
Mesajlar
52,647
Ticaret : 1 / 0 / 0
Selamlar, incelediğim birçok serverfiles'da PrintScreen tuşu ile SS alındığı zaman kaydettiği yol ve bildirim tarzı birşey gözükmüyor. Ufak ince ayrıntılara dikkat eden birisi olduğum için kendi açacağım server'a bu özelliği ekledim ve benim gibi ince ayrıntılara dikkat edenler olduğunu düşündüğüm için paylaşıyorum. Aslında yapımı basit ancak bi köşede dursun, zararı olmaz :)
1-) root » game.py açın
2-)

Oluşacak görüntü:

Kanıt:



Ufak Tatlışlık # Ekran Görüntüsü Bildirimi

Metin2 Lobby olarak sunucu geliştirme ve oyun içi deneyimleri geliştirmeye yönelik küçük ama etkileyici sistemlerden birini sizlere aktarmak istiyoruz. Bu yazıda, oyuncuların ekran görüntüsünü alırken otomatik olarak bir bildirim gösteren Ufak Tatlışlık # Ekran Göruntusu Bildirimi sistemini ele alacağız. Bu sistem, özellikle Metin2 özel sunucularında oyun içi deneyimi zenginleştirmek, güvenlik önlemleri almak veya estetik açıdan oyun atmosferini desteklemek için idealdir.

Sistem Nedir?

Oyuncu klavyeden F12 tuşuna bastığında Windows veya sistem varsayılanı tarafından bir ekran görüntüsü alınır. Bu eylem sırasında oyun içi bir bildirim göstermek, hem estetik hem de fonksiyonel olarak kullanıcı deneyimini artırabilir. Bu sistem sayesinde, ekran görüntüsü alındığında oyun içi bir mesaj belirir: 'Ekran görüntüsü alındı!'. Bu sayede hem kullanıcıya geri bildirim verilir hem de gizli ekran görüntüleri alınmasının önüne geçilebilir.

Nasıl Entegre Edilir?

Bu sistemi Metin2 özel sunucularınızda kullanmak için öncelikle client-side dosyalarda bazı değişiklikler yapmanız gerekir. Sistem, py files ve uiscript dosyaları üzerinden çalışır. Öncelikle, root klasöründe bulunan game.py dosyasında gerekli kod bloklarını tanımlamalısınız. Bu blok, klavye tuşuna basıldığında çalışacak olan fonksiyonu tetikler. Daha sonra, ui.py dosyasında da gerekli çağrıyı yaparak bildirim sistemini entegre edebilirsiniz.

Python Kod Yapısı

Python tarafında bu işlemi gerçekleştirmek için öncelikle import satırlarına time ve app gibi modüller eklenmelidir. Ardından, klavye tuşuna basıldığında çalışacak olan fonksiyon yazılır. Örneğin:

if app.IsPressed(app.DIK_F12):
chat.AppendChat(chat.CHAT_TYPE_INFO, 'Ekran görüntüsü alındı!')

Bu yapı sayesinde, F12 tuşuna basıldığında oyun içinde bir bilgi mesajı görüntülenir.

Py GUI ve UIscript Kullanımı

Sistemin görsel olarak daha estetik görünmesi için Py GUI tabanlı bir bildirim tasarımı da yapılabilir. Bu durumda uiscript dosyası kullanılır ve özel bir pencere veya metin kutusu ile kullanıcıya bildirim gösterilir. Ancak bu işlem daha fazla kodlama bilgisi gerektirebilir. Basit bir yapı için standart chat.AppendChat yeterlidir.

Dikkat Edilmesi Gerekenler

Bu sistemi entegre ederken game.py dosyasında yanlışlıkla başka bir fonksiyonu bozmamaya dikkat edilmelidir. Ayrıca, farklı tuş kombinasyonları için aynı yapı tekrar edilebilir. Fakat her tuş için ayrı ayrı kontrol yazmak performans kaybına neden olabilir. Bu nedenle, sadece ihtiyaç duyulan tuşlar için bildirim sistemi oluşturulmalıdır.

Sonuç

Ufak Tatlışlık # Ekran Görüntüsü Bildirimi sistemi, Metin2 özel sunucularında kullanıcı dostu ve estetik bir eklentidir. Oyun içi küçük dokunuşlar, oyuncuların deneyimini ciddi şekilde artırabilir. Bu sistem, C++ veya Python bilgisi olan geliştiriciler için kolayca entegre edilebilir. Metin2Lobby olarak bu tür sistemlerin geliştiriciler için nasıl kullanılabileceğini örneklerle anlatmaya devam edeceğiz.


Small Sweetness # Screenshot Notification

Metin2 Lobby brings you one of the small but impressive systems that enhance server development and in-game experiences. In this article, we will discuss the automatic notification system that shows a message when players take screenshots: Small Sweetness # Screenshot Notification. This system is ideal for enhancing in-game experience, implementing security measures, or supporting the aesthetic atmosphere of the game, especially on Metin2 private servers.

What Is The System?

When a player presses the F12 key, a screenshot is taken by Windows or the system's default settings. During this action, showing an in-game notification can improve both aesthetics and functionality of the user experience. With this system, a message like 'Screenshot captured!' appears within the game when a screenshot is taken. This way, feedback is provided to the user, and hidden screenshots are prevented.

How To Integrate?

To use this system on your Metin2 private servers, you first need to make certain changes in the client-side files. The system operates via py files and uiscript files. Initially, you must define the necessary code blocks in the game.py file located in the root folder. This block triggers the function when a keyboard key is pressed. Then, you can integrate the notification system by making the necessary call in the ui.py file.

Python Code Structure

To implement this feature in Python, first add modules such as time and app to the import lines. Then write the function that executes when the keyboard key is pressed. For example:

if app.IsPressed(app.DIK_F12):
chat.AppendChat(chat.CHAT_TYPE_INFO, 'Screenshot captured!')

With this structure, an info message is displayed in-game when the F12 key is pressed.

Using Py GUI and UIscript

For a more aesthetic visual appearance of the system, a custom notification design can be created using Py GUI. In this case, uiscript files are used to show the notification through a custom window or text box. However, this process may require more coding knowledge. For simple implementations, the standard chat.AppendChat method is sufficient.

Important Notes

While integrating this system, care should be taken not to break other functions in the game.py file. Additionally, the same structure can be repeated for different key combinations. However, creating separate checks for each key might cause performance loss. Therefore, notifications should only be implemented for keys that are actually needed.

Conclusion

Small Sweetness # Screenshot Notification is a user-friendly and aesthetic addition for Metin2 private servers. Small touches like these can significantly enhance player experience. This system can easily be integrated by developers with knowledge of C++ or Python. At Metin2Lobby, we will continue to present examples of how such systems can be utilized by developers.​
 

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

Benzer konular

Geri
Üst Alt