Back to Index Page generated: Dec 1, 2024, 3:15:25 AM

Expansion Fighter HUD Mk. II

Content

Manifest

from Expansion Manager's OXP list from Expansion Manifest
Description A HUD with instrument panel and polarized glass laser sight. 4 MFDs. A HUD with instrument panel and polarized glass laser sight. 4 MFDs.
Identifier oolite.oxp.captkev.fighter_hud2 oolite.oxp.captkev.fighter_hud2
Title Fighter HUD Mk. II Fighter HUD Mk. II
Category HUDs HUDs
Author CaptKev, spara CaptKev, spara
Version 1.4.1 1.4.1
Tags
Required Oolite Version
Maximum Oolite Version
Required Expansions
Optional Expansions
Conflict Expansions
Information URL http://wiki.alioth.net/index.php/Fighter_HUD_%28Oolite%29 n/a
Download URL https://wiki.alioth.net/img_auth.php/1/1d/Fighter_hud_mkii_1.4.1.oxz n/a
License CC-BY-NC-SA 2.0 CC-BY-NC-SA 2.0
File Size n/a
Upload date 1610873244

Documentation

Also read http://wiki.alioth.net/index.php/Fighter%20HUD%20Mk.%20II

Equipment

This expansion declares no equipment.

Ships

This expansion declares no ships.

Models

This expansion declares no models.

Scripts

Path
Config/script.js
"use strict";

this.name = "fighter_hud2";
this.author = "spara";
this.copyright = "2015 spara";
this.license     = "CC BY-NC-SA 4.0"; 

this.$strings = ["adder-player", "anaconda-player", "asp-player", "boa-player", "boa-mk2-player", "boa_mk2-player", "cobramk1-player", "cobra_mk1-player", "cobra3-player", "cobra_mk3-player", "ferdelance-player", "ferdelance2013-player", "gecko-player", "krait-player", "mamba-player", "moray-player", "morayMED-player", "python-player", "sidewinder-player", "transporter-player"];

this.$shipImages = ["adder", "anaconda", "asp2", "boa", "boa2", "boa2", "cobra1", "cobra1", "cobra3", "cobra3", "ferdelance", "ferdelance", "gecko", "krait", "mamba", "moray", "moray", "python", "sidewinder", "transporter"];

this.startUp = function() {
	this.$hudSelector = worldScripts.hudselector;
	if(this.$hudSelector)
		this.$hudSelector.$HUDSelectorAddHUD("Fighter HUD Mk. II ", this.name);
}

this.startUpComplete = function() {
	this.playerBoughtNewShip(player.ship);
}

this.playerBoughtNewShip = function(ship) {
	if(!this.$hudSelector && (player.ship.hud === "hud.plist" || player.ship.hud === "hud-small.plist"))
		player.ship.hud =  this.name + ".plist";
	for (var i = 0; i < this.$strings.length; i++) {
		if (ship.dataKey.toLowerCase().indexOf(this.$strings[i]) !== -1) {
			player.ship.setCustomHUDDial("fhudShipImage", "fhud_"+this.$shipImages[i]+".png");
			break;
		}
	}
	if (i === this.$strings.length) 
		player.ship.setCustomHUDDial("fhudShipImage", "fhud_oolite.png");
}