View Single Post
  #86  
Old 06-24-2015, 08:08 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Here is my fix, simply replace the whole createEditorFunction function with this:

PHP Code:
// Create Editor Window
function createEditorWindow(temp.npc_idtemp.npc_imgtemp.npc_xtemp.npc_ytemp.npc_script) {
  new 
GuiMLTextEditProfile("SyntaxHighlightLegacyProfile") {
    
fontType fileexists("DejaVuSansMono.ttf") ? "DejaVuSansMono" "Courier";
    
fontSize = (thiso.options.scriptfontsize <= 14 thiso.options.scriptfontsize);
    
cursorColor "0 0 0";
    
fillColorHL "255 255 0";
    
fontColor "0 0 0";
    
fontColorHL "192 0 0"// control words like if, else etc.
    
fontColorSEL "0 16 0"// identifiers 0,96,0
    
fontColorLink "192 0 192"// strings
    
fontColorLinkHL "0 0 255"// numbers
  
}
  new 
GuiWindowCtrl("LevelNPC_" temp.npc_id "_Window") {
    
profile GuiBlueWindowProfile;
    
clientrelative true;
    
this.npc_id temp.npc_id;
    
temp.ww clientwidth 600;
    
temp.wh clientheight 500;
    
= (screenwidth temp.ww) / 2;
    
= (screenheight temp.wh) / 2;
    
isexternal true;
    
text format("NPC Script Editor (X: %s Y: %s)"temp.npc_x 64temp.npc_y 64);
    
destroyonhide true;
    
thiso.trigger("CenterExternalWindow"this);
    
    new 
GuiScrollCtrl("LevelNPC_" temp.npc_id "_ScriptScroll") {
      
profile GuiBlueScrollProfile;
      
scrollprofile GuiBlueScrollProfile;
      
useownprofile true;
      
profile.fillColor "255 255 255";
      
profile.opaque true;
      
profile.border 1;
      
profile.bitmap "guiblue_scroll_noback.png";
      
horizsizing "width";
      
vertsizing  "height";
      
clientwidth  temp.ww;
      
clientheight temp.wh 40;
      
      new 
GuiMLTextEditCtrl("LevelNPC_" temp.npc_id "_Script") {
        
profile SyntaxHighlightLegacyProfile;
        
useownprofile true;
        
profile.fillcolorhl "80 180 255";
        
profile.fontcolorlink "255 0 255";
        
profile.fontsize 15;
        
        
horizsizing "width";
        
syntaxhighlighting true;
        
wordwrap false;
        
clientheight temp.wh;
        
clientwidth  temp.ww 40;
        
width -= 4;
        
        
setlines(temp.npc_script);
        
temp.scriptctrl this;

        
autoindenting true;
        
tabspaces 2;
      }
    }
    new 
GuiButtonCtrl("LevelNPC_" temp.npc_id "_ScriptClose") {
      
profile GuiBlueButtonProfile;
      
horizsizing "left";
      
vertsizing  "top";
      
clientwidth  64;
      
clientheight 32;
      
temp.ww 68;
      
temp.wh 40 4;
      
text "Close";
      
thiso.catchevent(this.name"onAction""onCloseScript");
    }
    new 
GuiButtonCtrl("LevelNPC_" temp.npc_id "_ScriptApply") {
      
profile GuiBlueButtonProfile;
      
horizsizing "left";
      
vertsizing  "top";
      
clientwidth  64;
      
clientheight 32;
      
temp.ww 68 64 4;
      
temp.wh 40 4;
      
text "Apply";
      
thiso.catchevent(this.name"onAction""onApplyScript");
    }
    new 
GuiTextEditCtrl("LevelNPC_" temp.npc_id "_Image") {
      
profile GuiBlueTextEditProfile;
      
clientwidth 256;
      
clientheight 24;
      
4;
      
temp.wh 24 10;
      
text temp.npc_img;
      
thiso.catchevent(this.name"onAction""onUpdateImage");
      
temp.imgctrl this;
    }
    
this.scriptctrl temp.scriptctrl;
    
this.imgctrl    temp.imgctrl;
  }

or re-download the script in this attachment:
Attached Files
File Type: txt olne.txt (39.2 KB, 356 views)
__________________
Quote:
Reply With Quote