• 🎉 Hey there! I've just launched my brand new server voting platform — Metin2 P Servers 🚀

add simple UI issue

Member
Oct
Threads
2
16
1
3
HubMoney
344
Client DEV\pack_maker\uiscript\uiscript\custom_button.py

import uiscriptlib window = { "name": "MyNewUIWindow", "style": ("movable", "float"), "x": 100, "y": 100, "width": 200, "height": 150, "children": ( { "name": "board", "type": "board", "x": 0, "y": 0, "width": 200, "height": 150, "children": ( { "name": "my_button", "type": "button", "x": 50, "y": 50, "text": "Click Me!", "default_image": "d:/ymir work/ui/public/large_button_01.sub", "over_image": "d:/ymir work/ui/public/large_button_02.sub", "down_image": "d:/ymir work/ui/public/large_button_03.sub", }, ), }, ), }
root/uiCustomButton.py

import ui import uiscriptlib class MyNewUI(ui.ScriptWindow): def __init__(self): ui.ScriptWindow.__init__(self) self.LoadWindow() def LoadWindow(self): try: uiscriptlib.LoadScriptFile(self, "uiscript/uiscript/custom_button.py") except Exception as e: import dbg dbg.LogBox(f"Error loading UI: {e}") return def OnPressMyButton(self): import chat chat.AppendChat(chat.CHAT_TYPE_INFO, "Button clicked!") def OnUpdate(self): pass def OnKeyDown(self, key): if key == 1: # Escape key self.Close() return True def Close(self): self.Hide() if __name__ == "__main__": wnd = MyNewUI() wnd.Show()
root/game.py

__init__ self.myNewUI = None def OpenMyNewUI(self): if not self.myNewUI: self.myNewUI = uiCustomButton.MyNewUI() self.myNewUI.Show() def OnKeyDown(self, key): if key == app.DIK_J: self.OpenMyNewUI()
when i do import uiCustomButton at top of file game.py i got this error i dont know why doesnt recognize the module

syserr:

0726 10:14:08849 ::
networkModule.py(line:188) SetSelectCharacterPhase
system.py(line:177) __hybrid_import
system.py(line:142) _process_result
introSelect.py(line:18) <module>
system.py(line:177) __hybrid_import
system.py(line:142) _process_result
uiInventory.py(line:23) <module>
system.py(line:177) __hybrid_import
system.py(line:142) _process_result
game.py(line:55) <module>
system.py(line:184) __hybrid_import

networkModule.SetSelectCharacterPhase - <type 'exceptions.ImportError'>:No module named uiCustomButton

0726 10:14:08849 :: ============================================================================================================
0726 10:14:08849 :: Abort!!!!