Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Startup GUI? (https://forums.graalonline.com/forums/showthread.php?t=134259132)

iSlayer 05-12-2010 01:26 AM

Startup GUI?
 
Hey guys I want to get a startup GUI and I found this in the Graal Bible

PHP Code:

//#CLIENTSIDE
function onCreated()
{
  
ExampleWindow = new GuiWindowCtrl("ExampleWindow");
  
  
with (ExampleWindow)
  {
    
profile     "GuiBlueWindowProfile";
    
position    "20 20";
    
extent      "320 240";
    
canMove     true;
    
canResize   false;
    
canMaximize false;
    
canClose    true;
    
tile        true;
    
text        "Welcome here i will display all the required information";
    
    new 
GuiControl(AppleTab)
    {
      
visible    false;
      
profile    "GuiBlueControlProfile";
      
position   "10 52";
      
extent     "222 184";
      
      new 
GuiTextCtrl(AppleTab_Label)
      {
        
profile  "GuiBlueTextProfile";
        
position "0 0";
        
extent   "222 20";
        
text     "Current Staff: Owner: iSlayer";
      };
    };
    
    new 
GuiControl(BananaTab)
    {
      
visible    false;
      
profile    "GuiBlueControlProfile";
      
position   "10 52";
      
extent     "222 184";
      
      new 
GuiTextCtrl(BananaTab_Label)
      {
        
profile  "GuiBlueTextProfile";
        
position "0 0";
        
extent   "222 20";
        
text     "We are hiring all dev positions";
      };
    };
    
    new 
GuiControl(CranberryTab)
    {
      
visible    false;
      
profile    "GuiBlueControlProfile";
      
position   "10 52";
      
extent     "222 184";
      
      new 
GuiTextCtrl(CranberryTab_Label)
      {
        
profile  "GuiBlueTextProfile";
        
position "0 0";
        
extent   "222 20";
        
text     "Forum PM to iSlayer";
      };
    };
    
    new 
GuiTabCtrl(ExampleTabs)
    {
      
profile   "GuiBlueTabProfile";
      
position  "10 28";
      
extent    "300 24";
      
      
clearRows();
      
with (addRow(0"Staff Members"))
      {
        
this.pane AppleTab;
      }
      
with (addRow(1"Hirings"))
      {
        
this.pane BananaTab;
      }
      
with (addRow(2"Contact"))
      {
        
this.pane CranberryTab;
      }
      
      
thiso.catchevent(name"onSelect""onTabSelect");
    };
  };
  
ExampleTabs.setSelectedById(0);
  
GraalControl.addControl(ExampleWindow);
}

function 
onTabSelect(tabs)
{
  for (
temp.tabtemp.tabs.rows)
  {
    if (
temp.tab.pane == null)
    {
      continue;
    }
    
    if (
temp.tab == temp.tabs.selected)
    {
      
temp.tab.pane.show();
    }
    else
    {
      
temp.tab.pane.hide();
    }
  }


Would this work? Any help would be helpful ;)

iSlayer 05-12-2010 01:35 AM

Actually I found this

PHP Code:

function onActionServerSidecmd 

  if ( 
cmd == "getMessage" 
  { 
    
temp.n.loadLines"control/serverNews.txt" ); 
    
temp.h.loadLines"control/serverHirings.txt" ); 
    
temp.s.loadLines"control/serverStaff.txt" ); 
    
temp.i.loadLines"control/serverInfo.txt" ); 
    
triggerclient"gui"name"returnMessage"temp.ntemp.htemp.stemp.); 
  } 

//#CLIENTSIDE 
function onCreated() 

  
triggerserver"gui"name"getMessage" ); 

