diff --git a/src/markets/specificMarkets/customSlaveMarket.js b/src/markets/specificMarkets/customSlaveMarket.js index f47c4afde96f9f870a158f681dba36120528a6be..b6f37404f71f22dd96284bd271c46c6f955f7a6f 100644 --- a/src/markets/specificMarkets/customSlaveMarket.js +++ b/src/markets/specificMarkets/customSlaveMarket.js @@ -12,7 +12,7 @@ App.Markets["Custom Slave"] = function() { el.append(weight()); el.append(face()); el.append(race()); - // Skin tone + el.append(skin()); el.append(boobs()); el.append(butt()); el.append(sex()); @@ -319,7 +319,7 @@ App.Markets["Custom Slave"] = function() { select.append(option); } select.onchange = () => { - slave.nationality = select.options[select.selectedIndex].value; + slave.race = select.options[select.selectedIndex].value; jQuery("#race-text").empty().append(description()); }; el.append(select); @@ -335,7 +335,51 @@ App.Markets["Custom Slave"] = function() { return el; } - //TODO: function skinTone + function skin() { + const el = document.createElement("div"); + const slaveProperty = "skin"; + const choices = new Map; + for (const skin of App.Data.misc.naturalSkins) { + choices.set(skin, capFirstChar(skin)); + } + + createDescription(el, description, slaveProperty); + + // Choices + el.append( + App.UI.DOM.makeTextBox( + slave.skin, + (v) => { + slave.skin = v; + jQuery("#skin-text").empty().append(description()); + } + ) + ); + + const select = document.createElement("select"); + for (const [value, text] of choices) { + const option = document.createElement("option"); + option.text = text; + option.value = value; + select.append(option); + } + select.onchange = () => { + slave.skin = select.options[select.selectedIndex].value; + jQuery("#skin-text").empty().append(description()); + }; + el.append(select); + + function description() { + if (slave.race) { + return `${capFirstChar(slave.skin)}. `; + } else { + return "Ethnicity is unimportant. "; + } + } + + return el; + } + function boobs() { const el = document.createElement("div");