Oyun Seçeneklerine Oto Mesaj Ekleme [Python]

Whistle

Ruhsuz Filozof
Kurucu
Kurumsal Üye
Geliştirici
Yardımsever Üye
Mesaj
11.494
Çözümler
546
Beğeni
12.054
Puan
5.864
root/constinfo.py açılır ve şu kod eklenir;
Python:
WHISPER_OTO_MESAJ = 0
WHISPER_OTO_MESAJ_TEXT = ""

root/uigameoption.py açılır ve aratılır;
Python:
def __Initialize(self):
En alta şu kod eklenir:
Kod:
self.showotoTextButtonList = []

Tekrar aratılır;
Python:
self.showDamageButtonList.append(GetObject("show_d amage_off_button"))
Altına şu kodlar eklenir:
Python:
self.showotoTextButtonList.append(GetObject("ototext_on_button2"))
            self.showotoTextButtonList.append(GetObject("ototext_off_button2"))

Tekrar aratılır;
Python:
self.showDamageButtonList[1].SAFE_SetEvent(self.__OnClickShowDamageOffButton)
Altına şu kodlar eklenir:
Python:
      self.showotoTextButtonList[0].SAFE_SetEvent(self.__OnClickOtoTextOnButton2)
        self.showotoTextButtonList[1].SAFE_SetEvent(self.__OnClickOtoTextOffButton2)

Tekrar aratılır;
Python:
def OnUpdate(self):
Altına şu kodlar eklenir:
Python:
        if constInfo.bildirimler == 0:            if tek == 0:
                self.showotoTextButtonList[0].Down()
                self.showotoTextButtonList[1].SetUp()
                tek = 1
            #self.showotoTextButtonList[0].SetUpVisual("d:/ymir work/ui/public/middle_button_03.sub")
        else:
            if tek == 0:
                self.showotoTextButtonList[0].SetUp()
                self.showotoTextButtonList[1].Down()
                tek = 1
            #self.showotoTextButtonList[1].SetUpVisual("d:/ymir work/ui/public/middle_button_03.sub")
            #self.showotoTextButtonList[0].SetUp()
            #self.showotoTextButtonList[1].Down()

Tekrar aratılır;
Python:
def __OnClickBlockPartyRequest(self):
Altına şu kodlar eklenir:
Python:
def __OnClickOtoTextOnButton2(self):        global tek
        tek = 0
        self.showotoTextButtonList[0].Down()
        self.showotoTextButtonList[1].SetUp()
     
    def __OnClickOtoTextOffButton2(self):
        global tek
        tek = 0
        self.showotoTextButtonList[0].SetUp()
        self.showotoTextButtonList[1].Down()
ve root bölümüde bitti

sıra uiscript'e geldi
uiscript/gameoption.py açılır ve şu kodlar en alta eklenir;
Python:
                {                    "name" : "ototext_on_button2",
                    "type" : "radio_button",


                    "x" : LINE_DATA_X,
                    "y" : 240 + EK_Y + 25,


                    "text" : uiScriptLocale.OPTION_SALESTEXT_VIEW_ON,


                    "default_image" : ROOT_PATH + "middle_button_01.sub",
                    "over_image" : ROOT_PATH + "middle_button_02.sub",
                    "down_image" : ROOT_PATH + "middle_button_03.sub",
                },
                {
                    "name" : "ototext_off_button2",
                    "type" : "radio_button",


                    "x" : LINE_DATA_X+MIDDLE_BUTTON_WIDTH,
                    "y" : 240 + EK_Y + 25,


                    "text" : uiScriptLocale.OPTION_SALESTEXT_VIEW_OFF,


                    "default_image" : ROOT_PATH + "middle_button_01.sub",
                    "over_image" : ROOT_PATH + "middle_button_02.sub",
                    "down_image" : ROOT_PATH + "middle_button_03.sub",
                },

Sistemin çalıştığına dair kanıt;
Oyun Seçeneklerine Oto Mesaj Ekleme [Python].jpg
 
Son düzenleme:
Kardeşim şu Tab ayarlarını ekle ayarsız bide uigameoption.py da def OnUpdate(self): diye bi kod yok hazır dosya atabilir misin?
 
En son bir moderatör tarafından düzenlenmiş:
Kardeşim şu Tab ayarlarını ekle ayarsız bide uigameoption.py da def OnUpdate(self): diye bi kod yok hazır dosya atabilir misin?
Merhaba,
Tab ayarlarını ne yazik ki forum sitemiz desteklemiyor. Desteklemediği için tab ayarlarını python az çok biliyorsanız kendiniz yapabilirsiniz.
Bu arada uigameoption.py'de def "OnUpdate(self):" yoksa
Kod:
def OnBlockMode(self, mode):
        global blockMode
        blockMode = mode
        self.RefreshBlock()
şu kodu aratır mısınız? Eğer bu kod varsa bu kodun altına "def OnUpdate(self):" oluşturup verdiğim kodları ekleyiniz.
 
Python:
0806 14:33:28416 :: Failed to load script file : uiscript/gameoptiondialog.py
0806 14:33:28419 ::
ui.py(line:4449) LoadScriptFile
system.py(line:198) execfile
system.py(line:169) Run
uiscript/gameoptiondialog.py(line:514) <module>

LoadScriptFile!!!!!!!!!!!!!! - <type 'exceptions.NameError'>:name 'EK_Y' is not defined

0806 14:33:28419 :: ============================================================================================================
0806 14:33:28419 :: Abort!!!!


0806 14:33:28420 ::
uiGameOption.py(line:69) __Load_LoadScript
ui.py(line:4466) LoadScriptFile
exception.py(line:36) Abort

