Advertisement
AlisaCodeDragon

PVBuilderCmdWnd ( only ride )

Jul 23rd, 2023
2,210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class PVBuilderCmdWnd extends UICommonAPI;  // only ride
  2. var string m_WindowName;
  3. var WindowHandle Me;
  4. var EditBoxHandle RideId_EditBox;
  5. var ButtonHandle Ride_button;
  6.  
  7. function OnLoad()
  8. {
  9.     local string pawnViewerMode;
  10.  
  11.     SetClosingOnESC();
  12.     Me = GetWindowHandle( "PVBuilderCmdWnd" );
  13.    
  14.     if(GetINIString("URL", "L2PawnViewerMode", pawnViewerMode, "l2.ini"))
  15.     {
  16.         Me.SetWindowTitle("BuilderCommand" @ "(" $ pawnViewerMode $ ")");
  17.     }  
  18.    
  19.     Ride_button = GetButtonHandle( m_WindowName$".Ride_button" );  
  20.     RideId_EditBox = GetEditBoxHandle( m_WindowName$".RideId_EditBox" );
  21.     RideId_EditBox.SetString("13330");
  22.    
  23. }  
  24.    
  25.     function OnClickRefreshButton()
  26. {  
  27.     local string ride_id;
  28.     ride_id = RideId_EditBox.GetString();  
  29.     ExecuteCommand("///ride id="$ride_id );
  30.    
  31. }
  32.    
  33. function OnClickButton( String a_ButtonID )
  34. {
  35.     switch( a_ButtonID )
  36.     {    
  37.       case "Ride_button":
  38.             if( Ride_button.GetButtonName() == "Ride" )
  39.             {
  40.                 ExecuteCommand("///ride_id=" @ RideId_EditBox.GetString());
  41.                 Ride_button.SetNameText( "Unride" );
  42.                 break;
  43.             }
  44.             else
  45.             {
  46.                 ExecuteCommand( "///unride" );
  47.                 Ride_button.SetNameText( "Ride" );
  48.                 break;
  49.             }  
  50.        
  51.     }
  52.    
  53. }
  54.            
  55.            
  56.    
  57.  
  58.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement