Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > Code Gallery
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 11-21-2008, 02:53 AM
cyan3 cyan3 is offline
Registered User
cyan3's Avatar
Join Date: Nov 2005
Location: England
Posts: 2,919
cyan3 has a brilliant futurecyan3 has a brilliant futurecyan3 has a brilliant futurecyan3 has a brilliant futurecyan3 has a brilliant futurecyan3 has a brilliant futurecyan3 has a brilliant future
Server Select GUI

I've been trying to teach myself some GS2 and I thought GUI scripting would be an easy place to start. So i messed around with some GUI Controls and come up with this.

PHP Code:
//Made by Felix Lionheart (cyan3)
//#CLIENTSIDE

function onKeyPressed(keycharcharacter)

  if (
character == "9"){
   
show();
}
 public function 
show()

  new 
GuiWindowCtrl("ServerSelect_Window") {
    
profile GuiWindowProfile;
    
clientrelative true;
    
clientextent "320,240";
    
extent "230 425";

    
canclose true;
    
canmaximize false;
    
canminimize true;
    
canmove true;
    
canresize false;
    
closequery false;
    
destroyonhide true;
    
text "Server Select -" SPC servername;
    
5;
    
100;

//Gold Servers
    
new GuiTextCtrl("ServerSelect_GoldServers") {
      
profile GuiTextProfile;
      
profile.fontsize 15;   
      
text "Gold Servers";
      
position "5 0";
}
    new 
GuiButtonCtrl("ServerSelect_GraalKingdoms") {
      
profile GuiButtonProfile;
      
text "Graal Kingdoms";
      
width 100;
      
5;
      
25;
}
    new 
GuiButtonCtrl("ServerSelect_Zone") {
      
profile GuiButtonProfile;
      
text "Zone";
      
width 100;
      
5;
      
60;
}
    new 
GuiButtonCtrl("ServerSelect_Games") {
      
profile GuiButtonProfile;
      
text "Graal Skills";
      
width 100;
      
110;
      
60;
}
    new 
GuiButtonCtrl("ServerSelect_KingdomsDebug") {
      
profile GuiButtonProfile;
      
text "Kingdoms Debug";
      
width 100;
      
110;
      
25;
}
//Classic Servers
    
new GuiTextCtrl("ServerSelect_ClassicServers") {
      
profile GuiTextProfile;
      
profile.fontsize 15;
      
text "Classic Servers";
      
position "5 90";

    new 
GuiButtonCtrl("ServerSelect_Zodiac") {
      
profile GuiButtonProfile;
      
text "Zodiac";
      
width 100;
      
5;
      
115;
}
    new 
GuiButtonCtrl("ServerSelect_Era") {
      
profile GuiButtonProfile;
      
text "Era";
      
width 100;
      
5;
      
150;
}
    new 
GuiButtonCtrl("ServerSelect_Classic") {
      
profile GuiButtonProfile;
      
text "Classic";
      
width 100;
      
5;
      
185;
}
    new 
GuiButtonCtrl("ServerSelect_Valikorlia") {
      
profile GuiButtonProfile;
      
text "Valikorlia";
      
width 100;
      
110;
      
115;
}
    new 
GuiButtonCtrl("ServerSelect_Atlantis") {
      
profile GuiButtonProfile;
      
text "Atlantis";
      
width 100;
      
110;
      
150;
}
    new 
GuiButtonCtrl("ServerSelect_Delteria") {
      
profile GuiButtonProfile;
      
text "Delteria";
      
width 100;
      
110;
      
185;
}
    new 
GuiButtonCtrl("ServerSelect_NPulse") {
      
profile GuiButtonProfile;
      
text "N-Pulse";
      
width 100;
      
5;
      
220;
}   
    new 
GuiButtonCtrl("ServerSelect_UnholyNation") {
      
profile GuiButtonProfile;
      
text "Unholy Nation";
      
width 100;
      
110;
      
220;
}

//Hosted Servers
    
new GuiTextCtrl("ServerSelect_HostedServers") {
      
profile GuiTextProfile;
      
profile.fontsize 15;
      
text "Hosted Servers";
      
position "5 250";
}
    new 
GuiButtonCtrl("ServerSelect_Aeon") {
      
profile GuiButtonProfile;
      
text "Aeon";
      
width 100;
      
5;
      
275;
}   
    new 
GuiButtonCtrl("ServerSelect_OlWest") {
      
profile GuiButtonProfile;
      
text "Ol' West";
      
width 100;
      
110;
      
275;
}
    new 
GuiButtonCtrl("ServerSelect_Atrius") {
      
profile GuiButtonProfile;
      
text "Atrius";
      
width 100;
      
5;
      
310;
}

//Other Servers
    
new GuiButtonCtrl("ServerSelect_Reconnect") {
    
profile GuiButtonProfile;
    
text "Reconnect";
    
width 100;
    
110;
    
310;
}
    new 
GuiButtonCtrl("ServerSelect_Disconnect") {
      
profile GuiButtonProfile;
      
text "Disconnect";
      
width 100;
      
5;
      
345;
}
    new 
GuiButtonCtrl("ServerSelect_Close") {
      
profile GuiButtonProfile;
      
text "Close";
      
width 70;
      
145;
      
360;
     }
    }

//Gold Servers
function ServerSelect_GraalKingdoms.onAction() {
  
serverwarp("Graal Kingdoms");
 }

function 
ServerSelect_KingdomsDebug.onAction() {
  
serverwarp("Kingdoms Debug");
 }
 
function 
ServerSelect_Zone.onAction() {
  
serverwarp("Zone");
  }

function 
ServerSelect_Games.onAction() {
  
serverwarp("Games");
 }
 
//Classic Servers
function ServerSelect_Zodiac.onAction() {
   
serverwarp("Zodiac");
  }
  
function 
ServerSelect_Era.onAction() {
  
serverwarp("Era");
 }
 
function 
ServerSelect_Classic.onAction() {
  
serverwarp("Classic");
 }

function 
ServerSelect_Valikorlia.onAction() {
  
serverwarp("Valikorlia");
 }

function 
ServerSelect_Atlantis.onAction() {
  
serverwarp("Atlantis");
 }

function 
ServerSelect_Delteria.onAction() {
  
serverwarp("Delteria");
 }
 
function 
ServerSelect_NPulse.onAction() {
  
serverwarp("N-Pulse");
 }

//Hosted Servers
function ServerSelect_Aeon.onAction() {
  
serverwarp("AEON");
 }

function 
ServerSelect_OlWest.onAction() {
  
serverwarp("Ol' West");
 }

function 
ServerSelect_Atrius.onAction() {
  
serverwarp("Atrius");
  }

//Other Servers
function ServerSelect_Reconnect.onAction() {
  
serverwarp(servername);
 }

function 
ServerSelect_Disconnect.onAction() {
  
serverwarp("Login1");
 }

function 
ServerSelect_Close.onAction() {
  
ServerSelect_Window.destroy();

Attached Thumbnails
Click image for larger version

Name:	graal_1227230204.png
Views:	422
Size:	257.7 KB
ID:	46555  

Last edited by cyan3; 11-21-2008 at 04:21 AM..
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 06:50 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.