Jump to content

guiBringToFront Problem


FSXTim

Recommended Posts

Posted

I have two windows and I want to bring one of them to the front. But it's still in the background!

function OpenRules_Button (state) 
    if state == "left" then 
        if source == GUIEditor_Button1 or source == GUIEditor_Button3 then 
            guiSetVisible(Regeln_Window, true)   
            guiBringToFront (Regeln_Window)              
        end  
    end 
end 
addEventHandler("onClientGUIClick", getRootElement(), OpenRules_Button) 

Can anybody help me?

Greets

430x73.png
Posted

That should work.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

try this:

function OpenRules_Button (button,state) -- there's one more argument before state is defineed 
    if state == "left" then 
        if source == GUIEditor_Button1 or source == GUIEditor_Button3 then 
            guiSetVisible(Regeln_Window, true)  
            guiBringToFront (Regeln_Window)             
        end  
    end 
end 
addEventHandler("onClientGUIClick",guiRoot, OpenRules_Button) --defined root as guiRoot 

I've add a couple of comments for you

My in-game name: Jaysds1

Retired CMG Scripter

World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode

Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/

 

sE5Qm.png

TiV3C.png

img.php?id=0&text=Lua%20Scripter

Posted

@Jaysds1: Thanks, but:

That should work.

I tried again and it's working now. I'm sure I did something wrong!

Thanks

Greets

430x73.png
Posted

I didn't do anything, but well.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

You're using GUI Editor? Why the variable names are not GUIEditor_Button[1] and GUIEditor_Button[3]? '-'

Software Engineer & Entrepreneur Running Lustrel and VilarikA • Highly engaged on open source community

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...