| Back to Index | Page generated: Oct 27, 2025, 5:37:22 AM | 
 Expansion MFDRestoreAfterLoad
 Expansion MFDRestoreAfterLoad| from Expansion Manager's OXP list | from Expansion Manifest | |
|---|---|---|
| Description | Restore MFD configuration after game loading. | Restore MFD configuration after game loading. | 
| Identifier | oolite.oxp.SMax.MFDRestoreAfterLoad | oolite.oxp.SMax.MFDRestoreAfterLoad | 
| Title | MFDRestoreAfterLoad | MFDRestoreAfterLoad | 
| Category | HUDs | HUDs | 
| Author | SMax | SMax | 
| Version | 0.1 | 0.1 | 
| Tags | MFD, HUDS | MFD, HUDS | 
| Required Oolite Version | ||
| Maximum Oolite Version | ||
| Required Expansions | ||
| Optional Expansions | ||
| Conflict Expansions | ||
| Information URL | n/a | |
| Download URL | https://wiki.alioth.net/img_auth.php/d/d0/MFDRestoreAfterLoad_0.1.oxz | n/a | 
| License | CC-BY-NC-SA 4.0 | CC-BY-NC-SA 4.0 | 
| File Size | n/a | |
| Upload date | 1610873477 | 
Also read http://wiki.alioth.net/index.php/MFDRestoreAfterLoad
MFD Restore After Load By S Max Restore MFD configuration after game loading. License ======= This work is licensed under the Creative Commons Attribution-Noncommercial-Share Alike 4.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/4.0/ Version History =============== 0.1 - Initial release
| Path | |
|---|---|
| Config/script.js | this.name           = "MFDRestoreAfterLoad";
this.author         = "SMax";
this.copyright      = "2015 SMax";
this.licence        = "CC-BY-NC-SA 4.0";
this.description    = "Restore MFD configuration after game loading.";
this.version        = "0.1 alpha 1";
"use strict";
this.startUpComplete = function() {
	var config = JSON.parse(missionVariables.MFDRestoreAfterLoad_Data);
	if (config && config.length > 0) {
		var p = player.ship;	
		for (var i = 0; i < config.length; i++) {
			try {
				if (config[i]) {
					p.setMultiFunctionDisplay(i, config[i]);
				}
			}
			catch (err) {
				log(this.name, "ERROR: Unable to set MFD " + (i + 1) + " to " + config[i]);
			}
		}
	}
}
this.playerWillSaveGame = function() {
	var p = player.ship;
	var config = [];
	if (p) {
		for (var i = 0; i < p.multiFunctionDisplayList.length; i++) {
			config.push(p.multiFunctionDisplayList[i]);
		}
	}
	
	missionVariables.MFDRestoreAfterLoad_Data = JSON.stringify(config);
} |