Jump to content

Where to change the position of buttons in dialog.


Recommended Posts

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

4 hours ago, Tatsumaru said:

Hello

How to lower these buttons? I suspect that in the uiquest.py file, but where exactly? Or maybe somewhere else?

ixWfGwt.jpg

I think is at  class BarButton, you need to edit it

 

Try to use this:

 

class BarButton(ui.Button):
    ColorUp = 0x40999999
    ColorDown = 0x40aaaacc
    ColorOver = 0x40ddddff

    UP=0
    DOWN=1
    OVER=2

    def __init__(self, layer = "UI", 
            aColorUp   = ColorUp, 
            aColorDown = ColorDown, 
            aColorOver = ColorOver):
        ui.Button.__init__(self,layer)
        self.state = self.UP
        self.colortable = aColorUp, aColorDown, aColorOver

    def OnRender(self):
        x,y = self.GetGlobalPosition()
        grp.SetColor(self.colortable[self.state])
        grp.RenderBar(x,y,self.GetWidth(),self.GetHeight())

    def CallEvent(self):
        self.state = self.UP
        ui.Button.CallEvent(self)

    def DownEvent(self):
        self.state = self.DOWN

    def ShowToolTip(self):
        self.state = self.OVER

    def HideToolTip(self):
        self.state = self.UP

 

 

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
Share on other sites

La 26.04.2018 la 5:56, Tatsumaru a spus:

Hello

How to lower these buttons? I suspect that in the uiquest.py file, but where exactly? Or maybe somewhere else?

ixWfGwt.jpg

Change the "MakeEachButton" as I have below, or add more "say ("")" before that dialog in quest.

def MakeEachButton(i):
            if self.skin == 3:
                button = BarButton("TOP_MOST",0x50000000, 0x50404040, 0x50606060)
                button.SetParent(c)
                button.SetSize(106,26)
                button.SetPosition(self.sx+c.GetWidth()/2+((i*2)-1)*56-56, self.sy+(event.GetLineCount(self.descIndex))*16+20+5)
                button.SetText("a")
                button.SetTextColor(0xff000000)
            else:
                i = i % 8
                button = BarButton("TOP_MOST")
                button.SetParent(c)
                button.SetSize(200,26)
                button.SetPosition(self.sx+c.GetWidth()/2-100,self.sy+(event.GetLineCount(self.descIndex)+i*2)*16+20+5)
                button.SetText("a")
                button.SetTextColor(0xffffffff)
            return button

 

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • 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.