Back to Index Page generated: Dec 20, 2024, 7:22:09 AM

Expansion Coluber HUD CH01

Content

Warnings

  1. Unknown key 'optional_oxp' at https://wiki.alioth.net/img_auth.php/e/ed/ColuberHUD-1.2.3.oxz!manifest.plist

Manifest

from Expansion Manager's OXP list from Expansion Manifest
Description The Coluber HUD CH01 is a fully featured HUD with individual scales for each gauge and additional control lights for important equipment. The Coluber HUD CH01 is a fully featured HUD with individual scales for each gauge and additional control lights for important equipment.
Identifier oolite.oxp.captain_beatnik.coluber_hud_ch01 oolite.oxp.captain_beatnik.coluber_hud_ch01
Title Coluber HUD CH01 Coluber HUD CH01
Category HUDs HUDs
Author Captain Beatnik, Norby Captain Beatnik, Norby
Version 1.2.3 1.2.3
Tags Balance=green, HUD Balance=green, HUD
Required Oolite Version
Maximum Oolite Version
Required Expansions
Optional Expansions
Conflict Expansions
Information URL http://wiki.alioth.net/index.php/Coluber_HUD_CH01 n/a
Download URL https://wiki.alioth.net/img_auth.php/e/ed/ColuberHUD-1.2.3.oxz n/a
License CC-BY-NC-SA 4.0 CC-BY-NC-SA 4.0
File Size n/a
Upload date 1610873507

Documentation

Also read http://wiki.alioth.net/index.php/Coluber%20HUD%20CH01

Readme.txt

Coluber HUD CH01
----------------

REQUIRES:    
        Oolite Version 1.80+


FEATURES:

    The Coluber HUD CH01 is a fully featured HUD with individual scales for each gauge and 
    additional control lights for important equipment


MONITOR RESOLUTION:
    This HUD works with a 1680 x 1050 (16:10) resolution on the Monitor. Other resolutions may work, 
    but I did no testing on it.


KNOWN ISSUES:
    - This .oxz is not compatible with the Target Reticle.oxp


AUTHOR:
    Captain Beatnik
    Contact: captain.beatnik@gmx.de  


ATTRIBUTION:
    This work is derived from the original configuration files that come with the Oolite program package.
    Thanks a lot to Giles C Williams (aegidian) and all contributors for developing Oolite. 
    Special thanks to Thargoid, Killer Wolf, JeffBTX, Wyvern, Smivs and CommonSenseOTB. I have learned very much by studying their work. 


