| Back to Index | Page generated: Nov 24, 2025, 1:21:31 AM |
| from Expansion Manager's OXP list | from Expansion Manifest | |
|---|---|---|
| Description | If you are doing a cargo contract and mistakenly sell the goods on the market screen, this will immediately pop up a reminder that you needed that cargo to deliver elsewhere. | If you are doing a cargo contract and mistakenly sell the goods on the market screen, this will immediately pop up a reminder that you needed that cargo to deliver elsewhere. |
| Identifier | oolite.oxp.Wildeblood.Contracted_Goods_Reminder | oolite.oxp.Wildeblood.Contracted_Goods_Reminder |
| Title | Contracted Goods Reminder | Contracted Goods Reminder |
| Category | Miscellaneous | Miscellaneous |
| Author | Wildeblood | Wildeblood |
| Version | 1.3 | 1.3 |
| Tags | market | market |
| Required Oolite Version | ||
| Maximum Oolite Version | ||
| Required Expansions | ||
| Optional Expansions | ||
| Conflict Expansions | ||
| Information URL | http://aegidian.org/bb/viewtopic.php?f=4&t=11123 | n/a |
| Download URL | https://wiki.alioth.net/img_auth.php/4/4e/Contracted_Goods_Reminder.oxz | n/a |
| License | CC-BY-NC-SA 4.0 | CC-BY-NC-SA 4.0 |
| File Size | n/a | |
| Upload date | 1746281545 |
Also read http://wiki.alioth.net/index.php/Contracted%20Goods%20Reminder
| Path | |
|---|---|
| Config/script.js | "use strict";
// worldScripts["Contracted Goods Reminder"]
this.name = "Contracted Goods Reminder";
this.version = "1.3";
this.guiScreenChanged = function (to, from) {
if (player.ship.docked && (
to === "GUI_SCREEN_MARKET" ||
to === "GUI_SCREEN_MARKETINFO")) {
this.$reservedCargo = {};
var arrayLength = player.ship.contracts.length;
if (arrayLength) {
for (var i = 0; i < arrayLength; i++) {
var contract = player.ship.contracts[i];
var commodity = contract.commodity;
var quantity = contract.quantity;
var reserve = this.$reservedCargo[commodity];
if (reserve) {
this.$reservedCargo[commodity] += quantity;
} else {
this.$reservedCargo[commodity] = quantity;
}
}
}
}
};
this.playerSoldCargo = function (commodity, quantity, unitPrice) {
var reserve = this.$reservedCargo[commodity] || 0;
if (reserve) {
var availableStock = manifest[commodity] || 0;
if (availableStock < reserve) {
var displayName = displayNameForCommodity(commodity);
player.consoleMessage("You need at least " + reserve + " units of " + displayName.toLowerCase() + " to fulfil your contracts.", 6);
}
}
};
|