diff --git a/src/gui/options/optionsGroup.js b/src/gui/options/optionsGroup.js index a6ffd81760751d90cabb3ebeff05929bc7c4e08f..aa504c97e5689f27beb2fd0f9ce34c130488011d 100644 --- a/src/gui/options/optionsGroup.js +++ b/src/gui/options/optionsGroup.js @@ -92,10 +92,11 @@ App.UI.OptionsGroup = (function() { * @param {Object} [params] * @param {string} [params.unit] * @param {boolean} [params.large=false] + * @param {boolean} [params.forceString=false] * @returns {Option} */ - showTextBox({unit, large = false} = {}) { - this.textbox = {unit: unit, large: large}; + showTextBox({unit, large = false, forceString = false} = {}) { + this.textbox = {unit: unit, large: large, forceString: forceString}; return this; } @@ -303,12 +304,12 @@ App.UI.OptionsGroup = (function() { } if (this.textbox) { - const isNumber = typeof currentValue === "number"; + const onlyNumber = !this.textbox.forceString && typeof currentValue === "number"; const textbox = App.UI.DOM.makeTextBox(currentValue, input => { this.object[this.property] = input; App.UI.reload(); - }, isNumber); - if (isNumber) { + }, onlyNumber); + if (onlyNumber) { textbox.classList.add("number"); } if (this.textbox.large) { @@ -387,7 +388,7 @@ App.UI.OptionsGroup = (function() { } } - return class { + return class OptionsGroup { constructor() { /** * @type {Array<Row>} @@ -397,7 +398,7 @@ App.UI.OptionsGroup = (function() { } /** - * @returns {App.UI.OptionsGroup} + * @returns {OptionsGroup} */ enableDoubleColumn() { this.doubleColumn = true; @@ -456,7 +457,7 @@ App.UI.OptionsGroup = (function() { } for (/** @type {Row} */ const row of this.rows) { - row.render(container, this.doubleColumn); + row.render(container); } return container; diff --git a/src/npc/startingGirls/startingGirls.js b/src/npc/startingGirls/startingGirls.js index b440b57db2f1c5cb0cb5c2473b8b9cbe6910677a..4742905683b367543449ed1a92fe21fe3eea94d6 100644 --- a/src/npc/startingGirls/startingGirls.js +++ b/src/npc/startingGirls/startingGirls.js @@ -90,6 +90,8 @@ App.StartingGirls.cleanup = function(slave) { slave.prestige = Math.clamp(slave.prestige, 0, 3) || 0; if (slave.prestige === 0) { slave.prestigeDesc = 0; + } else if (slave.prestigeDesc === 0) { + slave.prestigeDesc = ""; } }; @@ -1200,7 +1202,9 @@ App.StartingGirls.profile = function(slave) { App.UI.DOM.appendNewElement("h3", el, "Optional customizations"); options = new App.UI.OptionsGroup(); - options.addOption("Origin story", "origin", slave).showTextBox({large: true}).addComment("Use complete, capitalized and punctuated sentences."); + options.addOption("Origin story", "origin", slave) + .showTextBox({large: true, forceString: true}) + .addComment("Use complete, capitalized and punctuated sentences."); options.addOption("Origin override", "originOverride", V) .addValue("Enable", 1).on() @@ -1208,7 +1212,9 @@ App.StartingGirls.profile = function(slave) { .addComment("Prevent Starting Girls from overwriting custom origin and tattoo with its defaults."); if (slave.prestige) { - options.addOption("Prestige description", "prestigeDesc", slave).showTextBox().addComment("Use complete, capitalized and punctuated sentences."); + options.addOption("Prestige description", "prestigeDesc", slave) + .showTextBox({large: true, forceString: true}) + .addComment("Use complete, capitalized and punctuated sentences."); } options.addOption("Description", "desc", slave.custom).showTextBox().addComment("Use complete, capitalized and punctuated sentences."); options.addOption("Label", "label", slave.custom).showTextBox().addComment("Use a short phrase");