switchbot button

08/09/2015 03:34 Terkea#1
i have a little problem, i added the button for switch, but when i press click on it dont works, how i can add that switchbot on button?

[Only registered and activated users can see links. Click Here To Register...]

inventorywindow
Code:
                        {
                            "name" : "SwitchButton",
                            "type" : "button",

                            "x" : 100,
                            "y" : 3,

                            "tooltip_text" : uiScriptLocale.SWITCH_TITLE,

                            "default_image" : "d:/ymir work/ui/terkea/bonus_button_01.tga",
                            "over_image" : "d:/ymir work/ui/terkea/bonus_button_02.tga",
                            "down_image" : "d:/ymir work/ui/terkea/bonus_button_03.tga",
                        },
uiinventory
Code:
self.SwitchButton=self.GetChild2("SwitchButton")
Code:
# SwitchButtonifself.SwitchButton:
self.SwitchButton.SetEvent(ui.__mem_func__(self.ClickSwitchButton))
Code:
self.SwitchButton=None
Code:
# SwitchButtondefClickSwitchButton(self):
if
self.switchbot.bot_shown ==1:
self.switchbot.Hide()
else:
self.switchbot.Show()
nobody?