[Python] Chat ekranına uyarı yazısı yazma.

Toranaga

Efendi Toranaga
Site yetkilisi
Süper Moderatör
Premium Üye
Geliştirici
Yardımsever Üye
Mesaj
851
Çözümler
44
Beğeni
893
Puan
959
Ticaret Puanı
0
Merhabalar. Resimde gördüğünüz gibidir. Basit bir işlem kolaylıkla ekleyebilirsiniz.
Linkleri görebilmek için giriş yap veya kayıt ol.

Kodlar:

uiChat.py:
## Düzenlemelerin hepsi class ChatLine(ui.EditLine): içindedir.
# Arat: def __init__(self) içinde
self.overTextLine = ui.TextLine()
self.overTextLine.SetParent(self)
self.overTextLine.SetPosition(-1, 0)
self.overTextLine.SetFontColor(1.0, 1.0, 0.0)
self.overTextLine.SetOutline()
self.overTextLine.Hide()
# Altına Ekle
self.placeholderTextLine = ui.TextLine()
self.placeholderTextLine.SetParent(self)
self.placeholderTextLine.SetPosition(-1, 0)
self.placeholderTextLine.SetFontColor(1.8, 1.8, 1.8)
self.placeholderTextLine.SetOutline()
self.placeholderTextLine.Show()
self.placeholderTextLine.SetText("  Shift tusuna basili tutarak chat akisini durdurabilirsin.")

# Arat: def OnIMEUpdate(self) içinde
    ui.EditLine.OnIMEUpdate(self)
    self.__CheckChatMark()
# Altına ekle
    if len(self.GetText()) > 0:
        self.placeholderTextLine.Hide()
    else:
        self.placeholderTextLine.Show()

# Değiştir: def __CheckChatMark(self)
def __CheckChatMark(self):
    self.overTextLine.Hide()

    text = self.GetText()
    if len(text) > 0:
        if '#' == text[0]:
            self.overTextLine.SetText("#")
            self.overTextLine.Show()
            self.placeholderTextLine.Hide() # Eklenen yer
        elif '%' == text[0]:
            self.overTextLine.SetText("%")
            self.overTextLine.Show()
            self.placeholderTextLine.Hide() # Eklenen
        elif '!' == text[0]:
            self.overTextLine.SetText("!")
            self.overTextLine.Show()
            self.placeholderTextLine.Hide() # Eklenen
 
Teşekkürler. SHIFT tuşuna basılı tutarak chati durdurma eklentisi elinizde var mı?
 
Paylaşım için teşekkürler.

Ekran Alıntısı.JPG
 
Diğerinde üst tuşuna basıp eski yazıları getirdiğinde bu yazı gitmiyordu onu ayarladım.
 
Geri
Üst