Jump to content

[HELP] Hide menu on resource start


Quebec

Recommended Posts

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

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