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

Expansion Planner

Content

Warnings

  1. Information URL mismatch between OXP Manifest and Expansion Manager string length at character position 0

Manifest

from Expansion Manager's OXP list from Expansion Manifest
Description Planner for those who play Oolite too much. Planner for those who play Oolite too much.
Identifier oolite.oxp.Ramen.Planner oolite.oxp.Ramen.Planner
Title Planner Planner
Category Miscellaneous Miscellaneous
Author Ramen Ramen
Version 1.0.0 1.0.0
Tags
Required Oolite Version
Maximum Oolite Version
Required Expansions
Optional Expansions
Conflict Expansions
Information URL n/a
Download URL https://wiki.alioth.net/img_auth.php/d/d5/Planner_1.0.0.oxz http://wiki.alioth.net/img_auth.php/d/d5/Planner_1.0.0.oxz
License CC-BY-NC-SA 3.0 CC-BY-NC-SA 3.0
File Size n/a
Upload date 1610873479

Documentation

Also read http://wiki.alioth.net/index.php/Planner

README.txt

Written by Ramen.

Changelog:
Mon Jun  8 12:37:41 EDT 2015 - first version



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
Scripts/planner.js
this.name           = "planner.js";
this.author         = "Ramen";
this.copyright      = "(C) 2015 Ramen";
this.licence        = "CC-NC-by-SA 3.0";
this.description    = "This OXP doesn't do very much yet.";
this.version        = "1.0.0";

"use strict";

this._tempVal = ""; 

this.startUpComplete = function()
{
    if (!missionVariables.planner_planNames)
    {
	missionVariables.planner_plans = JSON.stringify({});
	missionVariables.planner_planNames = JSON.stringify({"1_EXIT":
							     "Exit."});
    }
    this._plans = JSON.parse(missionVariables.planner_plans);
    this._planNames =  JSON.parse(missionVariables.planner_planNames);
    this.$dockedCheck();
}

this.shipDockedWithStation = function()
{
    this.$dockedCheck();
    this.playerWillSaveGame();
}

this.playerWillSaveGame = function()
{
    missionVariables.planner_plans = JSON.stringify(this._plans);
    missionVariables.planner_planNames = JSON.stringify(this._planNames);
}

this.$dockedCheck = function()
{
    player.ship.dockedStation.setInterface("Planner",
					       { title: "Planner",
						 category: "Info",
						 summary: "A Planner for "+
						 "'Real life' or Oolite",
						 callback:
						 this.$planner.bind(this)});
}

this.$planner = function()
{
    mission.runScreen({
	title: "Planner",
	message: "Choose an option.",
	choicesKey: "planner_options"},
		      this.$choice);
}
this.$choice = function(choice)
{
    if (choice == "1_ADD")
    {
	mission.runScreen({
	    title: "Planner",
	    message: "Enter subject. (30 char. max)",
	    textEntry: "TRUE"},
		      this.$subject);
    }
    else if (choice == "2_REMOVE")
    {
	mission.runScreen({
	    title: "Planner",
	    message: "Choose plan to remove.",
	    choices: this._planNames},
			  this.$remove);
    }
    else if (choice == "3_VIEW")
    {
	mission.runScreen({
	    title: "Planner",
	    message: "Choose a plan.",
	    choices: this._planNames},
			  this.$view);
    }
    else
    {
	return;
    }
}

this.$subject = function(choice)
{
    this._tempVal = choice;
    mission.runScreen({
	title: "Planner",
	message: "Enter details. (30 char. max)",
	exitScreen: "GUI_SCREEN_INTERFACES",
	textEntry: "TRUE"},
		      this.$details);
}

this.$details = function(choice)
{
    if (choice == "")
    {
	return;
    }
    this._plans[this._tempVal] = choice;
    this._planNames[this._tempVal] = this._tempVal;
}

this.$remove = function(choice)
{
    if (choice == "1_EXIT")
    {
	return;
    }
    delete this._plans[choice];
    delete this._planNames[choice];
    player.consoleMessage(choice + " removed.");
}

this.$view = function(choice)
{
    if (choice == "1_EXIT")
    {
	return;
    }
    mission.runScreen({
	title: choice,
	message: "Details:\n" + this._plans[choice]});
}