Creo 26 Posted April 5, 2021 Share Posted April 5, 2021 Hi, i have fully implemented itemshop ingame. I can open it from the game options but i would like to have a button next to minimap. Can someone guide me how to do it? Link to comment Share on other sites More sharing options...
Creo 26 Posted April 10, 2021 Author Share Posted April 10, 2021 f5 Link to comment Share on other sites More sharing options...
Artagnanxd 85 Posted April 10, 2021 Share Posted April 10, 2021 root/game.py Search: self.testAlignment.Show() add down self.itemShopButton = ui.Button() self.itemShopButton.SetParent(self) self.itemShopButton.SetPosition(wndMgr.GetScreenWidth() - 200, 40) self.itemShopButton.SetUpVisual("d:/ymir work/ui/public/Middle_Button_01.sub") self.itemShopButton.SetOverVisual("d:/ymir work/ui/public/Middle_Button_02.sub") self.itemShopButton.SetDownVisual("d:/ymir work/ui/public/Middle_Button_03.sub") self.itemShopButton.SetEvent(ui.__mem_func__(self.__OnClickItemShopButton)) #the function you are using self.itemShopButton.Show() search: def __PlayMusic(self, flag, filename): flag = int(flag) if flag: snd.FadeOutAllMusic() musicInfo.SaveLastPlayFieldMusic() snd.FadeInMusic("BGM/" + filename) else: snd.FadeOutAllMusic() musicInfo.LoadLastPlayFieldMusic() snd.FadeInMusic("BGM/" + musicInfo.fieldMusic) #unless you have a def from itemshop ( np. def BINARY_ItemShopOpen ) add down: def __OnClickItemShopButton(self): if self.interface: self.interface.wndItemShop.RequestOpen() this is an example, i don't know which itemshop you are using 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now