I adapted code from thargoid repairbots oxp, and made this :
Code: Select all
"use strict";
this.name = "SC worldscript events";
this.author = "Lone_Wolf";
this.copyright = "(C) 2011,2012 , 2014 Lone_Wolf.";
this.licence = "CC-by-SA 4.0";
this.description = "SC worldscript event handler";
this.version = "1.10.2";
this.startUp = function()
{
if ( worldScripts["Shield Cycler"].startUp ) { worldScripts["Shield Cycler"].startUp(); };
};
// worldscript events
this.guiScreenWillChange = function(to, from)
{
if ( to !== "GUI_SCREEN_MANIFEST" ) { return; };
if ( worldScripts["Shield Cycler"]._sc_settings.sc.version == worldScripts["Shield Cycler"]._sc_const.none ) { return; };
var _sc_display_strings = ["none","basic","standard","advanced"];
var sc_display_cycler = _sc_display_strings[worldScripts["Shield Cycler"]._sc_settings.sc.version];
var sc_display_manual = "";
var sc_display_functional = worldScripts["Shield Cycler"]._sc_settings.sc.functional ;
if ( worldScripts["Shield Cycler"]._sc_settings.sc.manual_version != worldScripts["Shield Cycler"]._sc_const.none )
{ var sc_display_manual = _sc_display_strings[worldScripts["Shield Cycler"]._sc_settings.sc.manual_version]; };
mission.setInstructions("Shield Cycler: " + sc_display_cycler +" ,Manual Configurator: " + sc_display_manual + " , " + sc_display_functional + " %% functional");
};
<snip>
Code: Select all
<key>SC worldscript events</key>
<string>Shield Cycler: standard ,Manual Configurator: standard , 100 % functional</string>
mission.setInstructions
, a bug in my code or a bug in oolite 1.80 ?