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");
}
|