Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- localPlayer = getLocalPlayer()
- wnd_window = {}
- addEventHandler( "onClientResourceStart", getResourceRootElement( getThisResource() ),
- function ( theResource )
- --outputConsole( "wnd_showServerInfo called" )
- --outputConsole( " source: ".. tostring( source ) )
- --outputConsole( " resourceStarted: ".. tostring( theResource ) )
- if source == getResourceRootElement( theResource ) then
- --outputConsole( " passed if: source == resource" )
- local xml = xmlLoadFile( "server.xml" )
- local contents = xmlNodeGetValue( xml )
- wnd_create( "Herzlich Willkommen auf Mars Reallife", "Willkommen/logo.jpg", contents )
- end
- end
- )
- function wnd_close()
- guiSetVisible( wnd_window.wnd, false )
- showCursor( false )
- end
- addEvent( "window_text", true )
- function wnd_create( title, logo, content )
- --outputConsole( "wnd_create called" )
- if not wnd_window.wnd then
- --outputConsole( " passed if" )
- wnd_window.wnd = guiCreateWindow( 0.1, 0.15, 0.8, 0.7, title, true )
- guiWindowSetSizable( wnd_window.wnd, false )
- guiWindowSetMovable( wnd_window.wnd, false )
- wnd_window.logo = guiCreateStaticImage( 0.05, 0.1, 0.9, 0.5, logo, true, wnd_window.wnd )
- --wnd_window.text = content
- wnd_window.memo = guiCreateMemo( 0, 0.3, 1, .6, content, true, wnd_window.wnd )
- guiMemoSetReadOnly( wnd_window.memo, true )
- wnd_window.close_btn = guiCreateButton( 0, .91, .3, 1, "Close", true, wnd_window.wnd )
- --outputConsole( " window created: ".. tostring( wnd_window.wnd ) )
- showCursor( true )
- addEventHandler( "onClientGUIClick", wnd_window.close_btn, wnd_close )
- end
- end
- addEventHandler( "window_text", getRootElement(), wnd_create )
Advertisement
Add Comment
Please, Sign In to add comment