seb-c

Untitled

May 4th, 2012
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 6.79 KB | None | 0 0
  1. ------------------------------------------------------------------------
  2. -- DEVELOPER:   Sebastian 'sebbe' Cronberg
  3. -- COPYRIGHT:   All right reserved by the developer(s)
  4. -- FILE:        welcomeGuiC.lua
  5. -- PROJECT:
  6. ------------------------------------------------------------------------
  7.  
  8. local engl = xmlLoadFile ( "files/xml/english.xml" )
  9. local engValue = xmlNodeGetValue ( engl)
  10. local polsk = xmlLoadFile ( "files/xml/polski.xml" )
  11. local poslValue = xmlNodeGetValue ( polsk )
  12. local Deutsch2 = xmlLoadFile ( "files/xml/deutsch.xml" )
  13. local DeutschValue = xmlNodeGetValue ( Deutsch2 )
  14. local nederland = xmlLoadFile ( "files/xml/nederlands.xml" )
  15. local nederValue = xmlNodeGetValue ( nederland )
  16. local soum = xmlLoadFile ( "files/xml/soumi.xml" )
  17. local soumValue = xmlNodeGetValue ( soum )
  18. local swe = xmlLoadFile ( "files/xml/svenska.xml" )
  19. local sweValue = xmlNodeGetValue ( swe )
  20. local slovensk = xmlLoadFile ( "files/xml/slovenski.xml" )
  21. local slovValue = xmlNodeGetValue ( slovensk )
  22. local esti = xmlLoadFile ( "files/xml/eesti.xml" )
  23. local estiValue = xmlNodeGetValue ( esti )
  24. local latvi = xmlLoadFile ( "files/xml/latvijas.xml" )
  25. local latviNode = xmlNodeGetValue ( latvi )
  26. local dk = xmlLoadFile ( "files/xml/danske.xml" )
  27. local dkNode = xmlNodeGetValue ( dk )
  28. local nor = xmlLoadFile ( "files/xml/norsk.xml" )
  29. local norNode = xmlNodeGetValue ( nor )
  30. local it = xmlLoadFile ( "files/xml/italiano.xml" )
  31. local itNode = xmlNodeGetValue ( it )
  32. local filip = xmlLoadFile ( "files/xml/filipino.xml" )
  33. local filipNode = xmlNodeGetValue( filip )
  34. local bahasa = xmlLoadFile ( "files/xml/bahasa.xml" )
  35. local bahNode = xmlNodeGetValue ( bahasa )
  36. local touni = xmlLoadFile ( "files/xml/tounisi.xml" )
  37. local touniNode = xmlNodeGetValue ( touni )
  38. local espan0l = xmlLoadFile ( "files/xml/espanol.xml" )
  39. local espanolNode = xmlNodeGetValue ( espan0l )
  40. local arab = xmlLoadFile ( "files/xml/arabic.xml" )
  41. local arabicNode = xmlNodeGetValue ( arab )
  42. local staff = xmlLoadFile ( "files/xml/staff.xml" )
  43. local staffText = xmlNodeGetValue ( staff )
  44. local info = xmlLoadFile ( "files/xml/info.xml" )
  45. local infoText = xmlNodeGetValue ( info )
  46. local faq = xmlLoadFile ( "files/xml/faq.xml" )
  47. local faqText = xmlNodeGetValue ( faq )
  48.  
  49. addEvent ( "GUI", true )
  50. function GUI ()
  51. mainWindow = guiCreateWindow(0.245,0.1922,0.5175,0.7,"",true)
  52. English = guiCreateButton(0.0229,0.0333,0.1135,0.0556,"English",true,mainWindow)
  53. Polski = guiCreateButton(0.0229,0.1175,0.1135,0.0556,"Polski",true,mainWindow)
  54. Deutsch = guiCreateButton(0.0229,0.2079,0.1135,0.0556,"Deutsch",true,mainWindow)
  55. Nederlands = guiCreateButton(0.0242,0.2921,0.1135,0.0556,"Nederlands",true,mainWindow)
  56. Soumi = guiCreateButton(0.0242,0.3825,0.1135,0.0556,"Soumi",true,mainWindow)
  57. Svenska = guiCreateButton(0.0229,0.4667,0.1135,0.0556,"Svenska",true,mainWindow)
  58. Slovenski = guiCreateButton(0.0229,0.5508,0.1135,0.0556,"Slovenski",true,mainWindow)
  59. Eesti = guiCreateButton(0.0229,0.6286,0.1135,0.0556,"Eesti",true,mainWindow)
  60. Latvijas = guiCreateButton(0.0229,0.7127,0.1135,0.0556,"Turkish",true,mainWindow)
  61. Dansk = guiCreateButton(0.0229,0.8063,0.1135,0.0556,"Dansk",true,mainWindow)
  62. Norsk = guiCreateButton(0.0242,0.8905,0.1135,0.0556,"Norsk",true,mainWindow)
  63. Italiano = guiCreateButton(0.8671,0.0349,0.1135,0.0556,"Italiano",true,mainWindow)
  64. Filipino = guiCreateButton(0.8671,0.1175,0.1135,0.0556,"Hindi",true,mainWindow)
  65. BahasaIndonesia = guiCreateButton(0.8659,0.1968,0.1135,0.0556,"Bahasa Indonesia",true,mainWindow)
  66. Tounisi = guiCreateButton(0.8659,0.2857,0.1135,0.0556,"Tounisi",true,mainWindow)
  67. Espanol = guiCreateButton(0.8647,0.3698,0.1135,0.0556,"Espanol",true,mainWindow)
  68. Arabic = guiCreateButton(0.8647,0.4524,0.1135,0.0556,"Arabic",true,mainWindow)
  69. StaffB = guiCreateButton(0.2923,0.0333,0.1135,0.0556,"Staff Roster",true,mainWindow)
  70. FaqB = guiCreateButton(0.4493,0.0333,0.1135,0.0556,"FAQ",true,mainWindow)
  71. InfoB = guiCreateButton(0.6002,0.0333,0.1135,0.0556,"Overview",true,mainWindow)
  72. CloseB = guiCreateButton(0.9167,0.9302,0.0592,0.0492,"X",true,mainWindow)
  73. theMemo = guiCreateMemo(0.1449,0.0937,0.7174,0.8556,"Hello and welcome to the Information Panel.\n\nTo see the rules in your language click on the button named your language.\nCan't find your language? If you would like it to be added, contact an admin or contact us at our website (WEBSITE HERE)\n\nIn the meanwhile, you can read the rules in English, this is an English speaking server afterall.\n\nYou can also find information as Staff Roster, FAQ and Overview but those are only avaliable in English.",true,mainWindow)
  74. guiSetVisible ( mainWindow, true )
  75. showCursor ( true )
  76. guiMemoSetReadOnly ( theMemo, true )
  77. guiWindowSetSizable ( mainWindow, false )
  78. end
  79. addEventHandler ( "GUI", root, GUI )
  80.  
  81. function buttonClick(button)
  82.     if (button) ~= "left" then return end
  83.     if ( source == CloseB ) then
  84.     guiSetVisible ( mainWindow, false )
  85.     showCursor ( false )
  86.     elseif (source == English) then
  87.         guiSetText( theMemo, tostring ( engValue ) )
  88.     elseif ( source == Polski ) then
  89.         guiSetText( theMemo, tostring ( poslValue ) )
  90.     elseif ( source == Nederlands ) then
  91.         guiSetText( theMemo, tostring ( nederValue ) )
  92.     elseif ( source == Deutsch ) then
  93.         guiSetText( theMemo, tostring ( DeutschValue ) )
  94.     elseif ( source == Soumi ) then
  95.         guiSetText( theMemo, tostring ( soumValue ) )
  96.     elseif ( source == Svenska ) then
  97.         guiSetText( theMemo, tostring ( sweValue ) )   
  98.     elseif ( source == Slovenski ) then
  99.         guiSetText( theMemo, tostring ( slovValue ) )
  100.     elseif ( source == Eesti ) then
  101.         guiSetText( theMemo, tostring ( estiValue ) )
  102.     elseif ( source == Latvijas ) then
  103.         guiSetText( theMemo, tostring ( latviNode ) )
  104.     elseif ( source == Dansk ) then
  105.         guiSetText( theMemo, tostring ( dkNode ) )
  106.     elseif ( source == Norsk ) then
  107.         guiSetText( theMemo, tostring ( norNode ) )
  108.     elseif ( source == Italiano ) then
  109.         guiSetText( theMemo, tostring ( itNode ) )
  110.     elseif ( source == Filipino ) then
  111.         guiSetText( theMemo, tostring ( filipNode ) )
  112.     elseif ( source == BahasaIndonesia ) then
  113.         guiSetText( theMemo, tostring ( bahNode ) )
  114.     elseif ( source == Tounisi ) then
  115.         guiSetText( theMemo, tostring ( touniNode ) )
  116.     elseif ( source == Espanol ) then
  117.         guiSetText( theMemo, tostring ( espanolNode ) )
  118.     elseif ( source == Arabic ) then
  119.         guiSetText( theMemo, tostring ( arabicNode ) ) 
  120.     elseif ( source == StaffB ) then
  121.         guiSetText( theMemo, tostring ( staffText ) )  
  122.     elseif ( source == FaqB ) then
  123.         guiSetText( theMemo, tostring ( faqText ) )
  124.     elseif ( source == InfoB ) then
  125.         guiSetText( theMemo, tostring ( infoText ) )   
  126.     end
  127. end
  128. addEventHandler("onClientGUIClick", resourceRoot, buttonClick, true)
  129.  
  130. function showGUI()
  131.     if (guiGetVisible ( mainWindow )) then
  132.         showCursor ( false )
  133.         guiSetVisible ( mainWindow, false )
  134.     else
  135.         triggerEvent ( "GUI", localPlayer )
  136.     end
  137. end
  138. bindKey ( "F1", "down", showGUI)
Advertisement
Add Comment
Please, Sign In to add comment