Quebec Posted April 10, 2020 Share Posted April 10, 2020 Hi! I've made a simple menu using DGS and it works just fine on F1 key press but it pops up when I start the resource. I want it to not be visible on resource start but rather on F1 key press. This is the code: DGS = exports.dgs local reguli = xmlLoadFile( "reguli.xml" ) local reguli1 = xmlNodeGetValue( reguli ) local allstars = xmlLoadFile( "allstars.xml" ) local allstars1 = xmlNodeGetValue( allstars ) local donatii = xmlLoadFile( "donatii.xml" ) local donatii1 = xmlNodeGetValue( donatii ) local window = DGS:dgsCreateWindow( 0.2, 0.3, 0.6, 0.4, "Allstars Roleplay", true, 0xFF5E0464 ) DGS:dgsWindowSetSizeable( window, false ) showCursor ( true ) DGS:dgsWindowSetCloseButtonEnabled(window, false) local tab = DGS:dgsCreateTabPanel ( 0, 0.1, 1, 1, true, window, 20, 0xFF999999 ) local tab1 = DGS:dgsCreateTab ( "Despre Allstars", tab, 1, 1, 0xFF5E0464 ) local tab2 = DGS:dgsCreateTab ( "Reguli Roleplay", tab, 1, 1, 0xFF5E0464 ) local tab3 = DGS:dgsCreateTab ( "Donatii", tab, 1, 1, 0xFF5E0464 ) memo1 = DGS:dgsCreateMemo( 0, 0, 1, 1, reguli1, true, tab2, 0xFFFFFFFF, 1, 1, nil, 0xFF333333 ) DGS:dgsMemoSetReadOnly( memo1, true ) memo2 = DGS:dgsCreateMemo( 0, 0, 1, 1, allstars1, true, tab1, 0xFFFFFFFF, 1, 1, nil, 0xFF333333 ) DGS:dgsMemoSetReadOnly( memo2, true ) memo3 = DGS:dgsCreateMemo( 0, 0, 1, 1, donatii1, true, tab3, 0xFFFFFFFF, 1, 1, nil, 0xFF333333 ) DGS:dgsMemoSetReadOnly( memo3, true ) function dgsToggleVisible() if ( DGS:dgsGetVisible (window) == true ) then DGS:dgsSetVisible (window, false ) showCursor(false) else DGS:dgsSetVisible (window, true ) showCursor(true) end end bindKey ( "F1", "down", dgsToggleVisible ) Link to comment
#\_oskar_/# Posted April 10, 2020 Share Posted April 10, 2020 DGS:dgsSetVisible (window, false ) 1 Link to comment
Quebec Posted April 10, 2020 Author Share Posted April 10, 2020 4 minutes ago, #\_oskar_/# said: DGS:dgsSetVisible (window, false ) Thanks a lot! It works. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now