Çözüldü KeyError hatası

  • Konuyu açan Konuyu açan allien
  • Açılış Tarihi Açılış Tarihi
  • Yanıt Yanıt 3
  • Gösterim Gösterim 50
Bu konu çözüme ulaştırılmıştır. Çözüm için konuya yazılan tüm yorumları okumayı unutmayın. Eğer konudaki yorumlar sorununuzu çözmediyse yeni bir konu açabilirsiniz.
Durum
İçerik kilitlendiği için mesaj gönderimine kapatıldı.

allien

Premium Üye
Premium Üye
MT Üye
Mesaj
172
Çözümler
8
Beğeni
55
Puan
499
Ticaret Puanı
0
merhaba oyun içi güncelleme notları sistemini eklemeye çalışıyorum fakat bana kafayı yedirtti :D saçma sapan bir şekilde KeyError veriyor uisystem.py da olan karşılığı ile systemdialog.py içerisindeki isimler aynı hataya bi anlam veremedim, çözüm önerilerinizi bekliyorum teşekkürler..


uisystem.py:
Genişlet Daralt Kopyala
    def __LoadSystemMenu_Default(self):
        pyScrLoader = ui.PythonScriptLoader()
        if constInfo.IN_GAME_SHOP_ENABLE:
            pyScrLoader.LoadScriptFile(self, uiScriptLocale.LOCALE_UISCRIPT_PATH + "SystemDialog.py")
        else:
            pyScrLoader.LoadScriptFile(self, "uiscript/systemdialog.py")

        self.GetChild("system_option_button").SAFE_SetEvent(self.__ClickSystemOptionButton)
        self.GetChild("game_option_button").SAFE_SetEvent(self.__ClickGameOptionButton)
        self.GetChild("advanced_skybox_option_button").SAFE_SetEvent(self.__ClickAdvancedSkyboxOptionButton)
        self.GetChild("change_button").SAFE_SetEvent(self.__ClickChangeCharacterButton)
        self.GetChild("logout_button").SAFE_SetEvent(self.__ClickLogOutButton)
        self.GetChild("exit_button").SAFE_SetEvent(self.__ClickExitButton)
        self.GetChild("help_button").SAFE_SetEvent(self.__ClickHelpButton)
        self.GetChild("cancel_button").SAFE_SetEvent(self.Close)
        if app.ENABLE_PATCHNOTE_WINDOW:
            self.wndPatchnotes = uiPatchnotes.PatchNoteWindow()
            self.GetChild("patchnotes_button").SAFE_SetEvent(self.__ClickPatchNotesButton)
        if app.ENABLE_CHANNEL_SWITCH_SYSTEM:
            self.GetChild("movechannel_button").SAFE_SetEvent(self.__ClickMoveChannelButton)

        if constInfo.IN_GAME_SHOP_ENABLE:
            self.GetChild("mall_button").SAFE_SetEvent(self.__ClickInGameShopButton)


    def __LoadSystemMenu_ForPortal(self):
        pyScrLoader = ui.PythonScriptLoader()
        pyScrLoader.LoadScriptFile(self, "uiscript/systemdialog_forportal.py")

        self.GetChild("system_option_button").SAFE_SetEvent(self.__ClickSystemOptionButton)
        self.GetChild("game_option_button").SAFE_SetEvent(self.__ClickGameOptionButton)
        self.GetChild("advanced_skybox_option_button").SAFE_SetEvent(self.__ClickAdvancedSkyboxOptionButton)
        self.GetChild("change_button").SAFE_SetEvent(self.__ClickChangeCharacterButton)
        self.GetChild("exit_button").SAFE_SetEvent(self.__ClickExitButton)
        self.GetChild("help_button").SAFE_SetEvent(self.__ClickHelpButton)
        self.GetChild("cancel_button").SAFE_SetEvent(self.Close)
        if app.ENABLE_CHANNEL_SWITCH_SYSTEM:
            self.GetChild("movechannel_button").SAFE_SetEvent(self.__ClickMoveChannelButton)


    def Destroy(self):
        self.ClearDictionary()

        if self.gameOptionDlg:
            self.gameOptionDlg.Destroy()

        if self.AdvancedskyboxOptionDlg:
            self.AdvancedskyboxOptionDlg.Destroy()

        if self.systemOptionDlg:
            self.systemOptionDlg.Destroy()

        self.__Initialize()

    def SetOpenHelpWindowEvent(self, event):
        self.eventOpenHelpWindow = event

    def OpenDialog(self):
        self.Show()

    def __ClickChangeCharacterButton(self):
        self.Close()

        net.ExitGame()

    if app.ENABLE_PATCHNOTE_WINDOW:
        def __ClickPatchNotesButton(self):
            self.Close()
            self.wndPatchnotes.Show()
            self.wndPatchnotes.SetTop()


systemdialog.py:
Genişlet Daralt Kopyala
import uiScriptLocale



ROOT = "d:/ymir work/ui/public/"



