Jump to content
  • 0

Itemshop icon next to minimap


Creo

Question

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 post

2 answers to this question

Recommended Posts

  • 0

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

 

 

Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • 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.