Back to Index Page generated: Nov 12, 2024, 11:02:04 PM

Expansion Space Bar Facelift

Content

Warnings

  1. Required Expansions mismatch between OXP Manifest and Expansion Manager at character position 0062 (DIGIT ZERO vs LATIN SMALL LETTER N)
  2. No version in dependency reference to oolite.oxp.spara.random_hits:null

Manifest

from Expansion Manager's OXP list from Expansion Manifest
Description Updates the look of Seedy Space Bars, and adds an external docking port (if the External Docking System is installed) Updates the look of Seedy Space Bars, and adds an external docking port (if the External Docking System is installed)
Identifier oolite.oxp.phkb.SpacebarFacelift oolite.oxp.phkb.SpacebarFacelift
Title Space Bar Facelift Space Bar Facelift
Category Retextures Retextures
Author phkb phkb
Version 1.6 1.6
Tags
Required Oolite Version
Maximum Oolite Version
Required Expansions
  • oolite.oxp.spara.random_hits:0
  • oolite.oxp.spara.random_hits:
  • Optional Expansions
    Conflict Expansions
    Information URL https://wiki.alioth.net/index.php/Space_Bar_Facelift n/a
    Download URL https://wiki.alioth.net/img_auth.php/1/1f/SpaceBarFacelift_1.6.oxz n/a
    License CC-BY-NC-SA 4.0 CC-BY-NC-SA 4.0
    File Size n/a
    Upload date 1712638676

    Documentation

    Also read http://wiki.alioth.net/index.php/Space%20Bar%20Facelift

    readme.txt

    Space Bar Face Lift
    by phkb
    
    Overview
    ========
    This mod updates the look and feel of Griff's Space Bar's (from the Random Hits OXP). Additionally, flashers are added to the standard dock to aid with visibility, and, if the External Dock System is installed, make the external landing pad available for players to dock at.
    
    License
    =======
    This work is licensed under the Creative Commons Attribution-Noncommercial-Share Alike 4.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/4.0/
    
    Asteroid textures from <a href="https://www.freepik.com/free-photo/concrete-wall-texture_1119956.htm#page=2&query=asteroid%20texture&position=46&from_view=keyword&track=ais&uuid=863c61d5-a1d1-4a10-94b2-388d011af0d1">Image by kues1</a> on Freepik
    
    Version History
    ===============
    1.6
    - Changed point where external docks are applied to existing Space Bars, to hopefully have them applied more reliably.
    
    1.5
    - Tweaked message sent to player when they approach, based on whether the station has docking clearance or not.
    - Tweaks to the process of selecting the space bar to add the external dock to.
    
    1.4
    - Corrections to shipdata-overrides and tweaks to the neon sign shader courtesy of another_commander.
    
    1.3
    - Fixed incorrect filename in shipdata-overrides.plist.
    
    1.2
    - Updated to latest EDS interface specification.
    
    1.1
    - Fixed a couple of issues with the external dock setup and operation.
    - Added a readme.txt file.
    
    1.0
    - Initial release

    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 = "SpaceBarFaceLift";
    this.author = "phkb";
    this.description = "Looks after external dock for spacebar";
    this.copyright = "2024 phkb";
    this.license = "CC BY-NC-SA 4.0";
    
    this._externalDockNotification = false;
    this._timer = null;
    this._setStation = null;
    
    //----------------------------------------------------------------------------------------
    this.systemWillPopulate = function() {
        this._setStation = null;
    
        system.setPopulator("sb_facelift", {
            callback: function (pos) {
                var w = worldScripts.SpaceBarFaceLift;
                var sp = system.shipsWithRole("random_hits_any_spacebar");
                if (sp && sp.length > 0) w.$registerExternalDocks(sp[0]);
            }.bind(this),
            location: "COORDINATES",
            coordinates: Vector3D(0, 0, 0),
            priority: 500
        });
    }
    
    //----------------------------------------------------------------------------------------
    // registers our external docks with the eds
    this.$registerExternalDocks = function (station) {
    	var eds = worldScripts.ExternalDockSystem;
        if (eds) {
            this._setStation = station;
    
            // set up the timer to let the player know about the docks
            this._timer = new Timer(this, this.$externalDockNotification, 2, 2);
            //log(this.name, "adding external doc for " + station);
            var dve = eds.$addExternalDock({station:station, position:[-550, 0, 22], scale:0.5, preDockCallback:this.$preDockSetup.bind(this)});
            //log(this.name, "dve = " + dve);
        } else {
            // get rid of the flashers on the external dock
            var fa = station.flashers;
            var last = fa.length;
            while (last--) {
                fa[last].remove();
                if (last == 10) break;
            }
        }
    }
    
    //----------------------------------------------------------------------------------------
    this.$preDockSetup = function(station) {
        // docking at the external port will still get you transferred inside
        player.addMessageToArrivalReport(expandDescription("[spacebar_redocked]"));
    }
    
    //----------------------------------------------------------------------------------------
    this.$externalDockNotification = function $externalDockNotification() {
    	if (this._setStation && this._externalDockNotification == false) {
    		if (this._setStation.position.distanceTo(player.ship) < player.ship.scannerRange * 0.85) {
                if (this._setStation.requiresDockingClearance) {
                    this._setStation.commsMessage(expandDescription("[spacebar_external_dock_clearance]"), player.ship);
                } else {
                    this._setStation.commsMessage(expandDescription("[spacebar_external_dock_free]"), player.ship);
                }
    			this._externalDockNotification = true;
    		}
    	} else {
    		this._timer.stop();
    	}
    }