LICENSE:
    This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

    To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/4.0/.
    
    You are free to:

        Share, copy and redistribute the material in any medium or format
    
        Adapt, remix, transform, and build upon the material

    The licensor cannot revoke these freedoms as long as you follow the license terms.

    Under the following terms:

            Attribution: You must give appropriate credit, provide a link to the license, and indicate if changes were made. 
            You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.

            NonCommercial: You may not use the material for commercial purposes.

            ShareAlike: If you remix, transform, or build upon the material, you must distribute your contributions under 
        the same license as the original.

            No additional restrictions: You may not apply legal terms or technological measures that legally restrict others 
        from doing anything the license permits.

    Notices:

        You do not have to comply with the license for elements of the material in the public domain or where your use 
        is permitted by an applicable exception or limitation.
    
        No warranties are given. The license may not give you all of the permissions necessary for your intended use. 
        For example, other rights such as publicity, privacy, or moral rights may limit how you use the material.


    (This is a human-readable summary of (and not a substitute for) the license.You should carefully review all of the terms and 
    conditions of the actual license at http://creativecommons.org/licenses/by-nc-sa/4.0/.before using the licensed material.)



VERSION HISTORY:
=======================

Version 1.2.3 2020-10-15
* Added ASC Target distance display

Version 1.2.2 2015-12-20
* Fixed docked HUD with HUDSelector, thanks to phkb.

Version 1.2.1 2015-06-22
* Fixed a missing image.

Version 1.2 2015-06-21
* Joystick sensitivity indicator enabled
* Alert sensitive scanner color
* Another degree fix by Mazur
* Allow big gui (longer equipment list in F5) disabled during flight

Version 1.1 2015-06-17 - an update by Norby
* Removed degree sign from cabin temp, thanks to Smivs.
* Added numeric ship speed display and a numeric altitude meter below 1000m.
* Gauges are hidden in dock to allow big gui.
* Clock moved a bit to fit into Xenon UI.

Version 1.0.1 2014-09-20
*Changed OXPs name
*Implemented compatibility with the ingame OXZ manager;
*implemented compatibility with HUDSelector.oxz. (Many thanks to Norby for providing the necessary JS-code);
*adjusted COMLOG and MESSAGE GUI size;
*added one MFD, now 7. MFD position now depends on monitor resolution;

Version 1.0.0 
*First release of this .OXZ

========================

*** end of file ***

Equipment

This expansion declares no equipment. This may be related to warnings.

Ships

This expansion declares no ships. This may be related to warnings.

Models

This expansion declares no models. This may be related to warnings.

Scripts

Path
Config/script.js
"use strict";
this.name = "coluber_hud_ch01";
this.author = "Captain Beatnik captain.beatnik@gmx.de, Norby norbylite@gmail.com";
this.licence = "CC BY-NC-SA 4.0";

this.startUp = function () {
	player.ship.hud =  this.name + "-dock.plist";
	var h = worldScripts.hudselector;
	if( h ) h.$HUDSelectorAddHUD("Coluber HUD CH01", this.name);
}

this.shipWillDockWithStation = function(station) {
	player.ship.hud =  this.name + "-dock.plist";
	if( this.$Timer ) { this.$Timer.stop(); delete this.$Timer;}
}

this.shipWillLaunchFromStation = function() {
	player.ship.hud =  this.name + ".plist";
	if( !this.$Timer ) this.$Timer = new Timer(this, this._update.bind(this), 0, 0.25);
}

this.$HUDSelectorCallBack = function ( off ) {
	var w = worldScripts.coluber_hud_ch01;
	if( off ) { //do things to disable your HUD like rename functions
		if( w.shipWillDockWithStation ) {
			w.$save_shipWillDockWithStation = w.shipWillDockWithStation;
			delete w.shipWillDockWithStation;
		}
		if( w.shipWillLaunchFromStation ) {
			w.$save_shipWillLaunchFromStation = w.shipWillLaunchFromStation;
			delete w.shipWillLaunchFromStation;
		}
		if( w.$Timer ) { w.$Timer.stop(); delete w.$Timer;}
	} else { //do things to activate your HUD like restore disabled functions
		//  if the player is docked, use the docked version of the HUD
		if (player.ship.docked) player.ship.hud =  this.name + "-dock.plist";
		if( !w.shipWillLaunchFromStation ) {
			eval("w.shipWillDockWithStation = "+w.$save_shipWillDockWithStation);
			eval("w.shipWillLaunchFromStation = "+w.$save_shipWillLaunchFromStation);
		}
		if( !this.$Timer ) this.$Timer = new Timer(this, this._update.bind(this), 0, 0.25);
	}
}

this._centeredText = function(txt, width) {
	var t = ""+txt; //force to srting, else txt.length is undefined for numbers
	var w = width / 2;
	while( t && t.length < w ) { //for fixed with font in setCustomHUDDial
		t = " " + t;
	}
	return(t);
}

this._update = function () {
	var p = player.ship;
	if( !p || !p.isValid ) return; //player died

	var setd = p.setCustomHUDDial;
	if( setd ) {
		if( !worldScripts.combat_MFD ) { //prefer CombatMFD if available
			var sp = Math.round(p.velocity.magnitude()/10)*10;
			sp = this._centeredText(sp, 28); //default width
			setd("combatSpeed", sp);
		}
	
		//altimeter
		var c = system.sun; //closest planetary object
       		if( c ) var d = p.position.distanceTo( c.position );
		else var d = 100000000000000000000.0; //10^20m for sure
		var l = system.planets;
		var len = l.length;
		for( var i = 0; i < len; i++ ) { //find the smallest distance
			var s = p.position.distanceTo( l[i].position )-l[i].radius;
			if( d > s ) {
				d = s;
				c = l[i];
			}
		}
		var alt = ""; //clear if no planetary object
		if( c ) {
			var a = p.position.distanceTo(c) - c.radius - p.collisionRadius;
			if( a < 1000 ) alt = this._centeredText( Math.floor(a)+"m", 28 );
		}
		setd("nearAlt", alt);
	}
}