OptionDialog.__Load_LoadScript - <type 'exceptions.SystemExit'>:

0806 14:33:28420 :: ============================================================================================================
0806 14:33:28420 :: Abort!!!!

Python:
0806 14:36:21751 :: Traceback (most recent call last):

0806 14:36:21751 ::   File "uiGameOption.py", line 615, in OnUpdate

0806 14:36:21751 :: AttributeError
0806 14:36:21751 :: :
0806 14:36:21751 :: 'module' object has no attribute 'bildirimler'
0806 14:36:21751 ::

0806 14:36:21764 :: Traceback (most recent call last):

0806 14:36:21764 ::   File "uiGameOption.py", line 615, in OnUpdate

0806 14:36:21765 :: AttributeError
0806 14:36:21765 :: :
0806 14:36:21765 :: 'module' object has no attribute 'bildirimler'
0806 14:36:21765 ::
 
En son bir moderatör tarafından düzenlenmiş:
O dönemler acemi olduğum için paylaşırken pek dikkat etmeden kodları eklemişim. Bunlar çözülebilir sorunlar. Sırasıyla şunları yapın;
Python:
0806 14:33:28416 :: Failed to load script file : uiscript/gameoptiondialog.py
0806 14:33:28419 ::
ui.py(line:4449) LoadScriptFile
system.py(line:198) execfile
system.py(line:169) Run
uiscript/gameoptiondialog.py(line:514) <module>

LoadScriptFile!!!!!!!!!!!!!! - <type 'exceptions.NameError'>:name 'EK_Y' is not defined

0806 14:33:28419 :: ============================================================================================================
0806 14:33:28419 :: Abort!!!!


0806 14:33:28420 ::
uiGameOption.py(line:69) __Load_LoadScript
ui.py(line:4466) LoadScriptFile
exception.py(line:36) Abort

OptionDialog.__Load_LoadScript - <type 'exceptions.SystemExit'>:

0806 14:33:28420 :: ============================================================================================================
0806 14:33:28420 :: Abort!!!!
Script dosyalarındaki syser çözümü için;
uiscript/gameoptiondialog.py dosyasının en başında tanımlanmış değişkenler var. Ona şunu ekleyin;
Python:
EK_Y = 25


Python:
0806 14:36:21751 :: Traceback (most recent call last):

0806 14:36:21751 ::   File "uiGameOption.py", line 615, in OnUpdate

0806 14:36:21751 :: AttributeError
0806 14:36:21751 :: :
0806 14:36:21751 :: 'module' object has no attribute 'bildirimler'
0806 14:36:21751 ::

0806 14:36:21764 :: Traceback (most recent call last):

0806 14:36:21764 ::   File "uiGameOption.py", line 615, in OnUpdate

0806 14:36:21765 :: AttributeError
0806 14:36:21765 :: :
0806 14:36:21765 :: 'module' object has no attribute 'bildirimler'
0806 14:36:21765 ::
Bu hatanın çözümü için ise root/constInfo.py dosyasına şunları ekleyin;
Python:
bildirimler = 0

Bu konunun varlığını bile unutmuştum. :D İyi ki syserr hatalarınızı yazmışsınız bende konuda ki eksiklikleri düzeltirim. :)
 
teşekkür edeirm :) def __IsSpecialMap(self) bu da yok bunada bakarmısın

@Whistle

Python:
0806 15:28:27013 :: Traceback (most recent call last):

0806 15:28:27013 ::   File "uiGameOption.py", line 616, in OnUpdate

0806 15:28:27014 :: UnboundLocalError
0806 15:28:27014 :: :
0806 15:28:27014 :: local variable 'tek' referenced before assignment
0806 15:28:27014 ::

0806 15:28:27029 :: Traceback (most recent call last):

0806 15:28:27029 ::   File "uiGameOption.py", line 616, in OnUpdate

0806 15:28:27030 :: UnboundLocalError
0806 15:28:27030 :: :
0806 15:28:27030 :: local variable 'tek' referenced before assignment
0806 15:28:27030 ::
 
En son bir moderatör tarafından düzenlenmiş:
teşekkür edeirm :) def __IsSpecialMap(self) bu da yok bunada bakarmısın
O hızlı ch sistemi için kullanılan fonksiyon. Konuda o kısmı düzelttim


@Whistle

Python:
0806 15:28:27013 :: Traceback (most recent call last):

0806 15:28:27013 ::   File "uiGameOption.py", line 616, in OnUpdate

0806 15:28:27014 :: UnboundLocalError
0806 15:28:27014 :: :
0806 15:28:27014 :: local variable 'tek' referenced before assignment
0806 15:28:27014 ::

0806 15:28:27029 :: Traceback (most recent call last):

0806 15:28:27029 ::   File "uiGameOption.py", line 616, in OnUpdate

0806 15:28:27030 :: UnboundLocalError
0806 15:28:27030 :: :
0806 15:28:27030 :: local variable 'tek' referenced before assignment
0806 15:28:27030 ::
Python:
        if constInfo.bildirimler == 0:
            self.showotoTextButtonList[0].Down()
            self.showotoTextButtonList[1].SetUp()
        else:
            self.showotoTextButtonList[0].SetUp()
            self.showotoTextButtonList[1].Down()
Şu şekilde değiştirebilirsiniz.

Yalnız bu sistemi yapan kişi 34k için yapmıştı. Bunu daha iyi bir şekilde kaynak kodunu kullanarak tasarlanabilir
 
Son düzenleme:
Geri
Üst