Jump to content

ricksanches5248

Inactive Member
  • Posts

    6
  • Joined

  • Last visited

  • Feedback

    0%

About ricksanches5248

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

ricksanches5248's Achievements

Rookie

Rookie (2/16)

  • Conversation Starter
  • Reacting Well
  • First Post
  • One Year In
  • One Month Later

Recent Badges

1

Reputation

  1. so you are having this error still?
  2. what does not work, same error or no error?
  3. what i would do is, make a new file in the root/ folder and name it: uiCustomBtn.py 1. paste your code in import ui import wndMgr import localeInfo import item import player import chat class CustomBtnWindow(ui.ScriptWindow): def __init__(self): super(CustomBtnWindow, self).__init__() self.bonusList = [] def LoadWindow(self): pyScrLoader = ui.PythonScriptLoader() pyScrLoader.LoadScriptFile(self, "UIScript/CustomBtn.py") self.btnClose = self.GetChild("close_button") self.btnClose.SetEvent(ui.__mem_func__(self.Close)) self.btnExample = self.GetChild("example_button") self.btnExample.SetEvent(ui.__mem_func__(self.OnExampleClick)) def OnExampleClick(self): # For demo: fetch a stat and display in chat stat = player.GetStatus(item.APPLY_MAX_HP) chat.AppendChat(chat.CHAT_TYPE_INFO, "Max HP: %d" % stat) def OnPressEscapeKey(self): self.Close() return True def Close(self): wndMgr.Hide(self.hWnd) 2. In the first lines of root/interfacemodule.py, where all imports are located, add the following import: from uiCustomBtn import CustomBtnWindow 3. change the method in root/interfacemodule.py like this def __MakeButton(self): self.Btn = CustomBtnWindow() self.Btn.LoadWindow() # self.Btn.Hide() def MakeInterface(self): self.__MakeButton()
  4. whats in here? interfaceModule.py(line:142) <module>
  5. you have to import the uiCustomBtn class in the interfacemodule. def __MakeButton(self): self.Btn = uiCustomBtn.CustomButton() # this is causing the error. self.Btn.LoadWindow() # self.Btn.Hide() def MakeInterface(self): self.__MakeButton() the error says it all no uiCustomBtn module found in "interfacemodule.py"
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.