Here is my fix, simply replace the whole createEditorFunction function with this:
PHP Code:
// Create Editor Window
function createEditorWindow(temp.npc_id, temp.npc_img, temp.npc_x, temp.npc_y, temp.npc_script) {
new GuiMLTextEditProfile("SyntaxHighlightLegacyProfile") {
fontType = fileexists("DejaVuSansMono.ttf") ? "DejaVuSansMono" : "Courier";
fontSize = (thiso.options.scriptfontsize <= 0 ? 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;
x = (screenwidth - temp.ww) / 2;
y = (screenheight - temp.wh) / 2;
isexternal = true;
text = format("NPC Script Editor (X: %s Y: %s)", temp.npc_x % 64, temp.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;
x = temp.ww - 68;
y = 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;
x = temp.ww - 68 - 64 - 4;
y = 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;
x = 4;
y = 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: