From 16ca6e4bbe1ee6640dd5884029f86f95d173c7a8 Mon Sep 17 00:00:00 2001 From: lowercasedonkey <lowercasedonkey@gmail.com> Date: Wed, 7 Oct 2020 20:36:11 -0400 Subject: [PATCH] families --- js/003-data/gameVariableData.js | 1 + src/gui/options/options.tw | 3 +++ src/interaction/slaveInteract.js | 42 +++++++++++++++++++++++--------- 3 files changed, 35 insertions(+), 11 deletions(-) diff --git a/js/003-data/gameVariableData.js b/js/003-data/gameVariableData.js index a223343999c..b4e328666d3 100644 --- a/js/003-data/gameVariableData.js +++ b/js/003-data/gameVariableData.js @@ -81,6 +81,7 @@ App.Data.defaultGameStateVariables = { extremeUnderage: 0, formatNumbers: 1, fucktoyInteractionsPosition: 1, + slaveInteractLongForm: false, headGirlSoftensFlaws: 1, headGirlTrainsFlaws: 1, headGirlTrainsHealth: 1, diff --git a/src/gui/options/options.tw b/src/gui/options/options.tw index 6077eb0299d..1ab2f1a3fe5 100644 --- a/src/gui/options/options.tw +++ b/src/gui/options/options.tw @@ -151,6 +151,9 @@ <<run _options.addOption("Interactions with your fucktoys are", "fucktoyInteractionsPosition") .addValueList([["next to them", 1], ["at page bottom", 0]])>> + <<run _options.addOption("Hide tabs in Slave Interact", "slaveInteractLongForm") + .addValue("Enabled", true).on().addValue("Disabled", false).off()>> + <<run _options.addOption("Line separations are", "lineSeparations") .addValue("Shown", 1).on().addValue("Hidden", 0).off()>> diff --git a/src/interaction/slaveInteract.js b/src/interaction/slaveInteract.js index 9490e14a403..91a1a888977 100644 --- a/src/interaction/slaveInteract.js +++ b/src/interaction/slaveInteract.js @@ -126,7 +126,11 @@ App.UI.SlaveInteract.mainPage = function(slave) { el.append(App.UI.SlaveInteract.navigation(slave)); - el.append(displayWithTabs()); + if (V.slaveInteractLongForm) { + el.append(displayWithoutTabs()); + } else { + el.append(displayWithTabs()); + } return el; @@ -164,17 +168,33 @@ App.UI.SlaveInteract.mainPage = function(slave) { return btn; } + } - function makeTabContents(item){ - const wrapperEl = document.createElement("div"); - wrapperEl.id = item.id; - wrapperEl.classList.add("tab-content"); - - const classEl = document.createElement("div"); - classEl.classList.add("content"); - classEl.append(item.node); - wrapperEl.append(classEl); - return wrapperEl; + function displayWithoutTabs() { + const el = new DocumentFragment(); + for (const tab of buttons) { + App.UI.DOM.appendNewElement("h2", el, tab.title); + if (tab.title !== "Family") { + el.append(tab.node); + } else { + // Families are weird and need the wrapper. But we can't have duplicate ID's all over the place, so just use it in their case. + el.append(makeTabContents(tab)); + if (tab.hasOwnProperty("onClick")){ + tab.onClick(); + } + } } + return el; + } + function makeTabContents(item) { + const wrapperEl = document.createElement("div"); + wrapperEl.id = item.id; + wrapperEl.classList.add("tab-content"); + + const classEl = document.createElement("div"); + classEl.classList.add("content"); + classEl.append(item.node); + wrapperEl.append(classEl); + return wrapperEl; } }; -- GitLab