Servus,
und zwar wollte ich dieses System einfügen Client Side :
Client Source hat wunderbar funktioniert aber habe immer Probleme mit den Python kram : hier einmal der link zu dem ganzen Thread und drunter packe ich mal die Syserr einträge und die datein die ich bearbeitet habe. Wenn jemand was findet könnte er mir bitte erklären was genau ich falsch eingefügt habe oder generell was ich falsch gemacht habe, danke euch #
Bitte melden Sie sich an, um diesen Link zu sehen.
Python
- import net
- import app
- import ui
- import uiOption
- import uiSystemOption
- import uiGameOption
- import uiScriptLocale
- import networkModule
- import constInfo
- import localeInfo
- if app.ENABLE_EXTENDED_PICKUP:
- import uiPickupOption
- SYSTEM_MENU_FOR_PORTAL = FALSE
- ###################################################################################################
- ## System
- class SystemDialog(ui.ScriptWindow):
- def __init__(self):
- ui.ScriptWindow.__init__(self)
- self.__Initialize()
- def __Initialize(self):
- self.eventOpenHelpWindow = None
- self.systemOptionDlg = None
- self.gameOptionDlg = None
- if app.ENABLE_EXTENDED_PICKUP:
- self.pickupOptionDialog = None
- def LoadDialog(self):
- if SYSTEM_MENU_FOR_PORTAL:
- self.__LoadSystemMenu_ForPortal()
- else:
- self.__LoadSystemMenu_Default()
- 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("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 constInfo.IN_GAME_SHOP_ENABLE:
- self.GetChild("mall_button").SAFE_SetEvent(self.__ClickInGameShopButton)
- if app.ENABLE_EXTENDED_PICKUP:
- self.GetChild("pickup_options_button").SAFE_SetEvent(self.__ClickPickupOptionsButton)
- 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("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)
- def Destroy(self):
- self.ClearDictionary()
- if self.gameOptionDlg:
- self.gameOptionDlg.Destroy()
- if self.systemOptionDlg:
- self.systemOptionDlg.Destroy()
- if self.systemOptionDlg:
- self.systemOptionDlg.Destroy()
- if app.ENABLE_EXTENDED_PICKUP and self.pickupOptionDialog:
- self.pickupOptionDialog.Destroy()
- self.__Initialize()
- def SetOpenHelpWindowEvent(self, event):
- self.eventOpenHelpWindow = event
- def OpenDialog(self):
- self.Show()
- def __ClickChangeCharacterButton(self):
- self.Close()
- net.ExitGame()
- def __OnClosePopupDialog(self):
- self.popup = None
- def __ClickLogOutButton(self):
- if SYSTEM_MENU_FOR_PORTAL:
- if app.loggined:
- self.Close()
- net.ExitApplication()
- else:
- self.Close()
- net.LogOutGame()
- else:
- self.Close()
- net.LogOutGame()
- def __ClickExitButton(self):
- self.Close()
- net.ExitApplication()
- def __ClickSystemOptionButton(self):
- self.Close()
- if not self.systemOptionDlg:
- self.systemOptionDlg = uiSystemOption.OptionDialog()
- self.systemOptionDlg.Show()
- def __ClickGameOptionButton(self):
- self.Close()
- if not self.gameOptionDlg:
- self.gameOptionDlg = uiGameOption.OptionDialog()
- self.gameOptionDlg.Show()
- if app.ENABLE_EXTENDED_PICKUP:
- def __ClickPickupOptionsButton(self):
- self.Close()
- if not self.pickupOptionDialog:
- self.pickupOptionDialog = uiPickupOption.OptionDialog()
- self.pickupOptionDialog.Show()
- def __ClickHelpButton(self):
- self.Close()
- if None != self.eventOpenHelpWindow:
- self.eventOpenHelpWindow()
- def __ClickInGameShopButton(self):
- self.Close()
- net.SendChatPacket("/in_game_mall")
- def Close(self):
- self.Hide()
- return TRUE
- def RefreshMobile(self):
- if self.gameOptionDlg:
- self.gameOptionDlg.RefreshMobile()
- #self.optionDialog.RefreshMobile()
- def OnMobileAuthority(self):
- if self.gameOptionDlg:
- self.gameOptionDlg.OnMobileAuthority()
- #self.optionDialog.OnMobileAuthority()
- def OnBlockMode(self, mode):
- uiGameOption.blockMode = mode
- if self.gameOptionDlg:
- self.gameOptionDlg.OnBlockMode(mode)
- #self.optionDialog.OnBlockMode(mode)
- def OnChangePKMode(self):
- if self.gameOptionDlg:
- self.gameOptionDlg.OnChangePKMode()
- #self.optionDialog.OnChangePKMode()
- def OnPressExitKey(self):
- self.Close()
- return TRUE
- def OnPressEscapeKey(self):
- self.Close()
- return TRUE
- if __name__ == "__main__":
- import app
- import wndMgr
- import systemSetting
- import mouseModule
- import grp
- import ui
- import chr
- import background
- import player
- #wndMgr.SetOutlineFlag(TRUE)
- app.SetMouseHandler(mouseModule.mouseController)
- app.SetHairColorEnable(TRUE)
- wndMgr.SetMouseHandler(mouseModule.mouseController)
- wndMgr.SetScreenSize(systemSetting.GetWidth(), systemSetting.GetHeight())
- app.Create("METIN2 CLOSED BETA", systemSetting.GetWidth(), systemSetting.GetHeight(), 1)
- mouseModule.mouseController.Create()
- wnd = SystemDialog()
- wnd.LoadDialog()
- wnd.Show()
- app.Loop()
Python
- 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" : "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" : "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",
- },
- {
- "name": "board",
- "type": "thinboard",
- "x": 0,
- "y": 0,
- "width": 200,
- "height": 368,
- "children":
- (
- {
- "name": "pickup_options_button",
- "type": "button",
- "x": 10,
- "y": 17, # REPLACE IT AS YOU WANT!!!
- "text": uiScriptLocale.EXTENDED_PICKUP_TITLE,
- "default_image": ROOT + "XLarge_Button_01.sub",
- "over_image": ROOT + "XLarge_Button_02.sub",
- "down_image": ROOT + "XLarge_Button_03.sub",
- },
- ),
- },
- ),
- }
Syserr:
Code
- 0518 08:17:19540 :: File "networkModule.py", line 247, in SetGamePhase
- 0518 08:17:19540 :: File "game.py", line 100, in __init__
- 0518 08:17:19540 :: File "interfaceModule.py", line 288, in MakeInterface
- 0518 08:17:19540 :: File "interfaceModule.py", line 223, in __MakeDialogs
- 0518 08:17:19540 :: File "uiSystem.py", line 37, in LoadDialog
- 0518 08:17:19540 :: File "uiSystem.py", line 58, in __LoadSystemMenu_Default
- 0518 08:17:19540 :: File "ui.py", line 2704, in GetChild
- 0518 08:17:19540 :: KeyError
- 0518 08:17:19540 :: :
- 0518 08:17:19540 :: 'pickup_options_button'
- 0518 08:17:19540 ::
PS : hab das ganze jetzt 2 oder 3 mal neu gemacht dennoch immer das selbe