From 5d282585b06cb09334805bafb8ece5446e81db8c Mon Sep 17 00:00:00 2001 From: lowercasedonkey <lowercasedonkey@gmail.com> Date: Sun, 30 Aug 2020 21:59:03 -0400 Subject: [PATCH] add prison support to marketcontrols --- src/markets/marketUI.js | 37 ++++++++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/src/markets/marketUI.js b/src/markets/marketUI.js index 44bfccf2f4e..69164464893 100644 --- a/src/markets/marketUI.js +++ b/src/markets/marketUI.js @@ -1,11 +1,30 @@ -App.UI.buyingFromMarketControls = function(slave, slaveCost) { - const {him, his} = getPronouns(slave); +App.UI.buyingFromMarketControls = function(slave, slaveCost, sTitleSingular = "slave", sTitlePlural = "slaves") { + const { him, his } = getPronouns(slave); const el = document.createElement("p"); + let title = {}; + if (sTitleSingular === "prisoner") { + title = { + decline: `Inspect a different prisoner`, + buyAndKeepShopping: `Buy ${him} and check out other other available ${sTitlePlural}`, + buyJustHer: `Enslave ${him}`, + buyHerAndFinish: `Enslave ${him} and finish your inspection`, + finish: `Finish your enslavement of prisoners` + }; + } else { + title = { + decline: `Decline to purchase ${him} and check out another ${sTitleSingular}`, + buyAndKeepShopping: `Buy ${him} and check out other ${sTitlePlural} to order`, + buyJustHer: `Buy ${his} slave contract`, + buyHerAndFinish: `Buy ${him} and finish your order of slaves`, + finish: `Finish your order of slaves` + }; + } + App.UI.DOM.appendNewElement( "div", el, App.UI.DOM.link( - `Decline to purchase ${him} and check out another slave`, + title.decline, () => { V.slavesSeen += 1; }, @@ -18,7 +37,7 @@ App.UI.buyingFromMarketControls = function(slave, slaveCost) { "div", el, App.UI.DOM.link( - `Buy ${him} and check out other slaves to order`, + title.buyAndKeepShopping, () => { cashX(forceNeg(slaveCost), "slaveTransfer", slave); V.newSlaves.push(slave); @@ -34,7 +53,7 @@ App.UI.buyingFromMarketControls = function(slave, slaveCost) { "div", el, App.UI.DOM.link( - `Buy ${his} slave contract`, + title.buyJustHer, () => { cashX(forceNeg(slaveCost), "slaveTransfer", slave); V.newSlaves.push(slave); @@ -51,7 +70,7 @@ App.UI.buyingFromMarketControls = function(slave, slaveCost) { "div", el, App.UI.DOM.link( - `Buy ${him} and finish your order of slaves`, + title.buyHerAndFinish, () => { cashX(forceNeg(slaveCost), "slaveTransfer", slave); V.newSlaves.push(slave); @@ -69,7 +88,7 @@ App.UI.buyingFromMarketControls = function(slave, slaveCost) { "div", el, App.UI.DOM.link( - `Finish your order of slaves`, + title.finish, () => { }, [], "Bulk Slave Intro" @@ -108,7 +127,7 @@ App.UI.buyingFromSchoolControls = function(school, costMod = 1, sTitleSingular = r.push(`You have cast such a wide net for slaves this week that it is becoming more expensive to find more for sale. Your reputation helps determine your reach within the slave market.`); } - const {him, his} = getPronouns(slave); + const { him, his } = getPronouns(slave); App.UI.DOM.appendNewElement( "div", el, @@ -186,7 +205,7 @@ App.UI.buyingFromSchoolControls = function(school, costMod = 1, sTitleSingular = App.UI.DOM.appendNewElement( "p", el, - App.Desc.longSlave(slave, {market: "generic"}) + App.Desc.longSlave(slave, { market: "generic" }) ); return el; -- GitLab