Back to Index Page generated: May 8, 2024, 6:16:03 AM

Expansion telescope_StationOptions

Content

Warnings

  1. http://wiki.alioth.net/index.php/telescope_StationOptions -> 404 Not Found
  2. Required Expansions mismatch between OXP Manifest and Expansion Manager at character position 0060 (DIGIT ZERO vs LATIN SMALL LETTER N)
  3. Information URL mismatch between OXP Manifest and Expansion Manager string length at character position 0
  4. No version in dependency reference to oolite.oxp.Norby.Telescope:null
  5. No version in dependency reference to oolite.oxp.Norby.cag.Telescope:null
  6. Conflict Expansions mismatch between OXP Manifest and Expansion Manager at character position 0064 (DIGIT ZERO vs LATIN SMALL LETTER N)

Manifest

from Expansion Manager's OXP list from Expansion Manifest
Description Adds Station Options to access Telescope 1.15 options/readme using F4. Adds Station Options to access Telescope 1.15 options/readme using F4.
Identifier oolite.oxp.cag.telescope_StationOptions.oxp oolite.oxp.cag.telescope_StationOptions.oxp
Title telescope_StationOptions telescope_StationOptions
Category Equipment Equipment
Author cag cag
Version 1.0 1.0
Tags
Required Oolite Version
Maximum Oolite Version
Required Expansions
  • oolite.oxp.Norby.Telescope:0
  • oolite.oxp.cag.station_options:1.0
  • oolite.oxp.Norby.Telescope:
  • oolite.oxp.cag.station_options:1.0
  • Optional Expansions
    Conflict Expansions
  • oolite.oxp.Norby.cag.Telescope:0
  • oolite.oxp.Norby.cag.Telescope:
  • Information URL n/a
    Download URL https://wiki.alioth.net/img_auth.php/6/63/Telescope_StationOptions.oxz n/a
    License CC-BY-NC-SA 4.0 CC-BY-NC-SA 4.0
    File Size n/a
    Upload date 1645499173

    Documentation

    readme.txt

    A cut/paste quick & dirty retrofit to demo StationOptions.oxp.
    
    When docked, hit F4 and look for "Telescope Options"

    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
    this.name		 = "telescope_StationOptions";
    this.author		 = "cag, Cholmondely";
    this.copyright	 = "2021 cag, Cholmondely";
    this.license	 = "CC BY-NC-SA 4.0";
    this.description = "Access Telescope while docked at Station";
    this.version	 = "1.0";
    
    /* jshint elision: true, shadow: true, esnext: true, curly: false, maxerr: 1000, asi: true,
    		  laxbreak: true, undef: true, unused: true, evil: true,  forin: true, eqnull: true,
    		  noarg: true, eqeqeq: true, boss: true, loopfunc: true, strict: true, nonew: true, noempty: false
    */
    
    /*jslint indent: 4, white: true, debug: true, continue: true, sub: true, css: false, todo: true,
    		 on: false, fragment: false, vars: true, nomen: true, plusplus: true, bitwise: true,
    		 regexp: true, newcap: true, unparam: true, sloppy: true, eqeq: true, stupid: true
    */
    
    /* global log, player, worldScripts
    */
    
    
    this.startUp = function startUp() {
    	var tso = worldScripts.telescope_StationOptions;
    	var ws = worldScripts.telescope;
    	var so = worldScripts.station_options;
    
    	if( !so ) {
    		log( "telescope_StationOptions", '\nstartUp, station_options oxp is missing!\n' );
    		return;
    	}	
    	if( !ws ) {
    		log( "telescope_StationOptions", '\nstartUp, telescope oxp is missing!\n' );
    		return;
    	}
    	var version = parseFloat(ws.version);
    	if( version >= 2.0 ) {
    		log( "telescope_StationOptions", '\nstartUp, telescope version is ' + ws.version 
    				+ ', aborting.  This oxp is only for earlier versions of telescope.\n' );
    		return;
    	}
    	if( version < 1.13 ) {		// introduced in 1.13
    		ws.$TelescopeBrightMassLockBorders = false;
    	}
    	tso._loadSavedOptions();
    	ws.playerWillSaveGame = tso.playerWillSaveGame;
    	try {
    		// initialize station options and pass callback functions
    		so.$O_initStationOptions( ws, 					// reference to oxp script
    								'telescope_', 			// string that begins all keys in missiontext.plist
    								tso._stnOptionsAllowed, // reference to script function
    								true, 					// call playerWillSaveGame? (telescope oxp has none)
    								tso._reloadFromStn );	// reference to script function
    		if( tso._stnOptionsAllowed() ) {
    			// ensure a loaded game will have so's interface set
    			so.equipmentAdded();
    		}
    	} catch( err ) {
    		log( "telescope_StationOptions", '\nstartUp, ' + err + '\n');
    		throw err;
    	}
    }
    
    this._stnOptionsAllowed = function _stnOptionsAllowed() {
    	var ws = worldScripts.telescope;
    	var ps = player && player.ship;
    /* 
    	log("telescope_StationOptions", '_stnOptionsAllowed, equipmentStatus = ' + ps.equipmentStatus( 'EQ_TELESCOPE' ) 
    		+ ', TelescopeFixedTel = ' + ws.$TelescopeFixedTel );
     */		
    	return ps && ps.equipmentStatus( 'EQ_TELESCOPE' ) === 'EQUIPMENT_OK'
    			  && ws.$TelescopeFixedTel !== 1;
    }
    
    this._reloadFromStn = function _reloadFromStn( names, pages ) {
    	log("telescope_StationOptions", '_reloadFromStn, pages = ' + pages + '\n\t names = ' + names );
    }
    
    this._loadSavedOptions = function _loadSavedOptions() {
    	var item, ws = worldScripts.telescope;
    	
    	if( !ws ) 
    		return;
    	item = missionVariables.$TelescopeAutoScan;
    	if( item === null ) 
    		return;		// none were saved
    	ws.$TelescopeAutoScan = item;
    	item = missionVariables.$TelescopeAutoScanMaxRange;
    	if( item !== null ) 
    		ws.$TelescopeAutoScanMaxRange = item;
    	item = missionVariables.$TelescopeAutoLock;
    	if( item !== null ) 
    		ws.$TelescopeAutoLock = item;
    	item = missionVariables.$TelescopeFarStatus;
    	if( item !== null ) 
    		ws.$TelescopeFarStatus = item;
    	item = missionVariables.$TelescopeGravLock;
    	if( item !== null ) 
    		ws.$TelescopeGravLock = item;
    	item = missionVariables.$TelescopeIdentLock;
    	if( item !== null ) 
    		ws.$TelescopeIdentLock = item;
    	item = missionVariables.$TelescopeLargeLightBalls;
    	if( item !== null ) 
    		ws.$TelescopeLargeLightBalls = item;
    	item = missionVariables.$TelescopeLightBalls;
    	if( item !== null ) 
    		ws.$TelescopeLightBalls = item;
    	item = missionVariables.$TelescopeMassLockBorders;
    	if( item !== null ) 
    		ws.$TelescopeMassLockBorders = item;
    	item = missionVariables.$TelescopeBrightMassLockBorders;
    	if( item !== null ) 
    		ws.$TelescopeBrightMassLockBorders = item;
    	item = missionVariables.$TelescopeRedAlertDist;
    	if( item !== null ) 
    		ws.$TelescopeRedAlertDist = item;
    	item = missionVariables.$TelescopeRedAlertLimiter;
    	if( item !== null ) 
    		ws.$TelescopeRedAlertLimiter = item;
    	item = missionVariables.$TelescopeRing;
    	if( item !== null ) 
    		ws.$TelescopeRing = item;
    	item = missionVariables.$TelescopeShipLightBalls;
    	if( item !== null ) 
    		ws.$TelescopeShipLightBalls = item;
    	item = missionVariables.$TelescopeShowVisualQuestionMark;
    	if( item !== null ) 
    		ws.$TelescopeShowVisualQuestionMark = item;
    	item = missionVariables.$TelescopeShowVisualStation;
    	if( item !== null ) 
    		ws.$TelescopeShowVisualStation = item;
    	item = missionVariables.$TelescopeShowVisualTarget;
    	if( item !== null ) 
    		ws.$TelescopeShowVisualTarget = item;
    	item = missionVariables.$TelescopeSniperMinRange;
    	if( item !== null ) 
    		ws.$TelescopeSniperMinRange = item;
    	item = missionVariables.$TelescopeSniperRange;
    	if( item !== null ) 
    		ws.$TelescopeSniperRange = item;
    	item = missionVariables.$TelescopeSniperRingSize;
    	if( item !== null ) 
    		ws.$TelescopeSniperRingSize = item;
    	item = missionVariables.$TelescopeSteering;
    	if( item !== null ) 
    		ws.$TelescopeSteering = item;
    	item = missionVariables.$TelescopeTargets;
    	if( item !== null ) 
    		ws.$TelescopeTargets = item;
    	
    	// this was only meant for testing, remove it!
    	item = missionVariables.$TelescopeThargoids;
    	if( item !== null ) {
    		delete missionVariables.$TelescopeThargoids;
    		ws.$TelescopeThargoids = false;
    		// ws.$TelescopeThargoids = item;
    	}
    	
    	item = missionVariables.$TelescopeVMarkMinDist;
    	if( item !== null ) 
    		ws.$TelescopeVMarkMinDist = item;
    	item = missionVariables.$TelescopeVMarkShipMinDist;
    	if( item !== null ) 
    		ws.$TelescopeVMarkShipMinDist = item;
    	
    	item = missionVariables.$TelescopeVPosHUD;
    	if( item !== null ) 
    		ws.$TelescopeVPosHUD = JSON.parse( item );
    	
    	item = missionVariables.$TelescopeVSize;
    	if( item !== null ) 
    		ws.$TelescopeVSize = item;
    	item = missionVariables.$TelescopeVZoomSize;
    	if( item !== null ) 
    		ws.$TelescopeVZoomSize = item;
    }
    
    this.playerWillSaveGame = function playerWillSaveGame() {
    	var ws = worldScripts.telescope;
    	
    	if( !ws ) 
    		return;
    
    	missionVariables.$TelescopeAutoScan = ws.$TelescopeAutoScan;
    	missionVariables.$TelescopeAutoScanMaxRange = ws.$TelescopeAutoScanMaxRange;
    	missionVariables.$TelescopeAutoLock = ws.$TelescopeAutoLock;
    	missionVariables.$TelescopeFarStatus = ws.$TelescopeFarStatus;
    	missionVariables.$TelescopeGravLock = ws.$TelescopeGravLock;
    	missionVariables.$TelescopeIdentLock = ws.$TelescopeIdentLock;
    	missionVariables.$TelescopeLargeLightBalls = ws.$TelescopeLargeLightBalls;
    	missionVariables.$TelescopeLightBalls = ws.$TelescopeLightBalls;
    	missionVariables.$TelescopeMassLockBorders = ws.$TelescopeMassLockBorders;
    	missionVariables.$TelescopeBrightMassLockBorders = ws.$TelescopeBrightMassLockBorders;
    	missionVariables.$TelescopeRedAlertDist = ws.$TelescopeRedAlertDist;
    	missionVariables.$TelescopeRedAlertLimiter = ws.$TelescopeRedAlertLimiter;
    	missionVariables.$TelescopeRing = ws.$TelescopeRing;
    	missionVariables.$TelescopeShipLightBalls = ws.$TelescopeShipLightBalls;
    	missionVariables.$TelescopeShowVisualQuestionMark = ws.$TelescopeShowVisualQuestionMark;
    	missionVariables.$TelescopeShowVisualStation = ws.$TelescopeShowVisualStation;
    	missionVariables.$TelescopeShowVisualTarget = ws.$TelescopeShowVisualTarget;
    	missionVariables.$TelescopeSniperMinRange = ws.$TelescopeSniperMinRange;
    	missionVariables.$TelescopeSniperRange = ws.$TelescopeSniperRange;
    	missionVariables.$TelescopeSniperRingSize = ws.$TelescopeSniperRingSize;
    	missionVariables.$TelescopeSteering = ws.$TelescopeSteering;
    	missionVariables.$TelescopeTargets = ws.$TelescopeTargets;
    	// missionVariables.$TelescopeThargoids = ws.$TelescopeThargoids;
    	missionVariables.$TelescopeVMarkMinDist = ws.$TelescopeVMarkMinDist;
    	missionVariables.$TelescopeVMarkShipMinDist = ws.$TelescopeVMarkShipMinDist;
    	
    	missionVariables.$TelescopeVPosHUD = JSON.stringify( ws.$TelescopeVPosHUD );
    	
    	missionVariables.$TelescopeVSize = ws.$TelescopeVSize;
    	missionVariables.$TelescopeVZoomSize = ws.$TelescopeVZoomSize;
    }