Scripts/VimanaX_HUD.js |
"use strict";
this.name = "VimanaX_HUD";
this.author = "Gnievmir, phkb";
this.license = "CC-BY-NC-SA 3.0";
this._sampleList = [];
//TODO: Next hops are switching between (Unknown) and actual places (bug in Here be Dragons)
this._hairSpace = String.fromCharCode(31);
this._hairSpaceLength = defaultFont.measureString(this._hairSpace);
this._ellip = "…";
this._debug = false;
this._style = "dark";
this._nonLinear = true;
this._ultraZoom = true;
this._AMS = null; // antimissile system
this._SRS = null; // self repair system
this._TLS = null; // telescope
this._TFS = null; // target filtering system
this._SLS = null; // sniper lock
this._SLP = null; // sniper lock plus
this._ACH = null; // autocrosshair
this._SEC = null; // shield equalizer-capacitors
this._SC = null; // Shield Cycler
this._LMSS = null; // LMSS
this._MS = null; // Manifest scanner
this._combatMFD = null;
this._telescopeVersion = 0;
this._specialSlots = [];
this._setSlot1 = 1;
this._setSlot2 = 2;
this._reqFuel = 0;
this._lastUsed = [];
this._hullAnim = [];
this._infoTimer = null; //store pointer to text info timer
this._iconTimer = null; //store pointer to graphical info timer
this._maintenance = false;
this._cbf = null;
this._govs = [];
this._ecos = [];
this._eqDamaged = [];
this._inflightHUD = "VimanaX_HUD-10mfds.plist"; // default hud when HUD selector isn't installed
this._dockedHUD = "VimanaX_HUD_docked-10mfds.plist";
this._checkMFDCycle = 0;
this._SC_Armour = false;
this._spacer = "";
this._staticText = {};
this._default = "";
this._killsOnLaunch = 0;
this._timer1Ping = false;
this._timer2Ping = false;
this._timer3Ping = false;
this._mapScreenChangeTimer = null;
this._destination = -1; // current witchspace destination
this._lastSource = -1; // used to establish the start point for destination system calculations
this._holdTarget = 0;
this._widthLookup = 0; // index of the width value in the _widths dictionary 0 = normal, 1 = narrow
this._clockFCB = null;
this._img = 0;
this._widths = {
"VimanaX_ASCName": [9.64, 12.65],
"VimanaX_SpecialSlot1": [8.9, 11.12],
"VimanaX_SpecialSlot2": [8.9, 11.12],
"VimanaX_LaserName": [8.15, 10.38],
"VimanaX_EQMode": [7.42, 9.64],
"VimanaX_PSName": [9.74, 10.38],
"VimanaX_L0": [11.12, 13.35],
"VimanaX_Lh": [9.64, 11.86],
"VimanaX_R0": [11.12, 13.35],
"VimanaX_Rh1": [9.74, 10.38],
};
this._gameShips = { // storage; ships and other model picture
//general ships
"249Alpha Active Cruiser": "anaconda",
"249Alpha Active Wing": "cobra3",
"249Alpha Active Wingman": "cobra3",
"249Alpha Reserve Cruiser": "anaconda",
"249Alpha Reserve Escort": "cobra3",
"249Alpha Reserve Wing": "cobra3",
"249Charlie Active Cruiser": "python_courier",
"249Charlie Active Solo": "fa_hunter",
"249Charlie Active Wing": "cobra_commodore",
"249Charlie Active Wingman": "cobra_commodore",
"249Charlie Reserve Cruiser": "python_courier",
"249Charlie Reserve Escort": "cobra_commodore",
"249Charlie Reserve Wing": "cobra_commodore",
"249Charlie Solo Reserve": "fa_hunter",
"Academy Security Interceptor": "interceptor",
"Academy Security Patrol": "viper",
"Accipiter Fear-Naught": "accipiter",
"Accipiter": "accipiter",
"Adder : Systems Shutdown": "adder",
"Adder Escort": "adder",
"Adder Graveship": "adder",
"Adder Mark II": "adder2",
"Adder Mark II-F": "adder2",
"Adder Mark II-R": "adder2",
"Adder Mark III": "adder3",
"Adder Mark III-E": "adder3",
"Adder Miner": "adder",
"Advert DroidShip": "hognose",
"Adder": "adder",
"Aeron Class Frigate": "aeron",
"Aeron Class Frigate: Rebel Fleet": "aeron",
"AHC Kraken IV (Hijacked)": "kraken",
"Ambassador Ship": "boa_cruiser",
"Ambassador Escort": "viper",
"Anaconda": "anaconda",
"Anaconda Graveship": "anaconda",
"Anaconda Tanker": "anaconda",
"Anaconda Transport": "anaconda",
"Anaconda: Escort Mother": "anaconda",
"Anaconda: Mafia Narcotics Transport": "anaconda",
"Andromeda": "andromeda",
"Annihilator": "annihilator",
"Aphid": "aphid",
"Arachnid Escort": "arachnid",
"Arachnid Mark 1": "arachnid",
"Arachnid Sniper": "arachnid",
"Arafura": "arafura",
"Armoured Passenger Transport": "armoured_transport",
"Armoured Transport Type1": "att1",
"Asp Escort": "asp2",
"Asp Explorer": "neo_asp_explorer",
"Asp Mark I": "asp1",
"Asp Mark II: Bounty Hunter": "asp2",
"Asp Mark II : Systems Shutdown": "asp2",
"Asp Mark II Graveship": "asp2",
"Asp Mark II Special": "asp2special",
"Asp Mark II": "asp2",
"Asp Mark II: Katik Escort": "asp2",
"Asp Mark II: Sahana": "asp2",
"Asp Mark IV": "asp2",
"Asp MkII": "asp2",
"Asp SG": "asp2",
"Asp": "asp2",
"Asp-X": "asp_x",
"Asp Pilot's pod": "escape",
"Astromine Defender Ray": "sunray",
"Augeas Security : Mega Krait": "krait",
"Augeas Security : Krait Interceptor": "krait",
"Baakili Far Trader": "baakili",
"Barracuda": "barracuda",
"Barracuda: Security Patrol": "barracuda",
"BattleBot Control Drone": "navydrone",
"Bellatrix Cruiser": "bellatrix",
"Bellatrix Leader": "bellatrix",
"BHG Outrider Mark II": "outrider",
"BHG Snark": "snark",
"Biesmaan Asp": "asp2",
"Black Baron Minion": "krait",
"Black Mamba Boa 2": "boa_cruiser",
"Black Mamba Fighter": "mamba",
"Black Racer": "racer_black",
"Black Racer (Bountyhunter)": "racer_black",
"Black Star Destroyer": "stardestroyer",
"Blue Racer": "racer_blue",
"Blue Racer (Buccaneer)": "racer_blue",
"Blue Racer (Riredisec)": "racer_blue",
"Boa Class Cruiser : Systems Shutdown": "boa_cruiser",
"Boa Class Cruiser Graveship": "boa_cruiser",
"Boa Class Cruiser": "boa_cruiser",
"Boa Class Cruiser: Konstantin Katik": "boa_cruiser",
"Boa Class StarLiner": "boa_cruiser",
"Boa Graveship": "boa",
"Boa Mark II: Escort Mother": "boa_cruiser",
"Boa": "boa",
"Boa SG": "boa",
"Boa: Escort Mother": "boa",
"Boomslang MK-III": "boomslang3",
"Boomslang mkIV": "boomslang4",
"Box Escort": "box_escort",
"Bounty Hunter": "***",
"Bribed GalCop": "viper",
"Bug": "bug",
"Bug Transport": "bug",
"Bulk Hauler - Eldjotnar": "bulk_hauler",
"Bulk Hauler - Fenrir": "bulk_hauler",
"Bulk Hauler - Jormundgand": "bulk_hauler",
"Bulk Hauler - Muninn": "bulk_hauler",
"Bulk Hauler": "bulk_hauler",
"Bushmaster Miner": "bushmaster",
"Caduceus Alpha": "caduceus",
"Caduceus Omega": "caduceus_omega",
"Cameron": "cobra3",
"Cat Mark II": "cat",
"Chameleon": "chameleon",
"Chatu": "wildships_nyoka",
"Chimera Gunship": "chimera",
"Chopped Cobra": "chopped_cobra",
"Chrysopelea MK-I": "chrysopelea",
"Cobra AC": "cobra_ac",
"Cobra Clipper SAR": "cobra3_clipper",
"Cobra Clipper": "cobra3_clipper",
"Cobra Commodore": "cobra_commodore",
"Cobra Courier SE": "cobra3_courier",
"Cobra Courier": "cobra3_courier",
"Cobra Cutlass": "cobra3_cutlass",
"Cobra III NjX": "cobra3njx",
"Cobra III NjX: Rebel Fighter": "cobra3njx",
"Cobra Mark I Graveship": "cobra1",
"Cobra Mark I Miner": "cobra1",
"Cobra Mark I": "cobra1",
"Cobra Mark II: Bounty Hunter": "cobra3",
"Cobra Mark III: Bounty Hunter": "cobra3",
"Cobra Mark II-X": "cobra2x",
"Cobra Mark III Graveship": "cobra3",
"Cobra Mark III Miner": "cobra3",
"Cobra Mark III": "cobra3",
"Cobra Mark III SG": "cobra3",
"Cobra Mark III-XT": "cobra_xt",
"Cobra Mark III: Cameron": "cobra3",
"Cobra Mark III: Cuervo": "cobra3",
"Cobra Mark III: Greer": "cobra3",
"Cobra Mark III: La Bruja Agent": "cobra3",
"Cobra Mark III: Lobo": "cobra3",
"Cobra Mark III: Zorra": "cobra3",
"Cobra Mark III : Systems Shutdown": "cobra3",
"Cobra Mark IV Black": "cobra4_black",
"Cobra Mark IV": "cobra4",
"Cobra Mk. III-XT 'Black Knave'": "cobra_xt",
"Cobra MkB": "cobramkb",
"Cobra MkVI ~ King Cobra": "kingcobramk1",
"Cobra MkVI ~ Star Snake": "kingcobramk1",
"Cobra Rapier": "cobra3_rapier",
"Cobra S9": "chopped_cobra",
"Cobra2-C": "cobra2_x",
"Cobra2-X": "cobra2_x",
"Colonial Viper Mark I": "light_fighter",
"Colonial Viper Mark I-S": "light_fighter",
"Commander Bolts": "ste",
"Condor": "condor",
"Constitution Class Heavy Cruiser": "constitution",
"Constrictor": "constrictor",
"Constrictor SG": "constrictor",
"Convict Miner Ray": "sunray",
"Copperhead Mk2": "copperhead",
"Copperhead Yari 'Soku Yaku'": "copperhead_yari",
"Copperhead Yari Escort": "copperhead_yari",
"Copperhead Yari": "copperhead_yari",
"Corona Research Shuttle": "worm",
"Corsair": "fa_corsair",
"Corsair Class Cruiser": "fa_corsair",
"Cougar ST": "cougar_st",
"Cougar": "cougar",
"Crazy 88 : Mega Mamba": "mamba",
"Cruiser": "fa_cruiser",
"Cruzer": "cruzer",
"Cuervo": "cobra3",
"Cylon Raider Mark 1": "raider",
"Cylon Raider Mark I": "raider",
"Cylon Raider Mark II": "raider",
"D.T.T. Atlas": "dtt_atlas",
"D.T.T. Cyclops": "dtt_cyclops",
"D.T.T. Galaxy Liner": "dtt_galaxy_liner",
"D.T.T. Heart of Gold": "dtt_heart_of_gold",
"D.T.T. Kraken": "dtt_kraken",
"D.T.T. MK-1": "dttmk1",
"D.T.T. Planet Express": "dtt_planet_express",
"D.T.T. Snake Charmer": "dtt_snake_charmer",
"D.T.T. War Lance": "dtt_war_lance",
"Daemon Class Cruiser": "daemon_cruiser",
"Daemon Class Cruiser: Eszausveian Navy": "daemon_cruiser",
"Dart": "fa_dart",
"Decomissioned Bulk Hauler": "bulk_hauler",
"Defector": "python",
"Delta Long-Range Escort": "delta",
"Deputy BHG Outrider Mark II-N": "outrider",
"Diamond Class Shuttle": "orbital_shuttle",
"Draco": "draco",
"Dragonette": "dragonette",
"Drake": "drake1",
"Drake Mk I": "drake1",
"Drake Mark II": "drake2",
"Draven Carrier": "draven_carrier",
"Draven Gunship": "draven_gunship",
"Draven Shuttle": "draven_shuttle",
"Draven Trader": "draven_trader",
"Draven_Gunship": "draven_gunship",
"Draven_Raider": "draven_raider",
"Draven_Trader": "draven_trader",
"DTT Manta": "dtt_manta",
"DTT Mark I": "dttmk1",
"DTT Tomahawk": "dtt_tomahawk",
"DTT Wraith": "dtt_wraith",
"Duma Fleet Hauler": "wildships_duma",
"Duma": "wildships_duma",
"Eagle Escort": "eagle_escort",
"Eagle Long Range Fighter Mark I": "adck_eagle_one",
"Eagle Long Range Fighter Mark II": "adck_eagle_two",
"Eagle Long Range Fighter Mark III": "adck_eagle_three",
"Eagle Long Range Fighter Mark IV": "adck_eagle_four",
"enemy commander": "ferdelance",
"Escape capsule (no life signs)": "escape",
"Eszausveian Navy : Balrog Class Dreadnaught": "balrog",
"Eszausveian Navy : Daemon Class Cruiser": "daemon_cruiser",
"Eszausveian Navy : Mongoose": "mongoose",
"Eszausveian Navy : Scorpion Frigate": "scorpion",
"Excalibur": "excalibur",
"Ezra Athesdottir": "moray",
"Falcon": "falcon",
"Falcon-E": "falcon",
"Falcon-H": "falcon",
"Falcon-S": "falcon",
"Falcon-T": "falcon",
"Far Star": "farstar_murderer",
"Fer de Lance: Bounty Hunter": "ferdelance",
"Fer-de-Lance : Systems Shutdown": "ferdelance",
"Fer-de-Lance Graveship": "ferdelance",
"Fer-de-Lance Interceptor": "ferdelance",
"Fer-de-Lance Lightspeeder": "fdl_lightspeeder",
"Fer-de-Lance": "ferdelance",
"Fer-de-Lance SG": "ferdelance",
"Fer-de-Lance SS": "neo_ferdelance",
"Feudal Freighter": "***",
"Firefly": "firefly",
"Firefly Class Transport": "s9_firefly",
"Freiherr-Class Korvette (Aniseres)": "feudal_lord",
"Freiherr-Class Korvette (Ansois)": "feudal_lord",
"Freiherr-Class Korvette (Aronar)": "feudal_lord",
"Freiherr-Class Korvette (Arries)": "feudal_lord",
"Freiherr-Class Korvette (Atbiarxe)": "feudal_lord",
"Freiherr-Class Korvette (Atlaar)": "feudal_lord",
"Freiherr-Class Korvette (Bedierat)": "feudal_lord",
"Freiherr-Class Korvette (Biarandi)": "feudal_lord",
"Freiherr-Class Korvette (Ceorat)": "feudal_lord",
"Freiherr-Class Korvette (Dierlabe)": "feudal_lord",
"Freiherr-Class Korvette (Digebiti)": "feudal_lord",
"Freiherr-Class Korvette (Diqudi)": "feudal_lord",
"Freiherr-Class Korvette (Ededleen)": "feudal_lord",
"Freiherr-Class Korvette (Edzaon)": "feudal_lord",
"Freiherr-Class Korvette (Enbirare)": "feudal_lord",
"Freiherr-Class Korvette (Enlaonus)": "feudal_lord",
"Freiherr-Class Korvette (Erinain)": "feudal_lord",
"Freiherr-Class Korvette (Erlaened)": "feudal_lord",
"Freiherr-Class Korvette (Erxearis)": "feudal_lord",
"Freiherr-Class Korvette (Esceso)": "feudal_lord",
"Freiherr-Class Korvette (Esredice)": "feudal_lord",
"Freiherr-Class Korvette (Essoza)": "feudal_lord",
"Freiherr-Class Korvette (Geinona)": "feudal_lord",
"Freiherr-Class Korvette (Gelaed)": "feudal_lord",
"Freiherr-Class Korvette (Inrearbi)": "feudal_lord",
"Freiherr-Class Korvette (Israra)": "feudal_lord",
"Freiherr-Class Korvette (Issoinen)": "feudal_lord",
"Freiherr-Class Korvette (Mainon)": "feudal_lord",
"Freiherr-Class Korvette (Mazare)": "feudal_lord",
"Freiherr-Class Korvette (Oneded)": "feudal_lord",
"Freiherr-Class Korvette (Onente)": "feudal_lord",
"Freiherr-Class Korvette (Onertius)": "feudal_lord",
"Freiherr-Class Korvette (Onusorle)": "feudal_lord",
"Freiherr-Class Korvette (Oreseren)": "feudal_lord",
"Freiherr-Class Korvette (Orverace)": "feudal_lord",
"Freiherr-Class Korvette (Qurexein)": "feudal_lord",
"Freiherr-Class Korvette (Qutecete)": "feudal_lord",
"Freiherr-Class Korvette (Rabiarce)": "feudal_lord",
"Freiherr-Class Korvette (Reenus)": "feudal_lord",
"Freiherr-Class Korvette (Resoisbe)": "feudal_lord",
"Freiherr-Class Korvette (Ridivexe)": "feudal_lord",
"Freiherr-Class Korvette (Rileaa)": "feudal_lord",
"Freiherr-Class Korvette (Rizace)": "feudal_lord",
"Freiherr-Class Korvette (Sogeve)": "feudal_lord",
"Freiherr-Class Korvette (Teususdi)": "feudal_lord",
"Freiherr-Class Korvette (Tibecea)": "feudal_lord",
"Freiherr-Class Korvette (Tibedied)": "feudal_lord",
"Freiherr-Class Korvette (Tiuson)": "feudal_lord",
"Freiherr-Class Korvette (Usedge)": "feudal_lord",
"Freiherr-Class Korvette (Usteer)": "feudal_lord",
"Freiherr-Class Korvette (Zagearbe)": "feudal_lord",
"Freiherr-Klasse Korvette": "feudal_lord",
"Fruit Bat": "fruitbat",
"Fuel Frame": "fuelframe",
"Fuel Tanker: Escort Mother": "fa_tanker",
"Fugu Tanker": "fugu",
"GalaxyMart Hauler Anaconda": "anaconda",
"GalaxyMart Security Sidewinder": "sidewinder",
"GalCop : Aeron Class Frigate": "aeron",
"GalCop : Cobra III NjX": "cobra3njx",
"GalCop Cobra Enforcer": "chopped_cobra",
"GalCop Dominatrix": "vampiremk3",
"GalCop Isis Space Boat": "space_boat",
"GalCop Manta Ray": "mantaray",
"GalCop Outrider Mark II-N": "outrider",
"GalCop Snark": "snark",
"GalCop Veloce e Appuntita": "veloceeappuntita",
"GalCop Vampire Mark II-B/N": "vampiremk2",
"GalCop Viper Interceptor": "interceptor",
"GalCop Viper": "viper",
"GalCop Viper SG": "viper",
"GalTech Escort Fighter": "gt_interceptor",
"GalTech Interceptor": "gt_interceptor",
"Gecko Escort": "gecko",
"Gecko Graveship": "gecko",
"Gecko": "gecko",
"Gecko 'Dragon Class'": "gecko",
"Gecko: Triad Goon": "gecko",
"Gecko: Triad Henchman": "gecko",
"Gemini Escort": "gemini",
"Ghavial Escort": "ghavial",
"Ghavial": "ghavial",
"Gnat": "gnat",
"Green Gecko": "gecko",
"Green Knight": "escape",
"Greer": "cobra3",
"Greer's Escape Capsule": "escape",
"Griff Boa Prototype": "griff_boa",
"Griff Krait": "griff_krait",
"Griffin Mk I": "griffin",
"GRS Armadillo": "buoytugger",
"GRS Controller": "grs_controller",
"GRS Guanako": "guanako",
"GRS Shuttle": "orbital_shuttle",
"GSP Safety Steward": "gsp_steward",
"Guardian Drone": "aquatics_guardian",
"Guild Sister O-Ren Ishii : Hooded Cobra": "hoodedcobra",
"Guild Target : Balrog Dreadnaught - 90,000C": "balrog",
"Guild Target : Boss Yankisona - 70,000C": "excalibur",
"Guild Target : Control Drone - 60,000C": "navydrone",
"Guild Target : ESS Defiant - 100,000C": "daemon_cruiser",
"Guild Target : GSS Indefatigable - 80,000C": "aeron",
"Guild Target : Hockey Team - 5,000C": "armoured_transport",
"Guild Target : Inspector Thorstan - 40,000C": "asp2",
"Guild Target : The Fair Wind - 30,000C": "anaconda",
"GW gecko": "gecko",
"GW krait": "krait",
"GW mamba": "mamba",
"GW moray": "moray",
"Hacker Viper": "viper",
"HammerHead Hauler Carrier": "hammerhead",
"Hawksbill Fuel Tanker": "hawksbill",
"Headhunter": "krait",
"Heavy Metal D Freight Hauler": "heavy_metal_d",
"Heavy Metal D": "heavy_metal_d",
"Heavy Metal S Freight Hauler": "heavy_metal_s",
"Heavy Metal S": "heavy_metal_s",
"Herald Ad-Droid": "hognose",
"Hognose": "hognose",
"Holy Avenger Mark II": "blackmonk_gunship",
"Hooded Cobra: O-Ren Ishii": "hoodedcobra",
"Hornet": "hornet",
"Hunter": "fa_hunter",
"Hydra": "hydra",
"Hydra 2": "hydra",
"Iguana": "iguana",
"Imperial Banshee": "banshee",
"Imperial Censor": "interceptor",
"Imperial Courier": "impcourier",
"Imperial Freighter": "freighter",
"Imperial Lictor": "viper",
"Imperial Navy Anaconda": "anaconda",
"Imperial Navy Asp Mark II": "asp2",
"Imperial Navy Boa Class Cruiser": "boa_cruiser",
"Imperial Navy Constrictor": "constrictor",
"Imperial Navy Sidewinder": "sidewinder_escort",
"Imperial Quaestor": "viper",
"Imperial Shuttle": "stardestroyershuttle",
"Imperial Star Destroyer": "stardestroyer",
"Imperial Tanker": "freighter",
"Imperial Trader": "imptrader",
"Inno Soin : Mega Fer-de-Lance": "ferdelance",
"Inter-system ferry": "anaconda",
"Ionics Funnelweb": "funnelweb",
"Ionics Huntsman": "huntsman",
"Ionics Redback": "redback",
"Ionics Whitetail": "whitetail",
"Irate Hockey Fan : Nemesis": "nemesis1",
"Iron King": "space_boat",
"Isis Medical Craft": "space_boat",
"Isis Space Boat": "space_boat",
"Jade Class RunAbout": "orbital_shuttle",
"Jaguar Company Mining Ship": "transporter",
"Jaguar Company Splinter Ship": "jaguar_splinter",
"Jaguar Company": "jaguar_cobra3",
"Junta Enforcer": "interceptor",
"Katik Anaconda": "anaconda",
"Katik Escort": "mamba",
"Katik Python": "python",
"Kestrel": "kestrel",
"KestrelInterceptor": "kestrel",
"King": "space_boat",
"King Cobra MkII": "kingcobramk2",
"KingCobra MkII ~ Damage, Inc.": "kingcobramk2",
"KingCobra MkII": "kingcobramk2",
"Kirin Military Transport": "kirin_xm",
"Kirin Sport": "kirin_sport",
"Kirin XM": "kirin_xm",
"Konstantin Katik": "boa_cruiser",
"Konstantin Katik's pod": "escape",
"Kracken": "kracken",
"Krait Explorer": "krait",
"Krait Graveship": "krait",
"Krait Interceptor: Augeas Security": "krait",
"Krait Patrol": "krait",
"Krait": "krait",
"Krait SG": "krait",
"La Bruja Agent": "cobra3",
"Lampyris": "lampyris",
"Leviathan": "leviathan",
"Light Fighter": "light_fighter",
"Link Vessel": "huntsman",
"Lira": "lira",
"Lobo": "cobra3",
"Long Range Cruiser": "long_range_cruiser",
"Lynx Bulk Carrier - No Trailer": "lynx_nocar",
"Lynx Bulk Carrier": "lynx",
"Maelstrom": "maelstrom",
"Mafia Narcotics Transport : Anaconda": "anaconda",
"Malfunctioning BattleBot": "navybattlebot1",
"Mall-Wart Hauler Anaconda": "anaconda",
"Mallwart Security Sidewinder": "sidewinder",
"Mamba Escort": "mamba",
"Mamba Explorer": "mamba",
"Mamba Graveship": "mamba",
"Mamba": "mamba",
"Mamba: Katik Escort": "mamba",
"Man O' War": "manowar",
"Manchi Vulture": "fa_vulture",
"Manchi Wasp": "fa_wasp",
"Manta Ray": "mantaray",
"Manta Ray Carrier": "manta_ray",
"Manta: Security Patrol": "mantaray",
"Mega Fer-de-Lance: Inno Soin": "ferdelance",
"Mega Krait: Augeas Security": "krait",
"Mega Mamba: Crazy 88": "mamba",
"Mega Mamba: Soin Clan Sister": "mamba",
"Merlin": "merlin",
"Military Hydra": "hydra",
"Military Hydra 2": "hydra",
"Military Manta Ray": "mantaray",
"Military Rattle Cutter": "rattlecutter",
"Military Stingray": "***",
"Miner Cobra Mark III": "cobra3",
"Mining Transporter": "transporter",
"Mongoose Fighter": "mongoose",
"Mongoose: Eszausveian Navy": "mongoose",
"Monitor Mark II": "monitor2",
"Monitor": "monitor",
"Monitor: Escort Mother": "monitor",
"Moray Graveship": "moray",
"Moray Medical Boat": "moray",
"Moray Star Boat Graveship": "moray",
"Moray Star Boat": "moray",
"Moray: Ezra Athesdottir": "moray",
"Morrigan": "morrigan",
"Mosquito Sport": "mosquito_sport",
"Mosquito Trader": "mosquito",
"MT SEC Flying Fox": "fruitbat",
"Mussurana": "mussurana",
"Naval Asp Mark II-a": "asp2",
"Navy Asp Mark II": "navy_asp2",
"Navy BattleBot Mark I": "navybattlebot1",
"Navy BattleBot Mark II": "navybattlebot2",
"Navy BattleBot MkII": "navybattlebot2",
"Navy Cruiser 'Thunder Child'": "smivs_liner",
"Navy Frigate": "picket_frigate",
"Navy Intelligence Constrictor": "constrictor",
"Navy Landing Craft": "navy_lander",
"Navy Medical Ship": "seccom_medship",
"Navy Minesweeper Mk II": "minesweeper",
"Navy Shuttle": "navy_shuttle",
"Navy Sidewinder": "navy_sidewinder",
"Navy Special Ops Asp Mark II": "asp2",
"Navy Thargon Collector": "thargon_collector",
"Navy Transport": "navy_transport",
"Navy Viper": "viper",
"NavyCondor": "condor_navy",
"Nemesis": "nemesis1",
"Nemesis Mark I": "nemesis1",
"Nemesis Mark I: Irate Hockey Fan": "nemesis1",
"Nemesis Mark I: Team Minder": "nemesis1",
"Night Adder Escort": "nightadder",
"Night Adder": "nightadder",
"Nuit-Sec Vampire Mark II-B/F": "vampiremk2",
"Nyoka": "wildships_nyoka",
"Oodles Hauler Anaconda": "anaconda",
"Oodles Security Sidewinder": "sidewinder",
"Ophidian Escort": "ophidian",
"Ophidian Passenger Transport": "ophidian",
"Ophidian Yacht": "ophidian",
"Ophidian": "ophidian",
"Orbital Shuttle": "orbital_shuttle",
"Orca Class Destroyer (Hijacked)": "aquatics_destroyer",
"Orca Class Destroyer": "aquatics_destroyer",
"Orca Worker's Commuter": "workcom",
"Orisis class Ferry": "orisis_ferry",
"Outrider Mark I": "outrider",
"Outrider Mark II": "outrider",
"Outrider Mark II-N": "outrider",
"Paddy Restaurant Junk": "worm",
"Peldorian Asp": "asp2",
"People's Police Ray": "sunray",
"Phantom Intimidator": "phantom_intimidator",
"Phantom": "phantom",
"Pi-42 Hauler Anaconda": "anaconda",
"Pi-42 Hauler Boa": "boa",
"Pi-42 Security Sidewinder": "sidewinder",
"Pilot Examiner": "asp2",
"Pirate Frigate": "picket_frigate",
"Pitviper (Bountyhunter)": "pitviper1",
"Pitviper (Buccaneer)": "pitviper1",
"Pitviper (Vindicator)": "pitviper1",
"Pitviper Mark II": "pitviper2",
"Pitviper S.E. Beast": "pitviper1",
"Pitviper": "pitviper1",
"Pitviper Coluberguard": "pitviper1",
"Pitviper MkII Coluberguard": "pitviper2",
"PitViper Guard": "pitviper1",
"Plasma Sentry Drone": "plasmadrone",
"Police Barracuda": "barracuda",
"PoliceCondor": "condor_police",
"PoliceKestrel": "kestrel",
"Poltergeist": "poltergeist",
"Poltergeist Defence Ship": "poltergeist_mil",
"Porcupine": "porcupine",
"Prinz Klasse Zerstoerer": "feudal_prince",
"Prinz-Class Zerstoerer (Aniseres)": "feudal_prince",
"Prinz-Class Zerstoerer (Ansois)": "feudal_prince",
"Prinz-Class Zerstoerer (Aronar)": "feudal_prince",
"Prinz-Class Zerstoerer (Arries)": "feudal_prince",
"Prinz-Class Zerstoerer (Atbiarxe)": "feudal_prince",
"Prinz-Class Zerstoerer (Atlaar)": "feudal_prince",
"Prinz-Class Zerstoerer (Bedierat)": "feudal_prince",
"Prinz-Class Zerstoerer (Biarandi)": "feudal_prince",
"Prinz-Class Zerstoerer (Ceorat)": "feudal_prince",
"Prinz-Class Zerstoerer (Dierlabe)": "feudal_prince",
"Prinz-Class Zerstoerer (Digebiti)": "feudal_prince",
"Prinz-Class Zerstoerer (Diqudi)": "feudal_prince",
"Prinz-Class Zerstoerer (Ededleen)": "feudal_prince",
"Prinz-Class Zerstoerer (Edzaon)": "feudal_prince",
"Prinz-Class Zerstoerer (Enbirare)": "feudal_prince",
"Prinz-Class Zerstoerer (Enlaonus)": "feudal_prince",
"Prinz-Class Zerstoerer (Erinain)": "feudal_prince",
"Prinz-Class Zerstoerer (Erlaened)": "feudal_prince",
"Prinz-Class Zerstoerer (Erxearis)": "feudal_prince",
"Prinz-Class Zerstoerer (Esceso)": "feudal_prince",
"Prinz-Class Zerstoerer (Esredice)": "feudal_prince",
"Prinz-Class Zerstoerer (Essoza)": "feudal_prince",
"Prinz-Class Zerstoerer (Geinona)": "feudal_prince",
"Prinz-Class Zerstoerer (Gelaed)": "feudal_prince",
"Prinz-Class Zerstoerer (Inrearbi)": "feudal_prince",
"Prinz-Class Zerstoerer (Israra)": "feudal_prince",
"Prinz-Class Zerstoerer (Issoinen)": "feudal_prince",
"Prinz-Class Zerstoerer (Mainon)": "feudal_prince",
"Prinz-Class Zerstoerer (Mazare)": "feudal_prince",
"Prinz-Class Zerstoerer (Oneded)": "feudal_prince",
"Prinz-Class Zerstoerer (Onente)": "feudal_prince",
"Prinz-Class Zerstoerer (Onertius)": "feudal_prince",
"Prinz-Class Zerstoerer (Onusorle)": "feudal_prince",
"Prinz-Class Zerstoerer (Oreseren)": "feudal_prince",
"Prinz-Class Zerstoerer (Orverace)": "feudal_prince",
"Prinz-Class Zerstoerer (Qurexein)": "feudal_prince",
"Prinz-Class Zerstoerer (Qutecete)": "feudal_prince",
"Prinz-Class Zerstoerer (Rabiarce)": "feudal_prince",
"Prinz-Class Zerstoerer (Reenus)": "feudal_prince",
"Prinz-Class Zerstoerer (Resoisbe)": "feudal_prince",
"Prinz-Class Zerstoerer (Ridivexe)": "feudal_prince",
"Prinz-Class Zerstoerer (Rileaa)": "feudal_prince",
"Prinz-Class Zerstoerer (Rizace)": "feudal_prince",
"Prinz-Class Zerstoerer (Sogeve)": "feudal_prince",
"Prinz-Class Zerstoerer (Teususdi)": "feudal_prince",
"Prinz-Class Zerstoerer (Tibecea)": "feudal_prince",
"Prinz-Class Zerstoerer (Tibedied)": "feudal_prince",
"Prinz-Class Zerstoerer (Tiuson)": "feudal_prince",
"Prinz-Class Zerstoerer (Usedge)": "feudal_prince",
"Prinz-Class Zerstoerer (Usteer)": "feudal_prince",
"Prinz-Class Zerstoerer (Zagearbe)": "feudal_prince",
"Prison Ship": "anaconda",
"Prisoner Transport DK-332": "sturgeon",
"Prollykanteraprillito": "chopped_cobra",
"PTSF 200-X3: Triad Bodyguard": "excalibur",
"Purple Haze": "purple_haze",
"Python Class Cruiser": "python_cruiser",
"Python Commander": "python",
"Python Courier": "python_courier",
"Python Cruiser: Escort Mother": "python_cruiser",
"Python ET Special": "python_et",
"Python Graveship": "python",
"Python X: Escort Mother": "python_et",
"Python": "python",
"Python HSG": "python",
"Python BattleCruiser": "python",
"Python: Escort Mother": "python",
"Qubeenian Rebel Fighter": "krait",
"Raider": "raider",
"Ramazan Government Redback": "redback",
"Ramazan Government Whitetail": "whitetail",
"Raptor": "raptor",
"Raptor Defense Interceptor": "raptor",
"Rattle Cutter": "rattlecutter",
"Reaper Dominatrix": "vampiremk3",
"Rebel : Aeron Class Frigate": "aeron",
"Rebel : Cobra III NjX": "cobra3njx",
"Recovered Thargoid Warship": "newbug1",
"\"Red Knights Squadron\" Viper": "viper",
"Red Racer": "racer_red",
"Red Racer (Bountyhunter)": "racer_red",
"Red Racer (Buccaneer)": "racer_red",
"Red Racer (Fist of Alecto)": "racer_red",
"Red Racer (Riredisec)": "racer_red",
"Renegade Barracuda": "barracuda",
"Renegade Daemon Class Cruiser": "daemon_cruiser",
"Renegade Mongoose": "mongoose",
"Renegade Phoenix": "phoenix",
"Renegade Scorpion Frigate": "scorpion",
"Renegade Venom": "venom",
"Renegade Viper": "viper",
"Repair Crew Transporter": "transporter",
"Repair Crew Transporter: Cat Nap": "transporter",
"Reserve Asp Mark II": "asp2",
"Reserve Cobra Mark I": "cobra1",
"Reserve Cobra Mark III": "cobra3",
"Revolutionary Guard": "viper",
"Revolutionary Lictor": "viper",
"Revolutionary Logistics": "freighter",
"Rigel Tactical Bomber": "rigel",
"Ritter-Class Jaeger (Aniseres)": "feudal_knight",
"Ritter-Class Jaeger (Ansois)": "feudal_knight",
"Ritter-Class Jaeger (Aronar)": "feudal_knight",
"Ritter-Class Jaeger (Arries)": "feudal_knight",
"Ritter-Class Jaeger (Atbiarxe)": "feudal_knight",
"Ritter-Class Jaeger (Atlaar)": "feudal_knight",
"Ritter-Class Jaeger (Bedierat)": "feudal_knight",
"Ritter-Class Jaeger (Biarandi)": "feudal_knight",
"Ritter-Class Jaeger (Ceorat)": "feudal_knight",
"Ritter-Class Jaeger (Dierlabe)": "feudal_knight",
"Ritter-Class Jaeger (Digebiti)": "feudal_knight",
"Ritter-Class Jaeger (Diqudi)": "feudal_knight",
"Ritter-Class Jaeger (Ededleen)": "feudal_knight",
"Ritter-Class Jaeger (Edzaon)": "feudal_knight",
"Ritter-Class Jaeger (Enbirare)": "feudal_knight",
"Ritter-Class Jaeger (Enlaonus)": "feudal_knight",
"Ritter-Class Jaeger (Erinain)": "feudal_knight",
"Ritter-Class Jaeger (Erlaened)": "feudal_knight",
"Ritter-Class Jaeger (Erxearis)": "feudal_knight",
"Ritter-Class Jaeger (Esceso)": "feudal_knight",
"Ritter-Class Jaeger (Esredice)": "feudal_knight",
"Ritter-Class Jaeger (Essoza)": "feudal_knight",
"Ritter-Class Jaeger (Geinona)": "feudal_knight",
"Ritter-Class Jaeger (Gelaed)": "feudal_knight",
"Ritter-Class Jaeger (Inrearbi)": "feudal_knight",
"Ritter-Class Jaeger (Israra)": "feudal_knight",
"Ritter-Class Jaeger (Issoinen)": "feudal_knight",
"Ritter-Class Jaeger (Mainon)": "feudal_knight",
"Ritter-Class Jaeger (Mazare)": "feudal_knight",
"Ritter-Class Jaeger (Oneded)": "feudal_knight",
"Ritter-Class Jaeger (Onente)": "feudal_knight",
"Ritter-Class Jaeger (Onertius)": "feudal_knight",
"Ritter-Class Jaeger (Onusorle)": "feudal_knight",
"Ritter-Class Jaeger (Oreseren)": "feudal_knight",
"Ritter-Class Jaeger (Orverace)": "feudal_knight",
"Ritter-Class Jaeger (Qurexein)": "feudal_knight",
"Ritter-Class Jaeger (Qutecete)": "feudal_knight",
"Ritter-Class Jaeger (Rabiarce)": "feudal_knight",
"Ritter-Class Jaeger (Reenus)": "feudal_knight",
"Ritter-Class Jaeger (Resoisbe)": "feudal_knight",
"Ritter-Class Jaeger (Ridivexe)": "feudal_knight",
"Ritter-Class Jaeger (Rileaa)": "feudal_knight",
"Ritter-Class Jaeger (Rizace)": "feudal_knight",
"Ritter-Class Jaeger (Sogeve)": "feudal_knight",
"Ritter-Class Jaeger (Teususdi)": "feudal_knight",
"Ritter-Class Jaeger (Tibecea)": "feudal_knight",
"Ritter-Class Jaeger (Tibedied)": "feudal_knight",
"Ritter-Class Jaeger (Tiuson)": "feudal_knight",
"Ritter-Class Jaeger (Usedge)": "feudal_knight",
"Ritter-Class Jaeger (Usteer)": "feudal_knight",
"Ritter-Class Jaeger (Zagearbe)": "feudal_knight",
"Ritter-Klasse Jaeger": "feudal_knight",
"RLF Fighter": "whitetail",
"RLF Leader": "redback",
"RLF Vessel": "huntsman",
"Rogue Escape Pod": "escape",
"Rogue Frigate": "picket_frigate",
"Rogue Interceptor": "interceptor",
"Rogue Viper Interceptor": "interceptor",
"Rogue Viper": "viper",
"RRS Aphid": "aphid",
"RRS Asp": "asp2",
"RRS Cobra Courier": "cobra3_courier",
"RRS Cobra Mk III": "cobra3",
"RRS Cobra Rapier": "cobra3_rapier",
"RRS Gecko": "gecko",
"RRS Iguana": "iguana",
"RRS Mamba": "mamba",
"RRS Salamander": "salamander",
"RRS Sidewinder": "sidewinder_escort",
"Rusty Military Stingray": "stingray",
"S.T.E": "ste",
"S8 Escort": "s8",
"S8 Sniper": "s8",
"S8": "s8",
"Sahana's pod": "escape",
"Sainsboory's Hauler Anaconda": "anaconda",
"Sainsboory's Security Sidewinder": "sidewinder",
"Saiph Interceptor": "saiph",
"Salamander": "salamander",
"Salvager Hognose": "hognose",
"Salvager Phoenix": "phoenix",
"Scavenger Phoenix": "phoenix",
"Scimitar": "scimitar",
"Scorpion Frigate": "scorpion",
"Scorpion Frigate: Eszausveian Navy": "scorpion",
"Scorpius Escort": "vampiremk1",
"Scorpius": "scorpius",
"Scow": "fa_scow_r",
"Scow SE": "fa_scow_se",
"Secretarybird": "secretarybird",
"Security Patrol": "barracuda",
"Separatist Krait": "krait",
"Separatist Mamba": "mamba",
"Serpent Class Cruiser": "serpent_cruiser",
"Shader mamba": "mamba",
"Shark Escort": "shark",
"Shark": "shark",
"Shrike 'La Bandido'": "shrike",
"Shrike": "shrike",
"Shuriken 'Yumi Shin'": "shuriken",
"Shuriken": "shuriken",
"Sidewinder": "sidewinder",
"Sidewinder Casino Security": "sidewinder",
"Sidewinder: Casino Security": "sidewinder",
"Sidewinder Escort": "sidewinder_escort",
"Sidewinder Graveship": "sidewinder",
"Sidewinder Liner Escort": "sidewinder_escort",
"Sidewinder Schoolship": "sidewinder_escort",
"Sidewinder Scout Ship": "***",
"Sidewinder Special": "sidewinder_special",
"Sidewinder-X": "sidewinder_x",
"Sidewinder Playfair Escort": "sidewinder_escort",
"Sidewinder: Playfair Escort": "sidewinder_escort",
"Sidewinder: Flowers 4 U": "sidewinder_escort",
"Flowers 4 You Escort": "sidewinder_escort",
"Simulator Fighter: Cobra Mk I": "cobra1",
"Simulator Fighter: Cobra Mk III": "cobra3",
"Simulator Fighter: Gecko": "gecko",
"Simulator Fighter: Iron Sidewinder": "sidewinder",
"Simulator Fighter: Krait": "krait",
"Simulator Fighter: Mamba": "mamba",
"Simulator Fighter: Python": "python",
"Simulator Fighter: Sidewinder Escort": "sidewinder_escort",
"Simulator Fighter: Sidewinder": "sidewinder",
"Skat": "skat",
"SKS Plasma Mark I": "sks_plasma1",
"Snark": "snark",
"Soin Clan Sister : Mega Mamba": "mamba",
"Solar Research Ship II": "constrictor",
"Solar Research Ship": "constrictor",
"Sonoran": "sonoran",
"Special Branch : Mega Asp Mark III": "asp2",
"Spy Courier": "spy_courier",
"SSG Gecko 'Dragon Class'": "gecko",
"SSG Outrider Mark II": "outrider",
"SSG Snark": "snark",
"Star Destroyer [reactor breach detected]": "stardestroyer",
"Star Destroyer": "stardestroyer",
"Star Hauler Anaconda": "anaconda",
"Star Security Sidewinder": "sidewinder",
"StarSeeker Personal Shuttle": "starseeker",
"Starseeker: Yuri Batkov": "starseeker",
"Yrui Batkov": "starseeker",
"Stealth (hunter-heavy)": "bellatrix",
"Stealth (raider-heavy)": "bellatrix",
"Stealth Barracuda (assassin)": "barracuda",
"Stealth Barracuda (courier)": "barracuda",
"Stealth Barracuda (hunter)": "barracuda",
"Stealth Barracuda (hunter-hard)": "barracuda",
"Stealth Barracuda (raider)": "barracuda",
"Stealth Barracuda (raider-hard)": "barracuda",
"Stealth Barracuda (Stolen)": "barracuda",
"Stealth Barracuda Escort": "barracuda",
"Stealth Bellatrix Cruiser": "bellatrix",
"Steel Shark": "shark",
"Stormbrewer Vigilante": "stormbrewer",
"Stormbrewer": "stormbrewer",
"Strelka Cruiseliner": "strelka",
"Sturgeon Commissar Limousine": "sturgeon",
"Commissar Limousine: Colonel Bodarenko": "sturgeon",
"Colonel Bodarenko": "sturgeon",
"Sunracer": "fa_sunracer",
"Sunracer Scout": "fa_sunracer",
"Sunray": "sunray",
"Super Bulk Hauler": "super_bulk_hauler",
"SuperCobra": "supercobra",
"Surface Research Shuttle": "orbital_shuttle",
"SwatCondor": "condor_swat",
"Swift": "swift",
"Tanker": "fa_tanker",
"Tanker SE": "fa_tanker_se",
"Tanker Trader": "fa_tanker",
"TAU Rockhopper": "taurockhopper",
"Taxi Cab": "adder",
"Team Minder : Nemesis": "nemesis1",
"TEC Apep Mk II": "apep2",
"Tembo": "tembo",
"Tepiu": "tepiu",
"Teretrurus": "purple_haze",
"Tescoo Hauler Anaconda": "anaconda",
"Tescoo Hauler Boa": "boa",
"Tescoo Security Sidewinder": "sidewinder",
"Thargint Robot Interceptor": "armada_interceptor",
"Thargoid Battleship": "thargbatship",
"Thargoid Courier": "thargoid_courier",
"Thargoid Cruiser": "thargcruiser",
"Thargoid Thorgon Cruiser": "thargoid_cruiser",
"Terroriser Frigate": "thargoid_terroriser",
"Thargoid Deathwreaker": "newbug1",
"Thargoid Defence Drone": "tharglet",
"Thargoid Guard Outpost": "bugbase",
"Thargoid Guardian": "thargoid_guard",
"Thargoid Hive": "thargoid_hive_1",
"Thargoid Hive Sub 5": "thargoid_hive_2",
"Thargoid Hive Sub 6": "thargoid_hive_2",
"Thargoid Interceptor": "armada_interceptor",
"Thargoid Intimidator": "ubertharg",
"Thargoid Invader": "galnav_thargoid",
"Thargoid Jumpgate": "jumpgate",
"Thargoid Mantis Dreadnaught": "mantis",
"Thargoid Pathfinder": "thargoid",
"Thargoid Robot Fighter": "tharglet",
"Thargoid Sneak Courier": "sneak",
"Thargoid Spy Station": "bugstation",
"Thargoid Thargorn Battleship": "thargoid_battleship",
"Thargoid Transport": "newbug1",
"Thargoid Warship": "thargoid",
"The Morrigan": "morrigan",
"Thought Police": "sunray",
"Thought Police Ray": "sunray",
"Thought Police: Captain Suslov": "sunray",
"Viper: Captain Suslov": "sunray",
"Captain Suslov": "sunray",
"TIE Fighter": "tiefighter",
"TIE Interceptor": "tieinterceptor",
"Titan": "fa_titan",
"Tourist Ship": "orbital_shuttle",
"Tourist Shuttle: The Veiled Mourner": "orbital_shuttle",
"Training Fighter": "krait",
"Transporter": "transporter",
"Transporter Test": "transporter",
"Triad : Gecko": "gecko",
"Triad : Military PTSF 200-X3": "excalibur",
"Triad : Military Wasp EX-01": "wasp",
"Trident Executive Shuttle": "trident",
"Unit 1 (Gecko)": "gecko",
"Unit 1 (Krait)": "krait",
"Unit 1 (Mamba)": "mamba",
"Unit 1 (Moray)": "moray",
"Unit 2 (Gecko)": "gecko",
"Unit 2 (Krait)": "krait",
"Unit 2 (Mamba)": "mamba",
"Unit 2 (Moray)": "moray",
"Unit 3 (Gecko)": "gecko",
"Unit 3 (Krait)": "krait",
"Unit 3 (Mamba)": "mamba",
"Unit 3 (Moray)": "moray",
"Unit 4 (Gecko)": "gecko",
"Unit 4 (Krait)": "krait",
"Unit 4 (Mamba)": "mamba",
"Unit 4 (Moray)": "moray",
"Unknown Structure": "thargoid_hive_1",
"Urutu Mk III": "urutumk3",
"Urutu MkIV": "urutumk4",
"Valrisian's Asp": "asp2",
"Valrisian Hunters": "asp2",
"Valrisian's Hunters": "asp2",
"Vampire Mark II Purgatori": "vampiremk2",
"Vampire Mk 1 Gold": "vampiremk1",
"Vampire Mk I Gold Edition": "vampiremk1",
"Vampire Mk I": "vampiremk1",
"Vampire Mk II": "vampiremk2",
"Vampire Mk VI ~ Damage, Inc.": "vampiremk6",
"Vampire Mk VI": "vampiremk6",
"Vampire MkII Purgatori": "vampiremk2",
"Vampire MkIII ~ Dominatrix (Civillian)": "vampiremk3",
"Vampire MkIII ~ Dominatrix": "vampiremk3",
"Vampire MkIII ~ Purgatori (Civillian)": "vampiremk3",
"Vampire MkIII ~ Purgatori": "vampiremk3",
"Vampire MkIV Purgatori": "vampiremk4",
"Vampire MkIV": "vampiremk4",
"Vampire MkV ~ Spectre": "vampiremk5",
"Vampire Purgatori": "vampiremk2",
"Veloce e Appuntita S": "veloceeappuntita",
"Veloce e Appuntita": "veloceeappuntita",
"Venom ~ Pirate": "venom",
"Venom": "venom",
"Vintage Adder": "vintageadder",
"Vintage Adder: The Sitting Duck": "vintageadder",
"Viper Escort": "viper",
"Viper SG": "viper",
"Viper Raider": "viper_raider",
"Viper: Bribed Cop": "viper",
"Vortex": "vortex",
"Warship Replica": "newbug1",
"Wasp EX-01: Triad Enforcer": "wasp",
"Wasp EX-01: Triad Hitman": "wasp",
"Wasp EX-01: Triad Liquidator": "wasp",
"Werewolf (Civilian)": "werewolf",
"Werewolf (Purgatori Model)": "werewolf",
"Werewolf ~ Damage Inc.": "werewolf",
"Werewolf": "werewolf",
"Whiskey Runner": "asp2",
"Wiseguy Sidewinder": "sidewinder",
"Witness": "ste",
"Wolf Mark I": "wolf1",
"Wolf Mk I": "neo_wolfmk1",
"Wolf Mark II (Taranis Corp)": "wolf2",
"Wolf Mark II": "wolf2",
"Wolf Mark II Paragon": "wolf2",
"Wolf MkI Escort": "wolf1",
"Wolf MkI Sniper": "wolf1",
"Workers' Commuter": "workcom",
"Worm Attack Drone": "worm",
"Worm": "worm",
"Wyrm": "wyrm",
"Wyvern Explorer I": "wyvern",
"Wyvern Explorer II-M": "wyvern",
"Wyvern Explorer II-P": "wyvern",
"Xeptatl Society Agent": "chopped_cobra",
"Yasen-N 'Advanced' variant 1": "yasen",
"Yasen-N 'Advanced' variant 2": "yasen",
"Yasen-N 'Advanced' variant 3": "yasen",
"Yasen-N 'Advanced'": "yasen",
"Yasen-N": "yasen",
"YellOo Cab": "moray",
"Yellowbelly Racer": "racer_yellow",
"Yellowbelly Racer (Bountyhunter)": "racer_yellow",
"Yellowbelly Racer (Buccaneer)": "racer_yellow",
"Yellowbelly Racer (Fist of Alecto)": "racer_yellow",
"Yellowbelly Racer (Riredisec)": "racer_yellow",
"Zabe Resistance Krait": "krait",
"Zabe Resistance Mamba": "mamba",
"Zorra": "cobra3",
//other targets
"a BHG member in a spacesuit": "pilot",
"a crew member in a spacesuit": "pilot",
"a police officer in a spacesuit": "pilot",
"a SSG member in a spacesuit": "pilot",
"Academy Waymarker Buoy": "buoy",
"AIS escape pod": "wyvern_escape_pod",
"Alien cargo": "alien_cargo",
"Alien Class Jump Gate": "jumpgate",
"Alloys": "alloy",
"All units": "qbomb",
"Anti-missile dart": "ams_dart",
"Anti-Thargoid Drone": "antithargoid_drone",
"Anti-Thargoid Missile": "rmb_thargoid_missile",
"Anti-Thargoid Warhead": "rmb_warhead",
"ASM-12B ~ Jida Missile": "jida_missile",
"Asteroid": "asteroid",
"Asteroid (Target 1)": "asteroid",
"Asteroid (Target 2)": "asteroid",
"Asteroid (Target 3)": "asteroid",
"Asteroid (Target 4)": "asteroid",
"Asteroid Billboard": "billboard",
"Attack Drone": "liners_drone",
"Autoskimmer": "qbomb",
"autoskimmer": "qbomb",
"Black Box": "black_box",
"Thargoid Blitznest": "blitznest",
"Bomb": "stunbomb",
"Bomb 20": "cargo",
"Boulder": "boulder",
"Cargo container": "cargo",
"Cargo Container": "cargo",
"Cargo Shepherd": "magnet",
"Cascade Missile": "rmb_cascade_missile",
"Chaff Launcher": "rmb_mine_launcher",
"COM Satellite": "rssatellite_3",
"COM-Satellite": "rssatellite_3",
"Combat Drone": "antithargoid_drone",
"COMLR Satellite": "rssatellite_2",
"COMLR-Satellite": "rssatellite_2",
"Commissar Escape Pod": "escape",
"Commissar Escape Capsule": "comlimesc",
"Communications Station": "commstation",
"Communications Station: GSS Daring": "commstation",
"Convict Miner Minnow": "escapee1",
"Convict Miner Minnow (Escaping)": "escapee1",
"Cutpurse Missile": "missile",
"Debris": "alloy",
"Decoy Mine": "cargo",
"Defence Missile Launcher": "rmb_mine_launcher",
"Defence Missile": "rmb_warhead",
"Detention Container": "cargo",
"Displacer Missile": "ecm_missile",
"Disruptor Missile": "rmb_thargoid_missile",
"Distress Beacon Launcher": "rmb_mine_launcher",
"Docking Course Buoy": "academy_marker_buoy",
"Docking Drone": "***",
"ECM Hardened Missile": "ecm_missile",
"Ejected Pilot": "pilot",
"EMP Mine": "rmb_mine_launcher",
"Engage": "qbomb",
"Escape Capsule": "escape",
"Escape capsule": "escape",
"escape capsule": "escape",
"Escape Capsule: Asp Pilot": "escape",
"Escape Capsule: Greer": "escape",
"Escape Capsule: Konstantin Katik": "escape",
"Escape Capsule: Sahana": "escape",
"escape pod": "escape",
"Escape Pod": "escape",
"Escaped Convict": "escapee1",
"ESW Beacon Launcher": "rmb_mine_launcher",
"Explosive Shrapnel": "alloy",
"Female Star-Jelly": "starjelly1",
"Field Missile": "missile",
"Fragment": "fragment",
"Fragmentation Bomb": "rmb_mine_launcher",
"Fragmentation Missile": "rmb_frag_missile",
"Fuel cannister": "fuelpod2",
"Fuel Satellite": "fuel_satellite",
"Fuel Station": "fuel_station",
"GalDrivePod": "qbomb",
"GalMine AutoMiner": "autominer",
"GalMine Hopper": "mining_hopper",
"GalTech escape capsule GT-EC-01": "galtech_escape1",
"GalTech escape pod GIC-E1": "galtech_escape1",
"GalTech Escape Pod GIC-E1": "galtech_escape1",
"GalTech escape pod GIC-E2": "galtech_escape2",
"Giant Space Pizza": "pizza",
"Gold": "commodity_fragment",
"Grave Monument (Infinity)": "tgy_infinity",
"Grave Monument (Latin Crucifix)": "tgy_cross1",
"Grave Monument (Mark of Chaos)": "tgy_chaos",
"Grave Monument (Mjolnir)": "tgy_mjolnir",
"Grave Monument (Moai)": "tgy_moai",
"Grave Monument (Pentagram)": "tgy_pentagon",
"Grave Monument (Pointed Crucifix)": "tgy_cross2",
"Grave Monument (Star of David)": "tgy_david",
"Grave Monument (Wooden Crucifix)": "tgy_latincross",
"Graveyard Monument": "tgy_octagon",
"Graveyard Stone": "tgy_rip",
"Graviton Missile": "ecm_missile",
"Griff Outpost Buoy": "griff_buoy",
"Ground Radar": "slave_satellite",
"Hold": "qbomb",
"Homing Mine (Inactive)": "stealth_mine",
"Hyperspace check": "qbomb",
"Hyperspace Jumpgate": "jumpgate2",
"Ice Boulder": "iceboulder",
"Iceteroid": "iceteroid",
"Informational Beacon": "constore_beacon",
"Intercept Missile": "rmb_warhead",
"Interdictor Mine": "interdictor_mine",
"Ironfist Memorial": "memorial_ironfist",
"Jump Gate (Captured Alien)": "jumpgate",
"Jump Gate (Rose variant)": "gate_rose",
"Jump Gate (Sun)": "gate_spider",
"Jump Gate (Spider variant)": "gate_spider",
"Kamikaze Drone": "kamikaze_drone",
"Kicker Missile": "missile",
"King Cobra Escape Capsule": "kc2escape",
"Korshkov Test Facility Buoy": "constore_beacon",
"Lawmaker Missile": "rmb_law_missile",
"Lifeboat": "escape",
"Male Star-Jelly": "starjelly2",
"Manchi missile": "fa_manchi_missile",
"Metal Fragment": "alloy",
"Metal fragment": "alloy",
"Mine": "rmb_mine",
"Minerals": "commodity_fragment",
"Mine Sweeper Satellite": "blackmonk_minesweeper",
"Mini-missile": "missile",
"Mining Pod: Astromine Convict": "escapee1",
"Mining Pod: Escaped Convict": "escapee1",
"Missile": "missile",
"MM Hardened Missile": "ecm_missile",
"MM Standard Missile": "missile",
"Mobile Mine Sweeper Satellite": "blackmonk_minesweeper",
"Naval Marker Beacon": "buoy",
"Navy Cluster-Bomb": "clusterbomb",
"Navy SecCom Buoy": "buoy",
"Nova missile": "fa_nova_missile",
"Ore": "commodity_fragment",
"Override Missile": "rmb_override_missile",
"Pilot Circuit Buoy 1": "academy_marker_buoy",
"Pilot Circuit Buoy 2": "academy_marker_buoy",
"Pilot Circuit Buoy 3": "academy_marker_buoy",
"Pilot Circuit Buoy 4": "academy_marker_buoy",
"Pilot Circuit Buoy 5": "academy_marker_buoy",
"Pilot Circuit Buoy 6": "academy_marker_buoy",
"Pilot Circuit Buoy 7": "academy_marker_buoy",
"Pilot Course Buoy": "academy_marker_buoy",
"Plasma torpedo": "fa_plasma_torpedo",
"Platinum": "commodity_fragment",
"Probe Missile": "missile",
"Proximity Mine": "buoy",
"Quirium Cascade Mine": "qbomb",
"Quirium Crystal": "commodity_fragment",
"Radio Bomb": "qbomb",
"Radioactives": "commodity_fragment",
"Raptor's Claw Mine": "stunbomb",
"Regroup": "qbomb",
"Remote Detonation Mine": "rmb_mine",
"Remote Launcher": "rmb_mine_launcher",
"Reprogrammed Fighter": "ct_thargon",
"Research Station Buoy": "buoy",
"Robot Fighter": "tharglet",
"Rose Class Jump Gate": "gate_rose",
"Satellite Telescope": "rssatellite_4",
"Screamer Mine": "interdictor_mine",
"Secure Container": "gempod2",
"Sentinel Asteroid": "sentinel_asteroid",
"Sentinel Satellite": "blackmonk_minesweeper",
"SM-1 missile": "fa_sm1_missile",
"Solar Radiation Disrupter Missile": "ecm_missile",
"Space Suit (Crew Member)": "pilot",
"Space Suit (Police Officer)": "pilot",
"Space Suit (SSG Member)": "pilot",
"Special Functions": "qbomb",
"Spider Class Jump Gate": "gate_spider",
"Splinter": "splinter",
"Star-Jelly egg": "starjellyegg",
"Star-Jelly larva": "starjellylarva",
"Station Killer Missile": "ecm_missile",
"Stealth Spy Satellite": "blackmonk_minesweeper",
"Stellar Serpent": "serpent",
"SunSkimmerPodMissile": "probe_missile",
"Surveillance Satellite": "rssatellite_1",
"Surveillance-Satellite": "rssatellite_1",
"Svengali Memorial": "memorial_ironfist",
"Swarm Group": "swarm",
"Sweep": "qbomb",
"Sword Drive Unit": "sword_drive",
"Target Drone": "***",
"Target Practice Course Buoy": "academy_marker_buoy",
"Thargon Jamming Mine": "stunbomb",
"Thargoid Computer": "stealth_artefact",
"Thargoid Controller": "thargoid_controller",
"Thargoid Projectile": "aquatics_guardian",
"Thargoid Spy Satellite": "blackmonk_minesweeper",
"Thargoid Witchspace Jammer": "witchspace_jammer",
"Time Bonus Ring": "academy_pilot_ring",
"Tomb Casket": "tgy_mausoleum",
"Tomb casket": "tgy_mausoleum",
"Tracker Missile": "missile",
"Training Asteroid": "asteroid",
"Transmitter": "cotbs_transmitter",
"Trident Missile": "trident_missile",
"Trigonal Container": "gempod2",
"Undo": "qbomb",
"Unit 1": "qbomb",
"Unit 2": "qbomb",
"Unit 3": "qbomb",
"Unit 4": "qbomb",
"Unit 5": "qbomb",
"Unknow Item": "stealth_artefact",
"Unknown Item": "stealth_artefact", // in case the previous item gets its spelling fixed
"Unusual cargo container": "cargo",
"UPS container": "cargo",
"Void Bomb": "void_bomb",
"Vault Container": "cargo",
"Xeptatl's Sword": "sword_missile",
"Xeptatl's Sword Warhead": "sword_warhead",
//navi
"Broadcast Array Navbouy": "broadcast_array_beacon",
"Communications relay": "buoy",
"Constore Buoy": "constore_beacon",
"Distress Beacon": "buoy",
"ESW Beacon": "buoy",
"GalCop Navy Buoy": "buoy",
"Graveyard Beacon": "tgy_beacon",
"Navigation Buoy": "buoy",
"Rock Hermit Buoy": "buoy",
"Solar Navigation Buoy": "buoy",
"Taxi Station Buoy": "constore_beacon",
"Tournament Buoy": "buoy",
"Training Buoy": "buoy",
"Witchpoint Beacon": "buoy",
//dockable
"A Seedy Space Bar": "spacebar",
"Abandoned Rock Hermit": "rockhermit",
"Abandoned Rock Hermit: GAL-ID Unit Offline": "rockhermit",
"Abandoned Rock Hermit: No Transponder": "rockhermit",
"Academy Orbital Station": "laveacademy",
"Aquarian Shipbuilding Corp. HQ": "aquatics_hq",
"Astrofactory": "astrofactory",
"AstroFactory": "astrofactory",
"Astrofarm": "astrofarm",
"AstroFarm": "astrofarm",
"Astromine Penal Colony": "astromine",
"Astromine Prison Facility": "astromine",
"Aurora Galaxy Liner": "aurora",
"Avernus Orbital": "avernus",
"Axtech Dodecahedron": "dodo_alt",
"Axtech Dodecahedron Station": "dodo_alt",
"Dodecahedron Station (Axtech Variant)": "dodo_alt",
"Behemoth (Hijacked)": "behemoth_1",
"Behemoth - Hera": "behemoth_4",
"Behemoth - Nellie": "behemoth_2",
"Behemoth Type 1": "behemoth_1",
"Behemoth 2": "behemoth_2",
"Behemoth Type 2": "behemoth_2",
"Behemoth Type 3": "behemoth_3",
"Behemoth Type 4": "behemoth_4",
"Black Monk Monastery": "blackmonk_monastery",
"Broadcast Array": "broadcast_array",
"Capt Kev Dodecahedron Station": "dodo_alt",
"CK-A1 Dodecahedron": "dodo_alt",
"CK-I1 Dodecahedron": "dodo_alt",
"CoachWhip hOopy Casino": "hoopy_casino",
"Collective SLAPU": "slapu",
"Collective ZGF": "comfactory",
"Collective Zero-G Factory": "comfactory",
"Constellation Icosahedron Station": "ico_alt",
"Icosahedron Station (Constelation Variant)": "ico_alt",
"Coriolis Station": "***",
"Cruise Ship 'Patricia'": "smivs_liner",
"Cruise Ship 'Ronald'": "smivs_liner",
"Darkside Distillery": "distillery",
"Darkside Moonshine Distillery": "distillery",
"Darkside Moonshine Saloon": "saloon",
"Deep Space Dredger": "dredger",
"Dodecahedron Station": "***",
"Dodecahedron Station: Port Liberty": "dodo",
"Dodechedron Station": "dodo",
"Draven Oodulldoff Station": "draven_station",
"Dredger Salvage Droid": "salvagedroid",
"Dredger Shuttle": "dredgershuttle",
"Dredger Trader": "dredgertrader",
"DS-A1 Coriolis": "deepspace_coriolis",
"DS-A1 Coriolis Station": "deepspace_coriolis",
"DS-A1 Dodecahedron": "deepspace_dodo",
"DS-A1 Dodecahedron Station": "deepspace_dodo",
"DS-A1 Icosahedron": "deepspace_ico",
"DS-A1 Icosahedron Station": "deepspace_ico",
"Emerald Class Liner": "emerald",
"Enrece Research Station": "damaged_coriolis",
"Erehwon Station": "erehwon_station",
"Factory": "comfactory",
"Free Trade Zone": "rockhermit",
"Freedom of Zabe": "behemoth_1",
"FrontierTech Worldranger Icosahedron Station": "ico_alt",
"Frontierworldsranger1 Station (Frontierworldsranger1 Variant)": "ico_alt",
"Fury": "fury_ds",
"G-X1 Coriolis": "coriolis_alt",
"G-X1 Coriolis Station": "coriolis_alt",
"G-X1 Icosahedron": "ico_alt",
"G-X1 Icosahedron Station": "ico_alt",
"G-Z1 Dodecahedron": "dodo_alt2",
"G-Z1 Dodecahedron Station": "dodo_alt2",
"G-Z1 Icosahedron": "ico_alt",
"G-Z1 Icosahedron Station": "ico_alt",
"G-Z1 Octahedron": "octahedron2",
"G-Z1 Octahedron Outpost": "octahedron2",
"G-Z1 Tetrahedron": "tetrahedron2",
"G-Z1 Tetrahedron Depot": "tetrahedron2",
"G-Z2 Octahedron": "octahedron",
"G-Z2 Octahedron Outpost": "octahedron",
"G-Z2 Tetrahedron": "tetrahedron",
"G-Z2 Tetrahedron Depot": "tetrahedron",
"GalaxyMart Con Store": "constore",
"GASE Dodecahedron": "dodo_alt",
"GASECBlue Dodecahedron Station": "dodo_alt",
"Dodecahedron Station (GASECBlue Variant)": "dodo_alt",
"Gateway Station": "gateway",
"Generation Ship": "generationship",
"Globe Station II": "globe_station",
"Globe Station III": "globe_station_xl",
"Greenline Coriolis": "coriolis_alt",
"Greenline Coriolis Station": "coriolis_alt",
"Coriolis Station (Greenline Variant)": "coriolis_alt",
"Griff Icosahedron Station": "ico_alt",
"Griff Research Orbital Base": "dodo",
"Griff Research Ltd Orbital Base": "dodo",
"GRS Buoy Factory": "grs_station",
"Habitat Mark II": "hab_mk2",
"Hacker Outpost": "hacker_outpost",
"Hathor Station": "hathor",
"Hesperides Wiseguy Way-Station": "dodo",
"HoOpy Casino": "hoopy_casino",
"Hoopy Hotel: Hospitality of Hades": "dodo",
"Deep Space Hoopy Hotel : Hades Branch": "dodo",
"Hoopy Hotel: Light of Lernean": "dodo",
"Deep Space Hoopy Hotel : Lernean Branch": "dodo",
"Icosahedron Station": "***",
"Imperial AstroFactory": "astrofactory",
"Revolutionary AstroFarm": "astrofarm",
"Imperial Dodecahedron Station": "dodo_alt",
"Imperial Navy Base": "wildships_2spur2comms",
"Imperial Navy Carrier (Komodo Class)": "komodo",
"Imperial Navy Class Carrier": "navy_carrier",
"Imperial Navy Headquarters": "wildships_4comms4ring",
"Imperial Navy Outpost": "wildships_2disc2comms",
"Imperial Navy Research Station": "wildships_2solar2comms",
"Ionics CR150 Weapons Platform": "ionics_wplatform",
"Isis Interstellar": "isis_interstellar",
"ISS Imperator": "imperator",
"Jaguar Company Base": "jaguar_company",
"Katik Asteroid": "rockhermit",
"KHS-2R Orbiter": "wildships_2ring",
"KHS-4R Orbiter": "wildships_4ring",
"KHS-8R Orbiter": "wildships_8ring",
"Kiota Biosphere": "wildships_4sphere",
"Kiota Biosphere Station": "wildships_4sphere",
"Kiota Habitat": "***",
"Kiota Habitat Station": "***",
"Kiota Manufacturing": "wildships_2disc",
"Kiota Manufacturing Station": "wildships_2disc",
"Kiota Mega Habitat": "wildships_8ring",
"Kiota Mega Habitat Station": "wildships_8ring",
"Kiota Relay": "wildships_2comms",
"Kiota Relay Station": "wildships_2comms",
"Kiota Research": "wildships_4spur",
"Kiota Research Station": "wildships_4spur",
"Kiota Solar": "wildships_2solar",
"Kiota Solar Station": "wildships_2solar",
"Korshkov Test Facility": "ico",
"KOS-M Orbiter": "wildships_2spur2solar",
"KOS-P Orbiter": "wildships_2disc2solar",
"KOS-RJ Orbiter": "wildships_4spur",
"KOS-RM Orbiter": "wildships_2spur2sphere",
"KOS-RS Orbiter": "wildships_2spur2sphere",
"KOS-RT Orbiter": "wildships_2spur2sphere",
"Leesti High": "dodo",
"Leviathan System Platform (Hijacked)": "aquatics_platform",
"Leviathan System Platform": "aquatics_platform",
"Liberty Station": "dodo",
"LX5 Dodecahedron": "dodo_alt",
"LX5 Dodecahedron Station": "dodo_alt",
"Dodecahedron Station (lx5)": "dodo_alt",
"M-G2 Globe": "globe_station",
"M-G2 Globe Station": "globe_station",
"M-G3 Globe": "globe_station_xl",
"M-G3 Globe Station": "globe_station_xl",
"M-T1 Torus": "tori_a",
"M-T1 Torus Station": "tori_a",
"M-T2 Torus": "tori_b",
"M-T2 Torus Station": "tori_b",
"Mall-Wart Con Store": "constore",
"Mayan Dodecahedron": "dodo_alt",
"Mayan Dodecahedron Station": "dodo_alt",
"Metaforce Coriolis": "coriolis_alt",
"Metaforce Coriolis Station": "coriolis_alt",
"Coriolis Station (Metaforce Variant)": "coriolis_alt",
"Military Base: Red Devil": "milbase",
"Mining Facility: The Odd Job": "rockhermit",
"Mining Outpost": "miningoutpost",
"Moonshine Saloon": "saloon",
"N-A1 Coriolis": "deepspace_coriolis",
"N-A1 Coriolis Station": "deepspace_coriolis",
"N-X1 Dodecahedron": "dodo_alt",
"N-X1 Dodecahedron Station": "dodo_alt",
"Navy Base": "coyote_navy_station",
"Navy Class Carrier": "navy_carrier",
"Navy Intelligence Station": "deepspace_coriolis",
"Navy SecCom Station": "navystation",
"Nemeanian Military Base": "milbase",
"Nephthys Station": "nephthys",
"Nuit Station": "nuit",
"Octahedron Outpost": "octahedron",
"Oodles Con Store": "constore",
"Orisis class hospital": "hospitalship",
"PG-C1 Icosahedron": "ico_alt",
"PG-W1 Icosahedron": "ico_alt",
"PG-W2 Icosahedron": "ico_alt",
"Worldbuilders Icosahedron Station": "ico_alt",
"Icosahedron Station (Worldbuildersx1l Variant)": "ico_alt",
"Pi-42 Con Store": "constore",
"Pirate Base": "rockhermit",
"Pirate Rock": "rockhermit",
"Raceedat Station": "coriolis_alt2",
"Raceedat Penal Colony": "astromine",
"RaTech Coriolis": "coriolis_alt",
"RaTech Gold Coriolis Station": "coriolis_alt",
"Coriolis Station (TechGold Variant)": "coriolis_alt",
"Rebel Outpost": "ionics_link_base",
"Rebel Outpost: New Hope": "ionics_link_base",
"RedTec Coriolis": "coriolis_alt",
"RedTec Coriolis Station": "coriolis_alt",
"Coriolis Station (Redtec Variant)": "coriolis_alt",
"Refuelling Station": "fuel_station",
"Renegade Station": "sentinel",
"Ribilebi Research Station": "ico_alt",
"Rock Hermit": "***",
"Rock Hermit: The La Bruja Facility": "rockhermit",
"Royal Hunting Lodge": "hunting_lodge",
"RRS Headquarters": "rrs_headquarters",
"RRS Waystation": "rescue_station",
"S-A1 Coriolis": "smivs_coriolis",
"S-A1 Coriolis Station": "smivs_coriolis",
"S-A1 Dodecahedron": "deepspace_dodo",
"S-A1 Dodecahedron Station": "deepspace_dodo",
"S-A1 Icosahedron": "deepspace_ico",
"S-A1 Icosahedron Station": "deepspace_ico",
"Sabre": "sabre",
"Saga Class Cruise Ship": "smivs_liner",
"Sainsboory's Con Store": "constore",
"Salvage Gang": "salvage_gang",
"Sentinel Station": "sentinel",
"SIRF Station": "sirf",
"System Independent Repair Facility": "sirf",
"Slaver Base": "rockhermit",
"Sodalite Station": "sodalite",
"Sodalite Coluber Inc": "sodalite",
"Sodalite Station Coluber Inc.": "sodalite",
"Solar Research Laboratory": "slapu",
"SolarTec Coriolis": "coriolis_alt",
"SolarTec Coriolis Station": "coriolis_alt",
"Coriolis Station (Solartec Variant)": "coriolis_alt",
"Sothis Station": "sothis",
"Space Pizza Giftshop": "gsp_giftshop",
"Space Pizza Visitor Centre and Giftshop": "gsp_giftshop",
"Special Branch Orbital Headquaters": "milbase",
"Special Branch Orbital Headquarters": "milbase",
"Star Con Store": "constore",
"Sun Research Station Alpha": "wildships_2solar",
"Sun Research Station Beta": "coriolis",
"Sun Research Station Delta": "coriolis",
"Sun Research Station Omega": "wildships_2solar",
"Super Dredger": "superdredger",
"Super Hub I": "superhub",
"Super Hub II": "superhub",
"Super Hub III": "superhub",
"Super Hub IV": "superhub",
"Super Hub": "superhub",
"Superhub": "superhub",
"Taranis Corporation HQ": "taranis",
"Taxi Station": "taxi_station",
"Tescoo Con Store": "constore",
"Tetier Military Station": "ico_alt",
"Tetrahedron Depot": "tetrahedron",
"The Augeaian Orbital Repair Facility": "dodo",
"Augeaian Orbital Repair Facility": "dodo",
"The Link Base": "ionics_link_base",
"Tigershark": "tigershark",
"Tionisla Orbital Graveyard": "dodo_alt",
"Torus Station": "tori_a",
"Tourist Information Centre": "gsp_giftshop",
"Trade Outpost": "trade_outpost",
"Training Station": "coriolis",
"Transit Station": "transit_station",
"Trontech Dodecahedron": "dodo_alt",
"Trontech Vulcan Dodecahedron Station": "dodo_alt",
"Dodecahedron Station (Trontechvulcan Variant)": "dodo_alt",
"Waspline Coriolis": "coriolis_alt",
"Waspline Coriolis Station": "coriolis_alt",
"Coriolis Station (Waspline Variant)": "coriolis_alt",
"Wiseguy Waystation: Hesperides Central": "dodo",
"Wrecked Station": "coriolis_wreck",
"Xeptatl Society Headquarters": "xs_headquarters",
"Xeptatl Society Monitor Station": "ionics_link_base",
"Xeptatl Society Research Station": "dumbell_station",
"ZRV Biarra": "behemoth_2",
"ZRV Ceused": "behemoth_2",
"ZRV Esbeena": "behemoth_2",
"ZRV Inriisus": "behemoth_2",
"ZRV Solaerin": "behemoth_2",
};
this._disambiguation = {
"coriolis-station": "coriolis",
"griff_coriolis_mainhull": "coriolis",
"sfep_noshaders_coriolis": "coriolis",
"alt-coriolis_station": "coriolis_alt",
"noshaders_L_Station": "coriolis_alt",
"deepspace_coriolis-station": "deepspace_coriolis",
"grittycoriolis-station": "deepspace_coriolis",
"grittycoriolis-station2": "deepspace_coriolis",
"adck_coriolis-station": "deepspace_coriolis",
"dodecahedron-station": "dodo",
"griff_dodo_mainhull": "dodo",
"sfep_noshaders_dodecahedron": "dodo",
"alt-dodo_station": "dodo_alt",
"noshaders_XL_Station": "dodo_alt",
"capt_kev_dodo_plain": "dodo_alt",
"capt_kev_dodo_mayan": "dodo_alt",
"capt_kev_dodo_imperial": "dodo_alt",
"deepspace_dodecahedron-station": "deepspace_dodo",
"adck_dodecahedron-station": "deepspace_dodo",
"icosahedron-station": "ico",
"griff_ico_mainhull": "ico",
"sfep_noshaders_icosahedron": "ico",
"noshaders_icosahedron_alt": "ico",
"noshaders_XXL_Station": "ico_alt",
"alt-ico_station": "ico_alt",
"deepspace_icosahedron-station": "deepspace_ico",
"adck_icosahedron-station": "deepspace_ico",
"feudal-boa": "boa",
"feudal-boa2": "boa_cruiser",
"feudal-moray": "moray",
"feudal-python": "python",
"feudal-anaconda": "anaconda",
"feudal-adder": "adder",
"stingray": "stingray",
"commilray-player": "com_stingray",
"commilray": "com_stingray",
"anarchies-bountyhunter-asp": "asp2",
"anarchies-bountyhunter-cobra3": "cobra3",
"anarchies-bountyhunter-fdl": "ferdelance",
"sidewinder": "sidewinder",
"ftzescort2": "sidewinder",
"ftzpirate12": "sidewinder",
"random_hits_big_boss_fighter_sidewinder": "sidewinder",
"random_hits_mark_revenge_wing6": "sidewinder",
"random_hits_mark_sidewinder": "sidewinder",
"random_hits_markguard6": "sidewinder",
"phkb_sidewinder_1": "sidewinder",
"phkb_sidewinder_2": "sidewinder",
"phkb_sidewinder_3": "sidewinder",
"phkb_sidewinder_4": "sidewinder",
"phkb_sidewinder_5": "sidewinder",
"phkb_sidewinder_6": "sidewinder",
"phkb_sidewinder_7": "sidewinder",
"phkb_sidewinder_8": "sidewinder",
"phkb_sidewinder_9": "sidewinder",
"phkb_sidewinder_10": "sidewinder",
"phkb_sidewinder_11": "sidewinder",
"phkb_sidewinder_12": "sidewinder",
"phkb_sidewinder_13": "sidewinder",
"phkb_sidewinder_14": "sidewinder",
"phkb_sidewinder_15": "sidewinder",
"phkb_sidewinder_16": "sidewinder",
"phkb_sidewinder_17": "sidewinder",
"phkb_sidewinder_18": "sidewinder",
"phkb_sidewinder_19": "sidewinder",
"phkb_sidewinder_20": "sidewinder",
"phkb_sidewinder_21": "sidewinder",
"phkb_sidewinder_22": "sidewinder",
"phkb_sidewinder_23": "sidewinder",
"phkb_sidewinder_24": "sidewinder",
"phkb_sidewinder_25": "sidewinder",
"phkb_sidewinder_26": "sidewinder",
"phkb_sidewinder_27": "sidewinder",
"phkb_sidewinder_28": "sidewinder",
"phkb_sidewinder_29": "sidewinder",
"phkb_sidewinder_30": "sidewinder",
"phkb_sidewinder_31": "sidewinder",
"phkb_sidewinder_32": "sidewinder",
"phkb_sidewinder_33": "sidewinder",
"phkb_sidewinder_34": "sidewinder",
"phkb_sidewinder_35": "sidewinder",
"phkb_sidewinder_36": "sidewinder",
"phkb_sidewinder_37": "sidewinder",
"phkb_sidewinder_38": "sidewinder",
"phkb_sidewinder_39": "sidewinder",
"phkb_sidewinder_40": "sidewinder",
"phkb_sidewinder_41": "sidewinder",
"phkb_sidewinder_42": "sidewinder",
"phkb_sidewinder_43": "sidewinder",
"phkb_sidewinder_44": "sidewinder",
"phkb_sidewinder_45": "sidewinder",
"rsvh_sidewinder": "sidewinder",
"sidewinder_npc_able": "sidewinder",
"sidewinder_npc_baker": "sidewinder",
"sidewinder_npc_charlie": "sidewinder",
"sidewinder_npc_doris": "sidewinder",
"sidewinder_npc_emile": "sidewinder",
"sidewinder_npc_farragut": "sidewinder",
"sidewinder_npc_ganymede": "sidewinder",
"noshaders_z_groovy_sidewinder-NPC_able": "sidewinder",
"noshaders_z_groovy_sidewinder-NPC_baker": "sidewinder",
"noshaders_z_groovy_sidewinder-NPC_charlie": "sidewinder",
"noshaders_z_groovy_sidewinder-NPC_doris": "sidewinder",
"noshaders_z_groovy_sidewinder-NPC_emile": "sidewinder",
"noshaders_z_groovy_sidewinder-NPC_farragut": "sidewinder",
"noshaders_z_groovy_sidewinder-NPC_ganymede": "sidewinder",
"sidewinder-re2dux": "sidewinder_x",
"sidewinder-escort-re2dux": "sidewinder_x",
"sidewinder-escort": "sidewinder_escort",
"rrs_sidewinder": "sidewinder_escort",
"liners_sidewinder_x": "sidewinder_escort",
"phkb_sidewinder_escort_1": "sidewinder_escort",
"phkb_sidewinder_escort_2": "sidewinder_escort",
"phkb_sidewinder_escort_3": "sidewinder_escort",
"phkb_sidewinder_escort_4": "sidewinder_escort",
"phkb_sidewinder_escort_5": "sidewinder_escort",
"phkb_sidewinder_escort_6": "sidewinder_escort",
"phkb_sidewinder_escort_7": "sidewinder_escort",
"phkb_sidewinder_escort_8": "sidewinder_escort",
"phkb_sidewinder_escort_9": "sidewinder_escort",
"phkb_sidewinder_escort_10": "sidewinder_escort",
"phkb_sidewinder_escort_11": "sidewinder_escort",
"phkb_sidewinder_escort_12": "sidewinder_escort",
"phkb_sidewinder_escort_13": "sidewinder_escort",
"phkb_sidewinder_escort_14": "sidewinder_escort",
"phkb_sidewinder_escort_15": "sidewinder_escort",
"phkb_sidewinder_escort_16": "sidewinder_escort",
"phkb_sidewinder_escort_17": "sidewinder_escort",
"phkb_sidewinder_escort_18": "sidewinder_escort",
"wildShips_kiota4Ring": "wildships_4ring",
"wildShips_kiota4RingVariant": "wildships_4ringvariant",
"wildShips_kiota2Ring": "wildships_2ring",
"rock-hermit": "rockhermit",
"rock-hermit-chaotic": "rockhermit",
"rock-hermit-pirate": "rockhermit",
"griff_rockhermit": "rockhermit",
"griff_normalmapped_hermit-chaotic": "rockhermit",
"griff_normalmapped_hermit-pirate": "rockhermit",
"noshaders_rock-hermit_alt": "rockhermit",
"pirate-cove": "rockhermit",
"erh_standard": "erh_style$_rhStyle",
"erh_chaotic": "erh_style$_rhStyle",
"erh_pirate": "erh_style$_rhStyle",
"feudal-drone": "escape",
"feudal-drone-1": "escape",
"feudal-drone-2": "escape",
"feudal-drone-3": "escape",
"feudal-drone-4": "escape",
"feudal-drone-5": "escape",
"IR-target-drone": "gecko",
"laveAcademy_targetDroneL1": "academy_target_drone",
"laveAcademy_targetDroneL2": "academy_target_drone",
"laveAcademy_targetDroneL3": "academy_target_drone",
"laveAcademy_dockingDroneL1": "academy_docking_drone",
"laveAcademy_dockingDroneL2a": "academy_docking_drone_a",
"laveAcademy_dockingDroneL2b": "academy_docking_drone_b",
"laveAcademy_dockingDroneL2c": "academy_docking_drone_c",
"laveAcademy_dockingDroneL3a": "academy_docking_drone_a",
"laveAcademy_dockingDroneL3b": "academy_docking_drone_b",
"laveAcademy_dockingDroneL3c": "academy_docking_drone_c",
};
this._operationalFunctionNames = [ // list of functions to enable/disable at HUDSelector callback
"shipDockedWithStation",
"shipWillLaunchFromStation",
"shipExitedWitchspace",
"shipDied",
"guiScreenChanged",
"alertConditionChanged",
"compassTargetChanged",
"shipTargetAcquired",
"playerBoughtNewShip",
"missionScreenEnded",
"mfdKeyChanged"
];
//----------------------------------------------------------------------------------------
this.startUp = function _vimanaXHUD_startUp() {
var i = 0;
this._combatMFD = worldScripts["combat_MFD"];
worldScripts.VimanaX_Alerts._combatMFD = this._combatMFD;
this.$measureText();
var p = player.ship;
p.crosshairs = "vx_crosshair_off.plist";
p.setCustomHUDDial("VimanaX_Rh", "");
if (!missionVariables.ironHide_percentage) missionVariables.ironHide_percentage = 0;
for (i = 0; i < 8; i++) {
this._govs.push(String.fromCharCode(i));
this._ecos.push(String.fromCharCode(23 - i));
}
if (worldScripts["telescope"]) {
this._TLS = worldScripts["telescope"];
this._TLS.$TelescopeVSize = 4;
this._TLS.$TelescopeVZoomSize = 4;
// check what version of telescope is in play
var ver = worldScripts["telescope"].version.split(".");
this._telescopeVersion = 2;
if (parseInt(ver[0]) == 1) this._telescopeVersion = 1;
if (parseInt(ver[0]) >= 2) {
if (ver.length > 1 && parseInt(ver[1]) > 0) this._telescopeVersion = 2.1;
else if (ver.length > 2 && parseInt(ver[2]) > 1) this._telescopeVersion = 2.1;
}
}
if (worldScripts.shieldequalizercapacitors) this._SEC = worldScripts.shieldequalizercapacitors;
if (worldScripts.sniperlock) this._SLS = worldScripts.sniperlock;
if (worldScripts.sniperlock_plus) this._SLP = worldScripts.sniperlock_plus;
if (worldScripts["Auto Crosshairs"]) this._ACH = worldScripts["Auto Crosshairs"];
if (worldScripts.ams_system) this._AMS = worldScripts.ams_system; else this._setSlot1 = 0;
if (worldScripts["Target Filtering System"]) this._TFS = worldScripts["Target Filtering System"];
if (worldScripts.ManifestScanner) this._MS = worldScripts.ManifestScanner;
this._SRS = worldScripts["Repair System"];
if (this._SRS) {
if (this._SRS.version) {
var bits = this._SRS.version.split(".");
var major = parseInt(bits[0]);
var minor = parseInt(bits[1]);
if (major < 2 || (major == 2 && minor < 14)) {
this._setSlot2 = 0;
this._SRS = null;
}
}
}
this._SC = worldScripts["Shield Cycler"];
//if (this._SC && this._SC.version && this._SC.version >= "2.1") this._SC = null;
if (worldScripts.LMSS_Core) this._LMSS = worldScripts.LMSS_Core;
i = p.equipment.length;
while (i--) {
if (p.equipmentStatus(p.equipment[i].equipmentKey) === "EQUIPMENT_DAMAGED") this._eqDamaged.push(p.equipment[i].name);
}
// if the player has already bought the original modules, auto-award them in this new save game (should only happen one time)
if (!missionVariables.VimanaX_HUD_Style) {
if (p.equipmentStatus("EQ_VIMANA_TARGET_MODULE") == "EQUIPMENT_OK" && p.equipmentStatus("EQ_VIMANAX_TARGET_MODULE") == "EQUIPMENT_UNAVAILABLE") p.awardEquipment("EQ_VIMANAX_TARGET_MODULE");
if (p.equipmentStatus("EQ_VIMANA_TRAVEL_MODULE") == "EQUIPMENT_OK" && p.equipmentStatus("EQ_VIMANAX_TRAVEL_MODULE") == "EQUIPMENT_UNAVAILABLE") p.awardEquipment("EQ_VIMANAX_TRAVEL_MODULE");
if (p.equipmentStatus("EQ_VIMANA_SHIP_MODULE") == "EQUIPMENT_OK" && p.equipmentStatus("EQ_VIMANAX_SHIP_MODULE") == "EQUIPMENT_UNAVAILABLE") p.awardEquipment("EQ_VIMANAX_SHIP_MODULE");
}
if (missionVariables.VimanaX_HUD_SpecialSlot1) this._setSlot1 = parseInt(missionVariables.VimanaX_HUD_SpecialSlot1);
if (missionVariables.VimanaX_HUD_SpecialSlot2) this._setSlot2 = parseInt(missionVariables.VimanaX_HUD_SpecialSlot2);
if (missionVariables.VimanaX_HUD_DisableAlerts) worldScripts.VimanaX_Alerts._disabled = (missionVariables.VimanaX_HUD_DisableAlerts == "1" ? true : false);
if (missionVariables.VimanaX_HUD_Style) this._style = missionVariables.VimanaX_HUD_Style;
if (missionVariables.VimanaX_HUD_NonLinear) this._nonLinear = (missionVariables.VimanaX_HUD_NonLinear == "1" ? true : false);
if (missionVariables.VimanaX_HUD_UltraZoom) this._ultraZoom = (missionVariables.VimanaX_HUD_UltraZoom == "1" ? true : false);
if (missionVariables.VimanaX_HUD_Inflight) this._inflightHUD = missionVariables.VimanaX_HUD_Inflight;
switch (this._inflightHUD) {
case "VimanaX_HUD-6mfds.plist": this._dockedHUD = "VimanaX_HUD_docked-6mfds.plist"; break;
case "VimanaX_HUD-10mfds.plist": this._dockedHUD = "VimanaX_HUD_docked-10mfds.plist"; break;
case "VimanaX_HUD-12mfds.plist": this._dockedHUD = "VimanaX_HUD_docked-12mfds.plist"; break;
}
var hs = worldScripts.hudselector;
if (hs) {
hs.$HUDSelectorAddHUD("Vimana-X HUD 6 MFDs", this.name + "-6mfds");
hs.$HUDSelectorAddHUD("Vimana-X HUD 10 MFDs", this.name + "-10mfds");
hs.$HUDSelectorAddHUD("Vimana-X HUD 12 MFDs", this.name + "-12mfds");
this.$updateHUDSelectorSettings();
}
if (p.hud.indexOf("VimanaX") >= 0) p.hud = this._dockedHUD;
this.$updateShipConfigHUD();
if (p.equipmentStatus("EQ_AMS") === "EQUIPMENT_UNAVAILABLE") {
if (this._setSlot1 == 1) this._setSlot1 = 0;
if (this._setSlot2 == 1) this._setSlot2 = 0;
}
if (this._SRS && !this._SRS.$controllerVersion) {
if (this._setSlot1 == 2) this._setSlot1 = 0;
if (this._setSlot2 == 2) this._setSlot2 = 0;
}
this.$changeSettings();
}
//-------------------------------------------------------------------------------------------------------------
this.startUpComplete = function _vimanaXHUD_startUpComplete() {
this._clockFCB = addFrameCallback(this.$updateClock.bind(this));
this.$switchDockedColor();
this.$initInterface(player.ship.dockedStation);
if (worldScripts.ShipConfiguration_F3HUDControl) {
if (player.ship.hud.indexOf(this.name) >= 0) this.$updateShipConfigHUD();
}
// pre-calc the centering function on these text items, so we don't have to do it repeatedly later
this._staticText.targetHeader = this.$padText(".: TARGET INFO :.", 9.16, false, true);
this._staticText.travelHeader = this.$padText(".: TRAVEL INFO :.", 9.16, false, true);
this._staticText.checkList = this.$padText("..:: CheckList ::..", this._widths["VimanaX_R0"][this._widthLookup], true, true);
this._staticText.shipDamaged = this.$padText("SHIP DAMAGED!", this._widths["VimanaX_Rh1"][this._widthLookup], true, true);
this._staticText.shipInfo = this.$padText(".: SHIP INFO :.", 9.16, true, true);
this._staticText.nextHops = this.$padText("...: NEXT HOPS :...", this._widths["VimanaX_L0"][this._widthLookup], true, true);
this._staticText.unavailable = this.$padText("UNAVAILABLE", this._widths["VimanaX_L0"][this._widthLookup], true, true);
this._staticText.moduleNotInstalled = this.$padText("Module not installed", this._widths["VimanaX_L0"][this._widthLookup], true, true);
this._staticText.moduleDamaged = this.$padText("Module damaged", this._widths["VimanaX_L0"][this._widthLookup], true, true);
this._lastSource = system.ID;
}
//-------------------------------------------------------------------------------------------------------------
this.playerBoughtNewShip = function _vimanaXHUD_playerBoughtNewShip(ship, price) {
this.$setDestination();
this.$initInterface(player.ship.dockedStation);
}
//----------------------------------------------------------------------------------------
this.playerWillSaveGame = function _vimanaXHUD_playerWillSaveGame() {
missionVariables.VimanaX_HUD_SpecialSlot1 = this._setSlot1;
missionVariables.VimanaX_HUD_SpecialSlot2 = this._setSlot2;
missionVariables.VimanaX_HUD_DisableAlerts = (worldScripts.VimanaX_Alerts._disabled ? "1" : "0");
missionVariables.VimanaX_HUD_Style = this._style;
missionVariables.VimanaX_HUD_NonLinear = (this._nonLinear ? "1" : "0");
missionVariables.VimanaX_HUD_UltraZoom = (this._ultraZoom ? "1" : "0");
missionVariables.VimanaX_HUD_Inflight = this._inflightHUD;
}
//----------------------------------------------------------------------------------------
this.$HUDSelectorCallBack = function _vimanaXHUD_HUDSelectorCallBack(off) {
var ws = worldScripts.VimanaX_HUD;
var pship = player.ship;
var funcNames = this._operationalFunctionNames;
var i = funcNames.length;
if (ws._debug) log(this.name, "HUDSelectorCallBack, off:" + off + ", pship.hud:" + pship.hud);
if (off) {
// disable
ws.$stopTimers();
if (isValidFrameCallback(ws._clockFCB)) removeFrameCallback(ws._clockFCB);
while (i--)
if (ws[funcNames[i]]) {
ws["$save_" + funcNames[i]] = ws[funcNames[i]];
delete ws[funcNames[i]];
}
if (pship.dockedStation) pship.dockedStation.setInterface(ws.name, null);
worldScripts.VimanaX_Alerts.$disableAlerts();
ws.$revertShipConfigHUD();
} else {
// enable
this.$switchDockedColor();
while (i--)
if (!ws[funcNames[i]]) {
ws[funcNames[i]] = ws["$save_" + funcNames[i]];
}
ws._inflightHUD = pship.hud;
if (!pship.docked) {
ws.shipWillLaunchFromStation();
worldScripts.VimanaX_Alerts.shipExitedWitchspace();
} else {
switch (ws._inflightHUD) {
case "VimanaX_HUD-6mfds.plist": ws._dockedHUD = "VimanaX_HUD_docked-6mfds.plist"; break;
case "VimanaX_HUD-10mfds.plist": ws._dockedHUD = "VimanaX_HUD_docked-10mfds.plist"; break;
case "VimanaX_HUD-12mfds.plist": ws._dockedHUD = "VimanaX_HUD_docked-12mfds.plist"; break;
}
pship.hud = ws._dockedHUD;
if (!isValidFrameCallback(ws._clockFCB))
ws._clockFCB = addFrameCallback(ws.$updateClock.bind(ws));
}
this.$updateHUDSelectorSettings();
if (pship.dockedStation) this.$initInterface(pship.dockedStation);
worldScripts.VimanaX_Alerts.$enableAlerts();
ws.$updateShipConfigHUD();
}
}
//----------------------------------------------------------------------------------------
this.missionScreenEnded = function() {
this.$switchDockedColor();
}
//----------------------------------------------------------------------------------------
this.shipDockedWithStation = function _vimanaXHUD_shipDockedWithStation(station) {
var p = player.ship;
this.$stopTimers();
if (isValidFrameCallback(this._cbf)) removeFrameCallback(this._cbf);
if (!isValidFrameCallback(this._clockFCB)) this._clockFCB = addFrameCallback(this.$updateClock.bind(this));
this._cbf = null;
this._lastUsed[13] = "";
this._inflightHUD = p.hud;
switch (this._inflightHUD) {
case "VimanaX_HUD-6mfds.plist": this._dockedHUD = "VimanaX_HUD_docked-6mfds.plist"; break;
case "VimanaX_HUD-10mfds.plist": this._dockedHUD = "VimanaX_HUD_docked-10mfds.plist"; break;
case "VimanaX_HUD-12mfds.plist": this._dockedHUD = "VimanaX_HUD_docked-12mfds.plist"; break;
}
p.hud = this._dockedHUD;
this.$updateDockedHUDLabels();
this.$initInterface(station);
}
//----------------------------------------------------------------------------------------
this.shipDied = function _vimanaXHUD_shipDied() {
this.$stopTimers();
if (isValidFrameCallback(this._cbf)) removeFrameCallback(this._cbf);
this._cbf = null;
this._lastUsed[13] = "";
}
//----------------------------------------------------------------------------------------
this.shipWillLaunchFromStation = function _vimanaXHUD_shipWillLaunchFromStation() {
var p = player.ship;
this._lastSource = system.ID;
if (this._inflightHUD && p.hud.indexOf("VimanaX_HUD_docked") >= 0) p.hud = this._inflightHUD;
if (isValidFrameCallback(this._clockFCB)) removeFrameCallback(this._clockFCB);
this.$setHUDEquipment(false);
this._timer1Ping = false;
this._timer2Ping = false;
this._timer3Ping = false;
this._killsOnLaunch = player.score;
var i = 20;
while (i--) { this._lastUsed[i] = null; }
if (!isValidFrameCallback(this._cbf))
this._cbf = addFrameCallback(this.$showIndicators.bind(this));
this.$checkMaint();
//set player ship image
this._hullAnim[0] = (this._gameShips[p.name] ? this._gameShips[p.name] : "");
if (this._hullAnim[0] == "***") this._hullAnim[0] = this._disambiguation[p.dataKey];
if (this._hullAnim[0] == "undefined") {
log(this.name, "ERROR! Undefined lookup for " + p.name + " (" + p.dataKey + ")");
this._hullAnum[0] = "blank";
}
this.$AlertNo = 0;
var eq = p.equipment;
i = eq.length;
while (i--) {
if (eq[i].damageProbability > 0) this._lastUsed[16]++;
}
var sc = worldScripts.ShipConfiguration_Core;
if (sc) {
var a = sc._armour;
if (a && a.length > 0) {
i = a.length;
while (i--) {
if (a[i] && p.equipmentStatus(a[i]) === "EQUIPMENT_OK") {
this._SC_Armour = true;
break;
}
}
}
}
if (!this._infoTimer) this._infoTimer = new Timer(this, this.$showInfo.bind(this), 2, 0.25);
if (!this._iconTimer) this._iconTimer = new Timer(this, this.$showIcon.bind(this), 1, 0.5);
this.$startAnim();
this.$equipmentStatus();
this._lastUsed[12] = 1;
this.$setLPanel();
// this will be redundant if HUD selector gets there first, but just in case
p.hud.scannerUltraZoom = this._ultraZoom;
p.hud.scannerNonLinear = this._nonLinear;
if (worldScripts.ManualWitchspaceAlignment) {
var mwa = worldScripts.ManualWitchspaceAlignment;
if (mwa._userOverride === false) { // only do the change if the player hasn't told us not to
mwa._color = 2; // 0 = blue, 1 = amber/orange, 2 = green, 3 = pink, 4 = purple, 5 = white
}
}
}
//----------------------------------------------------------------------------------------
this.guiScreenChanged = function _vimanaXHUD_guiScreenChanged(to, from) {
this._mapScreen = from;
if (from !== "GUI_SCREEN_MAIN") {
if (this._mapScreenChangeTimer == null || this._mapScreenChangeTimer.isRunning === false) this._mapScreenChangeTimer = new Timer(this, this.$checkForNewDestination, 0.3, 0);
}
if (from === "GUI_SCREEN_SHORT_RANGE_CHART" || from === "GUI_SCREEN_LONG_RANGE_CHART") {
this._lastUsed[12] = 1;
this.$setLPanel();
}
if (from == "GUI_SCREEN_LOAD" && to == "GUI_SCREEN_STATUS") {
this.$switchDockedColor();
}
}
//----------------------------------------------------------------------------------------
this.equipmentRepaired = function _vimanaXHUD_equipmentRepaired(equipment) { //repaired
var p = player.ship;
var i = p.equipment.length;
while (i--) {
if (this._eqDamaged[i] == EquipmentInfo.infoForKey(equipment).name) this._eqDamaged.splice(i, 1);
}
this.$equipmentStatus();
if (equipment == "EQ_VIMANAX_SHIP_MODULE") this.$startAnim();
}
//----------------------------------------------------------------------------------------
this.equipmentDamaged = function _vimanaXHUD_equipmentDamaged(equipment) { //damaged
var eq = EquipmentInfo.infoForKey(equipment);
if (eq.isVisible) {
this._eqDamaged.push(EquipmentInfo.infoForKey(equipment).name);
this.$equipmentStatus();
}
}
//----------------------------------------------------------------------------------------
this.shipTargetAcquired = function _vimanaXHUD_shipTargetAcquired(target) {
if (target.isWormhole) return;
var p = player.ship;
p.setCustomHUDDial("VimanaX_LPTitle", this._staticText.targetHeader);
p.setCustomHUDDial("VimanaX_SClock", "");
p.setCustomHUDDial("VimanaX_CEnergy", "");
p.setCustomHUDDial("VimanaX_CSpeed", "");
p.setCustomHUDDial("VimanaX_CMissile", "");
if (p.equipmentStatus("EQ_VIMANAX_TARGET_MODULE") === "EQUIPMENT_OK") {
var m = null;
//set ship model and name
m = (this._gameShips[target.name] ? "vx_" + this._gameShips[target.name] + ".png" : null);
if (m && m == "vx_***.png") m = "vx_" + this._disambiguation[target.dataKey] + ".png";
if (m && m.indexOf("$") >= 0) {
var erhs = m.split("$")[1].replace(".png", "");
m = m.replace("$" + erhs, target[erhs]);
}
if (m == "vx_undefined.png" || m == "vx_erh_styleundefined.png") {
log(this.name, "ERROR! Undefined lookup for " + target.name + " (" + target.dataKey + ")");
m = null;
}
if (m) var model = m; else var model = "vx_blank.png";
p.setCustomHUDDial("VimanaX_PTarget", model);
}
}
//----------------------------------------------------------------------------------------
this.shipExitedWitchspace = function _vimanaXHUD_shipExitedWitchspace() {
if (system.ID != -1) this._lastSource = system.ID;
this.$checkMaint();
this._destination = this.$playerTargetSystem();
this.$setDestination();
this._lastUsed[12] = 1;
this._lastUsed[13] = "";
this.$setLPanel();
}
//----------------------------------------------------------------------------------------
this.alertConditionChanged = function _vimanaXHUD_alertConditionChanged(newState, oldState) {
var cond = ["", "green_", "", "red_"][newState];
if (this._debug) log(this.name, "Setting player's crosshairs to vx_" + cond + "crosshair_off.plist");
player.ship.crosshairs = "vx_" + cond + "crosshair_off.plist";
if (this._ACH) {
this._ACH.$crosshairs.default.off = this._ACH.$offTargetCrosshairs = "vx_" + cond + "crosshair_off.plist";
this._ACH.$onTargetCrosshairs = this._ACH.$crosshairs.default.on = "vx_" + cond + "crosshair_on.plist";
}
}
//----------------------------------------------------------------------------------------
this.compassTargetChanged = function _vimanaXHUD_compassTargetChanged(whom, mode) {
if (!whom) return;
var target = "";
if (mode === "COMPASS_MODE_BASIC") {
if (whom.isPlanet) target = "Planet";
else target = "Main Station";
} else if (mode === "COMPASS_MODE_PLANET") {
var s = System.infoForSystem(galaxyNumber, system.info.systemID);
var ex = this._ecos[s.economy] + this._govs[s.government] + (s.techlevel + 1);
target = whom.name + " " + ex;
} else if (mode === "COMPASS_MODE_TARGET") {
target = "Target";
} else {
if (whom.beaconLabel) target = whom.beaconLabel;
else if (whom.displayName) target = whom.displayName;
else if (whom.name) target = whom.name;
else if (whom.beaconCode) target = whom.beaconCode;
else target = "Unidentified";
}
player.ship.setCustomHUDDial("VimanaX_ASCName", this.$padText(target, this._widths["VimanaX_ASCName"][this._widthLookup]));
}
//----------------------------------------------------------------------------------------
this.playerBoughtEquipment = function _vimanaXHUD_playerBoughtEquipment(equipment) {
var p = player.ship;
if (equipment == "EQ_VIMANAX_SELL_TARGET_MODULE") {
p.removeEquipment("EQ_VIMANAX_TARGET_MODULE");
p.removeEquipment(equipment);
}
if (equipment == "EQ_VIMANAX_SELL_TRAVEL_MODULE") {
p.removeEquipment("EQ_VIMANAX_TRAVEL_MODULE");
p.removeEquipment(equipment);
}
if (equipment == "EQ_VIMANAX_SELL_SHIP_MODULE") {
p.removeEquipment("EQ_VIMANAX_SHIP_MODULE");
p.removeEquipment(equipment);
}
}
/*******************************************************************
* display hud icons (pictograms)
* ******************************************************************/
//----------------------------------------------------------------------------------------
this.$updateClock = function _vimanaXHUD_updateClock() {
player.ship.setCustomHUDDial("VimanaX_Clock", clock.clockString);
}
//----------------------------------------------------------------------------------------
this.$setHUDEquipment = function _vimanaXHUD_setHUDEquipment(remove) {
var p = player.ship;
p.setCustomHUDDial("VimanaX_HUD_Main", "vx_vimana_hud_main_" + this._style + ".png");
p.setCustomHUDDial("VimanaX_HUD_Surrounds", "vx_vimana_hud_surrounds_" + this._style + ".png");
p.setCustomHUDDial("VimanaX_HUD_Compass", "vx_compass.png");
p.setCustomHUDDial("VimanaX_WeaponLabel", "WEAPON");
p.setCustomHUDDial("VimanaX_PrimedLabel", "PRIMED");
p.setCustomHUDDial("VimanaX_EquipLabel", "EQUIP");
p.setCustomHUDDial("VimanaX_ModeLabel", "MODE");
p.setCustomHUDDial("VimanaX_SpeedLabel", "SPEED");
p.setCustomHUDDial("VimanaX_FuelLabel", "FUEL");
p.setCustomHUDDial("VimanaX_AltLabel", "ALT");
p.setCustomHUDDial("VimanaX_CargoLabel", "CARGO");
p.setCustomHUDDial("VimanaX_CTempLabel", "C.TEMP");
p.setCustomHUDDial("VimanaX_EnergyLabel", "ENERGY");
p.setCustomHUDDial("VimanaX_LTempLabel", "L.TEMP");
p.setCustomHUDDial("VimanaX_FshLabel", "F.SH");
p.setCustomHUDDial("VimanaX_AshLabel", "A.SH");
p.removeEquipment("EQ_VIMANAX_FONT_NARROW");
p.removeEquipment("EQ_VIMANAX_FONT_NORMAL");
if (!remove) {
if (this._widthLookup == 1) {
p.awardEquipment("EQ_VIMANAX_FONT_NARROW");
} else {
p.awardEquipment("EQ_VIMANAX_FONT_NORMAL");
}
}
var mfd = p.multiFunctionDisplayList;
var i = p.multiFunctionDisplays;
while (i--) {
if (this._style == "light" || (mfd[i] == null || mfd[i] == "" || mfd[i] === undefined || mfd[i] === "undefined" || !this.$confirmMFDEquipment(mfd[i]))) {
p.setCustomHUDDial("VimanaX_MFDBackground_" + (i + 1).toString(), "vx_blank.png");
} else {
p.setCustomHUDDial("VimanaX_MFDBackground_" + (i + 1).toString(), "vx_mfd_underlay.png");
}
}
}
//-------------------------------------------------------------------------------------------------------------
this.mfdKeyChanged = function(index, key) {
var p = player.ship;
if (this._style == "light" || (key == null || key == "" || key === undefined || key === "undefined" || !this.$confirmMFDEquipment(key))) {
p.setCustomHUDDial("VimanaX_MFDBackground_" + (index + 1).toString(), "vx_blank.png");
} else {
p.setCustomHUDDial("VimanaX_MFDBackground_" + (index + 1).toString(), "vx_mfd_underlay.png");
}
}
//-------------------------------------------------------------------------------------------------------------
this.$checkMFD = function $checkMFD(index) {
var p = player.ship;
if (!p || !p.isValid) return;
var mfd = p.multiFunctionDisplayList;
if (this._style == "light" || (mfd[index] == null || mfd[index] == "" || mfd[index] === undefined || !this.$confirmMFDEquipment(mfd[index]))) {
p.setCustomHUDDial("VimanaX_MFDBackground_" + (index + 1).toString(), "vx_blank.png");
} else {
p.setCustomHUDDial("VimanaX_MFDBackground_" + (index + 1).toString(), "vx_mfd_underlay.png");
}
}
//----------------------------------------------------------------------------------------
this.$stopTimers = function _vimanaXHUD_stopTimers() {
if (this._infoTimer) {
this._infoTimer.stop();
delete this._infoTimer;
}
if (this._iconTimer) {
this._iconTimer.stop();
delete this._iconTimer;
}
if (this._animTimer) {
this._animTimer.stop();
delete this._animTimer;
}
}
//----------------------------------------------------------------------------------------
this.$startAnim = function _vimanaXHUD_StartAnim() {
if (player.ship.equipmentStatus("EQ_VIMANAX_SHIP_MODULE") === "EQUIPMENT_OK") {
if (!this._animTimer) this._animTimer = new Timer(this, this.$animHull.bind(this), 3, 1);
this._hullAnim[1] = 11;
}
}
//----------------------------------------------------------------------------------------
this.$showIcon = function _vimanaXHUD_showIcon() {
var that = _vimanaXHUD_showIcon;
var _player = (that._player = that._player || player);
var p = _player.ship;
if (!p || !p.isValid) return;
if (!this._timer1Ping) { this._timer1Ping = true; this.$playSound(); }
var alerts = worldScripts.VimanaX_Alerts;
var h = this.$getHostileShips();
if (h.length && p.alertCondition === 3) {
if (Math.floor((this._iconTimer.nextTime * 10) % 2))
p.setCustomHUDDial("VimanaX_HCG", "vx_combat.png");
else
p.setCustomHUDDial("VimanaX_HCG", "vx_blank.png");
} else {
p.setCustomHUDDial("VimanaX_HCG", "vx_blank.png");
}
if (this._LMSS) { //lmss icon
var ws = this._LMSS;
switch (p.viewDirection) {
case "VIEW_FORWARD":
if (p.equipmentStatus("EQ_LMSS_FRONT") === "EQUIPMENT_OK")
this.$LMSSIcons(ws._forwardTimer);
else if (p.equipmentStatus("EQ_LMSS_FRONT") === "EQUIPMENT_DAMAGED")
this.$blinkingIcons("VimanaX_Lmss", "vx_lmss_d.png");
else
p.setCustomHUDDial("VimanaX_Lmss", "vx_blank.png");
break;
case "VIEW_AFT":
if (p.equipmentStatus("EQ_LMSS_AFT") === "EQUIPMENT_OK")
this.$LMSSIcons(ws._aftTimer);
else if (p.equipmentStatus("EQ_LMSS_AFT") === "EQUIPMENT_DAMAGED")
this.$blinkingIcons("VimanaX_Lmss", "vx_lmss_d.png");
else
p.setCustomHUDDial("VimanaX_Lmss", "vx_blank.png");
break;
case "VIEW_PORT":
if (p.equipmentStatus("EQ_LMSS_PORT") === "EQUIPMENT_OK")
this.$LMSSIcons(ws._portTimer);
else if (p.equipmentStatus("EQ_LMSS_PORT") === "EQUIPMENT_DAMAGED")
this.$blinkingIcons("VimanaX_Lmss", "vx_lmss_d.png");
else
p.setCustomHUDDial("VimanaX_Lmss", "vx_blank.png");
break;
case "VIEW_STARBOARD":
if (p.equipmentStatus("EQ_LMSS_STARBOARD") === "EQUIPMENT_OK")
this.$LMSSIcons(ws._starboardTimer);
else if (p.equipmentStatus("EQ_LMSS_STARBOARD") === "EQUIPMENT_DAMAGED")
this.$blinkingIcons("VimanaX_Lmss", "vx_lmss_d.png");
else
p.setCustomHUDDial("VimanaX_Lmss", "vx_blank.png");
}
if (p.equipmentStatus("EQ_LMSS_ACTUATOR") === "EQUIPMENT_OK")
p.setCustomHUDDial("VimanaX_LmsA", "vx_lmsa.png");
else if (p.equipmentStatus("EQ_LMSS_ACTUATOR") === "EQUIPMENT_DAMAGED")
this.$blinkingIcons("VimanaX_LmsA", "vx_lmsa_d.png");
else
p.setCustomHUDDial("VimanaX_LmsA", "vx_blank.png");
}
if (p.equipmentStatus("EQ_CLOAKING_DEVICE") === "EQUIPMENT_DAMAGED") this.$blinkingIcons("VimanaX_Cloaking", "vx_invisible_d.png");
else if (p.isCloaked) this.$blinkingIcons("VimanaX_Cloaking", "vx_invisible.png");
else p.setCustomHUDDial("VimanaX_Cloaking", "vx_blank.png");
if (this._SEC) {
//forward capacitor
if (p.equipmentStatus("EQ_FORWARD_SHIELD_CAPACITOR") === "EQUIPMENT_DAMAGED")
this.$blinkingIcons("VimanaX_CapacitorF", "vx_cap_f_d.png");
else if (p.equipmentStatus("EQ_FORWARD_SHIELD_CAPACITOR") === "EQUIPMENT_OK") {
if (this._SEC.secforwardshieldcapacitor == 0)
p.setCustomHUDDial("VimanaX_CapacitorF", "vx_blank.png");
else if (this._SEC.secforwardshieldcapacitor < this._SEC.$maxCapacitorCharge - p.forwardShieldRecharge)
this.$blinkingIcons("VimanaX_CapacitorF", "vx_cap_f.png");
else
p.setCustomHUDDial("VimanaX_CapacitorF", "vx_cap_f.png");
} else
p.setCustomHUDDial("VimanaX_CapacitorF", "vx_blank.png");
//center dot
if (p.equipmentStatus("EQ_AFT_SHIELD_CAPACITOR") === "EQUIPMENT_DAMAGED" && p.equipmentStatus("EQ_FORWARD_SHIELD_CAPACITOR") === "EQUIPMENT_DAMAGED")
p.setCustomHUDDial("VimanaX_CapacitorC", "vx_cap_c_d.png");
else if (p.equipmentStatus("EQ_AFT_SHIELD_CAPACITOR") === "EQUIPMENT_OK" && p.equipmentStatus("EQ_FORWARD_SHIELD_CAPACITOR") === "EQUIPMENT_OK")
p.setCustomHUDDial("VimanaX_CapacitorC", "vx_cap_c.png");
else if (p.equipmentStatus("EQ_AFT_SHIELD_CAPACITOR") === "EQUIPMENT_OK" || p.equipmentStatus("EQ_FORWARD_SHIELD_CAPACITOR") === "EQUIPMENT_OK")
this.$blinkingIcons("VimanaX_CapacitorC", "vx_cap_b.png", "vx_cap_c.png");
else
p.setCustomHUDDial("VimanaX_CapacitorC", "vx_blank.png");
//aft capacitor
if (p.equipmentStatus("EQ_AFT_SHIELD_CAPACITOR") === "EQUIPMENT_DAMAGED")
this.$blinkingIcons("VimanaX_CapacitorA", "vx_cap_a_d.png");
else if (p.equipmentStatus("EQ_AFT_SHIELD_CAPACITOR") === "EQUIPMENT_OK") {
if (this._SEC.secaftshieldcapacitor == 0)
p.setCustomHUDDial("VimanaX_CapacitorA", "vx_blank.png");
else if (this._SEC.secaftshieldcapacitor < this._SEC.$maxCapacitorCharge - p.aftShieldRecharge)
this.$blinkingIcons("VimanaX_CapacitorA", "vx_cap_a.png");
else
p.setCustomHUDDial("VimanaX_CapacitorA", "vx_cap_a.png");
} else
p.setCustomHUDDial("VimanaX_CapacitorA", "vx_blank.png");
} else {
p.setCustomHUDDial("VimanaX_CapacitorF", "vx_blank.png");
p.setCustomHUDDial("VimanaX_CapacitorC", "vx_blank.png");
p.setCustomHUDDial("VimanaX_CapacitorA", "vx_blank.png");
}
if (p.equipmentStatus("EQ_SHIELD_EQUALIZER") === "EQUIPMENT_OK")
p.setCustomHUDDial("VimanaX_SCycler", "vx_sc.png");
else if (p.equipmentStatus("EQ_SHIELD_EQUALIZER") === "EQUIPMENT_DAMAGED")
this.$blinkingIcons("VimanaX_SCycler", "vx_sc_d.png");
else if (this._SC && this._SC._sc_settings && this._SC._sc_settings.sc.version) {
if (this._SC._sc_settings.sc.functional == 100)
p.setCustomHUDDial("VimanaX_SCycler", "vx_sc.png");
else
this.$blinkingIcons("VimanaX_SCycler", "vx_sc_d.png");
} else
p.setCustomHUDDial("VimanaX_SCycler", "vx_blank.png");
//EQ_NAVAL_ENERGY_UNIT
if (p.equipmentStatus("EQ_ENERGY_UNIT") === "EQUIPMENT_UNAVAILABLE" && p.equipmentStatus("EQ_NAVAL_ENERGY_UNIT") === "EQUIPMENT_UNAVAILABLE")
p.setCustomHUDDial("VimanaX_EEnergy", "vx_blank.png");
else {
if (p.equipmentStatus("EQ_ENERGY_UNIT") === "EQUIPMENT_OK")
p.setCustomHUDDial("VimanaX_EEnergy", "vx_eeu.png");
else if (p.equipmentStatus("EQ_ENERGY_UNIT") === "EQUIPMENT_DAMAGED")
this.$blinkingIcons("VimanaX_EEnergy", "vx_eeu_d.png");
else if (p.equipmentStatus("EQ_NAVAL_ENERGY_UNIT") === "EQUIPMENT_OK")
p.setCustomHUDDial("VimanaX_EEnergy", "vx_neu.png");
else if (p.equipmentStatus("EQ_NAVAL_ENERGY_UNIT") === "EQUIPMENT_DAMAGED")
this.$blinkingIcons("VimanaX_EEnergy", "vx_eeu_d.png");
}
if (p.equipmentStatus("EQ_ECM") === "EQUIPMENT_OK") p.setCustomHUDDial("VimanaX_ECM", "vx_ecm_o.png");
else if (p.equipmentStatus("EQ_ECM") === "EQUIPMENT_DAMAGED") this.$blinkingIcons("VimanaX_ECM", "vx_ecm_d.png");
if (this._maintenance == true) this.$blinkingIcons("VimanaX_Service", "vx_maintenance.png");
else p.setCustomHUDDial("VimanaX_Service", "vx_blank.png");
if (p.equipmentStatus("EQ_FUEL_INJECTION") === "EQUIPMENT_DAMAGED" || p.fuel < 0.1) this.$blinkingIcons("VimanaX_FInjector", "vx_injector_d.png");
else if (p.equipmentStatus("EQ_FUEL_INJECTION") === "EQUIPMENT_OK") p.setCustomHUDDial("VimanaX_FInjector", "vx_injector.png");
else p.setCustomHUDDial("VimanaX_FInjector", "vx_blank.png");
if (((p.fuel).toFixed(1) < this._reqFuel && system.ID != p.targetSystem) || p.fuel < 0.1) this.$blinkingIcons("VimanaX_FuelAlert", "vx_low_fuel.png");
else if (p.fuelLeakRate > 0 && p.fuel > 0) this.$blinkingIcons("VimanaX_FuelAlert", "vx_low_fuel.png");
else p.setCustomHUDDial("VimanaX_FuelAlert", "vx_blank.png");
//self repair system icons
var eqKey = (this._SRS && this._SRS.$controllerVersion ? this._SRS.$controllerVersion : null);
if (eqKey) {
if (this._SRS.$selfRepairsSystemStatus === "Active")
this.$blinkingIcons("VimanaX_RepIcon", "vx_srs_0.png", "vx_srs_1.png");
else if (this._SRS.$selfRepairsSystemStatus === "Self-repair")
this.$blinkingIcons("VimanaX_RepIcon", "vx_srs_d.png", "vx_blank.png");
else if (this._SRS.$selfRepairsSystemStatus === "Standby")
p.setCustomHUDDial("VimanaX_RepIcon", "vx_srs.png");
else if (this._SRS.$selfRepairsSystemStatus === "Shutdown")
p.setCustomHUDDial("VimanaX_RepIcon", "vx_srs_d.png");
else
p.setCustomHUDDial("VimanaX_RepIcon", "vx_blank.png");
} else
p.setCustomHUDDial("VimanaX_RepIcon", "vx_blank.png");
if (p.energy < p.maxEnergy / 3) this.$blinkingIcons("VimanaX_EnergyAlert", "vx_alert_red.png");
else if (p.energy < p.maxEnergy / 2) this.$blinkingIcons("VimanaX_EnergyAlert", "vx_alert_orange.png");
else p.setCustomHUDDial("VimanaX_EnergyAlert", "vx_blank.png");
var ctmp = Math.round(100 * p.temperature);
if (ctmp > 70) this.$blinkingIcons("VimanaX_CTempAlert", "vx_alert_red.png");
else if (ctmp > 50) this.$blinkingIcons("VimanaX_CTempAlert", "vx_alert_orange.png");
else p.setCustomHUDDial("VimanaX_CTempAlert", "vx_blank.png");
if (p.forwardShield < p.maxForwardShield * 0.2) this.$blinkingIcons("VimanaX_FshAlert", "vx_alert_red.png");
else if (!p.torusEngaged && p.forwardShield < p.maxForwardShield / 2) this.$blinkingIcons("VimanaX_FshAlert", "vx_alert_orange.png");
else p.setCustomHUDDial("VimanaX_FshAlert", "vx_blank.png");
if (p.aftShield < p.maxAftShield * 0.2) this.$blinkingIcons("VimanaX_AshAlert", "vx_alert_red.png");
else if (!p.torusEngaged && p.aftShield < p.maxAftShield / 2) this.$blinkingIcons("VimanaX_AshAlert", "vx_alert_orange.png");
else p.setCustomHUDDial("VimanaX_AshAlert", "vx_blank.png");
if (alerts._lastAlert[4] < 10000) this.$blinkingIcons("VimanaX_AltAlert", "vx_alert_orange.png");
else p.setCustomHUDDial("VimanaX_AltAlert", "vx_blank.png");
if (alerts._incomingMiss) this.$blinkingIcons("VimanaX_MissAlert", "vx_target.png");
else p.setCustomHUDDial("VimanaX_MissAlert", "vx_blank.png");
}
//----------------------------------------------------------------------------------------
this.$LMSSIcons = function _vimanaXHUD_LMSSIcons(tmr) {
var p = player.ship;
if (tmr && tmr.isRunning) {
if (Math.floor(this._iconTimer.nextTime * 10) & 1) p.setCustomHUDDial("VimanaX_Lmss", "vx_lmss1.png");
else p.setCustomHUDDial("VimanaX_Lmss", "vx_lmss0.png");
} else {
p.setCustomHUDDial("VimanaX_Lmss", "vx_lmss0.png");
}
}
//----------------------------------------------------------------------------------------
this.$blinkingIcons = function _vimanaXHUD_blinkingIcons(key, ico, blank) {
if (blank == null) blank = "vx_blank.png";
if (Math.floor(this._iconTimer.nextTime * 10) & 1) {
player.ship.setCustomHUDDial(key, ico);
} else {
player.ship.setCustomHUDDial(key, blank);
}
}
//----------------------------------------------------------------------------------------
this.$getHostileShips = function _vimanaXHUD_getHostileShips() {
return this.$filterEntities(
function (e) { return (e.isShip && e.hasHostileTarget && e.target === player.ship); }
);
};
//----------------------------------------------------------------------------------------
this.$filterEntities = function _vimanaXHUD_filterEntities(filterFunc) {
return system.filteredEntities(
this,
filterFunc,
player.ship,
player.ship.scannerRange
);
}
//----------------------------------------------------------------------------------------
this.$showInfo = function _vimanaXHUD_showInfo() { //txt information on the hud
var that = _vimanaXHUD_showInfo;
var _padText = (that._padText = that._padText || this.$padText);
var p = player.ship;
if (!this._timer2Ping) { this._timer2Ping = true; this.$playSound(); }
var col1 = 1.1;
var col2 = 10.9;
if (this._widthLookup == 1) {col1 = 2; col2 = 11.35;}
/**************************************
* display a list of damaged equipment
**************************************/
//right panel
p.setCustomHUDDial("VimanaX_RPTitle", this._staticText.shipInfo);
if (p.equipmentStatus("EQ_VIMANAX_SHIP_MODULE") === "EQUIPMENT_OK") {
if (this._eqDamaged.length && !(Math.floor(this._infoTimer.nextTime * 100) % 4)) {
if (this._eqDamaged.length < 9) {
var poz = this._lastUsed[14] = 0;
} else {
if (this._lastUsed[14] > this._eqDamaged.length - 1) this._lastUsed[14] = 0;
var poz = this._lastUsed[14];
this._lastUsed[14]++;
}
for (let i = 0; i < 9; i++) {
if (i > this._eqDamaged.length - 1) break;
let y = poz + i;
if (y > this._eqDamaged.length - 1) y -= this._eqDamaged.length;
let dsp = _padText((1 + y).toString(), col1, true) + _padText(". " + this._eqDamaged[y], col2);
let ln = i + 1;
p.setCustomHUDDial("VimanaX_R" + ln, dsp);
}
}
}
if (p.alertCondition === 3) {
if ((this._SLS && this._SLS.sniperlockchangeflag && this._SLS.sniperlockchangeflag === "ON") ||
(this._SLP && this._SLP._SLPState === "ON"))
p.setCustomHUDDial("VimanaX_TLock", "LOCKED");
else
p.setCustomHUDDial("VimanaX_TLock", "");
//hostile counter
var hc = [];
hc = this.$getHostileShips();
if (hc.length > 0) {
if (hc.length > 9)
p.setCustomHUDDial("VimanaX_HC", hc.length);
else
p.setCustomHUDDial("VimanaX_HC", " " + hc.length);
}
} else {
p.setCustomHUDDial("VimanaX_TLock", "");
}
this.$setLPanel();
//special slots
//repairbots status/ams system/heat sinks/ore processor
var i = this._specialSlots.length;
while (i--) {
var slotData = "VimanaX_SpecialSlot" + (i + 1).toString();
var slotLabel = "VimanaX_SpecialSlot" + (i + 1).toString() + "Label";
var outputLabel = "";
var outputData = "";
switch (this._specialSlots[i]) {
case "SRS":
outputLabel = "SR.SYS";
if (this._SRS && this._SRS.$controllerVersion)
outputData = this._SRS.$selfRepairsSystemStatus + ", Charges: " + missionVariables.repairCounter;
break;
case "AMS":
outputLabel = "AM.SYS";
if (p.equipmentStatus("EQ_AMS") === "EQUIPMENT_OK" && missionVariables.amActive === "ACTIVE" && this._AMS.amCount)
outputData = "Darts: " + this._AMS.amCount;
else if (p.equipmentStatus("EQ_AMS") === "EQUIPMENT_OK") outputData = "OFFLINE";
else if (p.equipmentStatus("EQ_AMS") === "EQUIPMENT_DAMAGED") outputData = "DAMAGED";
else outputData = "";
break;
case "HEATSINK":
outputLabel = "H.SINK";
if (p.equipmentStatus("EQ_HEAT_SINK_CONTROL") === "EQUIPMENT_OK") outputData = "Manual deploy: ";
if (p.equipmentStatus("EQ_HEAT_SINK_CONTROL") === "EQUIPMENT_DAMAGED") outputData = "DAMAGED";
if (p.equipmentStatus("EQ_HEAT_SINK_CONTROL_PASSIVE") === "EQUIPMENT_OK") outputData = "Auto deploy: ";
if (p.equipmentStatus("EQ_HEAT_SINK_CONTROL_PASSIVE") === "EQUIPMENT_DAMAGED") outputData = "DAMAGED";
if (outputData != "DAMAGED") {
var allhs = p.equipmentStatus("EQ_HEAT_SINK", true);
if (allhs) {
var hs = allhs["EQUIPMENT_OK"];
if (hs >= 0) outputData += hs + " avail";
}
}
break;
case "OREPROC":
outputLabel = "ORE.PR";
var op = worldScripts.oreProcessor;
// Idle
var idle = !op._oreTimer.isRunning;
// Processing: x remaining
var sp = op._splinter.length;
// Damaged
var sts = p.equipmentStatus("EQ_ORE_PROCESSOR");
if (sts != "EQUIPMENT_UNAVAILABLE" && sts != "EQUIPMENT_UNKNOWN") {
outputData = (sts == "EQUIPMENT_DAMAGED" ? "DAMAGED" : (idle ? "Idle: " : "Working: ") + sp + " remain");
}
break;
case "RANK":
outputLabel = "RANK";
var rnk = player.rank;
var score = player.score;
if (score >= 6400) rnk = "★ ELITE ★";
outputData = rnk + (score < 6400 ? " (->" + this.$killsUntilNextRank() + ")" : "") + ": " + (score - this._killsOnLaunch).toString();
break;
case "STATUS":
outputLabel = "LEGAL";
outputData = player.legalStatus + " (" + player.bounty + ")";
break;
}
p.setCustomHUDDial(slotLabel, outputLabel);
p.setCustomHUDDial(slotData, this.$padText(outputData, this._widths[slotData][this._widthLookup], true));
}
/*
* equip mode
*/
var eq_mode = "";
switch (p.primedEquipment) {
case "EQ_ENEMY_TARGETER_UPGRADE":
var w = worldScripts["Target System Upgrade"];
if (w.hasOwnProperty("_mode")) {
eq_mode = ["Target hostile/outlaw","Target neutral","Target cargo"][w._mode];
}
break;
case "EQ_TARGETSELECTOR":
var w = worldScripts.FastTargetSelector;
eq_mode = ["Standard targets", "All targets"][w._scanMode];
break;
case "EQ_GCM_EJECTION_DAMPER":
var w = worldScripts.GalCopBB_EjectionDamper;
var state = w._unitOn;
eq_mode = (state == true ? "On" : "Off");
var uses = w._usesLeft;
eq_mode += " (" + uses + (uses == 1 ? " use": " uses") + " left)";
break;
case "EQ_MFD_FAST_CONFIG":
var mfd = worldScripts.MFDFastConfiguration;
if (mfd) {
var modes = [
"Set current as set 1",
"Set current as set 2",
"Set current as set 3",
"Set current as Cond Green set",
"Set current as Cond Yellow set",
"Set current as Cond Red set",
"Set current as docking set",
"Make set 1 default",
"Make set 2 default",
"Make set 3 default",
"Make Cond Green set default",
"Make Cond Yellow set default",
"Make Cond Red set default",
"Delete set 1",
"Delete set 2",
"Delete set 3",
"Delete Cond Green set",
"Delete Cond Yellow set",
"Delete Cond Red set",
"Delete docking set",
"Hide setting functions from list",
"Activate default set",
"Activate set 1",
"Activate set 2",
"Activate set 3",
"Activate Cond Green set",
"Activate Cond Yellow set",
"Activate Cond Red set",
"Activate docking set",
"Disable auto-update mode",
"Restore setting functions to list"
];
eq_mode = modes[mfd._curr_mode];
}
break;
case "EQ_COMMSLOGMFD":
var cl = worldScripts.CommsLogMFD;
if (cl && (cl._currMode || cl._currMode == 0)) {
switch (cl._currMode) {
case 0: eq_mode = "Scroll back mode";
break;
case 1: eq_mode = "Scroll forward mode";
break;
case 2: eq_mode = "Scroll to prev launch";
break;
case 3: eq_mode = "Scroll to next launch";
break;
case 4: eq_mode = "View current";
break;
case 5: eq_mode = "View oldest";
break;
case 6: eq_mode = "Clear log mode";
break;
case 7: eq_mode = "Write comms to log";
break;
case 8:
if (worldScripts.CommsLogMFD._scrollMethod === 0) {
eq_mode = "Set scroll by message";
} else {
eq_mode = "Set scroll by line";
}
break;
default: eq_mode = "Scroll back mode";
break;
}
}
break;
case "EQ_TARGET_FILTERING_SYSTEM":
if (p.equipmentStatus("EQ_TARGET_FILTERING_SYSTEM") === "EQUIPMENT_OK") {
switch (this._TFS._mode) {
case 0: eq_mode = "Hostile/outlaw";
break;
case 1: eq_mode = "Thargoid";
break;
case 2: eq_mode = "Police";
break;
case 3: eq_mode = "Neutral";
break;
case 4: eq_mode = "Cargo";
break;
case 5: eq_mode = "Asteroids";
break;
}
}
break;
case "EQ_WPH_ASC_UPGRADE":
if (p.equipmentStatus("EQ_WPH_ASC_UPGRADE") === "EQUIPMENT_OK") {
eq_mode = "Clear current waypoint";
}
break;
case "EQ_FUEL_TRANSFER":
if (p.equipmentStatus("EQ_FUEL_TRANSFER") === "EQUIPMENT_OK") {
eq_mode = "Stop transfer";
}
break;
case "EQ_BROADCASTCOMMSMFD":
if (p.equipmentStatus("EQ_BROADCASTCOMMSMFD") === "EQUIPMENT_OK") {
eq_mode = "Select next option";
}
break;
case "EQ_MARKET_INQUIRER_MFD":
if (p.equipmentStatus("EQ_MARKET_INQUIRER_MFD") == "EQUIPMENT_OK") {
eq_mode = "View next commodity";
}
break;
case "EQ_GCM_RANGE_FINDER_MFD":
if (p.equipmentStatus("EQ_GCM_RANGE_FINDER_MFD") === "EQUIPMENT_OK") {
switch (worldScripts.GalCopBB_RangeFinder_MFD._mode) {
case 0: eq_mode = "Escape capsules";
break;
case 1: eq_mode = "Black boxes";
break;
case 2: eq_mode = "Asteroids";
break;
case 3: eq_mode = "Ships";
break;
case 4: eq_mode = "Comm relays";
break;
case 5: eq_mode = "Cargo pods";
break;
default: eq_mode = "Escape capsules";
break;
}
}
break;
case "EQ_BULK_CARGO_PROCESSOR":
if (p.equipmentStatus("EQ_BULK_CARGO_PROCESSOR") === "EQUIPMENT_OK") eq_mode = "Cycle processing type";
break;
case "EQ_FUEL_INJECTION_CRUISECONTROL":
if (p.equipmentStatus("EQ_FUEL_INJECTION_CRUISECONTROL") === "EQUIPMENT_OK") {
if (worldScripts.FuelInjectionCruiseControl._autoEngage) {
eq_mode = "Turn off auto-engage";
} else {
eq_mode = "Turn on auto-engage";
}
}
break;
case "EQ_SHIPS_LIBRARY":
if (p.equipmentStatus("EQ_SHIPS_LIBRARY") === "EQUIPMENT_OK") {
eq_mode = expandDescription("[ships-library-mfd-mode" + worldScripts["Ships Library"].$mfdMode + "]");
}
break;
case "EQ_MANIF_SCANNER":
if (p.equipmentStatus("EQ_MANIF_SCANNER") === "EQUIPMENT_OK") {
if (worldScripts.ManifestScanner._scanMode == 0) {
eq_mode = "Set active scan mode";
} else {
eq_mode = "Set manual scan mode";
}
}
break;
case "EQ_HEAT_SINK_CONTROL":
if (p.equipmentStatus("EQ_HEAT_SINK_CONTROL") === "EQUIPMENT_OK") {
if (worldScripts.ShipConfiguration_HeatSink._mode == 0) {
eq_mode = "Set auto deploy mode";
} else {
eq_mode = "Set manual deploy mode";
}
}
break;
case "EQ_SMUGGLING_INFLIGHT_STORAGE":
if (p.equipmentStatus("EQ_SMUGGLING_INFLIGHT_STORAGE") === "EQUIPMENT_OK") {
eq_mode = "Cycle cargo to store";
}
break;
case "EQ_CAMERA_DRONES":
if (p.equipmentStatus("EQ_CAMERA_DRONES") === "EQUIPMENT_OK") {
eq_mode = "Select next camera";
}
break;
case "EQ_WARRANT_SCANNER":
var ws = worldScripts["BountySystem_WarrantScanner"];
switch (ws._outputMode) {
case 0: eq_mode = "MFD output";
break;
case 1: eq_mode = "Console output";
}
break;
case "EQ_HYPER_RADIO":
eq_mode = "Reconnect";
break;
case "EQ_ORE_PROCESSOR":
eq_mode = "Scan minerals";
break;
case "EQ_WPH_ASC_UPGRADE":
eq_mode = "Delete selected";
break;
case "EQ_TELESCOPE":
var ws = worldScripts["telescopeeq"];
if (this._telescopeVersion >= 2) {
if (this._telescopeVersion > 2.0) {
// cag's 2.0 update to Telescope puts the primeable equipment menu item values out of reach
// code in v2.1.4 makes the mode visible again.
var tm = [
[ "Nearest target" ],
[ "Rescan" ],
[ "Step forward in list" ],
[ "Step back in list" ],
[ "Steer:", "off", "nearest only", "nearest + step list"],
[ "Lightballs:", "off", "nav only", "inc. ships", "large" ],
[ "Masslck ring:", "alert:off", "alert:on", "brighter" ],
[ "Sniper ring km:", "off", "5-25.6", "10-25.6", "15-25.6", "5-30", "10-30", "15-30"], //off=10-10
[ "Targets:", "20 and red alert", 50, 100, 200 ],
[ "Visual target:", "off", "weapons off", "no ring", "no station", "no question mark", "all" ],
[ "Visual target size:", 1, 2, 3, 4, 5, 6, 7, 8 ]
];
var selection = ws.$eq_MenuItem;
var subitem = (selection >= 4 ? ws.$eq_GetSubItem(selection) : 0);
} else {
var tm = [["N/A"]];
var selection = 0;
var subitem = 0;
}
} else {
var tm = [
[ "Nearest target" ],
[ "Rescan" ],
[ "Step forward in list" ],
[ "Step back in list" ],
[ "Lightballs:", "off", "nav only", "ships", "masslock borders", "bright masslock", "large" ],
[ "Sniper ring km:", "off", "5-25.6", "10-25.6", "15-25.6", "5-30", "10-30", "15-30"], //off=10-10
[ "Steer:", "off", "nearest only", "nearest + step list"],
[ "Targets:", "20 and red alert", 50, 100, 200 ],
[ "Visual target:", "off", "weapons off", "no ring", "no station", "no question mark", "all" ],
[ "Visual target size:", 1, 2, 3, 4, 5, 6, 7, 8 ]
];
var selection = ws.$Telescopeeq_MenuItem;
var subitem = (selection >= 4 ? ws.$Telescopeeq_GetSubItem(selection) : 0);
}
eq_mode = (selection >= 4 ? tm[selection][0] : "") + tm[selection][subitem];
break;
case "EQ_TOWBAR":
if (p.equipmentStatus("EQ_TOWBAR") === "EQUIPMENT_OK") {
var ws = worldScripts["towbar"];
switch (ws.$TowbarMiner) {
case 0: eq_mode = "Offline";
break;
case 1: eq_mode = "Cargo only";
break;
case 2: eq_mode = "Up to full";
break;
case 3: eq_mode = "Salvager";
break;
default: eq_mode = "Miner N/A";
}
}
break;
case "EQ_TSP_TARGET_BANKING_MODULE":
var m = worldScripts[expandDescription("[tsplugins_script_sh]")].$tbmTargetMode;
eq_mode = expandDescription("[tsplugins_title_mode" + m + "]");
break;
default: eq_mode = "N/A";
}
p.setCustomHUDDial("VimanaX_EQMode", this.$padText(eq_mode, this._widths["VimanaX_EQMode"][this._widthLookup]));
// check one MFD per
// make sure the HUD hasn't change since the last cycle and reduced the number of MFDs
if (this._checkMFDCycle > (p.multiFunctionDisplays - 1)) this._checkMFDCycle = 0;
this.$checkMFD(this._checkMFDCycle);
this._checkMFDCycle = (this._checkMFDCycle + 1) % p.multiFunctionDisplays;
}
/**************************************
* right panel
* ************************************/
//Player ship shields and hull test animation
//----------------------------------------------------------------------------------------
this.$animHull = function _vimanaXHUD_animHull() {
var p = player.ship;
if (!p || !p.isValid) return;
if (!this._timer3Ping) { this._timer3Ping = true; this.$playSound(); }
if (p.equipmentStatus("EQ_VIMANAX_SHIP_MODULE") === "EQUIPMENT_OK") {
if (this._hullAnim[0]) {
if (this._hullAnim[1] > 10) this._hullAnim[1] = 1;
else this._hullAnim[1]++;
if (this._hullAnim[1] <= 4) p.setCustomHUDDial("VimanaX_HullAnim", "vx_scan_" + this._hullAnim[1] + ".png");
else p.setCustomHUDDial("VimanaX_HullAnim", "vx_blank.png");
}
var wtp = Math.round(p.aftShield / p.maxAftShield * 100);
var wtt = Math.round(p.forwardShield / p.maxForwardShield * 100);
if (wtp > 75) p.setCustomHUDDial("VimanaX_TT", "vx_tt100.png");
else if (wtp > 50 && wtp < 76) p.setCustomHUDDial("VimanaX_TT", "vx_tt75.png");
else if (wtp > 25 && wtp < 51) p.setCustomHUDDial("VimanaX_TT", "vx_tt50.png");
else if (wtp > 1 && wtp < 26) p.setCustomHUDDial("VimanaX_TT", "vx_tt25.png");
else p.setCustomHUDDial("VimanaX_TT", "vx_blank.png");
if (wtt > 75) p.setCustomHUDDial("VimanaX_TP", "vx_tp100.png");
else if (wtt > 50 && wtt < 76) p.setCustomHUDDial("VimanaX_TP", "vx_tp75.png");
else if (wtt > 25 && wtt < 51) p.setCustomHUDDial("VimanaX_TP", "vx_tp50.png");
else if (wtt > 1 && wtt < 26) p.setCustomHUDDial("VimanaX_TP", "vx_tp25.png");
else p.setCustomHUDDial("VimanaX_TP", "vx_blank.png");
} else {
p.setCustomHUDDial("VimanaX_HullAnim", "vx_blank.png");
p.setCustomHUDDial("VimanaX_TT", "vx_blank.png");
p.setCustomHUDDial("VimanaX_TP", "vx_blank.png");
if (p.equipmentStatus("EQ_VIMANAX_SHIP_MODULE") === "EQUIPMENT_UNAVAILABLE") {
this._animTimer.stop();
delete this._animTimer;
}
}
}
//----------------------------------------------------------------------------------------
this.$equipmentStatus = function _vimanaXHUD_equipmentStatus() { //check equip
var p = player.ship;
p.setCustomHUDDial("VimanaX_Rh1", "");
p.setCustomHUDDial("VimanaX_Rh2", "");
var i = 10;
while (i--) {
p.setCustomHUDDial("VimanaX_R" + i, "");
}
if (p.equipmentStatus("EQ_VIMANAX_SHIP_MODULE") === "EQUIPMENT_OK") {
p.setCustomHUDDial("VimanaX_PSName", this.$padText(p.displayName, this._widths["VimanaX_PSName"][this._widthLookup]));
if (this._hullAnim[0]) var m = "vx_" + this._hullAnim[0] + ".png";
else var m = "vx_blank.png";
p.setCustomHUDDial("VimanaX_PShip", m);
if (this._eqDamaged.length) {
/***********************
* equip damaged
* *********************/
var pd = Math.round((this._eqDamaged.length / p.equipment.length) * 1000) / 10;
p.setCustomHUDDial("VimanaX_Rh1", this._staticText.shipDamaged);
p.setCustomHUDDial("VimanaX_Rh2", this._eqDamaged.length + " (" + pd + "%) system(s) broken");
p.setCustomHUDDial("VimanaX_R0", this._staticText.checkList);
if (this._SRS && this._SRS.$controllerVersion && missionVariables.repairCounter > 0) {
if (this._SRS.$selfRepairsSystemStatus === "Stand-by")
this._SRS.checkEquipment();
}
} else {
/***********************
* no damage
* *********************/
p.setCustomHUDDial("VimanaX_Rh1", "");
p.setCustomHUDDial("VimanaX_Rh2", "");
if (this._lastUsed[16] > 0) {
p.setCustomHUDDial("VimanaX_R8", "All equipment & systems");
p.setCustomHUDDial("VimanaX_R9", "operational and efficient");
} else {
p.setCustomHUDDial("VimanaX_R9", " No additional equipment!");
}
}
} else {
var tx = this._staticText.unavailable;
p.setCustomHUDDial("VimanaX_R1", tx);
if (p.equipmentStatus("EQ_VIMANAX_SHIP_MODULE") === "EQUIPMENT_DAMAGED") tx = this._staticText.moduleDamaged;
else tx = this._staticText.moduleNotInstalled;
p.setCustomHUDDial("VimanaX_R2", tx);
p.setCustomHUDDial("VimanaX_PShip", "vx_blank.png");
}
}
/**************************************
* left panel
* ************************************/
//----------------------------------------------------------------------------------------
this.$setLPanel = function _vimanaXHUD_setLPanel() {
var p = player.ship;
var i = 10;
while (i--) {
p.setCustomHUDDial("VimanaX_L" + i, "");
}
if (p.target && p.target.isValid && !p.target.isWormhole) {
if (p.equipmentStatus("EQ_VIMANAX_TARGET_MODULE") === "EQUIPMENT_OK") {
this.$targetInfo();
} else {
p.setCustomHUDDial("VimanaX_PTarget", "vx_blank.png");
p.setCustomHUDDial("VimanaX_Lh", "");
var tx = "";
p.setCustomHUDDial("VimanaX_L3", this._staticText.unavailable);
if (p.equipmentStatus("EQ_VIMANAX_TARGET_MODULE") === "EQUIPMENT_DAMAGED") tx = this._staticText.moduleDamaged;
else tx = this._staticText.moduleNotInstalled;
p.setCustomHUDDial("VimanaX_L4", tx);
}
} else { //travel info
if (this._lastUsed[12] == 1) {
this._lastUsed[12] == 0;
this._lastUsed[13] = "";
p.setCustomHUDDial("VimanaX_LPTitle", this._staticText.travelHeader);
p.setCustomHUDDial("VimanaX_PTarget", "vx_globe.png");
p.setCustomHUDDial("VimanaX_CEnergy", "");
p.setCustomHUDDial("VimanaX_CSpeed", "");
p.setCustomHUDDial("VimanaX_CMissile", "");
if (p.equipmentStatus("EQ_VIMANAX_TRAVEL_MODULE") === "EQUIPMENT_OK") {
this.$travelInfo();
} else {
this.$jumpDistIndicator();
p.setCustomHUDDial("VimanaX_PTarget", "vx_blank.png");
p.setCustomHUDDial("VimanaX_Lh", "");
var tx = "";
p.setCustomHUDDial("VimanaX_L3", this._staticText.unavailable);
if (p.equipmentStatus("EQ_VIMANAX_TRAVEL_MODULE") === "EQUIPMENT_DAMAGED") tx = this._staticText.moduleDamaged;
else tx = this._staticText.moduleNotInstalled;
p.setCustomHUDDial("VimanaX_L4", tx);
}
}
}
}
//----------------------------------------------------------------------------------------
this.$targetInfo = function _vimanaXHUD_targetInfo() {
var that = _vimanaXHUD_targetInfo;
var _padText = (that._padText = that._padText || this.$padText);
var _cbtMFD = (that._cbtMFD = that._cbtMFD || this._combatMFD);
var _ms = (that._ms = that._ms || this._MS);
var _gameShips = (that._gameShips = that._gameShips || this._gameShips);
var p = player.ship;
var tdata = [];
var col1 = 5;
var max = this._widths["VimanaX_L0"][this._widthLookup];
var hmax = this._widths["VimanaX_Lh"][this._widthLookup];
if (this._widthLookup == 1) col1 = 6; //{ max = 13.35; col1 = 6; hmax = 11.86; }
var i = 10;
while (i--) {
tdata[i] = "";
}
this._lastUsed[12] = 1;
tdata[0] = p.target.displayName;
if (p.target.dataKey == "telescopemarker") {
tdata[1] = "Additional info not available";
tdata[2] = "(Out of range)";
var itn = tdata[0].indexOf("km ");
if (itn > -1 && itn < 10) tdata[0] = tdata[0].substr(itn + 3);
if (this._lastUsed[13] != tdata[0]) { //load target model only for telescope
this._lastUsed[13] = tdata[0];
var m = null;
var tn = _gameShips[tdata[0]];
if (tn == "***") tn = null; // how to get data key of telescope target?
if (tn) m = "vx_" + tn + ".png";
if (m) var model = m; else var model = "vx_blank.png";
p.setCustomHUDDial("VimanaX_PTarget", model);
}
} else if ((p.target.isBoulder || p.target.isRock) && !p.target.isPiloted) {
tdata[1] = _padText("SPEED:", col1) + _cbtMFD.$Data["combatTSpeed"] + "m/s";
tdata[2] = _padText("BOUNTY:", col1) + p.target.bounty + "€";
} else if (p.target.isMissile) {
tdata[1] = _padText("SPEED:", col1) + _cbtMFD.$Data["combatTSpeed"] + "m/s";
tdata[2] = _padText("ENERGY:", col1) + Math.round(p.target.energy);
tdata[4] = _padText("TRAVELLED:", col1) + p.target.distanceTravelled.toFixed(0) + " m";
} else if (p.target.hasRole("escape-capsule")) {
tdata[1] = _padText("SPEED:", col1) + _cbtMFD.$Data["combatTSpeed"] + "m/s";
tdata[2] = _padText("BOUNTY:", col1) + p.target.bounty + "€";
} else if (p.target.scanClass == "CLASS_BUOY" && !p.target.isPiloted) {
if (p.target.name) tdata[0] = p.target.name;
else if (p.target.beaconLabel) tdata[0] = p.target.beaconLabel;
else if (p.target.beaconCode) tdata[0] = p.target.beaconCode;
else tdata[0] = "Unidentified";
tdata[2] = _padText("ENERGY:", col1) + Math.round(p.target.energy);
tdata[3] = _padText("RADIUS:", col1) + Math.round(p.target.collisionRadius) + " m";
} else if (p.target.isStation) {
if (p.target.maxSpeed == 0) {
tdata[3] = _padText("RADIUS:", col1) + Math.round(p.target.collisionRadius) + " m";
} else {
tdata[3] = _padText("SPEED:", col1) + _cbtMFD.$Data["combatTSpeed"] + "m/s";
}
tdata[4] = _padText("ENERGY:", col1) + Math.round(p.target.energy);
tdata[6] = _padText("DEFENDERS:", col1) + p.target.dockedPolice;
if (p.target.requiresDockingClearance) {
tdata[1] = _padText("DOCK:", col1) + "REQUEST";
switch (player.dockingClearanceStatus) {
case "DOCKING_CLEARANCE_STATUS_REQUESTED":
tdata[1] = _padText("DOCK:", col1) + "HOLD";
break;
case "DOCKING_CLEARANCE_STATUS_GRANTED":
tdata[1] = _padText("DOCK:", col1) + "GRANTED";
break;
case "DOCKING_CLEARANCE_STATUS_TIMING_OUT":
tdata[1] = _padText("DOCK:", col1) + "EXPIRING";
}
} else {
tdata[1] = _padText("DOCK:", col1) + "FREE";
}
} else if (p.target.isDerelict) {
tdata[2] = _padText("ENERGY:", col1) + Math.round(p.target.energy);
tdata[4] = _padText("CARGO:", col1) + p.target.cargoSpaceUsed + "/" + p.target.cargoSpaceCapacity + "t";
} else if (p.target.isShip && (p.target.isPiloted || p.target.isThargoid)) {
tdata[1] = _padText("SPEED:", col1) + _cbtMFD.$Data["combatTSpeed"] + "m/s";
tdata[2] = _padText("ENERGY:", col1) + Math.round(p.target.energy);
// use combatMFD to get weapon type, so we don't get more information than it provides
tdata[5] = _padText("WEAPON:", col1) + _padText(_cbtMFD.$Data["combatTLaser"].replace("Laser: ", ""), (max - col1));
tdata[6] = _padText("RANGE:", col1) + (tdata[5].indexOf("Unknown") >= 0 ? "??" : (p.target.weaponRange / 1000).toFixed(1) + "km");
// this reveals information the player doesn't have any right to know
/*var mc = 0;
var hmc = 0;
var msc = "";
i = p.target.missiles.length;
while (i--) {
let mst = p.target.missiles[i].equipmentKey;
if (mst == "EQ_MISSILE" || mst == "EQ_ARMOURY_STANDARD_MISSILE") mc++;
else hmc++;
}
if (hmc > 0 && mc > 0) msc = hmc + "h/" + mc + "s";
else if (hmc > 0) msc = hmc + "h";
else if (mc > 0) msc = mc + "s";
else msc = "0";*/
tdata[4] = _padText("MISSILE:", col1) + _cbtMFD.$Data["combatTMissile"];
// only show the used cargo space if the manifest scanner has done a scan
// capacity is related to ship specs, and is therefore OK to show
var cp = p.target.cargoSpaceCapacity;
if (_ms && cp > 0) {
var d = _ms.$findShipScan(p.target);
if (d !== "") {
tdata[7] = _padText("CARGO:", col1) + p.target.cargoSpaceUsed + "/" + cp + "t";
} else {
tdata[7] = _padText("CARGO:", col1) + "??/" + cp + "t";
}
} else {
tdata[7] = _padText("CARGO:", col1) + (cp > 0 ? "??" : "--") + "/" + cp + "t";
}
tdata[9] = _padText("BOUNTY:", col1) + p.target.bounty + "€";
if (player.alertCondition == 3) {
p.setCustomHUDDial("VimanaX_CEnergy", "E: " + Math.round(p.target.energy));
p.setCustomHUDDial("VimanaX_CSpeed", "V: " + _cbtMFD.$Data["combatTSpeed"] + "m/s");
p.setCustomHUDDial("VimanaX_CMissile", "M: " + _cbtMFD.$Data["combatTMissile"]);
}
} else if (p.target.isCargo) {
tdata[0] = p.target.name;
tdata[1] = p.target.shipUniqueName;
if (tdata[1].indexOf("Gold") > -1 || tdata[1].indexOf("Platinum") > -1) var unit = "kg";
else if (tdata[1].indexOf("Gem-Stones") > -1) var unit = "g";
else var unit = "t";
tdata[2] = _padText("AMOUNT:", col1) + p.target.commodityAmount + unit;
tdata[3] = _padText("SPEED:", col1) + _cbtMFD.$Data["combatTSpeed"] + "m/s";
}
//--------------
p.setCustomHUDDial("VimanaX_Lh", this.$padText(tdata[0], hmax));
p.setCustomHUDDial("VimanaX_L0", "");
i = 9
while (i--) {
p.setCustomHUDDial("VimanaX_L" + (i + 1), tdata[i + 1]);
}
}
//----------------------------------------------------------------------------------------
this.$travelInfo = function _vimanaXHUD_travelInfo() {
var that = _vimanaXHUD_travelInfo;
var _padText = (that._padText = that._padText || this.$padText);
var p = player.ship;
var dest = "Destination not set";
this._reqFuel = 0;
var ddist = "";
var nlabel = "";
var col1 = 7;
var col2 = 1.8;
var col3 = 6.2;
var max = this._widths["VimanaX_L0"][this._widthLookup];
var hmax = this._widths["VimanaX_Lh"][this._widthLookup];
if (this._widthLookup == 1) { col1 = 9.0; col2 = 2.1; col3 = 7.3; }
var i = 7;
while (i--) {
p.setCustomHUDDial("VimanaX_L" + (i + 3), "");
}
if (system.isInterstellarSpace) {
dest = "Interstellar Space!";
ddist = "Route calculation unavailable";
nlabel = "";
} else if (system.ID != p.targetSystem) {
var fullRoute = system.info.routeToSystem(System.infoForSystem(galaxyNumber, p.targetSystem), p.routeMode);
var tsys = System.infoForSystem(galaxyNumber, p.targetSystem);
if (!tsys.hasOwnProperty("concealment") || tsys.concealment < 200) {
dest = _padText(tsys.name, col1);
if (!tsys.hasOwnProperty("concealment") || tsys.concealment < 100) {
dest += this._ecos[tsys.economy] + this._govs[tsys.government] + (tsys.techlevel + 1);
} else {
dest += "? ? ?";
}
} else {
dest = _padText("(Unknown)", col1) + "? ? ?";
}
if (fullRoute) {
let dday = Math.floor(fullRoute.time / 24);
let dhour = Math.floor(fullRoute.time % 24);
let dmin = Math.floor(fullRoute.time % 60);
let tx = Math.floor(fullRoute.distance * 10) / 10;
let hp = fullRoute.route.length - 1;
ddist = tx.toFixed(1).toString() + "ly, " + dday + "d:" + dhour + "h:" + dmin + "m, " + hp + " jmp";
if (defaultFont.measureString(ddist) > hmax) {
ddist = tx.toFixed(1).toString() + "ly, " + fullRoute.time.toFixed(1) + "h, " + hp + " jmp";
}
if (fullRoute.route.length > 0) {
if (fullRoute.route.length > 8) var nxr = 8;
else var nxr = fullRoute.route.length;
if (p.routeMode === "OPTIMIZED_BY_NONE" && fullRoute.route.length > 2) {
p.setCustomHUDDial("VimanaX_L4", "Unknown route!");
} else {
for (i = 1; i < nxr; i++) {
let a = i + 2;
let b = System.infoForSystem(galaxyNumber, fullRoute.route[i]);
let c = system.info.routeToSystem(System.infoForSystem(galaxyNumber, fullRoute.route[i]), p.routeMode);
let tx = Math.floor(c.distance * 10) / 10;
if (i == 1) this._reqFuel = tx;
let d = _padText(tx.toFixed(1).toString(), col2, true) + "ly ";
if (!b.hasOwnProperty("concealment") || b.concealment < 200) {
d += _padText(b.name, col3);
if (!b.hasOwnProperty("concealment") || b.concealment < 100) {
d += this._ecos[b.economy] + this._govs[b.government] + (b.techlevel + 1);
} else {
d += "? ? ?";
}
} else {
d += _padText("(Unknown)", col3) + "? ? ?";
}
p.setCustomHUDDial("VimanaX_L" + a, d);
}
}
nlabel = this._staticText.nextHops;
}
}
}
p.setCustomHUDDial("VimanaX_Lh", dest);
p.setCustomHUDDial("VimanaX_L0", ddist);
p.setCustomHUDDial("VimanaX_L1", "");
p.setCustomHUDDial("VimanaX_L2", nlabel);
}
//----------------------------------------------------------------------------------------
// used when travel mod hasn't been purchased or isn't available
this.$jumpDistIndicator = function _vimanaXHUD_jumpDistIndicator() {
var p = player.ship;
this._reqFuel = 0;
if (!p || !p.isValid) return;
if (p.targetSystem == system.ID) return; // no target system set
var fullRoute = system.info.routeToSystem(System.infoForSystem(galaxyNumber, p.targetSystem), p.routeMode);
if (fullRoute && fullRoute.route.length > 1) {
let c = system.info.routeToSystem(System.infoForSystem(galaxyNumber, fullRoute.route[1]), p.routeMode);
let tx = Math.floor(c.distance * 10) / 10;
this._reqFuel = tx;
}
}
//----------------------------------------------------------------------------------------
this.$checkMaint = function _vimanaXHUD_checkMaint() {
var p = player.ship;
if (p.serviceLevel < 85) {
this._maintenance = true;
} else {
this._maintenance = false;
p.setCustomHUDDial("VimanaX_Service", "vx_blank.png");
}
}
//-------------------------------------------------------------------------------------------------------------
// sets the witchspace destination labels to the next destination (to fix bug in 1.82 with the builtin dial that only shows the final destination)
this.$setDestination = function _vimanaXHUD_setDestination() {
var p = player.ship;
var planet = "(Unknown)";
var extra = "";
if (this._destination == system.ID) planet = "(Not set)";
if (this._destination >= 0 && this._destination != system.ID) {
var s = System.infoForSystem(galaxyNumber, this._destination);
if (!s.hasOwnProperty("concealment") || s.concealment < 200) planet = s.name;
if (!s.hasOwnProperty("concealment") || s.concealment < 100) {
extra = " (" + this._ecos[s.economy] + this._govs[s.government] + (s.techlevel + 1) + ")";
planet += extra;
}
}
p.setCustomHUDDial("witchspace_destination", planet);
this._holdTarget = p.targetSystem;
}
//-------------------------------------------------------------------------------------------------------------
this.$checkForNewDestination = function _vimanaXHUD_checkForNewDestination() {
// check if our destination hasn't been set yet (-1) or if our targetSystem has changed, or we've just left the long/short range chart
if (this._destination === -1 || this._holdTarget != player.ship.targetSystem || (this._mapScreen === "GUI_SCREEN_SHORT_RANGE_CHART" || this._mapScreen === "GUI_SCREEN_LONG_RANGE_CHART")) {
this._destination = this.$playerTargetSystem();
this.$setDestination();
}
if (player.ship.docked) this.$updateDockedHUDLabels();
}
//-------------------------------------------------------------------------------------------------------------
// returns the player's target system (1.80) or the next jump to their target system (1.82)
this.$playerTargetSystem = function _vimanaXHUD_playerTargetSystem() {
var p = player.ship;
if (p.hasOwnProperty("nextSystem")) return p.nextSystem;
// need to check for the ANA when route checking - if no ANA it's just the targetSystem - no routing available
var target = p.targetSystem;
if (oolite.compareVersion("1.81") < 0 && p.hasEquipmentProviding("EQ_ADVANCED_NAVIGATIONAL_ARRAY") === true) {
// in 1.81 or greater, the target system could be more than 7 ly away. It becomes, essentially, the final destination.
// there could be multiple interim stop points between the current system and the target system.
// the only way to get this info is to recreate a route using the same logic as entered on the ANA, and pick item 1
// from the list. That should be the next destination in the list.
if (target != this._lastSource) {
var myRoute = System.infoForSystem(galaxyNumber, this._lastSource).routeToSystem(System.infoForSystem(galaxyNumber, target), p.routeMode);
if (myRoute && myRoute.route.length > 1) {
target = myRoute.route[1];
}
}
}
return target;
}
/***********************************
* indicators
***********************************/
//----------------------------------------------------------------------------------------
this.$showIndicators = function _vimanaXHUD_showIndicators() {
var that = _vimanaXHUD_showIndicators;
var _padText = (that._padText = that._padText || this.$padText);
var _widths = (that._widths = that._widths || this._widths);
var _cbtMFD = (that._cbtMFD = that._cbtMFD || this._combatMFD);
var p = player.ship;
if (!p || !p.isValid) return;
var i = 0;
var efl = 0 //extra fuel
//var speed = Math.round(p.velocity.magnitude() / 10) * 10;
var ctemp = Math.round(p.temperature * 100);
var fuel = (p.fuel).toFixed(1);
var td = -1;
if (p.target && p.target.isValid && !p.target.isWormhole) { //calculate & display distance to player target
var trg = p.target;
if (p.target.dataKey == "telescopemarker")
if (this._TLS.$TelescopeList[this._TLS.$TelescopeListi - 1]) trg = this._TLS.$TelescopeList[this._TLS.$TelescopeListi - 1];
if (trg.position) {
td = trg.position.distanceTo(p.position) - Math.round(trg.collisionRadius);
if (td > 100000) td = Math.round(td / 1000);
else td = Math.round(td / 10) / 100;
}
} else {
var sec = "" + Math.floor(clock.seconds % 60); //display clock
if (sec.length < 2) sec = "0" + sec;
var min = "" + Math.floor(clock.minutes % 60);
if (min.length < 2) min = "0" + min;
p.setCustomHUDDial("VimanaX_SClock", Math.floor(clock.hours % 24) + ":" + min + ":" + sec + " - " + clock.days);
}
// try to keep everything inside the element bounds
var decimals = 2;
var extra = "";
if (td >= 1000000) {
td = td / 1000000;
decimals = 1;
extra = "G";
} else if (td >= 10000) {
td = td / 1000;
decimals = 1;
extra = "M";
} else if (td >= 1000) decimals = 0;
else if (td >= 100) decimals = 1;
p.setCustomHUDDial("VimanaX_TDist", (td != -1 ? td.toFixed(decimals) + extra : "* * * * ") + this._spacer);
//DuplexFuelTank.oxz
if (p.equipmentStatus("EQ_DUPLEX_FUEL_TANK_STATE_1") == "EQUIPMENT_OK") efl += 1;
else if (p.equipmentStatus("EQ_DUPLEX_FUEL_TANK_STATE_2") == "EQUIPMENT_OK") efl += 2;
else if (p.equipmentStatus("EQ_DUPLEX_FUEL_TANK_STATE_3") == "EQUIPMENT_OK") efl += 3;
//ExtraFuelTanks
if (p.equipmentStatus("EQ_RESERVE_TANK") == "EQUIPMENT_OK") efl += 1;
else if (p.equipmentStatus("EQ_AUX_TANK") == "EQUIPMENT_OK") efl += 3;
//Fuel_Tank
if (p.equipmentStatus("EQ_FUELTANK_MINE") == "EQUIPMENT_OK") {
i = p.missiles.length;
while (i--) {
if (p.missiles[i].equipmentKey == "EQ_FUELTANK_MINE") efl += 3;
}
}
// ASC dist
var ascd_raw = _cbtMFD.$Data["combatSCTDist"];
if (!ascd_raw) ascd_raw = "";
if (this._lastUsed[19] != ascd_raw) {
this._lastUsed[19] = ascd_raw;
if (ascd_raw != "") {
var ascd = parseInt(ascd_raw);
// convert value back to m
if (ascd_raw.indexOf("Mkm") > 0) ascd *= 1000000000;
else if (ascd_raw.indexOf("km") > 0) ascd *= 1000;
// work out scale for display
var scale = "m";
if (ascd >= 10000000000) { // Gm gigameters
ascd /= 1000000000;
scale = "Gm";
} else if (ascd >= 10000000) {// Mm megameters
ascd /= 1000000;
scale = "Mm";
} else if (ascd >= 1000) { // km kilometers
ascd /= 1000;
scale = "km";
}
p.setCustomHUDDial("VimanaX_ASCDist", ascd.toFixed(0) + scale);
} else {
p.setCustomHUDDial("VimanaX_ASCDist", "");
}
}
// altitude calculation
if (system.isInterstellarSpace) {
var alt = 99999;
this.$setGauge("VimanaX_AltG", alt, 50000, 11, "lpi");
p.setCustomHUDDial("VimanaX_Alt", "--");
} else {
// use combat MFD's value for alt
var altRaw = _cbtMFD.$Data["combatAlt"].toString();
var alt = parseInt(altRaw);
if (isNaN(alt)) {
alt = 99999;
} else {
if (altRaw.indexOf("Mkm") > 0) alt = 99999; // basically max dist
else if (altRaw.indexOf("km") > 0) alt *= 1000 // convert to meters
}
// alt should now be in meters
if (this._lastUsed[11] != alt) {
var pre = "";
if (alt < 1000) {
pre = "0.";
var a = alt;
} else {
var a = Math.round(alt / 1000);
}
this.$setGauge("VimanaX_AltG", alt, 50000, 11, "lpi");
if (a > 50000) {
p.setCustomHUDDial("VimanaX_Alt", "--");
} else {
var post = "";
if (a >= 1000) {
a = a / 1000;
post = "k";
}
p.setCustomHUDDial("VimanaX_Alt", pre + Math.round(a) + post);
}
}
}
if (this._lastUsed[0] != ctemp) { //cabin temperature
p.setCustomHUDDial("VimanaX_CTemp", ctemp + "°");
this.$setGauge("VimanaX_CTempG", ctemp, 100, 0, "ln");
}
var spd = _cbtMFD.$Data["combatSpeed"];
if (this._lastUsed[1] != spd) { //speed
if (spd >= 100000) {
p.setCustomHUDDial("VimanaX_Speed", (spd / 1000).toFixed(0) + "k");
} else {
p.setCustomHUDDial("VimanaX_Speed", spd);
}
p.setCustomHUDDial("VimanaX_Speed2", "V: " + spd + " m/s");
if (spd > p.maxSpeed) this.$setGauge("VimanaX_SpeedG", spd, p.maxSpeed, 1, "ln");
else this.$setGauge("VimanaX_SpeedG", spd, p.maxSpeed, 1, "lp");
}
if (this._lastUsed[2] != fuel || this._lastUsed[3] != efl) { //fuel
var ef = "";
if (efl) ef = "+" + Math.round(efl);
p.setCustomHUDDial("VimanaX_Fuel", fuel + ef);
this.$setGauge("VimanaX_FuelG", fuel, 7, 2, "lp");
this._lastUsed[3] = efl;
this._lastUsed[2] = fuel;
}
if (this._lastUsed[15] != this._reqFuel) { //required fuel
var a = Math.round(this._reqFuel / (7 / 15));
player.ship.setCustomHUDDial("VimanaX_FuelR", "vx_fr" + a + ".png");
this._lastUsed[15] = this._reqFuel;
}
if (this._lastUsed[4] != p.cargoSpaceUsed || this._lastUsed[5] != p.cargoSpaceCapacity) { //cargo
p.setCustomHUDDial("VimanaX_Cargo", p.cargoSpaceUsed + "/" + p.cargoSpaceCapacity);
this._lastUsed[5] = p.cargoSpaceCapacity;
if (p.cargoSpaceCapacity == 0) this.$setGauge("VimanaX_CargoG", 1, 1, 4, "ln");
else this.$setGauge("VimanaX_CargoG", p.cargoSpaceUsed, p.cargoSpaceCapacity, 4, "ln");
}
if (this._lastUsed[6] != p.energy) { //energy
p.setCustomHUDDial("VimanaX_Energy", Math.round(p.energy));
this.$setGauge("VimanaX_EnergyG", p.energy, p.maxEnergy, 6, "ppi");
this._lastUsed[6] = p.energy;
}
if (this._lastUsed[7] != p.aftShield) {
var wtp = Math.round(p.aftShield / p.maxAftShield * 100);
p.setCustomHUDDial("VimanaX_Ash", wtp + "%");
this.$setGauge("VimanaX_AshG", p.aftShield, p.maxAftShield, 7, "ppi");
this._lastUsed[7] = p.aftShield;
}
if (this._lastUsed[8] != p.forwardShield) {
var wtt = Math.round(p.forwardShield / p.maxForwardShield * 100);
p.setCustomHUDDial("VimanaX_Fsh", wtt + "%");
this.$setGauge("VimanaX_FshG", p.forwardShield, p.maxForwardShield, 8, "ppi");
this._lastUsed[8] = p.forwardShield;
}
var lsname = p.currentWeapon.name;
p.setCustomHUDDial("VimanaX_LaserName", _padText(lsname, _widths["VimanaX_LaserName"][this._widthLookup], true));
if (this._lastUsed[9] != p.laserHeatLevel) {
p.setCustomHUDDial("VimanaX_LaserTemp", Math.round(p.laserHeatLevel * 1190) + "°");
this.$setGauge("VimanaX_LaserTempG", p.laserHeatLevel, 0.85, 9, "pn");
this._lastUsed[9] = p.laserHeatLevel;
}
if ((p.equipmentStatus("EQ_IRONHIDE") == "EQUIPMENT_UNAVAILABLE" || p.equipmentStatus("EQ_IRONHIDE") == "EQUIPMENT_UNKNOWN") && !this._SC_Armour) {
p.setCustomHUDDial("VimanaX_FArmour", "");
p.setCustomHUDDial("VimanaX_FArmourG", "vx_blank.png");
p.setCustomHUDDial("VimanaX_FArmourLabel", "");
p.setCustomHUDDial("VimanaX_AArmour", "");
p.setCustomHUDDial("VimanaX_AArmourG", "vx_blank.png");
p.setCustomHUDDial("VimanaX_AArmourLabel", "");
}
if (this._lastUsed[10] != missionVariables.ironHide_percentage) {
p.setCustomHUDDial("VimanaX_FArmour", missionVariables.ironHide_percentage.toFixed(0) + "%");
this.$setGauge("VimanaX_FArmourG", missionVariables.ironHide_percentage, 100, 10, "ppi");
p.setCustomHUDDial("VimanaX_FArmourLabel", "ARMOUR");
p.setCustomHUDDial("VimanaX_AArmour", "");
p.setCustomHUDDial("VimanaX_AArmourG", "vx_blank.png");
p.setCustomHUDDial("VimanaX_AArmourLabel", "");
this._lastUsed[10] = missionVariables.ironHide_percentage;
}
if (this._SC_Armour) {
var armourFront = 0;
var armourAft = 0;
var arm = worldScripts.ShipConfiguration_Armour;
if (p.script._armourFront >= 0) {
armourFront = p.script._armourFront;
armourAft = p.script._armourAft;
} else {
armourFront = arm._armourFront;
armourAft = arm._armourAft;
}
if (this._lastUsed[17] != armourFront) {
p.setCustomHUDDial("VimanaX_FArmour", armourFront.toFixed(0) + "%");
this.$setGauge("VimanaX_FArmourG", armourFront, 100, 17, "ppi");
p.setCustomHUDDial("VimanaX_FArmourLabel", "F.ARM");
this._lastUsed[17] = armourFront;
}
if (this._lastUsed[18] != armourAft) {
p.setCustomHUDDial("VimanaX_AArmour", armourAft.toFixed(0) + "%");
this.$setGauge("VimanaX_AArmourG", armourAft, 100, 18, "ppi");
p.setCustomHUDDial("VimanaX_AArmourLabel", "A.ARM");
this._lastUsed[18] = armourAft;
}
}
}
//----------------------------------------------------------------------------------------
this.$setGauge = function _vimanaXHUD_setGauge(key, cur, max, i, pos) {
//set gauge speed, ctemp, alt, shield, etc
var a = max / 15;
this._lastUsed[i] = cur;
if (cur > max) cur = max;
a = parseInt(cur / a);
player.ship.setCustomHUDDial(key, "vx_" + a + "_" + pos + ".png");
}
/***********************************
* F4 interface
***********************************/
//-------------------------------------------------------------------------------------------------------------
this.$initInterface = function _vimanaXHUD_initInterface(station) {
station.setInterface(this.name, {
title: "Vimana-X HUD Settings",
category: "Ship Systems",
summary: "Manages settings for some of the Vimana-X HUD components.",
callback: this.$showPage.bind(this)
});
}
//-------------------------------------------------------------------------------------------------------------
this.$showPage = function _vimanaXHUD_showPage() {
var curChoices = {};
var text = "";
var col = 22;
var counter = 0;
text = "Select from the options below:";
curChoices["00_00_ALERTS"] = {
text: "Large alert popups on the main screen - " + (worldScripts.VimanaX_Alerts._disabled == false ? "Enabled" : "Disabled"),
color: "greenColor",
alignment: "LEFT",
unselectable: true
};
if (worldScripts.VimanaX_Alerts._disabled == false) {
curChoices["00_00_DISABLE_ALERTS"] = {
text: "- Disable large alert popups",
alignment: "LEFT"
};
} else {
curChoices["00_00_ENABLE_ALERTS"] = {
text: "- Enable large alert popups",
alignment: "LEFT"
};
}
curChoices["00_01_STYLE"] = {
text: "Main screen UI style - " + this._style,
color: "greenColor",
alignment: "LEFT",
unselectable: true
};
if (this._style == "dark") {
curChoices["00_01_UILIGHT"] = {
text: "- Change style to light",
alignment: "LEFT"
};
} else {
curChoices["00_01_UIDARK"] = {
text: "- Change style to dark (helps manage glare)",
alignment: "LEFT"
};
}
curChoices["00_02_HEADER"] = {
text: "Non-linear scanner - " + (this._nonLinear ? "Yes" : "No") + " / Scanner ultra-zoom - " + (this._ultraZoom ? "Yes" : "No"),
color: "greenColor",
alignment: "LEFT",
unselectable: true
};
if (this._nonLinear == true) {
curChoices["00_02_LINEAR"] = {
text: "- Switch to linear scanner (ships can disappear from zoomed scanner)",
alignment: "LEFT"
}
} else {
curChoices["00_02_NONLINEAR"] = {
text: "- Switch to non-linear scanner (ships are pushed outwards as zoom increases)",
alignment: "LEFT"
}
}
if (this._ultraZoom == true) {
curChoices["00_03_NORMALZOOM"] = {
text: "- Switch to normal zoom modes (1x/2x/3x/4x/5x)",
alignment: "LEFT"
}
} else {
curChoices["00_03_ULTRAZOOM"] = {
text: "- Switch to ultra zoom modes (1x/2x/4x/8x/16x)",
alignment: "LEFT"
}
}
curChoices["00_99_OPTION"] = {
text: "",
unselectable: true
};
curChoices["01_00_HEADER"] = {
text: "Special Slot 1 content",
alignment: "LEFT",
color: "greenColor",
unselectable: true
};
curChoices["02_00_HEADER"] = {
text: "Special Slot 2 content",
alignment: "LEFT",
color: "greenColor",
unselectable: true
};
curChoices["01_00_OPTION"] = {
text: this.$padText("- Nothing", col) + (this._setSlot1 == 0 ? " ** currently set" : ""),
alignment: "LEFT"
};
curChoices["02_00_OPTION"] = {
text: this.$padText("- Nothing", col) + (this._setSlot2 == 0 ? " ** currently set" : ""),
alignment: "LEFT"
};
if (this._AMS) {
counter += 1;
curChoices["01_01_OPTION"] = {
text: this.$padText("- Anti-Missile system (when installed)", col) + (this._setSlot1 == 1 ? " ** currently set" : ""),
alignment: "LEFT"
};
curChoices["02_01_OPTION"] = {
text: this.$padText("- Anti-Missile system (when installed)", col) + (this._setSlot2 == 1 ? " ** currently set" : ""),
alignment: "LEFT"
};
}
if (this._SRS) {
counter += 1;
curChoices["01_02_OPTION"] = {
text: this.$padText("- Self-Repair system (when installed)", col) + (this._setSlot1 == 2 ? " ** currently set" : ""),
alignment: "LEFT"
};
curChoices["02_02_OPTION"] = {
text: this.$padText("- Self-Repair system (when installed)", col) + (this._setSlot2 == 2 ? " ** currently set" : ""),
alignment: "LEFT"
};
}
if (worldScripts.ShipConfiguration_HeatSink) {
counter += 1;
curChoices["01_05_OPTION"] = {
text: this.$padText("- Heak sink control (when installed)", col) + (this._setSlot1 == 5 ? " ** currently set" : ""),
alignment: "LEFT"
};
curChoices["02_05_OPTION"] = {
text: this.$padText("- Heak sink control (when installed)", col) + (this._setSlot2 == 5 ? " ** currently set" : ""),
alignment: "LEFT"
};
}
if (worldScripts.oreProcessor) {
counter += 1;
curChoices["01_06_OPTION"] = {
text: this.$padText("- Ore processor status (when installed)", col) + (this._setSlot1 == 6 ? " ** currently set" : ""),
alignment: "LEFT"
};
curChoices["02_06_OPTION"] = {
text: this.$padText("- Ore processor status (when installed)", col) + (this._setSlot2 == 6 ? " ** currently set" : ""),
alignment: "LEFT"
};
}
curChoices["01_03_OPTION"] = {
text: this.$padText("- Rank (with # kills for next rank and since launch)", col) + (this._setSlot1 == 3 ? " ** currently set" : ""),
alignment: "LEFT"
};
curChoices["02_03_OPTION"] = {
text: this.$padText("- Rank (with # kills for next rank and since launch)", col) + (this._setSlot2 == 3 ? " ** currently set" : ""),
alignment: "LEFT"
};
curChoices["01_04_OPTION"] = {
text: this.$padText("- Legal status (with current bounty)", col) + (this._setSlot1 == 4 ? " ** currently set" : ""),
alignment: "LEFT"
};
curChoices["02_04_OPTION"] = {
text: this.$padText("- Legal status (with current bounty)", col) + (this._setSlot2 == 4 ? " ** currently set" : ""),
alignment: "LEFT"
};
for (var i = 0; i < (5 - counter); i++) {
curChoices["98_SPACER_" + i.toString()] = {
text: "",
unselectable: true
}
}
curChoices["99_EXIT"] = "Exit";
if (this._default == "") this._default = "99_EXIT";
var opts = {
screenID: "oolite-vimanaxhud-dockside-map",
title: "Vimana-X HUD Configuration",
allowInterrupt: true,
exitScreen: "GUI_SCREEN_INTERFACES",
initialChoicesKey: this._default,
choices: curChoices,
message: text
};
mission.runScreen(opts, this.$screenHandler, this);
}
//-------------------------------------------------------------------------------------------------------------
this.$screenHandler = function _vimanaXHUD_screenHandler(choice) {
if (choice == null) return;
this._default = choice;
switch (choice) {
case "00_00_DISABLE_ALERTS": worldScripts.VimanaX_Alerts._disabled = true; this._default = "00_00_ENABLE_ALERTS"; break;
case "00_00_ENABLE_ALERTS": worldScripts.VimanaX_Alerts._disabled = false; this._default = "00_00_DISABLE_ALERTS"; break;
case "00_01_UILIGHT": this._style = "light"; this._default = "00_01_UIDARK"; break;
case "00_01_UIDARK": this._style = "dark"; this._default = "00_01_UILIGHT"; break;
case "00_02_NONLINEAR": this._nonLinear = true; this._default = "00_02_LINEAR"; this.$updateHUDSelectorSettings(); break;
case "00_02_LINEAR": this._nonLinear = false; this._default = "00_02_NONLINEAR"; this.$updateHUDSelectorSettings(); break;
case "00_03_ULTRAZOOM": this._ultraZoom = true; this._default = "00_03_NORMALZOOM"; this.$updateHUDSelectorSettings(); break;
case "00_03_NORMALZOOM": this._ultraZoom = false; this._default = "00_03_ULTRAZOOM"; this.$updateHUDSelectorSettings(); break;
case "01_00_OPTION": this._setSlot1 = 0; this.$changeSettings(); break;
case "01_01_OPTION": this._setSlot1 = 1; this.$changeSettings(); break;
case "01_02_OPTION": this._setSlot1 = 2; this.$changeSettings(); break;
case "01_03_OPTION": this._setSlot1 = 3; this.$changeSettings(); break;
case "01_04_OPTION": this._setSlot1 = 4; this.$changeSettings(); break;
case "01_05_OPTION": this._setSlot1 = 5; this.$changeSettings(); break;
case "01_06_OPTION": this._setSlot1 = 6; this.$changeSettings(); break;
case "02_00_OPTION": this._setSlot2 = 0; this.$changeSettings(); break;
case "02_01_OPTION": this._setSlot2 = 1; this.$changeSettings(); break;
case "02_02_OPTION": this._setSlot2 = 2; this.$changeSettings(); break;
case "02_03_OPTION": this._setSlot2 = 3; this.$changeSettings(); break;
case "02_04_OPTION": this._setSlot2 = 4; this.$changeSettings(); break;
case "02_05_OPTION": this._setSlot2 = 5; this.$changeSettings(); break;
case "02_06_OPTION": this._setSlot2 = 6; this.$changeSettings(); break;
}
if (choice != "99_EXIT") {
this.$showPage();
}
}
//----------------------------------------------------------------------------------------
this.$updateHUDSelectorSettings = function _vimanaXHUD_updateHUDSelectorSettings() {
var h = worldScripts.hudselector;
if (h) h.$HUDSelectorScanner = ((this._nonLinear ? 1 : 0) + (this._ultraZoom ? 2 : 0));
}
/***********************************
* helpers
***********************************/
//----------------------------------------------------------------------------------------
this.$measureText = function _vimanaXHUD_measureText() {
var test = defaultFont.measureString("0Z");
var i = oolite.resourcePaths.length;
while (i--) {
// we're going to force the issue for OCRA Extended...
if (oolite.resourcePaths[i].indexOf("OCRAExtended") >= 0) { test = 0.9; break; }
}
if (test > 0.864) this._widthLookup = 1;
test = defaultFont.measureString("0");
if (test > 0.5) {
this._spacer = "";
} else if (test > 0.45 && test <= 0.5) {
this._spacer = " ";
} else {
this._spacer = " ";
}
}
//-------------------------------------------------------------------------------------------------------------
// appends space to currentText to the specified length in 'em'
this.$padText = function _vimanaXHUD_padText(currentText, desiredLength, leftSwitch, centreSwitch) {
var that = _vimanaXHUD_padText;
var hairSpace = (that.hairSpace = that.hairSpace || this._hairSpace);
var ellip = (that.ellip = that.ellip || this._ellip);
var hairSpaceLength = (that.hairSpaceLength = that.hairSpaceLength || this._hairSpaceLength);
var measure = (that.measure = that.measure || defaultFont.measureString);
if (currentText == null) currentText = "";
var currentLength = measure(currentText.replace(/%%/g, "%"));
// calculate number needed to fill remaining length
var padsNeeded = Math.floor((desiredLength - currentLength) / hairSpaceLength);
if (padsNeeded < 1) {
// text is too long for column, so start pulling characters off
var tmp = currentText;
do {
tmp = tmp.substring(0, tmp.length - 2) + ellip;
if (tmp === ellip) break;
} while (measure(tmp.replace(/%%/g, "%")) > desiredLength);
currentLength = measure(tmp.replace(/%%/g, "%"));
padsNeeded = Math.floor((desiredLength - currentLength) / hairSpaceLength);
currentText = tmp;
}
// quick way of generating a repeated string of that number
if (!leftSwitch || leftSwitch === false) {
if (!centreSwitch || centreSwitch === false) {
return currentText + new Array(padsNeeded).join(hairSpace);
} else {
return currentText + new Array(parseInt(padsNeeded / 2)).join(hairSpace);
}
} else {
if (!centreSwitch || centreSwitch === false) {
return new Array(padsNeeded).join(hairSpace) + currentText;
} else {
return new Array(parseInt(padsNeeded / 2)).join(hairSpace) + currentText;
}
}
}
//-------------------------------------------------------------------------------------------------------------
// because there is no direct connection between equipment items and MFD ID's we're doing a translation here
this.$confirmMFDEquipment = function _vimanaXHUD_confirmMFDEquipment(mfdID) {
var list = null;
switch (mfdID) {
case "combat_MFD": list = ["EQ_COMBATMFD"]; break;
case "telescope": list = ["EQ_TELESCOPE"]; break;
case "escortdeck": list = ["EQ_ESCORTDECK", "EQ_ESCORTDECKXL"]; break;
case "CommsLogMFD": list = ["EQ_COMMSLOGMFD", "EQ_COMMSLOGMFD_PASSIVE"]; break;
case "BroadcastCommsMFD": list = ["EQ_BROADCASTCOMMSMFD"]; break;
case "trophy_mfd": list = ["EQ_TROPHY_MFD"]; break;
case "navi_mfd": list = ["EQ_NAVIGATION_MFD"]; break;
case "NavigationBeaconsMFD": list = ["EQ_NAVBEACONS_MFD"]; break;
case "inquirer_mfd": list = ["EQ_MARKET_INQUIRER_MFD"]; break;
case "HermitageMFD": list = null; if (!worldScripts.Hermitage_Main) return false; break; // no equip for this one
case "manifest_mfd": list = ["EQ_MANIFEST_MFD"]; break;
case "useful_MFD_general_info": list = null; if (!worldScripts.useful_MFDs) return false; break; // no equip for this one
case "useful_MFD_market": list = null; if (!worldScripts.useful_MFDs) return false; break;
case "Waypoint_Here_MFD": list = ["EQ_WPH_ASC_UPGRADE"]; break;
case "DamageReportMFD": list = ["EQ_DAMAGE_REPORT_MFD", "EQ_DAMAGE_REPORT_MFD_PASSIVE"]; break;
case "RangeFinderMFD": list = ["EQ_GCM_RANGE_FINDER_MFD"]; break;
case "LaunchQueueMFD": list = null; break; // no equip for this one
case "BountySystem_WarrantScanner": list = ["EQ_WARRANT_SCANNER"]; break;
case "RandomStationNames": list = ["EQ_ALMANAC_UNIT_MFD"]; break;
case "EQ_ADVANCED_SYSTEM_DATA_MFD": list = ["EQ_ADVANCED_SYSTEM_DATA_MFD"]; break;
case "nm_primeable-mfd": list = null; if (!worldScripts.PrimeableEquipmentMFD) return false; break;
case "SSLaneIndicator": list = ["EQ_SSLI_MFD"]; break;
case "tsplugins_srs": list = ["EQ_TSP_SHORT_RANGE_SNAPSHOT"]; break;
case "tsplugins_tmi": list = ["EQ_TSP_TARGET_MEMORY_INTERFACE"]; break;
case "ships-library": list = ["EQ_SHIPS_LIBRARY"]; break;
}
if (list == null) return true;
var p = player.ship;
var i = list.length;
while (i--) {
if (p.equipmentStatus(list[i]) == "EQUIPMENT_OK") return true;
}
return false;
}
//-------------------------------------------------------------------------------------------------------------
this.$changeSettings = function _vimanaXHUD_changeSettings() {
var list = ["", "AMS", "SRS", "RANK", "STATUS", "HEATSINK", "OREPROC"];
if (this._setSlot1 >= 0) this._specialSlots[0] = list[this._setSlot1];
if (this._setSlot2 >= 0) this._specialSlots[1] = list[this._setSlot2];
}
//-------------------------------------------------------------------------------------------------------------
this.$updateShipConfigHUD = function _vimanaXHUD_updateShipConfigHUD() {
// tell ShipConfig to use our HUD on the F3 Equip Ship screen
var sch = worldScripts.ShipConfiguration_F3HUDControl;
var p = player.ship;
if (sch && p.hud.indexOf(this.name) >= 0) {
if (!sch._holdXHUD) sch._holdXHUD = sch._equipSpaceHUD;
sch._equipSpaceHUD = this._dockedHUD;
}
}
//-------------------------------------------------------------------------------------------------------------
this.$revertShipConfigHUD = function _vimanaXHUD_revertShipConfigHUD() {
// tell ShipConfig to go back to it's former HUD on the F3 Equip Ship screen
var sch = worldScripts.ShipConfiguration_F3HUDControl;
var p = player.ship;
if (sch && sch._holdXHUD) {
sch._equipSpaceHUD = sch._holdXHUD;
delete sch._holdXHUD;
}
}
//-------------------------------------------------------------------------------------------------------------
this.$killsUntilNextRank = function _vimanaXHUD_killsUntilNextRank() {
var ranks = [6400, 2560, 512, 128, 64, 32, 16, 8];
var i = ranks.length;
var score = player.score;
while (i--) {
if (ranks[i] > score) return (ranks[i] - score);
}
return 0;
}
//-------------------------------------------------------------------------------------------------------------
this.$playSound = function _vimanaXHUD_playSound() {
var mySound = new SoundSource();
mySound.sound = "[@click]";
mySound.loop = false;
mySound.play();
}
//-------------------------------------------------------------------------------------------------------------
this.$switchDockedColor = function() {
player.ship.removeEquipment("EQ_VIMANAX_COLOR_NORMAL");
player.ship.removeEquipment("EQ_VIMANAX_COLOR_AMBER");
if (this.$checkForAmberMode() == true) {
player.ship.awardEquipment("EQ_VIMANAX_COLOR_AMBER");
} else {
player.ship.awardEquipment("EQ_VIMANAX_COLOR_NORMAL");
}
}
//-------------------------------------------------------------------------------------------------------------
this.$checkForAmberMode = function _vimanaXHUD_checkforAmberMode() {
var xenonUI = false;
if (worldScripts.Lib_GUI) {
if (worldScripts.Lib_GUI.$cur == "XenonUI") xenonUI = true;
} else {
if (worldScripts.XenonUI) xenonUI = true;
}
if (!xenonUI) return false;
return worldScripts.XenonUI._amber;
}
//-------------------------------------------------------------------------------------------------------------
this.$updateDockedHUDLabels = function() {
var s = "";
if (system.isInterstellarSpace) {
s = "Interstellar space";
} else {
s = system.name + " (" + this._ecos[system.economy] + this._govs[system.government] + (system.techLevel + 1) + ")";
}
player.ship.setCustomHUDDial("current_system", s);
player.ship.setCustomHUDDial("current_station", this.$padText(player.ship.dockedStation.displayName, 13.88, true));
}
// These functions are not used during gameplay. They are used to assist with creating the small ship images for
// the left and right panels
//-------------------------------------------------------------------------------------------------------------
this.$createShipImages = function (all) {
var exclude = ["heatsink","loader_withcargo","bounty_rhs_big_boss_imptrader_spacelane_shipset","LBbadrockI",
"rmb-chaff","hermitage","liners_tridentTine","LBbadrock","DHI_farpoint_marker","tugdrone","CT_launcher",
"drones_ATDroneLauncher","dock_rhs_mark_imptrader_shipset","dock_random_hits_mark_imptrader",
"armoury_trackerBeacon","missileRack_spentRack","random_hits_big_boss_imptrader_spacelane",
"drones_KDroneLauncher","btd_dummy_entity","repairBots_Bots","bounty_random_hits_big_boss_imptrader_spacelane",
"LBbadrockIII","jumpbeacon_marker","LBbadrockII","blackmonk_defenceship_mainhull","probe_probeLauncher",
"bounty_random_hits_mark_imptrader","random_hits_big_boss_imptrader","loader_nocargo","cotbs-ghost-base",
"armoury_fieldMine","random_hits_gravemarker1","rmb-frag-particle","rrs_solar_probe","drones_CDroneLauncher",
"gcm-temp-object","strut","arc-detail","rhs_mark_imptrader_shipset","random_hits_mark_imptrader",
"rhs_big_boss_imptrader_spacelane_shipset","armoury_missileMachine","random_hits_gravemarker2",
"random_hits_gravemarker3","telescopemarker","wormhole-restoration-wormhole-creator","ncc_bigturret",
"ncc_middle_part","ncc_biggun","tianve-masslocker","random_station_names_test_dummy",];
var shipkeys = Ship.keys();
this._list = [];
this._types = [];
if (!all) {
this._list = this._sampleList.concat();
} else {
for (var i = 0; i < shipkeys.length; i++) {
var shp = Ship.shipDataForKey(shipkeys[i]);
if (exclude.indexOf(shipkeys[i]) == -1 && shp.name !== undefined && !this._gameShips[shp.name] && this._types.indexOf(shp.name) == -1 &&
shp.name != "Splinter" && shp.name != "Wreckage" && shp.name != "Machinery" && shp.name.indexOf("lib_ms") == -1 && !shp._oo_is_subentity &&
shp.name.indexOf("Burning") == -1 && shp.name != "Sahana" && shipkeys[i].indexOf("towbar") == -1 &&
shp.name.indexOf("dock") == -1 && shp.name.indexOf("Dock") == -1 && shipkeys[i].indexOf("jaguar") == -1 &&
shp.name.indexOf("Card") == -1 && shp.name.indexOf("Turret") == -1 && shp.name.indexOf("Cargo") == -1 &&
shp.name != "Question Mark") {
this._list.push(shipkeys[i]);
//log(this.name, shipkeys[i] + " -- " + shp.name);
}
}
}
//this._list = Ship.keysForRole("station");
this._index = -1;
var w = worldScripts.XenonUI;
if (w) w.$addMissionScreenException("vimanax-ship");
this.$showShip();
}
this.$showShip = function () {
var found = false;
var shp = null;
do {
this._index += 1;
if (this._index >= this._list.length) return;
log(this.name, "trying " + this._list[this._index] + "...");
shp = Ship.shipDataForKey(this._list[this._index]);
if (shp && shp.name) {
if (this._types.indexOf(shp.name) == -1) found = true;
} else {
log(this.name, "WARNING: shp is " + (!shp ? "null" : "weird"));
found = false;
}
} while (found == false);
this._types.push(shp.name);
log(this.name, this._list[this._index] + " -- " + shp.name);
mission.runScreen({ screenID: "vimanax-ship", model: "[" + this._list[this._index] + "]", spinModel: false, background: "vx_white.png" });
var m = mission.displayModel;
/*if (shp.is_carrier && m) {
m.position = Vector3D(0, 0, m.collisionRadius * 2.8);
m.orientation = m.orientation.rotateX(1.6);
}*/
if (shp.isStation) {
m.orientation = m.orientation.rotateX(1.6);
}
if (m && m.flashers && m.flashers.length > 0) {
for (var i = m.flashers.length - 1; i >= 0; i--) {
var fl = m.flashers[i];
if (fl) fl.remove();
}
}
this._timer = new Timer(this, this.$nextShip, 2, 0);
}
this.$nextShip = function (choice, keyPress) {
this._timer.stop();
takeSnapShot("vx_ship_" + this._list[this._index]);
this.$showShip();
}
// validates images files for all ships in the gameships dictionary
// forces any errors into the log
this.$validateShipImages = function() {
this.shps = Object.keys(this._gameShips);
this.index = 0;
this._timer = new Timer(this, this.$doValidate.bind(this), 0.5, 0.5);
}
this.$doValidate = function() {
var p = player.ship;
if (this._gameShips[this.shps[this.index]] != "***") {
log(this.name, "trying " + this.shps[this.index]);
try {
p.setCustomHUDDial("VimanaX_PTarget", "vx_" + this._gameShips[this.shps[this.index]] + ".png");
} catch (error) {
log(this.name, "ERROR on file vx_" + this._gameShips[this.shps[this.index]] + ".png");
}
}
this.index += 1;
if (this.index > this.shps.length - 1) {
this._timer.stop();
}
}
|