function 
onActionClientSidecmdnhs

  if ( 
cmd == "returnMessage" 
  { 
    for ( 
temp.
    { 
      
temp.ne @= temp."\n"
    } 
     
    for ( 
temp.
    { 
      
temp.hi @= temp."\n"
    } 
     
    for ( 
temp.
    { 
      
temp.st @= temp."\n"
    } 
     
    for ( 
temp.
    { 
      
temp.inf @= temp."\n"
    } 
     
    
showMessagetemp.netemp.hitemp.sttemp.inf ); 
  } 

function 
showMessagenewshiringsstaffinfo 

  new 
GuiWindowCtrl"LoginMessage_Window" 
  { 
    
profile "GuiBlueWindowProfile"
     
    
width 440
    
height 368
     
    
screenwidth - ( width ); 
    
screenheight - ( height ); 
     
    
canMaximize canResize false
    
canClose canMinimize visible title true
     
    
text "Welcome to" SPC servername "!"
     
    new 
GuiScrollCtrl"LoginMessage_NewsScroll" 
    { 
      
profile "GuiBlueScrollProfile"
       
      
15
      
54
       
      
width 410
      
height 300
       
      
vScrollBar "dynamic"
      
hScrollBar "alwaysOff"
       
      
visible false
       
      new 
GuiMLTextCtrl"LoginMessage_NewsText" 
      { 
        
profile "GuiBlueTextProfile"
         
        
3
        
0
         
        
width 390
        
height 300
         
        
text news
      } 
    } 
     
    new 
GuiScrollCtrl"LoginMessage_HiringsScroll" 
    { 
      
profile "GuiBlueScrollProfile"
       
      
15
      
54
       
      
width 410
      
height 300
       
      
vScrollBar "dynamic"
      
hScrollBar "alwaysOff"
       
      
visible false
       
      new 
GuiMLTextCtrl"LoginMessage_HiringsText" 
      { 
        
profile "GuiBlueTextProfile"
         
        
3
        
0
         
        
width 390
        
height 300
         
        
text hirings
      } 
    } 
     
    new 
GuiScrollCtrl"LoginMessage_StaffScroll" 
    { 
      
profile "GuiBlueScrollProfile"
       
      
15
      
54
       
      
width 410
      
height 300
       
      
vScrollBar "dynamic"
      
hScrollBar "alwaysOff"
       
      
visible false
       
      new 
GuiMLTextCtrl"LoginMessage_StaffText" 
      { 
        
profile "GuiBlueTextProfile"
         
        
3
        
0
         
        
width 390
        
height 300
         
        
text staff
      } 
    } 
     
    new 
GuiScrollCtrl"LoginMessage_InfoScroll" 
    { 
      
profile "GuiBlueScrollProfile"
       
      
15
      
54
       
      
width 410
      
height 300
       
      
vScrollBar "dynamic"
      
hScrollBar "alwaysOff"
       
      
visible false
       
      new 
GuiMLTextCtrl"LoginMessage_InfoText" 
      { 
        
profile "GuiBlueTextProfile"
         
        
3
        
0
         
        
width 390
        
height 300
         
        
text info
      } 
    } 
    new 
GuiTabCtrl"LoginMessage_Tab" 
    { 
      
profile "GuiBlueTabProfile"
       
      
35
      
30
       
      
width 450
      
height 24
       
      
tabwidth 90
       
      
clearRows(); 
       
      
temp.= { 
                 { 
"News""LoginMessage_NewsScroll" }, 
                 { 
"Hirings""LoginMessage_HiringsScroll" }, 
                 { 
"Staff""LoginMessage_StaffScroll" }, 
                 { 
"Info""LoginMessage_InfoScroll" 
               }; 
       
      for ( 
temp.temp.
      { 
        
with addRow0temp.a[0] ) ) 
        { 
          
this.iPane temp.a[1]; 
        } 
      } 
      
thiso.catcheventname"onSelect""onTabSelected" ); 
      
setSelectedRow); 
    } 
  } 

function 
onTabSelectedtabs 

  for ( 
temp.tabs.rows 
  { 
    if ( 
temp.== tabs.selected 
    { 
      ( @ 
temp.t.iPane[0] ).visible true
    } 
    else 
    { 
      ( @ 
temp.t.iPane[0] ).visible false
    } 
  } 


Then if I give (npcserver)
r control/*.txt

And uploaded the TXT files, added as an NPC to my server would it work?

fowlplay4 05-12-2010 01:41 AM

Your second post's script should work, but the NPC Scripting forum isn't always going to give you a copy-paste solution all-the-time, so cry scripter-wolf carefully and make an effort to learn the GS2 Language.

iSlayer 05-12-2010 02:41 AM

Quote:

Originally Posted by fowlplay4 (Post 1575505)
Your second post's script should work, but the NPC Scripting forum isn't always going to give you a copy-paste solution all-the-time, so cry scripter-wolf carefully and make an effort to learn the GS2 Language.

OK, I will learn

coreys 05-12-2010 02:48 AM

Hm, where'd you find that script anyways, can you link me?

iSlayer 05-12-2010 02:59 AM

First was on Graal Bible cant remmember where and second was on code gallery

DeCeaseD 05-12-2010 05:35 AM

Quote:

Originally Posted by coreys (Post 1575519)
Hm, where'd you find that script anyways, can you link me?

Abjorn, I just posted in that thread actually, it should be the number 1 thread in the Code Gallery labeled "Login Message" or so, if you could also answer my question that would be appreciated. >_<


All times are GMT +2. The time now is 06:39 AM.

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