Scripts/xenonui.js |
(function () {
"use strict";
this.name = "XenonUI";
this.author = "phkb";
this.copyright = "2016 phkb";
this.description = "New backgrounds for UI screens. Needs one of the Xenon UI Resource packs (A through N) to be installed as well.";
this.license = "CC BY-NC-SA 3.0";
this._lastHUDCheck = false;
this._lastHUDHiddenCheck = false;
this._defaultsOn = false;
this._marketObserverInstalled = false; // flag to indicate when market observer is installed (for wide F8 display)
this._disableMissionScreen = []; // array of mission "screenID's" that will have the background disabled
this._chartExitScreenTimer = null;
this._missionOverlay = {}; // array of mission screen ID's and image names for overlays
this._backgroundOverride = []; // array of mission screen ID's we've forcefully added a background to
this._disableOverlays = false; // flag that indicates whether mission overlays will be applied to mission screens
this._enableLibGUIInt = true; // flag to indicate whether integration with LibGUI is on or off. true means it is on.
this._activeMode = true;
this._guiActive = ""; // monitors changes in the currently selected GUI (when Library is installed)
this._useBGS = "";
this._trueValues = ["yes", "1", 1, "true", true];
this._hdbgActive = false; // indicates that the HG Backgrounds OXP is active
this._addedID = {}; // keeps track of screen ID's we have added to Library GUI, so we can remove them if another GUI is selected
this._xr = null; // link to Xenon Redux UI (if installed)
this._defaultBG = {};
this._amber = false; // indicates whether blue (false) or amber (true) backgrounds will be used
this._ratio = "";
this._font = "default";
this._f6Overlay = {
"economy":null,
"government":null,
"suncolor":null,
"techlevel":null
};
// configuration settings for use in Lib_Config
this._xenonConfig = {
Name: this.name,
Alias: expandDescription("[xenonui_config_alias]"),
Display: expandDescription("[xenonui_config_display]"),
Alive: "_xenonConfig",
Notify: "$changeSettings",
Bool: {
B0: {
Name: "_disableOverlays",
Def: false,
Desc: expandDescription("[xenonui_disable_overlays]")
},
B1: {
Name: "_activeMode",
Def: true,
Desc: expandDescription("[xenonui_active_mode]")
},
B2: {
Name: "_amber",
Def: false,
Desc: expandDescription("[xenonui_amber]")
},
Info: expandDescription("[xenonui_config_bool_info]")
},
};
/*
This OXP replaces all the backgrounds of all UI screens with new versions using a hi-tech-like design theme.
In most cases any individual backgrounds supplied by individual OXP's on their mission "runScreen" will overridden by these ones (but see below).
A resource pack is required to complete the system. Depending on the font you are using in Oolite, you may want to use a specific resource pack to match.
The available packs are:
Pack name Font
--------------- -----------------------------
Pack A (16:9) OCR A Extended
Pack B (16:10) OCA A Extended
Pack C (16:9) Xolonium
Pack D (16:10) Xolonium
Pack E (16:9) Dangerous Square
Pack F (16:10) Dangerous Square
Pack G (16:9) Default font (Helvetica Bold)
Pack H (16:10) Default font (Helvetica Bold)
Pack I (16:9) Dosis font
Pack J (16:10) Dosis font
Pack K (16:9) Discognate font
Pack L (16:10) Discognate font
Pack M (16:9) NovaSquare font
Pack N (16:10) NovaSquare font
More packs may become available as new fonts are released for Oolite.
This OXP is designed to be compatible with the BackGroundSet (BGS). However, on some systems some BGS images may still be shown,
depending on the load order of the OXP's. If this OXP loads after BGS, these images will be used. If BGS loads after this OXP, it's images may be used.
To disable the BGS images you will need to edit BGS, and rename the "screenbackgrounds.plist" file in the "Config" folder to something like "xcreenbackgrounds.plist".
If your OXP has backgrounds you want to keep, and you want to still use this OXP, use the "$addMissionScreenException" to your startUpComplete script:
Example:
var w = worldScripts.XenonUI;
if (w) w.$addMissionScreenException("mymissionscreenid");
Note: When mission screens exit to the short or long range charts, the backgrounds are not being set. So a timer is in place to force the background on.
*/
//-------------------------------------------------------------------------------------------------------------
// adds a screen ID to the list of mission screen ID's this OXP will not override
this.$addMissionScreenException = function $addMissionScreenException(missionScreenID) {
var lib = worldScripts.Lib_GUI;
if (this._disableMissionScreen.indexOf(missionScreenID) === -1) this._disableMissionScreen.push(missionScreenID);
if (lib && this._enableLibGUIInt && (!this._addedID[missionScreenID] || this._addedID[missionScreenID] === 2) && lib.$cur === "XenonUI") {
if (!lib.$IDRules[missionScreenID]) {
this._addedID[missionScreenID] = 2;
this.$passConfig(missionScreenID);
// we can only add now...
lib.$IDRules[missionScreenID] = {
mpic: 0
};
}
//lib.$IDRules[missionScreenID] = {
// mpic: 0
//};
}
}
//-------------------------------------------------------------------------------------------------------------
// function to add an overlay image to a mission screen
this.$addMissionOverlay = function $addMissionOverlay(missionScreenID, imagename) {
if (!this._missionOverlay[missionScreenID] && imagename == null) imagename = "";
if (imagename != null) this._missionOverlay[missionScreenID] = imagename;
var lib = worldScripts.Lib_GUI;
// lib_GUI stuff
if (lib && this._enableLibGUIInt) {
if (imagename != null && imagename != "") {
lib.$IDs.XenonUI[missionScreenID] = {
pic: {
name: (this._amber === true ? "amber" : "xenon") + "_standard_f0.png",
height: 546
},
picBig: {
name: (this._amber === true ? "amber" : "xenon") + "_standard_f0_nohud.png",
height: 546
},
ov: {
name: imagename,
height: 546
},
sndRef: this._useBGS
};
if (lib.$cur === "XenonUI") {
if (!this._addedID[missionScreenID] || this._addedID[missionScreenID] === 2) {
if (!lib.$IDRules[missionScreenID]) {
this._addedID[missionScreenID] = 2;
this.$passConfig(missionScreenID);
// we can only add now...
if (this._disableOverlays === true) {
lib.$IDRules[missionScreenID] = {
pic: 1,
ov: 0
};
} else {
lib.$IDRules[missionScreenID] = {
pic: 1,
ov: 1
};
}
}
/*if (this._disableOverlays === true) {
lib.$IDRules[missionScreenID] = {
pic: 1,
ov: 0
};
} else {
lib.$IDRules[missionScreenID] = {
pic: 1,
ov: 1
};
}*/
}
}
} else {
if (imagename === "") {
lib.$IDs.XenonUI[missionScreenID] = {
pic: {
name: (this._amber === true ? "amber" : "xenon") + "_standard_f0.png",
height: 546
},
picBig: {
name: (this._amber === true ? "amber" : "xenon") + "_standard_f0_nohud.png",
height: 546
},
sndRef: this._useBGS
};
if (lib.$cur === "XenonUI" && (!this._addedID[missionScreenID] || this._addedID[missionScreenID] === 2)) {
if (!lib.$IDRules[missionScreenID]) {
this._addedID[missionScreenID] = 2;
this.$passConfig(missionScreenID);
// we can only add now...
lib.$IDRules[missionScreenID] = {
pic: 1
};
}
//lib.$IDRules[missionScreenID] = {
// pic: 1
//};
}
}
}
}
}
//-------------------------------------------------------------------------------------------------------------
this.$setF6OverlayLookup = function(section, ws, fnName) {
var check = ["economy","government","suncolor","techlevel"];
if (check.indexOf(section) == -1) {
log(this.name, "Exception! Invalid section defined. Must be either 'economy', 'government', 'suncolor' or 'techlevel' - tried to use " + section);
return false;
}
if (!worldScripts[ws][fnName]) {
log(this.name, "Exception! WorldScript/Function not found! " + ws + "." + fnName);
return false;
}
this._f6Overlay[section] = {worldscript:ws, functionname:fnName};
return true;
}
//-------------------------------------------------------------------------------------------------------------
this.$clearF6OverlayLookup = function(section) {
var check = ["economy","government","suncolor","techlevel"];
if (check.indexOf(section) == -1) {
log(this.name, "Exception! Invalid section defined. Must be either 'economy', 'government', 'suncolor' or 'techlevel' - tried to use " + section);
return false;
}
this._f6Overlay[section] = null;
return true;
}
//-------------------------------------------------------------------------------------------------------------
this.startUp = function () {
this._xr = worldScripts.XenonReduxUI;
// check to make sure we have resources (with some scope for new packs)
var res = ["Xenon UI Resource Pack A (16:9)", "Xenon UI Resource Pack B (16:10)",
"Xenon UI Resource Pack C (16:9)", "Xenon UI Resource Pack D (16:10)",
"Xenon UI Resource Pack E (16:9)", "Xenon UI Resource Pack F (16:10)",
"Xenon UI Resource Pack G (16:9)", "Xenon UI Resource Pack H (16:10)",
"Xenon UI Resource Pack I (16:9)", "Xenon UI Resource Pack J (16:10)",
"Xenon UI Resource Pack K (16:9)", "Xenon UI Resource Pack L (16:10)",
"Xenon UI Resource Pack M (16:9)", "Xenon UI Resource Pack N (16:10)"
]
var found = false;
for (var i = 0; i < res.length; i++) {
if (worldScriptNames.indexOf(res[i]) >= 0) {
found = true;
if (res[i].indexOf("16:9") > 0) this._ratio = "16_9"; else this._ratio = "16_10";
break;
}
}
if (found === false) {
log(this.name, "ERROR! No Xenon UI Resource packs installed. Xenon UI cannot function without one resource pack installed.");
// turn off the OXP here
delete this.guiScreenChanged;
delete this.missionScreenEnded;
delete this.gameResumed;
delete this.startUp;
delete this.startUpComplete;
delete this.infoSystemChanged;
return;
}
var rp = oolite.resourcePaths;
var i = rp.length;
while (i--) {
if (rp[i].indexOf("Font") >= 0) {
if (rp[i].indexOf("NovaSquare") > 0) {this._font = "novasquare"; break;}
if (rp[i].indexOf("Discognate") > 0) {this._font = "discognate"; break;}
if (rp[i].indexOf("Xolonium") > 0) {this._font = "xolonium"; break;}
if (rp[i].indexOf("Dangerous") > 0) {this._font = "dangeroussquare"; break;}
if (rp[i].indexOf("Dosis") > 0) {this._font = "dosis"; break;}
if (rp[i].indexOf("OCR") > 0) {this._font = "ocraextended"; break;}
}
}
var lib = worldScripts.Lib_GUI;
if (missionVariables.XenonUI_ActiveMode) this._activeMode = (this._trueValues.indexOf(missionVariables.XenonUI_ActiveMode) >= 0 ? true : false);
if (missionVariables.XenonUI_DisableOverlays) this._disableOverlays = (this._trueValues.indexOf(missionVariables.XenonUI_DisableOverlays) >= 0 ? true : false);
// only reload the amber setting if lib config is present - otherwise we'll just take the preset value
if (lib) {
if (missionVariables.XenonUI_Amber) this._amber = (this._trueValues.indexOf(missionVariables.XenonUI_Amber) >= 0 ? true : false);
this._lastAmber = this._amber;
}
if (!lib || lib.$cur === "XenonUI") {
this.$updateGuiColorSettings();
}
if (worldScripts["BGS"]) this._useBGS = "BGS";
if (worldScripts["market_observer3"]) this._marketObserverInstalled = true;
if (worldScripts["hdbg"]) this._hdbgActive = true;
if (!lib) this._enableLibGUIInt = false;
if (lib && this._enableLibGUIInt === true) {
// flag some screens as readonly
this._addedID["oolite-contracts-parcels-none"] = 1;
this._addedID["oolite-contracts-parcels-details"] = 1;
this._addedID["oolite-contracts-parcels-summary"] = 1;
this._addedID["oolite-contracts-passengers-none"] = 1;
this._addedID["oolite-contracts-passengers-details"] = 1;
this._addedID["oolite-contracts-passengers-summary"] = 1;
this._addedID["oolite-contracts-cargo-none"] = 1;
this._addedID["oolite-contracts-cargo-details"] = 1;
this._addedID["oolite-contracts-cargo-summary"] = 1;
this._addedID["oolite-primablemanager"] = 1;
this._addedID["oolite-register"] = 1;
this._addedID["Lib_Config"] = 1;
// disable our standard functions so LibGUI can take over
this.$previous_guiScreenChanged = this.guiScreenChanged;
delete this.guiScreenChanged;
var ver = lib.version.split(".");
if (ver.length >= 2) {
// only delete the infoSystemChanged if Lib GUI is greater than version 1.1
if (parseInt(ver[0]) > 1 || parseInt(ver[1]) > 1 || ver.length > 2)
delete this.infoSystemChanged;
}
delete this.missionScreenEnded;
delete this.gameResumed;
delete this.startUp;
this.$libGUISetup();
}
// if we don't have library to orchestrate backgrounds, disable "better screens" so xenon UI has priority
// otherwise, we end up with a clash of different background sets
if (!lib && worldScripts["smivs_screen-backgrounds_worldscript"]) {
worldScripts["smivs_screen-backgrounds_worldscript"].hide_guiScreenChanged = worldScripts["smivs_screen-backgrounds_worldscript"].guiScreenChanged;
delete worldScripts["smivs_screen-backgrounds_worldscript"].guiScreenChanged;
}
this.$addStandardMissionScreenOverlays();
this.$addStandardMissionScreenExceptions();
if (worldScripts["BGS-M"] && (!lib || this._enableLibGUIInt === false)) {
// bgs does a frame callback to apply screen overlays to the LRC
// however, with 1.80 the overlays don't work anymore
// unfortunately, the frame callback is still running which then removes the XenonUI F6 overlay
// to prevent this, we're monkey patching the framecallback destination function to be an empty function
// that appears to be the only way to stop BGS from doing the screen overlay thing, without actually getting a separate fix released for it.
var bgs = worldScripts["BGS-M"];
if (!bgs.x_doBGSChartsTimer) {
bgs.x_doBGSChartsTimer = bgs.doBGSChartsTimer;
bgs.doBGSChartsTimer = function (delta) {};
}
}
}
//-------------------------------------------------------------------------------------------------------------
this.startUpComplete = function () {
// register our settings, if Lib_Config is present
if (worldScripts.Lib_Config) {
worldScripts.Lib_Config._registerSet(this._xenonConfig);
this.$setBGSDefaultBackgrounds();
}
}
//-------------------------------------------------------------------------------------------------------------
this.playerWillSaveGame = function () {
missionVariables.XenonUI_ActiveMode = this._activeMode;
missionVariables.XenonUI_DisableOverlays = this._disableOverlays;
missionVariables.XenonUI_Amber = this._amber;
}
//-------------------------------------------------------------------------------------------------------------
this.chartHighlightModeChanged = function (newMode) {
if (this._enableLibGUIInt === false) {
this.guiScreenChanged("", "");
} else {
var lib = worldScripts.Lib_GUI;
var f6ovr = "f6-overlay.png";
if (player.ship.hasOwnProperty("chartHighlightMode") === true) {
switch (player.ship.chartHighlightMode) {
case "OOLRC_MODE_SUNCOLOR":
var lookup = this._f6Overlay.suncolor;
if (lookup) {
f6ovr = worldScripts[lookup.worldscript][lookup.functionname](this._ratio, this._font);
} else {
f6ovr = "f6-overlay-suncolor.png";
}
break;
case "OOLRC_MODE_TECHLEVEL":
var lookup = this._f6Overlay.techlevel;
if (lookup) {
f6ovr = worldScripts[lookup.worldscript][lookup.functionname](this._ratio, this._font);
} else {
f6ovr = "f6-overlay-techlevel.png";
}
break;
case "OOLRC_MODE_ECONOMY":
var lookup = this._f6Overlay.economy;
if (lookup) {
f6ovr = worldScripts[lookup.worldscript][lookup.functionname](this._ratio, this._font);
} else {
f6ovr = "f6-overlay-economy.png";
}
break;
case "OOLRC_MODE_GOVERNMENT":
var lookup = this._f6Overlay.government;
if (lookup) {
f6ovr = worldScripts[lookup.worldscript][lookup.functionname](this._ratio, this._font);
} else {
f6ovr = "f6-overlay-government.png";
}
break;
}
}
lib.$guis.XenonUI.GUI_SCREEN_SHORT_RANGE_CHART.ov = {
name: f6ovr,
height: 546
};
lib.$guis.XenonUI.GUI_SCREEN_LONG_RANGE_CHART.ov = {
name: f6ovr,
height: 546
};
lib.guiScreenChanged();
}
}
//-------------------------------------------------------------------------------------------------------------
this.infoSystemChanged = function (to, from) {
var lib = worldScripts.Lib_GUI;
if (lib && this._enableLibGUIInt === true) {
// force lib gui to do a screen update
lib.guiScreenChanged();
return;
}
this.guiScreenChanged(guiScreen, guiScreen);
}
//-------------------------------------------------------------------------------------------------------------
this.guiScreenChanged = function (to, from) {
var p = player.ship;
var startTimer = false;
var imagetype = "standard";
var redalert = "";
var nohud = "";
var imagename = "";
var ana = "";
var overlay = "";
var overlayHeight = 0;
if (this._marketObserverInstalled) {
if (from === "GUI_SCREEN_MARKET" || from === "GUI_SCREEN_MARKETINFO" || to === "GUI_SCREEN_MARKET" || to === "GUI_SCREEN_MARKETINFO")
// Because market observer uses a specialised HUD a slightly incorrect background image was being selected.
// This was unnoticable if the "allow_big_gui" was not enabled on the default HUD, but quite noticeable on the Xenon HUD.
// So we start a timer to force the correct background after Market Observer has set or reset the HUD.
startTimer = true;
}
// fix for the issue where exiting the ship library screen could sometimes result in the wrong background being displayed
// this would only be apparent with HUD's that don't implement the "allow_big_gui" setting.
if (from === "GUI_SCREEN_SHIPLIBRARY" && p && p.docked) startTimer = true;
if (p.alertCondition === 3) redalert = "_redalert";
if (p.hudHidden) nohud = "_nohud";
if (this.$isBigGuiActive() === true) nohud = "_nohud";
if (p.isInSpace) {
imagetype = "inflight";
// going to assume that nohud versions of inflight guis are not that important
nohud = "";
}
switch (guiScreen) {
case "GUI_SCREEN_MAIN":
return;
case "GUI_SCREEN_SHIPLIBRARY":
imagename = "f0";
nohud = "_nohud";
break;
case "GUI_SCREEN_KEYBOARD":
imagename = "nomenu";
nohud = "_nohud";
if (this._disableOverlays === false) overlay = "xui-keyboard.png";
break;
case "GUI_SCREEN_STICKPROFILE":
imagename = "f2";
nohud = "";
break;
case "GUI_SCREEN_STICKMAPPER":
imagename = "f2";
nohud = "";
if (this._disableOverlays === false) overlay = "xui-gamepad.png";
break;
case "GUI_SCREEN_OPTIONS":
imagename = "f2";
if (this._disableOverlays === false) overlay = "xui-settings.png";
break;
case "GUI_SCREEN_LOAD":
imagename = "f2";
if (this._disableOverlays === false) overlay = "xui-load.png";
break;
case "GUI_SCREEN_SAVE":
imagename = "f2";
if (this._disableOverlays === false) overlay = "xui-save.png";
break;
case "GUI_SCREEN_SAVE_OVERWRITE":
imagename = "f2";
if (this._disableOverlays === false) overlay = "xui-question.png";
break;
case "GUI_SCREEN_EQUIP_SHIP":
imagename = "f3-1";
if (this._disableOverlays === false) overlay = "xui-equipship.png";
break;
case "GUI_SCREEN_SHIPYARD":
imagename = "f3-2";
break;
case "GUI_SCREEN_INTERFACES":
imagename = "f4";
if (this._disableOverlays === false) overlay = "xui-interfaces.png";
break;
case "GUI_SCREEN_STATUS":
imagename = "f5-1";
// override BGS status and nocrowd image, if installed.
if (worldScripts["BGS-M"]) {
worldScripts["BGS-M"].bgsI.status = {
name: (this._amber === true ? "amber" : "xenon") + "_" + imagetype + "_" + imagename + nohud + redalert + ".png",
height: 546
};
worldScripts["BGS-M"].bgsI.noCrowd = {
name: (this._amber === true ? "amber" : "xenon") + "_" + imagetype + "_" + imagename + nohud + redalert + ".png",
height: 546
};
}
/*if (this._disableOverlays === false) {
if (this.$playerHasDamagedEquipment() === true) {
overlay = "xui-warning.png";
} else {
overlay = "xui-ok.png";
}
}*/
break;
case "GUI_SCREEN_MANIFEST":
imagename = "f5-2";
if (this._disableOverlays === false) overlay = "xui-clipboard.png";
break;
case "GUI_SCREEN_SHORT_RANGE_CHART":
case "GUI_SCREEN_LONG_RANGE_CHART":
if (guiScreen == "GUI_SCREEN_SHORT_RANGE_CHART") imagename = "f6";
if (guiScreen == "GUI_SCREEN_LONG_RANGE_CHART") {
imagename = "f6-2";
if (worldScripts["BGS-M"]) worldScripts["BGS-M"].bgsI.lrc = {
name: (this._amber === true ? "amber" : "xenon") + "_" + imagetype + "_" + imagename + ana + nohud + redalert + ".png",
height: 546
};
}
ana = "_ana";
if (p.equipmentStatus("EQ_ADVANCED_NAVIGATIONAL_ARRAY") != "EQUIPMENT_OK") ana = "_no_ana";
if (p.hasOwnProperty("chartHighlightMode") === true) {
switch (p.chartHighlightMode) {
case "OOLRC_MODE_SUNCOLOR":
var lookup = this._f6Overlay.suncolor;
if (lookup) {
overlay = worldScripts[lookup.worldscript][lookup.functionname](this._ratio, this._font);
} else {
overlay = "f6-overlay-suncolor.png";
}
break;
case "OOLRC_MODE_TECHLEVEL":
var lookup = this._f6Overlay.techlevel;
if (lookup) {
overlay = worldScripts[lookup.worldscript][lookup.functionname](this._ratio, this._font);
} else {
overlay = "f6-overlay-techlevel.png";
}
break;
case "OOLRC_MODE_ECONOMY":
var lookup = this._f6Overlay.economy;
if (lookup) {
overlay = worldScripts[lookup.worldscript][lookup.functionname](this._ratio, this._font);
} else {
overlay = "f6-overlay-economy.png";
}
break;
case "OOLRC_MODE_GOVERNMENT":
var lookup = this._f6Overlay.government;
if (lookup) {
overlay = worldScripts[lookup.worldscript][lookup.functionname](this._ratio, this._font);
} else {
overlay = "f6-overlay-government.png";
}
break;
}
} else {
overlay = "f6-overlay.png";
}
break;
case "GUI_SCREEN_SYSTEM_DATA":
imagename = "f7";
var sysinf = System.infoForSystem(galaxyNumber, p.targetSystem);
if (sysinf["sun_gone_nova"] || sysinf["sun_going_nova"]) imagename += "_nova";
break;
case "GUI_SCREEN_MARKET":
imagename = "f8";
if (this._disableOverlays === false) overlay = "xui-market.png";
if (this._marketObserverInstalled) imagename += "_wide";
break;
case "GUI_SCREEN_MARKETINFO":
imagename = "f8-2";
if (this._marketObserverInstalled) imagename += "_wide";
if (this._disableOverlays === false) overlay = "xui-tag.png";
break;
case "GUI_SCREEN_REPORT":
imagename = "f0";
if (this._disableOverlays === false) overlay = "xui-report.png";
if (this._hdbgActive === true) return;
break;
case "GUI_SCREEN_MISSION":
imagename = "f0";
// look for any exceptions and jump out if found
if (this._disableMissionScreen.indexOf(mission.screenID) != -1) imagename = "disable";
// check if we have an overlay to apply to this mission screen
if (this._disableOverlays === false && this._disableMissionScreen.indexOf(mission.screenID) === -1) {
if (this._missionOverlay[mission.screenID]) overlay = this._missionOverlay[mission.screenID];
}
break;
}
// build the file filename if it hasn't been disabled
if (imagename != "disable") {
imagename = (this._amber === true ? "amber_" : "xenon_") + imagetype + "_" + imagename + ana + nohud + redalert + ".png";
// load the image to the background
setScreenBackground({
name: imagename,
height: 546
});
}
// apply the overlay if one was found
if (overlay != "") setScreenOverlay({
name: overlay,
height: 546
});
// start a timer to force the background, if required
if (startTimer) {
if (this._chartExitScreenTimer && this._chartExitScreenTimer.isRunning) this._chartExitScreenTimer.stop();
this._chartExitScreenTimer = new Timer(this, this.$addBackground, 0.25, 0);
}
}
//-------------------------------------------------------------------------------------------------------------
this.missionScreenEnded = function () {
this.guiScreenChanged("", "");
}
//-------------------------------------------------------------------------------------------------------------
this.gameResumed = function () {
this.guiScreenChanged("", "");
}
//-------------------------------------------------------------------------------------------------------------
// adds overlays to the standard mission screens
this.$addStandardMissionScreenOverlays = function $addStandardMissionScreenOverlays() {
this.$addMissionOverlay("oolite-contracts-parcels-none", "xui-briefcase.png");
this.$addMissionOverlay("oolite-contracts-parcels-summary", "xui-briefcase.png");
this.$addMissionOverlay("oolite-contracts-passengers-none", "xui-boardingpass.png");
this.$addMissionOverlay("oolite-contracts-passengers-summary", "xui-boardingpass.png");
this.$addMissionOverlay("oolite-contracts-cargo-none", "xui-cargo.png");
this.$addMissionOverlay("oolite-contracts-cargo-summary", "xui-cargo.png");
this.$addMissionOverlay("oolite-primablemanager", "xui-switch.png");
this.$addMissionOverlay("oolite-register", "xui-register.png");
}
//-------------------------------------------------------------------------------------------------------------
// adds map screen exceptions for known screen ID's
this.$addStandardMissionScreenExceptions = function $addStandardMissionScreenExceptions() {
// each of these items can't be set using setScreenBackground - needs to be done via the plist file
this.$addMissionScreenException("oolite-contracts-parcels-details");
this.$addMissionScreenException("oolite-contracts-passengers-details");
this.$addMissionScreenException("oolite-contracts-cargo-details");
this.$addMissionScreenException("rrs_mission_map");
this.$addMissionScreenException("blackmonks-map");
this.$addMissionScreenException("ups-map");
this.$addMissionScreenException("escort-contracts");
if (worldScripts.Random_Hits) {
var ver = worldScripts.Random_Hits.version.split(".");
if (parseInt(ver[0]) > 1 ||
(parseInt(ver[0]) === 1 && parseInt(ver[1])) > 11 ||
(parseInt(ver[0]) === 1 && parseInt(ver[1]) === 11 && parseInt(ver[2]) > 2)) {
this.$addMissionScreenException("random_hits_map");
} else {
this.$addMissionScreenException("random_hits");
}
}
}
//-------------------------------------------------------------------------------------------------------------
// callback handler for when settings are changed
this.$changeSettings = function $changeSettings() {
var lib = worldScripts.Lib_GUI;
if (this._amber != this._lastAmber) {
this.$libGUISetup();
this._lastAmber = this._amber;
}
if (lib.$cur === "XenonUI") {
if (global.setScreenBackgroundForKey) this.$setBackgroundDefaults(true);
this.$updateGuiColorSettings();
}
// because of changes to library gui (from version 1.7), overlays can no longer be changed dynamically and will always be on/off
// until the game is saved and reloaded
/*if (this._disableOverlays === true) {
if (this._enableLibGUIInt === true && lib && lib.$cur === "XenonUI") {
var keys = Object.keys(this._missionOverlay);
for (var i = 0; i < keys.length; i++) {
if (!this._addedID[keys[i]] || this._addedID[keys[i]] === 2) {
if (!lib.$IDRules[keys[i]]) {
this._addedID[keys[i]] = 2;
this.$passConfig(keys[i]);
}
lib.$IDRules[keys[i]] = {
pic: 1,
ov: 0
};
}
}
}
} else {
if (this._enableLibGUIInt === true && lib && lib.$cur === "XenonUI") {
var keys = Object.keys(this._missionOverlay);
for (var i = 0; i < keys.length; i++) {
if (!this._addedID[keys[i]] || this._addedID[keys[i]] === 2) {
if (!lib.$IDRules[keys[i]]) {
this._addedID[keys[i]] = 2;
this.$passConfig(keys[i]);
}
lib.$IDRules[keys[i]] = {
pic: 1,
ov: 1
};
}
}
}
}*/
// reset our monitoring array regardless of which gui is active
if (this._activeMode === false) this._backgroundOverride = [];
this.$setupGeneralOverlays();
}
//-------------------------------------------------------------------------------------------------------------
// sets up the LibGUI parameters
this.$libGUISetup = function $libGUISetup() {
// setup some event callbacks
this.guiScreenChanged = this.$guiScreenChanged;
this.equipmentDamaged = this.$equipmentDamaged;
this.equipmentRepaired = this.$equipmentRepaired;
this.equipmentAdded = this.$equipmentAdded;
this.equipmentRemoved = this.$equipmentRemoved;
this.missionScreenEnded = this.$missionScreenEnded;
var style = (this._amber === true ? "amber" : "xenon");
var lib = worldScripts.Lib_GUI;
lib.$guis.XenonUI = {
GUI_SCREEN_GAMEOPTIONS: {
pic: {
name: style + "_standard_f2.png",
height: 546
},
picBig: {
name: style + "_standard_f2_nohud.png",
height: 546
},
picFlight: {
name: style + "_inflight_f2.png",
height: 546
},
picRed: {
name: style + "_inflight_f2_redalert.png",
height: 546
},
sndRef: this._useBGS
},
GUI_SCREEN_LOAD: {
pic: {
name: style + "_standard_nomenu.png",
height: 546
}
},
GUI_SCREEN_SAVE: {
pic: {
name: style + "_standard_nomenu.png",
height: 546
}
},
GUI_SCREEN_SAVE_OVERWRITE: {
pic: {
name: style + "_standard_nomenu.png",
height: 546
}
},
GUI_SCREEN_EQUIP_SHIP: {
pic: {
name: style + "_standard_f3-1.png",
height: 546
},
picBig: {
name: style + "_standard_f3-1_nohud.png",
height: 546
},
sndRef: this._useBGS
},
GUI_SCREEN_INTERFACES: {
pic: {
name: style + "_standard_f4.png",
height: 546
},
picBig: {
name: style + "_standard_f4_nohud.png",
height: 546
},
sndRef: this._useBGS
},
GUI_SCREEN_KEYBOARD: {
pic: {
name: style + "_standard_nomenu_nohud.png",
height: 546
},
picFlight: {
name: style + "_standard_nomenu_nohud.png",
height: 546
}
},
GUI_SCREEN_MANIFEST: {
pic: {
name: style + "_standard_f5-2.png",
height: 546
},
picBig: {
name: style + "_standard_f5-2_nohud.png",
height: 546
},
picFlight: {
name: style + "_inflight_f5-2.png",
height: 546
},
picRed: {
name: style + "_inflight_f5-2_redalert.png",
height: 546
},
sndRef: this._useBGS
},
GUI_SCREEN_MARKET: {
pic: {
name: style + "_standard_f8" + (this._marketObserverInstalled === true ? "_wide" : "") + ".png",
height: 546
},
picBig: {
name: style + "_standard_f8" + (this._marketObserverInstalled === true ? "_wide" : "") + "_nohud.png",
height: 546
},
picFlight: {
name: style + "_inflight_f8" + (this._marketObserverInstalled === true ? "_wide" : "") + ".png",
height: 546
},
picRed: {
name: style + "_inflight_f8" + (this._marketObserverInstalled === true ? "_wide" : "") + "_redalert.png",
height: 546
},
sndRef: this._useBGS
},
GUI_SCREEN_MARKETINFO: {
pic: {
name: style + "_standard_f8-2" + (this._marketObserverInstalled === true ? "_wide" : "") + ".png",
height: 546
},
picBig: {
name: style + "_standard_f8-2" + (this._marketObserverInstalled === true ? "_wide" : "") + "_nohud.png",
height: 546
},
picFlight: {
name: style + "_inflight_f8-2" + (this._marketObserverInstalled === true ? "_wide" : "") + ".png",
height: 546
},
picRed: {
name: style + "_inflight_f8-2" + (this._marketObserverInstalled === true ? "_wide" : "") + "_redalert.png",
height: 546
},
sndRef: this._useBGS
},
GUI_SCREEN_OPTIONS: {
pic: {
name: style + "_standard_f2.png",
height: 546
},
picBig: {
name: style + "_standard_f2_nohud.png",
height: 546
},
picFlight: {
name: style + "_inflight_f2.png",
height: 546
},
picRed: {
name: style + "_inflight_f2_redalert.png",
height: 546
},
sndRef: this._useBGS
},
GUI_SCREEN_SHIPLIBRARY: {
pic: {
name: style + "_standard_f0_nohud.png",
height: 546
}
},
GUI_SCREEN_SHIPYARD: {
pic: {
name: style + "_standard_f3-2.png",
height: 546
},
picBig: {
name: style + "_standard_f3-2_nohud.png",
height: 546
},
sndRef: this._useBGS
},
GUI_SCREEN_STATUS: {
pic: {
name: style + "_standard_f5-1.png",
height: 546
},
picBig: {
name: style + "_standard_f5-1_nohud.png",
height: 546
},
picFlight: {
name: style + "_inflight_f5-1.png",
height: 546
},
picRed: {
name: style + "_inflight_f5-1_redalert.png",
height: 546
},
sndRef: this._useBGS
},
GUI_SCREEN_STICKMAPPER: {
pic: {
name: style + "_standard_f2.png",
height: 546
},
picBig: {
name: style + "_standard_f2.png",
height: 546
},
picFlight: {
name: style + "_flight_f2.png",
height: 546
},
sndRef: this._useBGS
},
GUI_SCREEN_STICKPROFILE: {
pic: {
name: style + "_standard_f2.png",
height: 546
},
picBig: {
name: style + "_standard_f2.png",
height: 546
},
picFlight: {
name: style + "_flight_f2.png",
height: 546
},
sndRef: this._useBGS
},
GUI_SCREEN_SYSTEM_DATA: {
pic: {
name: style + "_standard_f7.png",
height: 546
},
picBig: {
name: style + "_standard_f7_nohud.png",
height: 546
},
picNova: {
name: style + "_standard_f7_nova.png",
height: 546
},
picNovaBig: {
name: style + "_standard_f7_nova_nohud.png",
height: 546
},
picFlight: {
name: style + "_inflight_f7.png",
height: 546
},
picRed: {
name: style + "_inflight_f7_redalert.png",
height: 546
},
picNovaRed: {
name: style + "_inflight_f7_nova_redalert.png",
height: 546
},
sndRef: this._useBGS
},
};
if (this._hdbgActive === false) {
lib.$guis.XenonUI.generic = {
pic: {
name: style + "_standard_nomenu.png",
height: 546
},
sndRef: this._useBGS
};
lib.$guis.XenonUI.GUI_SCREEN_REPORT = {
pic: {
name: style + "_standard_f0.png",
height: 546
},
picBig: {
name: style + "_standard_f0_nohud.png",
height: 546
},
sndRef: this._useBGS
};
}
this.$setupVariableScreens();
this.$setupGeneralOverlays();
// mission screen IDs
lib.$IDs.XenonUI = {
generic: {
pic: {
name: style + "_standard_f0.png",
height: 546
},
picBig: {
name: style + "_standard_f0_nohud.png",
height: 546
},
picFlight: {
name: style + "_inflight_f0.png",
height: 546
},
picRed: {
name: style + "_inflight_f0_redalert.png",
height: 546
},
ov: {
name: style + "_standard_f0.png",
height: 546
},
ovBig: {
name: style + "_standard_f0_nohud.png",
height: 546
},
sndRef: this._useBGS
}
};
}
//-------------------------------------------------------------------------------------------------------------
// adjust background images on F5/F6 screen based on availability/status of equipment
this.$setupVariableScreens = function $setupVariableScreens() {
var ana = "_ana";
if (player.ship.equipmentStatus("EQ_ADVANCED_NAVIGATIONAL_ARRAY") != "EQUIPMENT_OK") ana = "_no_ana";
var lib = worldScripts.Lib_GUI;
var f6ovr = "f6-overlay.png";
if (player.ship.hasOwnProperty("chartHighlightMode") === true) {
switch (player.ship.chartHighlightMode) {
case "OOLRC_MODE_SUNCOLOR":
var lookup = this._f6Overlay.suncolor;
if (lookup) {
f6ovr = worldScripts[lookup.worldscript][lookup.functionname](this._ratio, this._font);
} else {
f6ovr = "f6-overlay-suncolor.png";
}
break;
case "OOLRC_MODE_TECHLEVEL":
var lookup = this._f6Overlay.techlevel;
if (lookup) {
f6ovr = worldScripts[lookup.worldscript][lookup.functionname](this._ratio, this._font);
} else {
f6ovr = "f6-overlay-techlevel.png";
}
break;
case "OOLRC_MODE_ECONOMY":
var lookup = this._f6Overlay.economy;
if (lookup) {
f6ovr = worldScripts[lookup.worldscript][lookup.functionname](this._ratio, this._font);
} else {
f6ovr = "f6-overlay-economy.png";
}
break;
case "OOLRC_MODE_GOVERNMENT":
var lookup = this._f6Overlay.government;
if (lookup) {
f6ovr = worldScripts[lookup.worldscript][lookup.functionname](this._ratio, this._font);
} else {
f6ovr = "f6-overlay-government.png";
}
break;
}
}
var style = (this._amber === true ? "amber" : "xenon");
lib.$guis.XenonUI.GUI_SCREEN_SHORT_RANGE_CHART = {
pic: {
name: style + "_standard_f6" + ana + ".png",
height: 546
},
picBig: {
name: style + "_standard_f6" + ana + "_nohud.png",
height: 546
},
picFlight: {
name: style + "_inflight_f6" + ana + ".png",
height: 546
},
picRed: {
name: style + "_inflight_f6" + ana + "_redalert.png",
height: 546
},
ov: {
name: f6ovr,
height: 546
},
sndRef: this._useBGS
};
lib.$guis.XenonUI.GUI_SCREEN_LONG_RANGE_CHART = {
pic: {
name: style + "_standard_f6-2" + ana + ".png",
height: 546
},
picBig: {
name: style + "_standard_f6-2" + ana + "_nohud.png",
height: 546
},
picFlight: {
name: style + "_inflight_f6-2" + ana + ".png",
height: 546
},
picRed: {
name: style + "_inflight_f6-2" + ana + "_redalert.png",
height: 546
},
ov: {
name: f6ovr,
height: 546
},
sndRef: this._useBGS
};
}
//-------------------------------------------------------------------------------------------------------------
// adjust overlay images on general (non-mission) screens
this.$setupGeneralOverlays = function $setupGeneralOverlays() {
var lib = worldScripts.Lib_GUI.$guis.XenonUI;
if (this._disableOverlays) {
delete lib.GUI_SCREEN_GAMEOPTIONS["ov"];
delete lib.GUI_SCREEN_LOAD["ov"];
delete lib.GUI_SCREEN_SAVE["ov"];
delete lib.GUI_SCREEN_SAVE_OVERWRITE["ov"];
delete lib.GUI_SCREEN_EQUIP_SHIP["ov"];
delete lib.GUI_SCREEN_INTERFACES["ov"];
delete lib.GUI_SCREEN_KEYBOARD["ov"];
delete lib.GUI_SCREEN_MANIFEST["ov"];
delete lib.GUI_SCREEN_MARKET["ov"];
delete lib.GUI_SCREEN_MARKETINFO["ov"];
delete lib.GUI_SCREEN_OPTIONS["ov"];
if (this._hdbgActive === false) delete lib.GUI_SCREEN_REPORT["ov"];
//delete lib.GUI_SCREEN_STATUS["ov"];
delete lib.GUI_SCREEN_STICKMAPPER["ov"];
} else {
lib.GUI_SCREEN_GAMEOPTIONS["ov"] = {
name: "xui-settings.png",
height: 546
};
lib.GUI_SCREEN_LOAD["ov"] = {
name: "xui-load.png",
height: 546
};
lib.GUI_SCREEN_SAVE["ov"] = {
name: "xui-save.png",
height: 546
};
lib.GUI_SCREEN_SAVE_OVERWRITE["ov"] = {
name: "xui-question.png",
height: 546
};
lib.GUI_SCREEN_EQUIP_SHIP["ov"] = {
name: "xui-equipship.png",
height: 546
};
lib.GUI_SCREEN_INTERFACES["ov"] = {
name: "xui-interfaces.png",
height: 546
};
lib.GUI_SCREEN_KEYBOARD["ov"] = {
name: "xui-keyboard.png",
height: 546
};
lib.GUI_SCREEN_MANIFEST["ov"] = {
name: "xui-clipboard.png",
height: 546
};
lib.GUI_SCREEN_MARKET["ov"] = {
name: "xui-market.png",
height: 546
};
lib.GUI_SCREEN_MARKETINFO["ov"] = {
name: "xui-tag.png",
height: 546
};
lib.GUI_SCREEN_OPTIONS["ov"] = {
name: "xui-settings.png",
height: 546
};
if (this._hdbgActive === false) lib.GUI_SCREEN_REPORT["ov"] = {
name: "xui-report.png",
height: 546
};
lib.GUI_SCREEN_STICKMAPPER["ov"] = {
name: "xui-gamepad.png",
height: 546
};
}
}
//-------------------------------------------------------------------------------------------------------------
// alternate version for use with Lib_GUI
this.$missionScreenEnded = function $missionScreenEnded() {
var lib = worldScripts.Lib_GUI;
if (player.ship.hudAllowsBigGui != this._lastHUDCheck) {
if (global.setScreenBackgroundForKey) this.$setBackgroundDefaults(true);
this._lastHUDCheck = player.ship.hudAllowsBigGui;
}
if (this._guiActive != lib.$cur && (this._guiActive === "XenonUI" || lib.$cur === "XenonUI")) {
if (lib.$cur === "XenonUI") {
// if we've got it available (v1.85/86) then force the default screen background to be Xenon's
if (global.setScreenBackgroundForKey) this.$setBackgroundDefaults(true);
this.$updateGuiColorSettings();
for (var i = 0; i < this._disableMissionScreen.length; i++) {
if (!this._addedID[this._disableMissionScreen[i]] || this._addedID[this._disableMissionScreen[i]] === 2) {
if (!lib.$IDRules[this._disableMissionScreen[i]]) {
this._addedID[this._disableMissionScreen[i]] = 2;
this.$passConfig(this._disableMissionScreen[i]);
// we can only add now...
lib.$IDRules[this._disableMissionScreen[i]] = {
mpic: 0
};
}
//lib.$IDRules[this._disableMissionScreen[i]] = {
// mpic: 0
//};
}
}
var keys = Object.keys(this._missionOverlay);
for (var i = 0; i < keys.length; i++) {
// update Lib_GUI with our settings for mission screens
if (!this._addedID[keys[i]] || this._addedID[keys[i]] === 2) {
if (!lib.$IDRules[keys[i]]) {
this._addedID[keys[i]] = 2;
this.$passConfig(keys[i]);
if (this._missionOverlay[keys[i]] != "") {
if (this._disableOverlays === true) {
lib.$IDRules[keys[i]] = {
pic: 1,
ov: 0
};
} else {
lib.$IDRules[keys[i]] = {
pic: 1,
ov: 1
};
}
} else {
lib.$IDRules[keys[i]] = {
pic: 1
};
}
}
/*if (this._missionOverlay[keys[i]] != "") {
if (this._disableOverlays === true) {
lib.$IDRules[keys[i]] = {
pic: 1,
ov: 0
};
} else {
lib.$IDRules[keys[i]] = {
pic: 1,
ov: 1
};
}
} else {
lib.$IDRules[keys[i]] = {
pic: 1
};
}*/
}
}
} else {
// if we've got it available (v1.85/86) then reset the default screen backgrounds to be what it was previously
if (global.setScreenBackgroundForKey) this.$setBackgroundDefaults(false);
}
this._guiActive = lib.$cur;
}
}
//-------------------------------------------------------------------------------------------------------------
// activated when Library GUI is in use
// gets any unrecorded mission ScreenID's add add them to the list of rules to use Xenon
this.$guiScreenChanged = function $guiScreenChanged(to, from) {
if (guiScreen === "GUI_SCREEN_STATUS") {
// this bit should only be run once after load
if (this._guiActive === "") {
// force all the screen rego stuff to happen if xenon was set after loading
if (worldScripts.Lib_GUI.$cur === "XenonUI") {
this.missionScreenEnded();
this.$setBackgroundDefaults(true);
}
// make sure our local copy gets updated
this._guiActive = worldScripts.Lib_GUI.$cur;
}
}
if (guiScreen === "GUI_SCREEN_MISSION" && this._guiActive === "XenonUI" && this._activeMode === true) {
if (player.ship.hudHidden != this._lastHUDHiddenCheck) {
this.$setBackgroundDefaults(true);
this._lastHUDHiddenCheck = player.ship.hudHidden;
}
if (mission.screenID && mission.screenID != "" && this._disableMissionScreen.indexOf(mission.screenID) === -1) {
this.$addMissionOverlay(mission.screenID, null);
// make a note of any screen we add this way
if (this._backgroundOverride.indexOf(mission.screenID) === -1) this._backgroundOverride.push(mission.screenID);
// force an update
worldScripts.Lib_GUI.guiScreenChanged();
}
// we'll try to override LibGUI if a mission screen is displayed without a screenID
if (!mission.screenID) {
this.$previous_guiScreenChanged(to, from);
}
}
// force an update so the right overlay is used
if (to == "GUI_SCREEN_SHORT_RANGE_CHART" || to == "GUI_SCREEN_LONG_RANGE_CHART") {
this.chartHighlightModeChanged();
}
}
//-------------------------------------------------------------------------------------------------------------
// activated when Library GUI is in use
this.$equipmentAdded = function $equipmentAdded(equipmentKey) {
if (equipmentKey != "EQ_ADVANCED_NAVIGATIONAL_ARRAY") return;
this.$setupVariableScreens();
}
//-------------------------------------------------------------------------------------------------------------
// activated when Library GUI is in use
this.$equipmentRemoved = function $equipmentRemoved(equipmentKey) {
if (equipmentKey != "EQ_ADVANCED_NAVIGATIONAL_ARRAY") return;
this.$setupVariableScreens();
}
//-------------------------------------------------------------------------------------------------------------
// activated when Library GUI is in use
this.$equipmentDamaged = function $equipmentDamaged(equipmentKey) {
if (equipmentKey != "EQ_ADVANCED_NAVIGATIONAL_ARRAY") return;
this.$setupVariableScreens();
}
//-------------------------------------------------------------------------------------------------------------
// activated when Library GUI is in use
this.$equipmentRepaired = function $equipmentRepaired(equipmentKey) {
if (equipmentKey != "EQ_ADVANCED_NAVIGATIONAL_ARRAY") return;
this.$setupVariableScreens();
}
//-------------------------------------------------------------------------------------------------------------
// forces a background after the timer has expired
this.$addBackground = function $addBackground() {
this.guiScreenChanged("", "");
}
//-------------------------------------------------------------------------------------------------------------
// returns true if a HUD with allowBigGUI is enabled, otherwise false
this.$isBigGuiActive = function $isBigGuiActive() {
if (oolite.compareVersion("1.83") <= 0) {
return player.ship.hudAllowsBigGui;
} else {
var bigGuiHUD = ["XenonHUD.plist", "coluber_hud_ch01-dock.plist"]; // until there is a property we can check, I'll be listing HUD's that have the allow_big_gui property set here
if (bigGuiHUD.indexOf(player.ship.hud) >= 0) {
return true;
} else {
return false;
}
}
}
//-------------------------------------------------------------------------------------------------------------
// returns true if any of the visible equipment items are damaged
this.$playerHasDamagedEquipment = function $playerHasDamagedEquipment() {
var p = player.ship;
var eq = p.equipment;
for (var i = 0; i < eq.length; i++) {
var itm = eq[i];
if (itm.isVisible === true && p.equipmentStatus(itm.equipmentKey) === "EQUIPMENT_DAMAGED") return true;
}
return false;
}
//-------------------------------------------------------------------------------------------------------------
this.$setBackgroundDefaults = function $setBackgroundDefaults(onOff) {
if (onOff === true) {
if (this._defaultsOn == false) {
this._defaultBG["long_range_chart_mission"] = getScreenBackgroundForKey("long_range_chart_mission");
this._defaultBG["short_range_chart_mission"] = getScreenBackgroundForKey("short_range_chart_mission");
this._defaultBG["custom_chart_mission"] = getScreenBackgroundForKey("custom_chart_mission");
this._defaultBG["long_range_chart"] = getScreenBackgroundForKey("long_range_chart");
this._defaultBG["short_range_chart"] = getScreenBackgroundForKey("short_range_chart");
this._defaultBG["keyboardsettings"] = getScreenBackgroundForKey("keyboardsettings");
this._defaultBG["load_save"] = getScreenBackgroundForKey("load_save");
this._defaultBG["mount_weapon"] = getScreenBackgroundForKey("mount_weapon");
this._defaultBG["newgame"] = getScreenBackgroundForKey("newgame");
this._defaultBG["settings"] = getScreenBackgroundForKey("settings");
this._defaultBG["shiplibrary"] = getScreenBackgroundForKey("shiplibrary");
this._defaultBG["paused_docked_overlay"] = getScreenBackgroundForKey("paused_docked_overlay");
this._defaultBG["paused_overlay"] = getScreenBackgroundForKey("paused_overlay");
this._defaultBG["oxz-manager"] = getScreenBackgroundForKey("oxz-manager");
}
this._defaultsOn = true;
var p = player.ship;
var nohud = "";
var ana = "_ana";
var style = (this._amber === true ? "amber" : "xenon");
if (this.$isBigGuiActive() === true) nohud = "_nohud";
if (p.equipmentStatus("EQ_ADVANCED_NAVIGATIONAL_ARRAY") != "EQUIPMENT_OK") ana = "_no_ana";
var imagename = style + "_standard_f0" + nohud + ".png";
setScreenBackgroundForKey("custom_chart_mission", {
name: imagename,
height: 546
});
setScreenBackgroundForKey("short_range_chart_mission", {
name: imagename,
height: 546
});
setScreenBackgroundForKey("long_range_chart_mission", {
name: imagename,
height: 546
});
imagename = style + "_standard_f6" + ana + nohud + ".png";
setScreenBackgroundForKey("short_range_chart", {
name: imagename,
height: 546
});
imagename = style + "_standard_f6-2" + ana + nohud + ".png";
setScreenBackgroundForKey("long_range_chart", {
name: imagename,
height: 546
});
setScreenBackgroundForKey("keyboardsettings", {
name: style + "_standard_nomenu_nohud.png",
height: 546
});
setScreenBackgroundForKey("load_save", {
name: style + "_standard_nomenu.png",
height: 546
});
setScreenBackgroundForKey("mount_weapon", {
name: style + "_standard_f3-1.png",
height: 546
});
setScreenBackgroundForKey("newgame", {
name: style + "_standard_nomenu_nohud.png",
height: 546
});
setScreenBackgroundForKey("settings", {
name: style + "_inflight_f2.png",
height: 546
});
setScreenBackgroundForKey("shiplibrary", {
name: style + "_standard_f0_nohud.png",
height: 546
});
setScreenBackgroundForKey("paused_docked_overlay", {
name: "pause_overlay.png",
height: 546
});
setScreenBackgroundForKey("paused_overlay", {
name: "pause_overlay.png",
height: 546
});
imagename = "xenon_oxzmgr.png";
setScreenBackgroundForKey("oxz-manager", {
name: imagename,
height: 546
});
} else {
var keys = Object.keys(this._defaultBG);
for (var i = 0; i < keys.length; i++) {
var bg = getScreenBackgroundForKey(keys[i]);
// are xenon's backgrounds still set?
if (bg.hasOwnProperty("name") === true && (bg.name.indexOf(style + "_standard") >= 0 || bg.name.indexOf("pause_overlay") >= 0)) {
// ok, we can reset things now
setScreenBackgroundForKey(keys[i], this._defaultBG[keys[i]]);
}
}
this._defaultsOn = false;
}
}
//-------------------------------------------------------------------------------------------------------------
this.$updateGuiColorSettings = function $updateGuiColorSettings() {
if (global.setGuiColorSettingForKey) {
setGuiColorSettingForKey("screen_divider_color", (this._amber === false ? "0 74 127 200" : "127 74 0 200"));
setGuiColorSettingForKey("screen_title_color", (this._amber === false ? "0 148 255 200" : "255 148 0 200"));
}
}
//-------------------------------------------------------------------------------------------------------------
this.$setBGSDefaultBackgrounds = function $setBGSDefaultBackgrounds() {
// until BGS has something similar
if (worldScripts.Lib_GUI.$cur == "BGS" && global.setGuiColorSettingForKey) {
setGuiColorSettingForKey("screen_title_color", "0.9 0.9 0.8");
setGuiColorSettingForKey("screen_divider_color", "0.0 0.0 0.0 0.0");
setScreenBackgroundForKey("paused_docked_overlay", "bgs_ov_paused.png");
setScreenBackgroundForKey("paused_overlay", "bgs_ov_paused.png");
setScreenBackgroundForKey("intro", "bgs_intro.png");
setScreenBackgroundForKey("keyboardsettings", "bgs_fullscr.png");
setScreenBackgroundForKey("load_save", "bgs_options.png");
setScreenBackgroundForKey("newgame", "bgs_intro.png");
setScreenBackgroundForKey("oxz-manager", "bgs_fullscr.png");
setScreenBackgroundForKey("settings", "bgs_options.png");
setScreenBackgroundForKey("shiplibrary", "bgs_fullscr.png");
setScreenBackgroundForKey("long_range_chart_mission", "lib_black.png");
setScreenBackgroundForKey("short_range_chart_mission", "lib_black.png");
}
}
//-------------------------------------------------------------------------------------------------------------
// used to allow XenonUI and XenonReduxUI to co-exist
this.$xenonCrossConfig = function $xenonCrossConfig(screenID) {
this._addedID[screenID] = 2;
}
this.$passConfig = function $passConfig(screenID) {
if (this._xr) this._xr.$xenonCrossConfig(screenID);
}
}).call(this); |
Scripts/xenonui_compatibility.js |
"use strict";
this.name = "XenonUI_Compatibility";
this.author = "phkb";
this.copyright = "2021 phkb";
this.description = "OXP Compatibility function overrides";
this.license = "CC BY-NC-SA 3.0";
this.startUp = function () {
// make sothis tc compatible
if (worldScripts.sothis_tc && worldScripts.sothis_tc.version == "1.0.3") {
var stc = worldScripts.sothis_tc;
stc.missionScreenOpportunity = this._sothis_missionScreenOpportunity;
}
// make Iron Raven compatible
if (worldScripts["IR-main-script.js"] && worldScripts["IR-main-script.js"].version == "1.4.2.1") {
worldScripts["IR-main-script.js"].questionScreens = this.questionScreens;
worldScripts["IR-main-script.js"].shipDockedWithStation = this._ir_shipDockedWithStation;
worldScripts["IR-main-script.js"].missionScreens = this.missionScreens;
worldScripts["IR-main-script.js"].choiceEvaluation = this.choiceEvaluation;
}
}
//-------------------------------------------------------------------------------------------------------------
// to make Sothis TC compatible
this._sothis_missionScreenOpportunity = function () {
if (!this.$showWelcome) return;
var messText = expandDescription("[STC_welcome]");
if (this.$new_cargoes)
messText = messText + expandDescription("[STC_new_cargoes]");
var tcbgpic = "OOmap_G" + (galaxyNumber + 1) + ".png";
mission.runScreen({
title: "Sothis Trade Center",
message: messText,
overlay: tcbgpic
});
this.$showWelcome = false;
}
//-------------------------------------------------------------------------------------------------------------
// to make Iron Raven compatible
this.questionScreens = function () {
if (system.ID == 23) // Maenes
{
if (missionVariables.IR_status == "IR_IBANEZ_4") {
this._runScreen({
title: "QuiCo Pharmaceuticals",
overlay: "IR_quico_logo.png",
messageKey: "IR_MAENES_intro",
choicesKey: "IR_questions"
}, this.choiceEvaluation);
missionVariables.IR_offer = "IR_MAENES_QUESTIONS"
}
}
if (system.ID == 171) // Yokohama
{
if (missionVariables.IR_status == "IR_IBANEZ_4") {
this._runScreen({
title: "Yokohama Exports",
overlay: "IR_yk_logo.png",
messageKey: "IR_YOKOHAMA_intro",
choicesKey: "IR_questions"
}, this.choiceEvaluation);
missionVariables.IR_offer = "IR_YOKOHAMA_QUESTIONS"
}
}
if (system.ID == 232) //Janes
{
if (missionVariables.IR_status == "IR_IBANEZ_4") {
this._runScreen({
title: "Janes's Shipyard Intelligence",
overlay: "IR_janes_logo.png",
messageKey: "IR_JANES_intro",
choicesKey: "IR_questions"
}, this.choiceEvaluation);
missionVariables.IR_offer = "IR_JANES_QUESTIONS"
}
}
if (system.ID == 240) // Pirate Cove
{
if (missionVariables.IR_status == "IR_IBANEZ_4") {
if (!missionVariables.IR_alsto) {
this._runScreen({
title: " ",
messageKey: "IR_PIRATE_intro",
choicesKey: "IR_questions"
}, this.choiceEvaluation);
missionVariables.IR_offer = "IR_PIRATE_QUESTIONS"
missionVariables.IR_alsto = "MET"
} else {
this._runScreen({
title: " ",
messageKey: "IR_PIRATE_intro_alt",
choicesKey: "IR_questions"
}, this.choiceEvaluation);
missionVariables.IR_offer = "IR_PIRATE_QUESTIONS"
}
}
}
if (system.ID == 119) // PleasureWorld
{
if (missionVariables.IR_status == "IR_IBANEZ_4") {
this._runScreen({
title: "PleasureWorld",
overlay: "IR_pw_logo.png",
messageKey: "IR_PW_intro",
choicesKey: "IR_questions"
}, this.choiceEvaluation);
missionVariables.IR_offer = "IR_PW_QUESTIONS"
}
}
if (system.ID == 180) // NWE
{
if (missionVariables.IR_status == "IR_IBANEZ_4") {
this._runScreen({
title: "Naval Weapons Establishment",
overlay: "IR_NWE_logo.png",
messageKey: "IR_NWE_intro",
choicesKey: "IR_questions"
}, this.choiceEvaluation);
missionVariables.IR_offer = "IR_NWE_QUESTIONS"
}
}
if (system.ID == 219) // GSE
{
if (missionVariables.IR_status == "IR_IBANEZ_4") {
this._runScreen({
title: "Galactic Stock Exchange",
overlay: "IR_GSE_logo.png",
messageKey: "IR_GSE_intro",
choicesKey: "IR_questions"
}, this.choiceEvaluation);
missionVariables.IR_offer = "IR_GSE_QUESTIONS"
}
}
if (system.ID == 31) // KORSHKOV
{
if (missionVariables.IR_status == "IR_IBANEZ_4") {
this._runScreen({
title: "OKB Korshkov",
overlay: "IR_korshlogo.png",
messageKey: "IR_KORSHKOV_intro",
choicesKey: "IR_questions"
}, this.choiceEvaluation);
missionVariables.IR_offer = "IR_KORSHKOV_QUESTIONS"
}
}
}
this._ir_shipDockedWithStation = function (station) {
this.addIRinterface()
if (missionVariables.IR_status == "IR_epilogue" && clock.days > missionVariables.IR_epilogue_deadline) {
this._runScreen({
messageKey: "IR_final",
choicesKey: "IR_continue"
}, function (choice) {
if (choice == 1) {
this._runScreen({
overlay: "IR_title.png",
messageKey: "IR_theend"
});
missionVariables.IR_status = "IR_completed"
mission.setInstructionsKey(null)
missionVariables.IR_epilogue_deadline = null
missionVariables.IR_shipment_quest = null
missionVariables.IR_SDF_quest = null
missionVariables.IR_SDF_question_no = null
missionVariables.IR_SDF_question_key = null
missionVariables.IR_SDF_question_string = null
missionVariables.IR_defences_quest = null
missionVariables.IR_defences_question_no = null
missionVariables.IR_defences_question_key = null
missionVariables.IR_defences_question_string = null
missionVariables.IR_finance_quest = null
missionVariables.IR_finance_question_no = null
missionVariables.IR_finance_question_key = null
missionVariables.IR_finance_question_string = null
missionVariables.IR_shipment_quest_method = null
missionVariables.IR_shipment_question_no = null
missionVariables.IR_shipment_question_key = null
missionVariables.IR_shipment_question_string = null
missionVariables.IR_GSE_loan = null
missionVariables.IR_wife_status = null
missionVariables.IR_alsto = null
missionVariables.IR_count = null
missionVariables.IR_defences_kill_count = null
missionVariables.IR_SDF_quest_location = null
missionVariables.IR_SDF_quest_location_name = null
missionVariables.IR_KORSHKOV_deadline = null
missionVariables.IR_asked_question = null
missionVariables.IR_question_settings = null
missionVariables.IR_screen_log = null
missionVariables.IR_screen_location = null
}
});
}
if (player.ship.docked && galaxyNumber == 7) this.missionScreens();
}
this.missionScreens = function () {
if (guiScreen == "GUI_SCREEN_MISSION" || !player.ship.docked)
return;
if (player.ship.dockedStation.hasRole("IR-luft-core")) {
if (missionVariables.IR_SDF_quest == "JACOB" || missionVariables.IR_SDF_quest == "LUFTSLOTTE") {
this._runScreen({
title: "Luftslotte 6",
messageKey: "IR_SDF_quest_4"
})
missionVariables.IR_SDF_quest = "KRAIT"
}
}
if (player.ship.dockedStation.isMainStation && missionVariables.IR_offer == null) {
if (missionVariables.IR_status == null) {
this._runScreen({
overlay: "IR_title.png",
choicesKey: "IR_continue"
}, function (choice) {
if (choice == 1) {
this._runScreen({
messageKey: "IR_IBANEZ_1"
});
mission.setInstructionsKey("IR_IBANEZ_INFO")
missionVariables.IR_status = "IR_IBANEZ_1"
}
});
}
if (missionVariables.IR_finance_quest == "REPROCESSED" && clock.days >= missionVariables.IR_KORSHKOV_deadline) //this is 20 days
{
this._runScreen({
title: "Jane's Shipyard Intelligence",
messageKey: "IR_finance_quest_4"
});
missionVariables.IR_finance_quest = "JANES_NEWS"
missionVariables.IR_KORSHKOV_deadline = null
player.incrementFinanceStatus()
}
if (missionVariables.IR_SDF_quest == "ADDRESS" && clock.days >= missionVariables.IR_SDF_deadline) {
this._runScreen({
messageKey: "IR_SDF_quest_2"
});
missionVariables.IR_SDF_quest = "JACOB"
player.incrementSDFStatus()
}
if (missionVariables.IR_SDF_quest == "POD_SCOOPED") {
this._runScreen({
messageKey: "IR_SDF_quest_5"
});
player.ship.useSpecialCargo("WARNING: Radiation detected in cargo hold")
missionVariables.IR_SDF_quest = "KORSHKOV"
player.incrementSDFStatus()
}
if (missionVariables.IR_SDF_quest == "PHOTO" && clock.days >= missionVariables.IR_SDF_deadline) {
this._runScreen({
messageKey: "IR_SDF_quest_8a",
overlay: "IR_kinnaird.png",
choicesKey: "IR_continue"
}, function (choice) {
if (choice == 1)
this._runScreen({
messageKey: "IR_SDF_quest_8b",
overlay: "IR_match.png",
choicesKey: "IR_continue"
}, function (choice) {
if (choice == 1) {
this._runScreen({
messageKey: "IR_SDF_quest_8c"
});
missionVariables.IR_SDF_quest = "COMPLETED"
player.clearSDFStatus()
missionVariables.IR_SDF_status_no = null
missionVariables.IR_SDF_deadline = null
++missionVariables.IR_quest_count
}
});
});
}
if (missionVariables.IR_finance_quest == "WAIT3" && clock.days >= missionVariables.IR_KORSHKOV_deadline) {
this._runScreen({
title: " ",
overlay: "IR_bloomberg.png",
messageKey: "IR_finance_quest_10"
});
missionVariables.IR_KORSHKOV_deadline = null
player.clearFinanceStatus()
missionVariables.IR_finance_status_no = null
missionVariables.IR_finance_quest = "COMPLETED"
++missionVariables.IR_quest_count
}
if (missionVariables.IR_shipment_quest == "SUCCESS") {
this._runScreen({
messageKey: "IR_shipment_success"
});
player.clearShipmentStatus()
missionVariables.IR_shipment_status_no = null
missionVariables.IR_shipment_quest = "COMPLETED"
missionVariables.IR_YOKOHAMA_deadline = null
++missionVariables.IR_quest_count
missionVariables.IR_tipoff_deadline = clock.days + 10
}
if (missionVariables.IR_shipment_quest == "DISPATCHED") {
this._runScreen({
messageKey: "IR_shipment_failure"
});
player.clearShipmentStatus()
missionVariables.IR_shipment_status_no = null
missionVariables.IR_shipment_quest = "FAILED"
++missionVariables.IR_quest_count
missionVariables.IR_YOKOHAMA_deadline = null
}
if (missionVariables.IR_shipment_quest == "COMPLETED") {
if (clock.days >= missionVariables.IR_tipoff_deadline) {
this._runScreen({
messageKey: "IR_tipoff"
});
missionVariables.IR_tipoff_deadline = null
missionVariables.IR_shipment_quest = "TIPPEDOFF"
}
}
if (missionVariables.IR_loan_deadline) {
if (clock.days >= missionVariables.IR_loan_deadline) {
this._runScreen({
title: "First Galactic Bank",
messageKey: "IR_GSE_loan_warning"
});
mission.setInstructionsKey(null)
missionVariables.IR_loan_deadline = null
missionVariables.IR_load_remaining = null
player.credits -= 550000
missionVariables.IR_GSE_loan = "DEFAULTED"
}
}
if (missionVariables.IR_defences_quest == "DEMO_6" && clock.days > missionVariables.IR_defences_quest_deadline) {
this._runScreen({
messageKey: "IR_defences_quest_6"
});
++missionVariables.IR_quest_count
missionVariables.IR_defences_quest = "COMPLETED"
missionVariables.IR_defences_quest_deadline = null
missionVariables.IR_defences_status_no = null
player.clearDefencesStatus()
}
if (missionVariables.IR_status == "IR_KINNAIRD_2") {
this._runScreen({
messageKey: "IR_kinnaird_3alt"
});
}
if (missionVariables.IR_status == "IR_LEXICON_1" && clock.days > missionVariables.IR_LEXICON_deadline) {
this._runScreen({
messageKey: "IR_LEXICON_2"
});
missionVariables.IR_status = "IR_LEXICON_2"
mission.setInstructionsKey("IR_LEXICON_brief_2")
missionVariables.IR_LEXICON_deadline = null
}
if (missionVariables.IR_status == "IR_CHERKASOVA_1") // briefing with Cherkasova
{
this._runScreen({
messageKey: "IR_CHERKASOVA_1a",
overlay: "IR_KSR_logo.png",
choicesKey: "IR_continue"
}, function (choice) {
if (choice == 1)
this._runScreen({
messageKey: "IR_CHERKASOVA_1b",
overlay: "IR_KSR_logo.png",
choicesKey: "IR_continue"
}, function (choice) {
if (choice == 1)
this._runScreen({
messageKey: "IR_CHERKASOVA_1c",
overlay: "IR_KSR_logo.png",
choicesKey: "IR_continue"
}, function (choice) {
if (choice == 1)
this._runScreen({
messageKey: "IR_CHERKASOVA_1d",
overlay: "IR_KSR_logo.png",
choicesKey: "IR_cherkasova_choices"
}, function (choice) {
if (choice == 1) {
this._runScreen({
messageKey: "IR_LOA_1",
overlay: "IR_KSR_logo.png"
})
mission.setInstructionsKey("IR_LOA_brief_1")
missionVariables.IR_status = "IR_LOA_1"
mission.setInstructionsKey("IR_LOA_brief_1")
missionVariables.IR_cherkasova_deadline = null
}
if (choice == 2) {
this._runScreen({
messageKey: "IR_sources_1",
overlay: "IR_KSR_logo.png"
}) //screen fails to run
mission.setInstructionsKey("IR_LEXICON_brief_1")
missionVariables.IR_status = "IR_sources_1"
missionVariables.IR_cherkasova_deadline = null
mission.setInstructionsKey("IR_LEXICON_brief_1")
missionVariables.IR_sources_deadline = clock.days + 15
}
});
});
});
});
}
if (missionVariables.IR_status == "IR_sources_1" && clock.days > missionVariables.IR_sources_deadline) {
this._runScreen({
messageKey: "IR_sources_2"
});
missionVariables.IR_status = "IR_sources_2"
mission.setInstructionsKey("IR_waitforinfo_brief")
missionVariables.IR_sources_deadline = clock.days + 7
}
if (missionVariables.IR_status == "IR_sources_2" && clock.days > missionVariables.IR_sources_deadline) {
this._runScreen({
messageKey: "IR_sources_3"
});
missionVariables.IR_status = "IR_sources_3"
missionVariables.IR_sources_deadline = null
mission.setInstructionsKey("IR_sources_brief_1")
}
if (missionVariables.IR_status == "IR_LOA_4" && clock.days > missionVariables.IR_attack_deadline) {
this._runScreen({
messageKey: "IR_LOA_5"
});
missionVariables.IR_status = "IR_LOA_5"
missionVariables.IR_attack_deadline = null
mission.setInstructionsKey("IR_LOA_brief_4")
}
if (missionVariables.IR_status == "IR_LOA_7" && clock.days > missionVariables.IR_epilogue_deadline) {
this._runScreen({
messageKey: "IR_LOA_7"
});
missionVariables.IR_status = "IR_LOA_8"
missionVariables.IR_epilogue_deadline = clock.days + 10
}
if (missionVariables.IR_status == "IR_LOA_8" && clock.days > missionVariables.IR_epilogue_deadline) {
this._runScreen({
messageKey: "IR_LOA_8"
});
missionVariables.IR_status = "IR_LOA_9"
missionVariables.IR_epilogue_deadline = clock.days + 7
}
if (missionVariables.IR_status == "IR_LOA_9" && clock.days > missionVariables.IR_epilogue_deadline) {
this._runScreen({
messageKey: "IR_invite"
});
missionVariables.IR_status = "IR_invite"
mission.setInstructionsKey("IR_invite_brief")
missionVariables.IR_epilogue_deadline = null
}
if (missionVariables.IR_status == "IR_sources_6" && clock.days > missionVariables.IR_epilogue_deadline) {
this._runScreen({
messageKey: "IR_sources_6"
});
missionVariables.IR_status = "IR_sources_7"
missionVariables.IR_epilogue_deadline = clock.days + 15
}
if (missionVariables.IR_status == "IR_sources_7" && clock.days > missionVariables.IR_epilogue_deadline) {
this._runScreen({
messageKey: "IR_invite"
});
missionVariables.IR_status = "IR_invite"
mission.setInstructionsKey("IR_invite_brief")
missionVariables.IR_epilogue_deadline = null
}
//Location Specific
if (system.ID == 7) //Vegedius
{
if (missionVariables.IR_status == "IR_IBANEZ_1") {
this._runScreen({
title: "GalCop High Command",
messageKey: "IR_IBANEZ_2a",
choicesKey: "IR_continue"
}, function (choice) {
if (choice == 1)
this._runScreen({
title: "GalCop High Command",
messageKey: "IR_IBANEZ_2b",
choicesKey: "IR_continue"
}, function (choice) {
if (choice == 1) {
this._runScreen({
title: "GalCop High Command",
messageKey: "IR_IBANEZ_2c"
});
missionVariables.IR_status = "IR_IBANEZ_2"
mission.setInstructionsKey("IR_RAAED_INFO")
}
});
});
}
if (missionVariables.IR_status == "IR_RAAED_1") //return to Ibanez
{
this._runScreen({
title: "Galcop High Command",
messageKey: "IR_IBANEZ_3"
})
missionVariables.IR_status = "IR_IBANEZ_3"
mission.setInstructionsKey("IR_JANES_INFO")
}
if (missionVariables.IR_status == "IR_JANES_1") // return to Ibanez for big briefing
{
this._runScreen({
title: "GalCop High Command",
messageKey: "IR_IBANEZ_4a",
choicesKey: "IR_continue"
}, function (choice) {
if (choice == 1)
this._runScreen({
title: "GalCop High Command",
messageKey: "IR_IBANEZ_4b",
choicesKey: "IR_continue"
}, function (choice) {
if (choice == 1)
this._runScreen({
title: "GalCop High Command",
messageKey: "IR_IBANEZ_4c",
choicesKey: "IR_continue"
}, function (choice) {
if (choice == 1) {
this._runScreen({
title: "GalCop High Command",
messageKey: "IR_IBANEZ_4d"
});
missionVariables.IR_status = "IR_IBANEZ_4"
mission.setInstructionsKey(null)
this.setupQuestions()
this.setupStatus()
missionVariables.IR_quest_count = 0
this.addIRinterface();
}
});
});
});
}
if (missionVariables.IR_status == "IR_IBANEZ_4" && missionVariables.IR_quest_count == 4) {
missionVariables.IR_quest_count = null
if (missionVariables.IR_shipment_quest_method == "YOKOHAMA_AMBUSH") {
this._runScreen({
messageKey: "IR_IBANEZ_5a",
choicesKey: "IR_continue"
}, function (choice) {
if (choice == 1) {
this._runScreen({
overlay: "IR_title.png",
messageKey: "IR_theend"
});
missionVariables.IR_status = "IR_completed"
mission.setInstructionsKey(null)
missionVariables.IR_epilogue_deadline = null
missionVariables.IR_shipment_quest = null
missionVariables.IR_SDF_quest = null
missionVariables.IR_defences_quest = null
missionVariables.IR_finance_quest = null
missionVariables.IR_shipment_quest_method = null
}
});
}
if (missionVariables.IR_shipment_quest == "FAILED") {
this._runScreen({
messageKey: "IR_IBANEZ_5b",
choicesKey: "IR_continue"
}, function (choice) {
if (choice == 1) {
this._runScreen({
overlay: "IR_title.png",
messageKey: "IR_theend"
});
missionVariables.IR_status = "IR_completed"
mission.setInstructionsKey(null)
missionVariables.IR_epilogue_deadline = null
missionVariables.IR_shipment_quest = null
missionVariables.IR_SDF_quest = null
missionVariables.IR_defences_quest = null
missionVariables.IR_finance_quest = null
missionVariables.IR_shipment_quest_method = null
}
});
} else
this._runScreen({
title: "GalCop High Command",
messageKey: "IR_IBANEZ_5",
choicesKey: "IR_IBANEZ_choices"
}, function (choice) {
if (choice == "IR_IBANEZ_A_weiss") {
this._runScreen({
title: "GalCop High Command",
messageKey: "IR_weiss_1"
});
missionVariables.IR_status = "IR_WEISS_1"
mission.setInstructionsKey("IR_weiss_brief_1")
}
if (choice == "IR_IBANEZ_B_kinnaird") {
this._runScreen({
title: "GalCop High Command",
messageKey: "IR_kinnaird_1"
});
missionVariables.IR_status = "IR_KINNAIRD_1"
mission.setInstructionsKey("IR_kinnaird_brief_1")
}
if (choice == "IR_IBANEZ_C_moreinfo") {
this._runScreen({
title: "GalCop High Command",
messageKey: "IR_LEXICON_1"
});
missionVariables.IR_status = "IR_LEXICON_1"
mission.setInstructionsKey("IR_LEXICON_1")
missionVariables.IR_LEXICON_deadline = clock.days + 15
}
});
}
if (missionVariables.IR_status == "IR_WEISS_4" || missionVariables.IR_status == "IR_KINNAIRD_4") {
this._runScreen({
title: "Galcop High Command",
messageKey: "IR_IBANEZ_5_debrief"
})
missionVariables.IR_status = "IR_IBANEZ_5"
mission.setInstructionsKey("IR_waitforinfo_brief")
missionVariables.IR_cherkasova_deadline = clock.days + 20
}
if (missionVariables.IR_status == "IR_invite" && clock.days > missionVariables.IR_epilogue_deadline) {
this._runScreen({
messageKey: "IR_reward_a",
choicesKey: "IR_continue"
}, function (choice) {
if (choice == 1)
this._runScreen({
messageKey: "IR_reward_b",
choicesKey: "IR_continue"
}, function (choice) {
if (choice == 1)
this._runScreen({
messageKey: "IR_reward_c",
choicesKey: "IR_continue",
overlay: "IR_maenesmedal.png"
}, function (choice) {
if (choice == 1)
this._runScreen({
messageKey: "IR_reward_d",
choicesKey: "IR_continue"
}, function (choice) {
if (choice == 1) {
this._runScreen({
messageKey: "IR_reward_e"
});
missionVariables.IR_status = "IR_epilogue"
missionVariables.IR_epilogue_deadline = clock.days + 5
player.credits += 50000
mission.setInstructionsKey(null)
}
});
});
});
});
}
}
if (system.ID == 230) // RAAED
{
if (missionVariables.IR_status == "IR_IBANEZ_2") {
this._runScreen({
messageKey: "IR_RAAED_1a",
overlay: "IR_forest.png",
choicesKey: "IR_continue"
}, function (choice) {
if (choice == 1)
this._runScreen({
overlay: "IR_invoice.png",
choicesKey: "IR_continue"
}, function (choice) {
if (choice == 1)
this._runScreen({
messageKey: "IR_RAAED_1c",
overlay: "IR_forest.png",
choicesKey: "IR_continue"
}, function (choice) {
if (choice == 1)
this._runScreen({
messageKey: "IR_RAAED_1d",
choicesKey: "IR_continue",
overlay: "IR_forest.png"
}, function (choice) {
if (choice == 1) {
this._runScreen({
messageKey: "IR_RAAED_1e",
overlay: "IR_forest.png"
});
missionVariables.IR_status = "IR_RAAED_1"
mission.setInstructionsKey("IR_IBANEZ_INFO")
}
});
});
});
});
}
}
if (system.ID == 232) // Janes
{
if (missionVariables.IR_status == "IR_IBANEZ_3") // quick visit to Janes
{
this._runScreen({
messageKey: "IR_JANES_1a",
choicesKey: "IR_continue"
}, function (choice) {
if (choice == 1)
this._runScreen({
messageKey: "IR_JANES_1b",
choicesKey: "IR_continue"
}, function (choice) {
if (choice == 1) {
this._runScreen({
messageKey: "IR_JANES_1c"
});
missionVariables.IR_status = "IR_JANES_1"
mission.setInstructionsKey("IR_IBANEZ_INFO")
}
});
});
}
if (missionVariables.IR_status == "IR_IBANEZ_4") {
this._runScreen({
title: "Janes's Shipyard Intelligence",
overlay: "IR_janes_logo.png",
messageKey: "IR_JANES_intro",
choicesKey: "IR_questions"
}, this.choiceEvaluation);
missionVariables.IR_offer = "IR_JANES_QUESTIONS"
}
}
if (system.ID == 171) // Yokohama
{
if (missionVariables.IR_status == "IR_IBANEZ_4") {
this._runScreen({
title: "Yokohama Exports",
overlay: "IR_yk_logo.png",
messageKey: "IR_YOKOHAMA_intro",
choicesKey: "IR_questions"
}, this.choiceEvaluation);
missionVariables.IR_offer = "IR_YOKOHAMA_QUESTIONS"
}
}
if (missionVariables.IR_convoy_exited == "TRUE" && missionVariables.IR_alsto == "HELP_ACCEPTED") {
this._runScreen({
messageKey: "IR_shipment_contact_report"
});
player.incrementShipmentStatus()
missionVariables.IR_alsto = "INFORMED"
missionVariables.IR_convoy_exited = null
}
if (system.ID == 240) // Pirate Cove
{
if (missionVariables.IR_status == "IR_IBANEZ_4")
{
if (!missionVariables.IR_alsto) {
this._runScreen({
title: " ",
messageKey: "IR_PIRATE_intro",
choicesKey: "IR_questions"
}, this.choiceEvaluation);
missionVariables.IR_offer = "IR_PIRATE_QUESTIONS"
missionVariables.IR_alsto = "MET"
} else {
this._runScreen({
title: " ",
messageKey: "IR_PIRATE_intro_alt",
choicesKey: "IR_questions"
}, this.choiceEvaluation);
missionVariables.IR_offer = "IR_PIRATE_QUESTIONS"
}
}
if (missionVariables.IR_status == "IR_LOA_1") {
if (missionVariables.IR_alsto)
missionVariables.IR_LOA_text = "known"
if (missionVariables.IR_alsto == "INFORMED")
missionVariables.IR_LOA_text = "helped"
if (!missionVariables.IR_alsto)
missionVariables.IR_LOA_text = "unknown"
this._runScreen({
messageKey: "IR_LOA_" + [missionVariables.IR_LOA_text] + "_2a",
choicesKey: "IR_continue"
}, function (choice) {
if (choice == 1)
this._runScreen({
messageKey: "IR_LOA_" + [missionVariables.IR_LOA_text] + "_2b",
choicesKey: "IR_continue"
}, function (choice) {
if (choice == 1)
this._runScreen({
messageKey: "IR_LOA_2c",
choicesKey: "IR_continue"
}, function (choice) {
if (choice == 1) {
this._runScreen({
messageKey: "IR_LOA_2d"
})
missionVariables.IR_status = "IR_LOA_2"
mission.setInstructionsKey("IR_LOA_brief_2")
missionVariables.IR_alsto = null
missionVariables.IR_LOA_text = null
}
});
});
});
}
}
if (system.ID == 119) // PleasureWorld
{
if (missionVariables.IR_status == "IR_IBANEZ_4") {
this._runScreen({
title: "PleasureWorld",
overlay: "IR_pw_logo.png",
messageKey: "IR_PW_intro",
choicesKey: "IR_questions"
}, this.choiceEvaluation);
missionVariables.IR_offer = "IR_PW_QUESTIONS"
}
if (missionVariables.IR_status == "IR_WEISS_3") {
this._runScreen({
title: "PleasureWord",
overlay: "IR_pw_logo.png",
messageKey: "IR_weiss_3a",
choicesKey: "IR_continue"
}, function (choice) {
if (choice == 1)
this._runScreen({
overlay: "IR_pw_logo.png",
messageKey: "IR_weiss_3b"
})
missionVariables.IR_status = "IR_WEISS_4"
mission.setInstructionsKey("IR_weiss_brief_3")
});
}
if (missionVariables.IR_status == "IR_KINNAIRD_3") {
this._runScreen({
title: "PleasureWord",
overlay: "IR_pw_logo.png",
messageKey: "IR_kinnaird_4a",
choicesKey: "IR_continue"
}, function (choice) {
if (choice == 1)
this._runScreen({
messageKey: "IR_kinnaird_4b"
})
missionVariables.IR_status = "IR_KINNAIRD_4"
mission.setInstructionsKey("IR_kinnaird_brief_4")
});
}
if (missionVariables.IR_status == "IR_LEXICON_2") {
this._runScreen({
messageKey: "IR_LEXICON_3a",
overlay: "IR_nightclub.png",
choicesKey: "IR_continue"
}, function (choice) {
if (choice == 1)
this._runScreen({
messageKey: "IR_LEXICON_3b",
overlay: "IR_nightclub.png",
choicesKey: "IR_launch_choice"
}, function (choice) {
if (choice == 1) {
missionVariables.IR_status = "IR_LEXICON_4"
player.ship.launch()
}
});
});
}
if (missionVariables.IR_status == "IR_weiss_scooped") {
this._runScreen({
messageKey: "IR_LEXICON_4a",
choicesKey: "IR_continue"
}, function (choice) {
if (choice == 1)
this._runScreen({
messageKey: "IR_LEXICON_4b"
})
missionVariables.IR_status = "IR_IBANEZ_5"
mission.setInstructionsKey("IR_waitforinfo_brief")
missionVariables.IR_cherkasova_deadline = clock.days + 20
});
}
}
if (system.ID == 180) // NWE
{
if (missionVariables.IR_status == "IR_IBANEZ_4") {
this._runScreen({
title: "Naval Weapons Establishment",
overlay: "IR_NWE_logo.png",
messageKey: "IR_NWE_intro",
choicesKey: "IR_questions"
}, this.choiceEvaluation);
missionVariables.IR_offer = "IR_NWE_QUESTIONS"
}
if (missionVariables.IR_defences_quest == "DEMO_2") {
this._runScreen({
title: "Naval Weapons Establishment",
overlay: "IR_NWE_logo.png",
messageKey: "IR_defences_quest_2a",
choicesKey: "IR_continue"
}, function (choice) {
if (choice == 1) {
this._runScreen({
title: "Naval Weapons Establishment",
overlay: "IR_NWE_logo.png",
messageKey: "IR_defences_quest_2b"
});
missionVariables.IR_defences_quest_deadline = clock.days + 7
missionVariables.IR_defences_quest = "DEMO_3"
player.incrementDefencesStatus()
}
});
}
if (missionVariables.IR_defences_quest == "DEMO_3" && clock.days > missionVariables.IR_defences_quest_deadline) {
this._runScreen({
title: "Naval Weapons Establishment",
overlay: "IR_NWE_logo.png",
messageKey: "IR_defences_quest_3"
});
missionVariables.IR_defences_quest_deadline = null
missionVariables.IR_defences_quest = "DEMO_4"
player.incrementDefencesStatus()
}
}
if (system.ID == 82) // Inorle
{
if (missionVariables.IR_SDF_quest == "JACOB") {
this._runScreen({
messageKey: "IR_SDF_quest_3"
})
missionVariables.IR_SDF_quest = "LUFTSLOTTE"
}
}
if (system.ID == 219) // GSE
{
if (missionVariables.IR_status == "IR_IBANEZ_4") {
this._runScreen({
title: "Galactic Stock Exchange",
overlay: "IR_GSE_logo.png",
messageKey: "IR_GSE_intro",
choicesKey: "IR_questions"
}, this.choiceEvaluation);
missionVariables.IR_offer = "IR_GSE_QUESTIONS"
}
if (missionVariables.IR_finance_quest == "JANES_NEWS") {
this._runScreen({
title: "Galactic Stock Exchange",
overlay: "IR_GSE_logo.png",
messageKey: "IR_finance_quest_6a",
choicesKey: "IR_continue"
}, function (choice) {
if (choice == 1) {
this._runScreen({
title: "Galactic Stock Exchange",
overlay: "IR_GSE_logo.png",
messageKey: "IR_finance_quest_6b"
});
player.incrementFinanceStatus()
missionVariables.IR_offer = null
missionVariables.IR_finance_quest = "WIFE"
}
});
}
if (missionVariables.IR_finance_quest == "WIFE_MET") {
this._runScreen({
title: "Galactic Stock Exchange",
overlay: "IR_GSE_logo.png",
messageKey: "IR_finance_quest_8",
choicesKey: "IR_wife_choices"
}, function (choice) {
if (choice == "IR_wife_yes") {
this._runScreen({
title: "Galactic Stock Exchange",
overlay: "IR_GSE_logo.png",
messageKey: "IR_finance_quest_9_confirm"
});
missionVariables.IR_wife_status = "AFFAIR_CONFIRMED"
}
if (choice == "IR_wife_no") {
this._runScreen({
title: "Galactic Stock Exchange",
overlay: "IR_GSE_logo.png",
messageKey: "IR_finance_quest_9_deny"
});
missionVariables.IR_wife_status = "AFFAIR_DENIED"
}
player.incrementFinanceStatus()
missionVariables.IR_finance_quest = "WAIT3"
missionVariables.IR_KORSHKOV_deadline = clock.days + 10
missionVariables.IR_offer = null
});
}
}
if (system.ID == 31) // KORSHKOV
{
if (missionVariables.IR_finance_quest == "WAIT" && clock.days >= missionVariables.IR_KORSHKOV_deadline) {
this._runScreen({
title: "OKB Korshkov",
overlay: "IR_korshlogo.png",
messageKey: "IR_finance_quest_1"
});
player.incrementFinanceStatus()
missionVariables.IR_finance_quest = "COLLECTION"
missionVariables.IR_KORSHKOV_deadline = null
return;
}
if (missionVariables.IR_finance_quest == "COLLECTION") {
this.checkManifest()
if (missionVariables.IR_manifestOK == "TRUE") {
this._runScreen({
title: "OKB Korshkov",
overlay: "IR_korshlogo.png",
messageKey: "IR_finance_quest_2"
});
player.incrementFinanceStatus()
missionVariables.IR_KORSHKOV_deadline = clock.days + 10
missionVariables.IR_finance_quest = "WAIT2"
player.ship.manifest.radioactives -= 10
player.ship.manifest.alloys = -5
player.ship.manifest.minerals -= 2
player.ship.manifest.alienItems -= 2
player.ship.manifest.platinum -= 1
missionVariables.IR_manifestOK = null
return;
}
if (missionVariables.IR_manifestOK != "TRUE")
this._runScreen({
title: "OKB Korshkov",
overlay: "IR_korshlogo.png",
messageKey: "IR_finance_quest_3alt"
});
else return;
}
if (missionVariables.IR_finance_quest == "WAIT2" && clock.days >= missionVariables.IR_KORSHKOV_deadline) {
this._runScreen({
title: "OKB Korshkov",
overlay: "IR_korshlogo.png",
messageKey: "IR_finance_quest_3"
});
player.incrementFinanceStatus()
missionVariables.IR_KORSHKOV_deadline = null
missionVariables.IR_finance_quest = "IRRADIATE"
return;
}
if (missionVariables.IR_SDF_quest == "KORSHKOV") {
this._runScreen({
title: "OKB Korshkov",
overlay: "IR_korshlogo.png",
messageKey: "IR_SDF_quest_6"
});
player.incrementSDFStatus()
missionVariables.IR_SDF_deadline = clock.days + 10
missionVariables.IR_SDF_quest = "ANALYSIS"
player.ship.removeAllCargo()
missionVariables.IR_cargoCount = null
return;
}
if (missionVariables.IR_SDF_quest == "ANALYSIS" && clock.days >= missionVariables.IR_SDF_deadline)
{
this._runScreen({
title: "OKB Korshkov",
overlay: "IR_korshlogo.png",
messageKey: "IR_SDF_quest_7a",
choicesKey: "IR_continue"
}, function (choice) {
if (choice == 1) {
this._runScreen({
messageKey: "IR_SDF_quest_7b"
});
missionVariables.IR_SDF_quest = "DATA"
player.incrementSDFStatus()
this.incrementSDFQuestion()
missionVariables.IR_SDF_location = null
missionVariables.IR_SDF_location_name = null
}
});
return;
}
if (missionVariables.IR_status == "IR_IBANEZ_4") {
this._runScreen({
title: "OKB Korshkov",
overlay: "IR_korshlogo.png",
messageKey: "IR_KORSHKOV_intro",
choicesKey: "IR_questions"
}, this.choiceEvaluation);
missionVariables.IR_offer = "IR_KORSHKOV_QUESTIONS"
return;
}
}
if (system.ID == 142) // Tibiri bar
{
if (missionVariables.IR_finance_quest == "WIFE_DOCKED") {
this._runScreen({
messageKey: "IR_finance_quest_7a",
choicesKey: "IR_continue"
}, function (choice) {
if (choice == 1) {
this._runScreen({
messageKey: "IR_finance_quest_7b"
});
player.incrementFinanceStatus()
player.credits += 1000
missionVariables.IR_offer = null
missionVariables.IR_finance_quest = "WIFE_MET"
}
});
}
if (missionVariables.IR_finance_quest == "WIFE" || missionVariables.IR_finance_quest == "WIFE_IDENTIFIED")
this._runScreen({
messageKey: "IR_finance_quest_7alt"
});
}
if (system.ID == 23) // Maenes
{
if (missionVariables.IR_defences_question_no == 3 && !missionVariables.IR_defences_quest) {
if (!missionVariables.IR_Maenes_visit) {
this._runScreen({
title: "QuiCo Pharmaceuticals",
overlay: "IR_quico_logo.png",
messageKey: "IR_defences_quest_1_alt"
});
missionVariables.IR_defences_quest = "DEMO_1"
}
if (missionVariables.IR_Maenes_visit == "TRUE") {
this._runScreen({
title: "QuiCo Pharmaceuticals",
overlay: "IR_quico_logo.png",
messageKey: "IR_defences_quest_1"
});
missionVariables.IR_defences_quest = "DEMO_1"
missionVariables.IR_Maenes_visit = null
}
}
if (missionVariables.IR_defences_quest == "DEMO_4") {
this._runScreen({
title: "QuiCo Pharmaceuticals",
overlay: "IR_quico_logo.png",
messageKey: "IR_defences_quest_4"
});
missionVariables.IR_defences_quest = "DEMO_5"
}
if (missionVariables.IR_defences_quest == "SABOTAGED") {
this._runScreen({
title: "QuiCo Pharmaceuticals",
overlay: "IR_quico_logo.png",
messageKey: "IR_defences_quest_5a",
choicesKey: "IR_continue"
}, function (choice) {
if (choice == 1) {
this._runScreen({
messageKey: "IR_defences_quest_5b"
});
player.incrementDefencesStatus()
missionVariables.IR_defences_quest = "DEMO_6"
missionVariables.IR_defences_quest_deadline = clock.days + 15
}
});
}
if (missionVariables.IR_status == "IR_sources_5") {
this._runScreen({
title: "QuiCo Pharmaceuticals",
overlay: "IR_quico_logo.png",
messageKey: "IR_sources_5a",
choicesKey: "IR_continue"
}, function (choice) {
if (choice == 1) {
this._runScreen({
messageKey: "IR_sources_5b"
});
mission.setInstructionsKey("IR_waitforinfo_brief")
missionVariables.IR_status = "IR_sources_6"
missionVariables.IR_epilogue_deadline = clock.days + 10
}
});
}
if (missionVariables.IR_status == "IR_LOA_6") {
this._runScreen({
title: "QuiCo Pharmaceuticals",
overlay: "IR_quico_logo.png",
messageKey: "IR_LOA_6"
});
mission.setInstructionsKey("IR_waitforinfo_brief")
missionVariables.IR_status = "IR_LOA_7"
missionVariables.IR_epilogue_deadline = clock.days + 10
}
}
if (system.ID == 35 && missionVariables.IR_status == "IR_KINNAIRD_1") //Atanon
{
this._runScreen({
messageKey: "IR_kinnaird_2"
});
missionVariables.IR_status = "IR_KINNAIRD_2"
}
if (system.ID == 41 && missionVariables.IR_status == "IR_KINNAIRD_2") //Orlaroor
{
this._runScreen({
messageKey: "IR_kinnaird_3"
});
missionVariables.IR_status = "IR_KINNAIRD_3"
mission.setInstructionsKey("IR_kinnaird_brief_3")
}
if (system.ID == 149 && missionVariables.IR_status == "IR_LOA_3") //Arenxeon
{
this._runScreen({
messageKey: "IR_LOA_4a",
choicesKey: "IR_continue"
}, function (choice) {
if (choice == 1) {
this._runScreen({
messageKey: "IR_LOA_4b"
});
missionVariables.IR_status = "IR_LOA_4"
missionVariables.IR_attack_deadline = clock.days + 10
mission.setInstructionsKey("IR_waitforinfo_brief")
}
});
}
if (system.ID == 63 && missionVariables.IR_status == "IR_sources_3") //Edsoan
{
this._runScreen({
messageKey: "IR_sources_4a",
choicesKey: "IR_continue"
}, function (choice) {
if (choice == 1) {
this._runScreen({
messageKey: "IR_sources_4b"
});
missionVariables.IR_status = "IR_sources_4"
mission.setInstructionsKey("IR_sources_brief_2")
}
});
}
//keep brackets
}
}
this.choiceEvaluation = function (choice) {
switch (missionVariables.IR_offer) {
case "IR_GSE_QUESTIONS": {
if (choice == "IR_B_finance_question_key") {
if (missionVariables.IR_finance_question_no == 1) {
this._runScreen({
title: "Galactic Stock Exchange",
overlay: "IR_GSE_logo.png",
messageKey: "IR_GSE_finance_answer_1a",
choicesKey: "IR_continue"
}, function (choice) {
if (choice == 1) {
this.incrementFinanceQuestion()
this._runScreen({
title: "Galactic Stock Exchange",
overlay: "IR_GSE_logo.png",
messageKey: "IR_GSE_finance_answer_1b",
choicesKey: "IR_questions"
}, this.choiceEvaluation);
missionVariables.IR_offer = "IR_GSE_QUESTIONS"
}
});
break;
}
if (missionVariables.IR_finance_question_no > 1) {
missionVariables.IR_asked_question = missionVariables.IR_finance_question_string
this._runScreen({
title: "Galactic Stock Exchange",
overlay: "IR_GSE_logo.png",
messageKey: "IR_no_more_answer",
choicesKey: "IR_questions"
}, this.choiceEvaluation);
break;
}
}
if (choice == "IR_A_shipment_question_key") {
if (missionVariables.IR_shipment_question_no == 2 && !missionVariables.IR_GSE_loan) {
this._runScreen({
title: "Galactic Stock Exchange",
overlay: "IR_GSE_logo.png",
messageKey: "IR_GSE_loan_offer",
choicesKey: "IR_loan_choices"
}, function (choice) {
if (choice == "IR_loan_yes") {
this._runScreen({
title: "Galactic Stock Exchange",
overlay: "IR_GSE_logo.png",
messageKey: "IR_GSE_loan_agreed"
});
missionVariables.IR_GSE_loan = "ACCEPTED"
player.credits += 500000
missionVariables.IR_loan_deadline = clock.days + 60
missionVariables.IR_loan_remaining = missionVariables.IR_loan_deadline - clock.days
mission.setInstructionsKey("IR_loan_amount")
missionVariables.IR_offer = null
}
if (choice == "IR_loan_no") {
this._runScreen({
title: "Galactic Stock Exchange",
overlay: "IR_GSE_logo.png",
messageKey: "IR_GSE_loan_rejected",
choicesKey: "IR_questions"
}, this.choiceEvaluation);
missionVariables.IR_offer = null
missionVariables.IR_GSE_loan = "REJECTED"
}
if (choice == "IR_loan_defer") {
this._runScreen({
title: "Galactic Stock Exchange",
overlay: "IR_GSE_logo.png",
messageKey: "IR_GSE_loan_deferred",
choicesKey: "IR_questions"
}, this.choiceEvaluation);
missionVariables.IR_offer = "IR_GSE_QUESTIONS"
missionVariables.IR_GSE_loan = "DEFERRED"
}
});
break;
}
if (missionVariables.IR_GSE_loan == "DEFERRED") {
this._runScreen({
title: "Galactic Stock Exchange",
overlay: "IR_GSE_logo.png",
messageKey: "IR_GSE_loan_repeat_offer",
choicesKey: "IR_loan_choices"
}, function (choice) {
if (choice == "IR_loan_yes") {
this._runScreen({
title: "Galactic Stock Exchange",
overlay: "IR_GSE_logo.png",
messageKey: "IR_GSE_loan_agreed"
});
missionVariables.IR_GSE_loan = "ACCEPTED"
player.credits += 500000
missionVariables.IR_loan_deadline = clock.days + 60
missionVariables.IR_loan_remaining = missionVariables.IR_loan_deadline - clock.days
mission.setInstructionsKey("IR_loan_amount")
missionVariables.IR_offer = null
}
if (choice == "IR_loan_no") {
this._runScreen({
title: "Galactic Stock Exchange",
overlay: "IR_GSE_logo.png",
messageKey: "IR_GSE_loan_rejected",
choicesKey: "IR_questions"
}, this.choiceEvaluation);
missionVariables.IR_offer = "IR_GSE_QUESTIONS"
missionVariables.IR_GSE_loan = "REJECTED"
}
if (choice == "IR_loan_defer") {
this._runScreen({
title: "Galactic Stock Exchange",
overlay: "IR_GSE_logo.png",
messageKey: "IR_GSE_loan_deferred",
choicesKey: "IR_questions"
}, this.choiceEvaluation);
missionVariables.IR_offer = "IR_GSE_QUESTIONS"
missionVariables.IR_GSE_loan = "DEFERRED"
}
});
break;
}
if (missionVariables.IR_GSE_loan == "ACCEPTED") {
this._runScreen({
title: "Galactic Stock Exchange",
overlay: "IR_GSE_logo.png",
messageKey: "IR_GSE_loan_demand",
choicesKey: "IR_pay_choices"
}, function (choice) {
if (choice == "IR_pay_yes") {
this._runScreen({
title: "Galactic Stock Exchange",
overlay: "IR_GSE_logo.png",
messageKey: "IR_GSE_pay_accepted",
choicesKey: "IR_questions"
}, this.choiceEvaluation);
missionVariables.IR_GSE_loan = "PAID"
player.credits -= 550000
missionVariables.IR_loan_deadline = null
missionVariables.IR_loan_remaining = null
mission.setInstructionsKey(null)
missionVariables.IR_offer = "IR_GSE_QUESTIONS"
}
if (choice == "IR_pay_no") {
this._runScreen({
title: "Galactic Stock Exchange",
overlay: "IR_GSE_logo.png",
messageKey: "IR_GSE_pay_deferred",
choicesKey: "IR_questions"
}, this.choiceEvaluation);
missionVariables.IR_offer = "IR_GSE_QUESTIONS"
}
});
break;
}
}
if (choice == "IR_E_exit_question_key")
return;
else
this._runScreen({
title: "Galactic Stock Exchange",
overlay: "IR_GSE_logo.png",
messageKey: "IR_negative_answer",
choicesKey: "IR_questions"
}, this.choiceEvaluation);
missionVariables.IR_offer = "IR_GSE_QUESTIONS"
break;
}
case "IR_KORSHKOV_QUESTIONS": {
if (choice == "IR_B_finance_question_key") {
if (missionVariables.IR_finance_question_no == 2) {
this._runScreen({
title: "OKB Korshkov",
overlay: "IR_korshlogo.png",
messageKey: "IR_KORSHKOV_finance_answer_1a",
choicesKey: "IR_continue"
}, function (choice) {
if (choice == 1) {
this.incrementFinanceQuestion()
this._runScreen({
title: "OKB Korshkov",
overlay: "IR_korshlogo.png",
messageKey: "IR_KORSHKOV_finance_answer_1b"
});
missionVariables.IR_offer = "IR_KORSHKOV_QUESTIONS"
missionVariables.IR_KORSHKOV_deadline = clock.days + 5
player.incrementFinanceStatus()
missionVariables.IR_offer = null
missionVariables.IR_finance_quest = "WAIT"
}
});
break;
}
if (missionVariables.IR_finance_question_no > 2) {
missionVariables.IR_asked_question = missionVariables.IR_finance_question_string
this._runScreen({
title: "OKB Korshkov",
overlay: "IR_korshlogo.png",
messageKey: "IR_no_more_answer",
choicesKey: "IR_questions"
}, this.choiceEvaluation);
break;
}
}
if (choice == "IR_E_exit_question_key") {
return;
} else
this._runScreen({
title: "OKB Korshkov",
overlay: "IR_korshlogo.png",
messageKey: "IR_negative_answer",
choicesKey: "IR_questions"
}, this.choiceEvaluation);
missionVariables.IR_offer = "IR_KORSHKOV_QUESTIONS"
break;
}
case "IR_JANES_QUESTIONS": {
if (choice == "IR_A_shipment_question_key") {
this._runScreen({
title: "Jane's Shipyard Intelligence",
overlay: "IR_janes_logo.png",
messageKey: "IR_no_more_answer",
choicesKey: "IR_questions"
}, this.choiceEvaluation);
break;
}
if (choice == "IR_C_SDF_question_key") {
if (missionVariables.IR_SDF_question_no == 1) {
this.incrementSDFQuestion()
this._runScreen({
title: "Jane's Shipyard Intelligence",
overlay: "IR_janes_logo.png",
messageKey: "IR_JANES_SDF_answer",
choicesKey: "IR_questions"
}, this.choiceEvaluation);
break;
}
if (missionVariables.IR_SDF_question_no > 1) {
this._runScreen({
title: "Jane's Shipyard Intelligence",
overlay: "IR_janes_logo.png",
messageKey: "IR_no_more_answer",
choicesKey: "IR_questions"
}, this.choiceEvaluation);
break;
}
}
if (choice == "IR_D_defences_question_key") {
this._runScreen({
title: "Jane's Shipyard Intelligence",
overlay: "IR_janes_logo.png",
messageKey: "IR_JANES_defences_answer",
choicesKey: "IR_questions"
}, this.choiceEvaluation);
break;
}
if (choice == "IR_E_exit_question_key")
return;
else
this._runScreen({
title: "Jane's Shipyard Intelligence",
messageKey: "IR_negative_answer",
choicesKey: "IR_questions"
}, this.choiceEvaluation);
missionVariables.IR_offer = "IR_JANES_QUESTIONS"
break;
}
case "IR_PIRATE_QUESTIONS": {
if (choice == "IR_A_shipment_question_key") {
if (missionVariables.IR_shipment_question_no == 2 && missionVariables.IR_shipment_quest == "SET") {
this._runScreen({
title: " ",
messageKey: "IR_PIRATE_shipment_answer",
choicesKey: "IR_continue"
}, function (choice) {
if (choice == 1)
this._runScreen({
title: " ",
messageKey: "IR_PIRATE_shipment_offer",
choicesKey: "IR_pirate_choices"
}, function (choice) {
if (choice == "IR_pirate_yes") {
this._runScreen({
title: " ",
messageKey: "IR_PIRATE_shipment_accepted"
});
missionVariables.IR_alsto = "HELP_ACCEPTED"
player.credits -= 250000
player.incrementShipmentStatus()
missionVariables.IR_offer = null
}
if (choice == "IR_pirate_no") {
this._runScreen({
title: " ",
messageKey: "IR_PIRATE_shipment_declined"
});
missionVariables.IR_offer = null
missionVariables.IR_alsto = "HELP_DECLINED"
}
});
});
break;
}
if (missionVariables.IR_shipment_question_no == 1) {
this._runScreen({
title: " ",
messageKey: "IR_negative_answer",
choicesKey: "IR_questions"
}, this.choiceEvaluation);
missionVariables.IR_offer = "IR_PIRATE_QUESTIONS"
break;
}
if (missionVariables.IR_shipment_question_no == 2 && missionVariables.IR_alsto == "HELP_ACCEPTED")
this._runScreen({
title: " ",
messageKey: "IR_PIRATE_shipment_confirm_help"
});
if (missionVariables.IR_shipment_question_no == 2 && missionVariables.IR_alsto == "HELP_DECLINED") {
this._runScreen({
title: " ",
messageKey: "IR_PIRATE_shipment_deferred_help",
choicesKey: "IR_pirate_choices"
}, function (choice) {
if (choice == "IR_pirate_yes") {
this._runScreen({
title: " ",
messageKey: "IR_PIRATE_shipment_accepted"
});
missionVariables.IR_alsto = "HELP_ACCEPTED"
player.credits -= 250000
player.incrementShipmentStatus()
missionVariables.IR_offer = null
}
if (choice == "IR_pirate_no") {
this._runScreen({
title: " ",
messageKey: "IR_PIRATE_shipment_declined"
});
missionVariables.IR_offer = null
missionVariables.IR_alsto = "HELP_DECLINED"
}
});
if (missionVariables.IR_shipment_question_no == 2 && missionVariables.IR_shipment_quest != "SET") {
missionVariables.IR_asked_question = missionVariables.IR_shipment_question_string
this._runScreen({
title: " ",
messageKey: "IR_no_more_answer",
choicesKey: "IR_questions"
}, this.choiceEvaluation);
break;
}
}
}
if (choice == "IR_C_SDF_question_key") {
if (missionVariables.IR_SDF_question_no < 2)
this._runScreen({
title: " ",
messageKey: "IR_PIRATE_SDF_answer_1",
choicesKey: "IR_questions"
}, this.choiceEvaluation);
if (missionVariables.IR_SDF_question_no == 2)
this._runScreen({
title: " ",
messageKey: "IR_PIRATE_SDF_answer_2",
choicesKey: "IR_questions"
}, this.choiceEvaluation);
if (missionVariables.IR_SDF_question_no > 2) {
this._runScreen({
title: " ",
messageKey: "IR_no_more_answer",
choicesKey: "IR_questions"
}, this.choiceEvaluation);
}
break;
}
if (choice == "IR_E_exit_question_key")
return;
else
this._runScreen({
title: " ",
messageKey: "IR_negative_answer",
choicesKey: "IR_questions"
}, this.choiceEvaluation);
missionVariables.IR_offer = "IR_PIRATE_QUESTIONS"
break;
}
case "IR_YOKOHAMA_QUESTIONS": {
if (choice == "IR_A_shipment_question_key") {
if (missionVariables.IR_shipment_question_no == 1) {
this.incrementShipmentQuestion()
this._runScreen({
title: "Yokohama Exports",
overlay: "IR_yk_logo.png",
messageKey: "IR_YOKOHAMA_shipment_answer_1"
});
missionVariables.IR_YOKOHAMA_deadline = clock.days + 30
missionVariables.IR_shipment_quest = "SET"
missionVariables.IR_offer = null
player.incrementShipmentStatus()
break;
}
if (missionVariables.IR_shipment_question_no == 2 && clock.days < missionVariables.IR_YOKOHAMA_deadline) {
this._runScreen({
title: "Yokohama Exports",
overlay: "IR_yk_logo.png",
messageKey: "IR_YOKOHAMA_shipment_answer_2",
choicesKey: "IR_YOKOHAMA_choices"
}, function (choice) {
if (choice == "IR_YOKOHAMA_yes") {
if (player.credits >= 1000000) {
this._runScreen({
title: "Yokohama Exports",
overlay: "IR_yk_logo.png",
messageKey: "IR_YOKOHAMA_shipment_agreed"
});
missionVariables.IR_shipment_quest = "SUCCESS"
missionVariables.IR_shipment_quest_method = "PURCHASED"
missionVariables.IR_YOKOHAMA_deadline = null
++missionVariables.IR_quest_count
this.incrementShipmentQuestion()
player.clearShipmentStatus()
missionVariables.IR_offer = null
player.credits -= 1000000
} else {
this._runScreen({
title: "Yokohama Exports",
overlay: "IR_yk_logo.png",
messageKey: "IR_YOKOHAMA_shipment_nomoney"
});
missionVariables.IR_offer = null
}
}
if (choice == "IR_YOKOHAMA_no") {
this._runScreen({
title: "Yokohama Exports",
overlay: "IR_yk_logo.png",
messageKey: "IR_YOKOHAMA_shipment_declined"
});
missionVariables.IR_shipment_quest = "ENROUTE"
this.incrementShipmentQuestion()
missionVariables.IR_offer = null
if (missionVariables.IR_alsto) {
player.incrementShipmentStatus()
}
}
if (choice == "IR_YOKOHAMA_defer") {
this._runScreen({
title: "Yokohama Exports",
overlay: "IR_yk_logo.png",
messageKey: "IR_YOKOHAMA_shipment_defer"
});
missionVariables.IR_offer = null
}
});
break;
}
if (missionVariables.IR_shipment_question_no == 2 && clock.days > missionVariables.IR_YOKOHAMA_deadline) {
this._runScreen({
title: "Yokohama Exports",
overlay: "IR_yk_logo.png",
messageKey: "IR_YOKOHAMA_shipment_toolate"
});
missionVariables.IR_shipment_quest = "DISPATCHED"
player.clearShipmentStatus()
missionVariables.IR_offer = null
break;
}
if (missionVariables.IR_shipment_question_no > 2) {
missionVariables.IR_asked_question = missionVariables.IR_shipment_question_string
this._runScreen({
title: "Yokohama Exports",
overlay: "IR_yk_logo.png",
messageKey: "IR_no_more_answer",
choicesKey: "IR_questions"
}, this.choiceEvaluation);
break;
}
}
if (choice == "IR_E_exit_question_key")
return;
else
this._runScreen({
title: "Yokohama Exports",
overlay: "IR_yk_logo.png",
messageKey: "IR_negative_answer",
choicesKey: "IR_questions"
}, this.choiceEvaluation);
missionVariables.IR_offer = "IR_YOKOHAMA_QUESTIONS"
break;
}
case "IR_PW_QUESTIONS": {
if (choice == "IR_C_SDF_question_key") {
if (missionVariables.IR_SDF_question_no == 2) {
this._runScreen({
title: "PleasureWorld",
overlay: "IR_pw_logo.png",
messageKey: "IR_PW_SDF_answer_1",
choicesKey: "IR_continue"
}, function (choice) {
if (choice == 1) {
this.incrementSDFQuestion()
this._runScreen({
title: " ",
messageKey: "IR_SDF_quest_1"
});
missionVariables.IR_SDF_quest = "ADDRESS"
missionVariables.IR_SDF_deadline = clock.days + 10
}
});
break;
}
if (missionVariables.IR_SDF_question_no == 3) {
this._runScreen({
title: "PleasureWorld",
overlay: "IR_pw_logo.png",
messageKey: "IR_no_more_answer",
choicesKey: "IR_questions"
}, this.choiceEvaluation);
break;
}
if (missionVariables.IR_SDF_question_no == 5) {
this._runScreen({
title: "PleasureWorld",
overlay: "IR_devries.png",
messageKey: "IR_PW_SDF_answer_2"
});
this.incrementSDFQuestion()
missionVariables.IR_SDF_quest = "PHOTO"
missionVariables.IR_SDF_deadline = clock.days + 35
} else {
this._runScreen({
title: "PleasureWorld",
overlay: "IR_pw_logo.png",
messageKey: "IR_negative_answer",
choicesKey: "IR_questions"
}, this.choiceEvaluation);
}
break;
}
if (choice == "IR_E_exit_question_key") {
missionVariables.IR_offer = "IR_ASKED"
return;
} else
this._runScreen({
title: "PleasureWorld",
overlay: "IR_pw_logo.png",
messageKey: "IR_negative_answer",
choicesKey: "IR_questions"
}, this.choiceEvaluation);
missionVariables.IR_offer = "IR_PW_QUESTIONS"
break;
}
case "IR_NWE_QUESTIONS": {
if (choice == "IR_C_SDF_question_key") {
if (missionVariables.IR_SDF_question_no == 4) {
this._runScreen({
title: "Naval Weapons Establishment",
overlay: "IR_NWE_logo.png",
messageKey: "IR_NWE_SDF_answer_1a",
choicesKey: "IR_continue"
}, function (choice) {
if (choice == 1) {
this.incrementSDFQuestion()
this._runScreen({
title: " ",
overlay: "IR_NWE_logo.png",
messageKey: "IR_NWE_SDF_answer_1b"
});
}
missionVariables.IR_offer = null
});
}
if (missionVariables.IR_SDF_question_no < 4 || missionVariables.IR_SDF_question_no > 4) {
this._runScreen({
title: "Naval Weapons Establishment",
overlay: "IR_NWE_logo.png",
messageKey: "IR_negative_answer",
choicesKey: "IR_questions"
}, this.choiceEvaluation);
}
break;
}
if (choice == "IR_D_defences_question_key") {
if (missionVariables.IR_defences_question_no < 3) {
this._runScreen({
title: "Naval Weapons Establishment",
overlay: "IR_NWE_logo.png",
messageKey: "IR_NWE_defences_answer_1"
});
missionVariables.IR_defences_question_no = 3
missionVariables.IR_offer = null
player.incrementDefencesStatus()
break;
}
if (missionVariables.IR_defences_question_no == 3) {
this._runScreen({
title: "Naval Weapons Establishment",
overlay: "IR_NWE_logo.png",
messageKey: "IR_no_more_answer",
choicesKey: "IR_questions"
}, this.choiceEvaluation);
break;
}
}
if (choice == "IR_E_exit_question_key")
return;
else
this._runScreen({
title: "Naval Weapons Establishment",
messageKey: "IR_negative_answer",
choicesKey: "IR_questions"
}, this.choiceEvaluation);
missionVariables.IR_offer = "IR_NWE_QUESTIONS"
break;
}
case "IR_MAENES_QUESTIONS": {
if (choice == "IR_D_defences_question_key") {
if (missionVariables.IR_defences_question_no == 1) {
this._runScreen({
title: "QuiCo Pharmaceuticals",
overlay: "IR_quico_logo.png",
messageKey: "IR_MAENES_defences_answer_1"
});
this.incrementDefencesQuestion()
missionVariables.IR_offer = null
missionVariables.IR_Maenes_visit = "TRUE"
break;
}
if (missionVariables.IR_defences_question_no >= 2) {
this._runScreen({
title: "QuiCo Pharmaceuticals",
overlay: "IR_quico_logo.png",
messageKey: "IR_no_more_answer",
choicesKey: "IR_questions"
}, this.choiceEvaluation);
break;
}
}
if (choice == "IR_E_exit_question_key")
return;
else
this._runScreen({
title: "QuiCo Pharmaceuticals",
overlay: "IR_quico_logo.png",
messageKey: "IR_negative_answer",
choicesKey: "IR_questions"
}, this.choiceEvaluation);
missionVariables.IR_offer = "IR_MAENES_QUESTIONS"
break;
}
}
}
|