Jump to content

Help on GUI panel


Recommended Posts

Hi, i created a skin selector using Dx Elements with guieditor, all the code is running good, but i have a problem, my panel open with F3, and i have 3 "pages" with that, what i mean? if i press a button in the panel, it removes a dx handler and create another one, but if i want to close it pressing F3, it closes, but opens instantly the first page, and i don't want that, can someone help me with that? i want to close second page without opening the first page

Link to comment

here it is

function open () 
    if ( guiGetVisible (text25)) then 
        removeEventHandler ( "onClientRender", getRootElement(), dxObjects2 ) 
        guiSetVisible ( page3, false ) 
        guiSetVisible ( page4, false ) 
        guiSetVisible ( text25, false ) 
        guiSetVisible ( text26, false ) 
        guiSetVisible ( text27, false ) 
        guiSetVisible ( text28, false ) 
        guiSetVisible ( text29, false ) 
        guiSetVisible ( text30, false ) 
        guiSetVisible ( text31, false ) 
        guiSetVisible ( text32, false ) 
        guiSetVisible ( text33, false ) 
        guiSetVisible ( text34, false ) 
        guiSetVisible ( text35, false ) 
        guiSetVisible ( text36, false ) 
        guiSetVisible ( text37, false ) 
        stopSound ( sound ) 
    end 
    if ( guiGetVisible (text38)) then 
        removeEventHandler ( "onClientRender", getRootElement(), dxObjects3 ) 
        guiSetVisible ( page5, false ) 
        guiSetVisible ( page6, false ) 
        guiSetVisible ( text38, false ) 
        guiSetVisible ( text39, false ) 
        guiSetVisible ( text40, false ) 
        guiSetVisible ( text41, false ) 
        guiSetVisible ( text42, false ) 
        stopSound ( sound ) 
    end 
    if ( guiGetVisible ( text25)) or ( guiGetVisible ( text38)) then  
    return end 
    if ( guiGetVisible ( text1 )) then 
    removeEventHandler ( "onClientRender", getRootElement(), dxObjects ) 
        guiSetVisible ( text1, false ) 
        guiSetVisible ( text2, false ) 
        guiSetVisible ( text3, false ) 
        guiSetVisible ( text4, false ) 
        guiSetVisible ( text5, false ) 
        guiSetVisible ( text6, false ) 
        guiSetVisible ( text7, false ) 
        guiSetVisible ( text8, false ) 
        guiSetVisible ( text9, false ) 
        guiSetVisible ( text10, false ) 
        guiSetVisible ( text11, false ) 
        guiSetVisible ( text12, false ) 
        guiSetVisible ( text13, false ) 
        guiSetVisible ( text14, false ) 
        guiSetVisible ( text15, false ) 
        guiSetVisible ( text16, false ) 
        guiSetVisible ( text17, false ) 
        guiSetVisible ( text18, false ) 
        guiSetVisible ( text19, false ) 
        guiSetVisible ( text20, false ) 
        guiSetVisible ( text21, false ) 
        guiSetVisible ( text22, false ) 
        guiSetVisible ( text23, false ) 
        guiSetVisible ( text24, false ) 
        guiSetVisible ( page1, false ) 
        guiSetVisible ( page2, false ) 
    showCursor ( false ) 
    setGameSpeed ( 1 ) 
    stopSound( sound ) 
    else 
    addEventHandler ( "onClientRender", getRootElement(), dxObjects ) 
        guiSetVisible ( text1, true ) 
        guiSetVisible ( text2, true ) 
        guiSetVisible ( text3, true ) 
        guiSetVisible ( text4, true ) 
        guiSetVisible ( text5, true ) 
        guiSetVisible ( text6, true ) 
        guiSetVisible ( text7, true ) 
        guiSetVisible ( text8, true ) 
        guiSetVisible ( text9, true ) 
        guiSetVisible ( text10, true ) 
        guiSetVisible ( text11, true ) 
        guiSetVisible ( text12, true ) 
        guiSetVisible ( text13, true ) 
        guiSetVisible ( text14, true ) 
        guiSetVisible ( text15, true ) 
        guiSetVisible ( text16, true ) 
        guiSetVisible ( text17, true ) 
        guiSetVisible ( text18, true ) 
        guiSetVisible ( text19, true ) 
        guiSetVisible ( text20, true ) 
        guiSetVisible ( text21, true ) 
        guiSetVisible ( text22, true ) 
        guiSetVisible ( text23, true ) 
        guiSetVisible ( text24, true ) 
        guiSetVisible ( page1, true ) 
        guiSetVisible ( page2, true ) 
    showCursor ( true ) 
    setGameSpeed ( 0.3 ) 
    sound = playSound("open.mp3") 
    end 
end 
bindKey ( "F3", "down", open ) 

Link to comment

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