Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #26  
Old 03-04-2011, 07:35 AM
devilsknite1 devilsknite1 is offline
C:
devilsknite1's Avatar
Join Date: Jul 2006
Location: Florida, USA
Posts: 269
devilsknite1 has a spectacular aura about
Send a message via AIM to devilsknite1 Send a message via MSN to devilsknite1 Send a message via Yahoo to devilsknite1
Ah, I've figured it out.

Maybe this could clarify some?

Here is the completed code:

PHP Code:
function onActionServerSideafisvar1svar2 ) {
  switch( 
afi ) {
    case 
"receiveTextTypeFile": {
      
temp.name_of_text svar1;
      
temp.text_type_file.loadLinessvar1 );
      
triggerClient"gui"name"getTextTypeFile"temp.text_type_filetemp.name_of_text );
      break;
    }
    case 
"editTextTypeFile": {
      
svar1.saveLinessvar2);
      break;
    }
  }
}

//#CLIENTSIDE

function onActionClientSideafifilebvar ) {
  switch( 
afi ) {
    case 
"getTextTypeFile": {
      
onEditTextTypeFilebvar );
      
TFE_MultiLineEdit1.setLinesfile );
      break;
    }
  }
}

function 
onCreated() {
  if ( 
TFE_Window1.visible ) {
    
TFE_Window1.destroy();
  }
  
this.file_selected NULL;
}

function 
onPlayerChats() {
  
temp.tokens player.chat.tokenize();
  if ( 
player.chat.starts"/lf " ) ) {
    
this.file_selected temp.tokens];
    
triggerServer"gui"name"receiveTextTypeFile"temp.tokens] );
  }
}

function 
onEditTextTypeFilesvar ) {
  new 
GuiWindowCtrl"TFE_Window1" ) {
    
profile GuiBlueWindowProfile;
    
clientRelative true;
    
clientExtent "581,416";
    
canClose false;
    
canMaximize false;
    
canMove true;
    
canResize false;
    
closeQuery false;
    
destroyOnHide false;
    
text "Loaded file: '" svar "'. Editing in progress.";
    
screenwidth - ( width );
    
screenheight - ( height );

    new 
GuiScrollCtrl"TFE_MultiLineEdit1_Scroll" ) {
      
profile GuiBlueScrollProfile;
      
height 369;
      
hScrollBar "dynamic";
      
vScrollBar "dynamic";
      
width 581;

      new 
GuiMLTextEditCtrl"TFE_MultiLineEdit1" ) {
        
profile GuiBlueMLTextEditProfile;
        
height 16;
        
horizSizing "width";
        
wordWrap false;
        
width 556;
      }
    }
    
    new 
GuiButtonCtrl"TFE_Button1" ) {
      
profile GuiBlueButtonProfile;
      
height 45;
      
text "Save";
      
width 67;
      
371;
    }
    
    new 
GuiButtonCtrl"TFE_Button2" ) {
      
profile GuiBlueButtonProfile;
      
height 45;
      
text "Clear all";
      
width 67;
      
257;
      
371;
    }
    
    new 
GuiButtonCtrl"TFE_Button3" ) {
      
profile GuiBlueButtonProfile;
      
height 45;
      
text "Cancel";
      
width 67;
      
514;
      
371;
    }
  }
}

function 
TFE_Button1.onAction() {
  if ( 
this.file_selected != NULL ) {
    
triggerServer"gui"name"editTextTypeFile"TFE_MultiLineEdit1.getLines(), this.file_selected );
    
TFE_Window1.destroy();
    
player.chat "Saved!";
  } else {
    
player.chat "Error with this.file_selected";
  }
}

function 
TFE_Button2.onAction() {
  
player.chat "Clearing...";
  
TFE_MultiLineEdit1.text "";
}

function 
TFE_Button3.onAction() {
  
TFE_Window1.destroy();


Last edited by devilsknite1; 03-04-2011 at 11:04 PM..
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 08:24 PM.


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