Moin ich versuche gerade eine Taskbar erweiterung zu erstellen.
Zweck des ganzen ist anstatt am Inventar oder am Fensterrand eine Navibar zu haben möchte ich sie überhalb der TaskBar.
Python
- class ExtendedTaskBar(ui.ScriptWindow):
- BUTTON_SWITCHBOT = 0
- BUTTON_BONUSBOARD = 0
- BUTTON_OFFLINESHOP = 0
- BUTTON_ANTIEXP = 0
- BUTTON_EXIT = 0
- class ButtonList(ui.SlotWindow):
- def __init__(self):
- ui.SlotWindow.__init__(self)
- self.event = 0
- self.arg = 0
- self.slotIndex = 0
- self.buttonIndex = 0
- slotIndex = 0
- wndMgr.SetSlotBaseImage(self.hWnd, "d:ymir work/ui/public/slot_base.sub", 1.0,1.0,1.0,1.0)
- wndMgr.AppendSlot(self.hWnd, slotIndex, 0,0,32,32)
- self.SetCoverButton(slotIndex, "d:ymir work/ui/game/slot_cover_button_01.sub",\
- "d:ymir work/ui/game/slot_cover_button_01.sub",\
- "d:ymir work/ui/game/slot_cover_button_01.sub",\
- "d:ymir work/ui/game/slot_cover_button_01.sub",\
- "d:ymir work/ui/game/slot_cover_button_01.sub", TRUE, FALSE)
- self.SetSize(32,32)
- def __del__(self):
- ui.SlotWindow.__del__(self)
- def getSlotIndex(self):
- return self.slotIndex
- def getButtonIndex(self):
- return self.buttonIndex
- def getButtonExp(self):
- return self.BUTTON_ANTIEXP
- def getButtonOff(self):
- return self.BUTTON_OFFLINESHOP
- def getButtonExit(self):
- return self.BUTTON_EXIT
- def getButtonSwitch(self):
- return BUTTON_SWITCHBOT
- def __init__(self):
- ui.ScriptWindow.__init__(self)
- self.ButtonList = 0
- self.SetWindowName("ExtendedTaskBar")
- def LoadWindow(self):
- try:
- pyScrLoader = ui.PythonScriptLoader()
- pyScrLoader.LoadScriptFile(self, "UIScript/ExtendedTaskBar.py")
- self.gjsz_switchbot = self.GetChild2("switchbot")
- self.gjsz_exit = self.GetChild2("exit")
- self.gjsz_antiexp = self.GetChild2("antiexp")
- self.gjsz_teleport = self.GetChild2("teleport")
- except:
- import exception
- exception.Abort("ExtendedTaskBar.LoadWindow.LoadObject")
- if self.gjsz_switchbot:
- self.gjsz_switchbot.SetEvent(ui.__mem_func__(self.Clickswitchbot))
- if self.gjsz_exit:
- self.gjsz_exit.SetEvent(ui.__mem_func__(self.ClickExit))
- if self.gjsz_antiexp:
- self.gjsz_antiexp.SetEvent(ui.__mem_func__(self.ClickAntiexp))
- if self.gjsz_teleport:
- self.gjsz_teleport.SetEvent(ui.__mem_func__(self.ClickTeleport))
- def Destroy(self):
- pass
- def SetToolTipText(self, eButton, text):
- pass
- def SetToggleButtonEvent(self, eButton, kEventFunc):
- pass
- def ClickSwitchbot(self):
- pass
- def ClickTeleport(self):
- pass
- def ClickAntiexp(self):
- pass
- def ClickExit(self):
- pass
- def YES(self):
- pass
- def No(self):
- self.questionDialog.Close()
Code
- import uiScriptLocale
- ROOT = "d:/ymir work/ui/game/"
- #Y_ADD_POSITION = -2
- Y_ADD_POSITION = Y_ADD_POSITION
- window = {
- "name" : "ExtendedTaskBar_0",
- "x" : 100,
- "y" : 100 - 37,
- "width" : SCREEN_WIDTH,
- "height" : 37,
- "children" :
- (
- ##Switchbot
- {
- "name" : "switchbot",
- "type" : "button",
- "x" : 8,
- "y" : Y_ADD_POSITION,
- "default_image" : ROOT + "gjsz_button/switchbot_1.tga",
- "over_image" : ROOT + "gjsz_button/switchbot_2.tga",
- "down_image" : ROOT + "gjsz_button/switchbot_1.tga",
- },
- ##BonusBoard
- {
- "name" : "bonusboard",
- "type" : "button",
- "x" : 8 ,
- "y" : Y_ADD_POSITION+35,
- "default_image" : ROOT + "gjsz_button/bonusboard_1.tga",
- "over_image" : ROOT + "gjsz_button/bonusboard_2.tga",
- "down_image" : ROOT + "gjsz_button/bonusboard_1.tga",
- },
- ##AntiExp
- {
- "name" : "antiexp",
- "type" : "button",
- "x" : 8 ,
- "y" : Y_ADD_POSITION+2*35,
- "default_image" : ROOT + "gjsz_button/anti_exp_1.tga",
- "over_image" : ROOT + "gjsz_button/anti_exp_2.tga",
- "down_image" : ROOT + "gjsz_button/anti_exp_1.tga",
- },
- ##Teleport
- {
- "name" : "teleport",
- "type" : "button",
- "x" : 8 ,
- "y" : Y_ADD_POSITION+3*35,
- "default_image" : ROOT + "gjsz_button/teleport_1.tga",
- "over_image" : ROOT + "gjsz_button/teleport_2.tga",
- "down_image" : ROOT + "gjsz_button/teleport_1.tga",
- },
- ##Exit
- {
- "name" : "exit",
- "type" : "button",
- "x" : 8 ,
- "y" : Y_ADD_POSITION+4*+35,
- "default_image" : ROOT + "gjsz_button/exit_1.tga",
- "over_image" : ROOT + "gjsz_button/exit_2.tga",
- "down_image" : ROOT + "gjsz_button/exit_1.tga",
- },
- ),
Code
- import uiScriptLocale
- ROOT = "d:/ymir work/ui/game/"
- #Y_ADD_POSITION = -2
- Y_ADD_POSITION = Y_ADD_POSITION
- window = {
- "name" : "ExtendedTaskBar_0",
- "x" : 100,
- "y" : 100 - 37,
- "width" : SCREEN_WIDTH,
- "height" : 37,
- "children" :
- (
- ##Switchbot
- {
- "name" : "switchbot",
- "type" : "button",
- "x" : 8,
- "y" : Y_ADD_POSITION,
- "default_image" : ROOT + "/switchbot_1.tga",
- "over_image" : ROOT + "gjsz_button/switchbot_2.tga",
- "down_image" : ROOT + "gjsz_button/switchbot_1.tga",
- },
- ##BonusBoard
- {
- "name" : "bonusboard",
- "type" : "button",
- "x" : 8 ,
- "y" : Y_ADD_POSITION+35,
- "default_image" : ROOT + "gjsz_button/bonusboard_1.tga",
- "over_image" : ROOT + "gjsz_button/bonusboard_2.tga",
- "down_image" : ROOT + "gjsz_button/bonusboard_1.tga",
- },
- ##AntiExp
- {
- "name" : "antiexp",
- "type" : "button",
- "x" : 8 ,
- "y" : Y_ADD_POSITION+2*35,
- "default_image" : ROOT + "gjsz_button/anti_exp_1.tga",
- "over_image" : ROOT + "gjsz_button/anti_exp_2.tga",
- "down_image" : ROOT + "gjsz_button/anti_exp_1.tga",
- },
- ##Teleport
- {
- "name" : "teleport",
- "type" : "button",
- "x" : 8 ,
- "y" : Y_ADD_POSITION+3*35,
- "default_image" : ROOT + "gjsz_button/teleport_1.tga",
- "over_image" : ROOT + "gjsz_button/teleport_2.tga",
- "down_image" : ROOT + "gjsz_button/teleport_1.tga",
- },
- ##Exit
- {
- "name" : "exit",
- "type" : "button",
- "x" : 8 ,
- "y" : Y_ADD_POSITION+4*+35,
- "default_image" : ROOT + "gjsz_button/exit_1.tga",
- "over_image" : ROOT + "gjsz_button/exit_2.tga",
- "down_image" : ROOT + "gjsz_button/exit_1.tga",
- },
- ),
Problem nun ich versuche mir dieses Fenster anzeigen zu lassen egal wo auf dem bildschirm nur will er nicht. Ich denke mal ich vergesse immer was in der class ExtendedTaskBar nur leider komme ich nicht drauf was.
Edit:Lösung kann man hiermit heraus finden.
Bitte melden Sie sich an, um diesen Link zu sehen.