window = {

    "name" : "SystemDialog",

    "style" : ("float",),



    "x" : SCREEN_WIDTH/2 - 100,

    "y" : SCREEN_HEIGHT/2 - 114,



    "width" : 200,

    "height" : 258,



    "children" :

    (

        {

            "name" : "board",

            "type" : "thinboard",



            "x" : 0,

            "y" : 0,



            "width" : 200,

            "height" : 258,



            "children" :

            (

                {

                    "name" : "help_button",

                    "type" : "button",



                    "x" : 10,

                    "y" : 17,



                    "text" : uiScriptLocale.SYSTEM_HELP,



                    "default_image" : ROOT + "XLarge_Button_01.sub",

                    "over_image" : ROOT + "XLarge_Button_02.sub",

                    "down_image" : ROOT + "XLarge_Button_03.sub",

                },



                {

                    "name" : "system_option_button",

                    "type" : "button",



                    "x" : 10,

                    "y" : 57,



                    "text" : uiScriptLocale.SYSTEMOPTION_TITLE,



                    "default_image" : ROOT + "XLarge_Button_01.sub",

                    "over_image" : ROOT + "XLarge_Button_02.sub",

                    "down_image" : ROOT + "XLarge_Button_03.sub",

                },

                {

                    "name" : "game_option_button",

                    "type" : "button",



                    "x" : 10,

                    "y" : 87,



                    "text" : uiScriptLocale.GAMEOPTION_TITLE,



                    "default_image" : ROOT + "XLarge_Button_01.sub",

                    "over_image" : ROOT + "XLarge_Button_02.sub",

                    "down_image" : ROOT + "XLarge_Button_03.sub",

                },

                {

                    "name" : "movechannel_button",

                    "type" : "button",



                    "x" : 10,

                    "y" : 147,



                    "text" : uiScriptLocale.SYSTEM_MOVE_CHANNEL,



                    "default_image" : ROOT + "XLarge_Button_01.sub",

                    "over_image" : ROOT + "XLarge_Button_02.sub",

                    "down_image" : ROOT + "XLarge_Button_03.sub",

                },

                {

                    "name" : "change_button",

                    "type" : "button",



                    "x" : 10,

                    "y" : 117,



                    "text" : uiScriptLocale.SYSTEM_CHANGE,



                    "default_image" : ROOT + "XLarge_Button_01.sub",

                    "over_image" : ROOT + "XLarge_Button_02.sub",

                    "down_image" : ROOT + "XLarge_Button_03.sub",

                },

                {

                    "name" : "logout_button",

                    "type" : "button",



                    "x" : 10,

                    "y" : 147,



                    "text" : uiScriptLocale.SYSTEM_LOGOUT,



                    "default_image" : ROOT + "XLarge_Button_01.sub",

                    "over_image" : ROOT + "XLarge_Button_02.sub",

                    "down_image" : ROOT + "XLarge_Button_03.sub",

                },

                {

                    "name" : "exit_button",

                    "type" : "button",



                    "x" : 10,

                    "y" : 177,



                    "text" : uiScriptLocale.SYSTEM_EXIT,



                    "default_image" : ROOT + "XLarge_Button_01.sub",

                    "over_image" : ROOT + "XLarge_Button_02.sub",

                    "down_image" : ROOT + "XLarge_Button_03.sub",

                },

                {

                    "name" : "patchnotes_button",

                    "type" : "button",



                    "x" : 10,

                    "y" : 197,



                    "text" : "Parches",



                    "default_image" : ROOT + "XLarge_Button_01.sub",

                    "over_image" : ROOT + "XLarge_Button_02.sub",

                    "down_image" : ROOT + "XLarge_Button_03.sub",

                },

                {

                    "name" : "cancel_button",

                    "type" : "button",



                    "x" : 10,

                    "y" : 217,



                    "text" : uiScriptLocale.CANCEL,



                    "default_image" : ROOT + "XLarge_Button_01.sub",

                    "over_image" : ROOT + "XLarge_Button_02.sub",

                    "down_image" : ROOT + "XLarge_Button_03.sub",

                },

            ),

        },

    ),

}


syserr.txt:
Genişlet Daralt Kopyala
1017 05:57:08004 :: Traceback (most recent call last):

1017 05:57:08004 ::   File "networkModule.py", line 236, in SetGamePhase

1017 05:57:08004 ::   File "game.py", line 102, in __init__

1017 05:57:08004 ::   File "interfaceModule.py", line 498, in MakeInterface

1017 05:57:08004 ::   File "interfaceModule.py", line 350, in __MakeDialogs

1017 05:57:08004 ::   File "uiSystem.py", line 42, in LoadDialog

1017 05:57:08004 ::   File "uiSystem.py", line 61, in __LoadSystemMenu_Default

1017 05:57:08004 ::   File "ui.py", line 6511, in GetChild

1017 05:57:08004 :: KeyError
1017 05:57:08004 :: :
1017 05:57:08004 :: 'patchnotes_button'
1017 05:57:08004 ::
 
Locale içindeki systemdialog.py editliyorsun dimi?
 
Çözüm
Durum
İçerik kilitlendiği için mesaj gönderimine kapatıldı.
Üst