Code: Select all
this.name = "Anaconda's offer";
this.version = "0.00001";
"use strict";
// this max's out the market supply of food or whatever commodity
this.shipDockedWithStation = function(station) {
station.setMarketQuantity("Food", 127);
}
// this adds a listing to the Interface screen
this.guiScreenChanged = function(to, from) {
player.ship.dockedStation.setInterface("AnacOffer",{
title: "Commodities offer from trader",
category: "Trade",
summary: "Public offer from Anaconda Such&such",
callback: this._AnacOffer.bind(this)
});
}
// this is the screen where you view the details of the offer; accept or decline or whatever else
this._AnacOffer = function() {
mission.runScreen( { title: "Public offer",
choicesKey: "YerResponse",
exitScreen: "GUI_SCREEN_INTERFACES"
},
function (choice) {
if (choice === "1-Y") {
player.credits = player.credits - 56;
manifest.food = manifest.food + 8;
};
if (choice === "2-N");
}
);
mission.addMessageText("Msg posted to all traders in-station");
mission.addMessageText("From Cmdr So&so of the Anaconda, Such&such");
mission.addMessageText("I have 8 containers of food and the station is not buying any more");
mission.addMessageText("Will sell to any trader for 7 credits per. Buyer must take full offer");
}
Missiontext.plist
{
"YerResponse" = {
"1-Y" = "Accept the offer";
"2-N" = "Decline the offer";
};
}
Big thanks to The Devs for the shiny new Interface screen! I'm just starting to think of the possibilities with it.