From 5dec6b9c12feed81e305b2addd8ea3ee16c8caca Mon Sep 17 00:00:00 2001 From: Fen Dweller Date: Tue, 25 Dec 2018 23:00:30 -0600 Subject: [PATCH] Get optional menus working. Made oral vore optional. --- features.js | 28 +++++++++++++++++++++ game.js | 72 +++++++++++++++++++++++++++++++++++------------------ stroll.html | 4 +-- 3 files changed, 78 insertions(+), 26 deletions(-) diff --git a/features.js b/features.js index bd46826..13591d4 100644 --- a/features.js +++ b/features.js @@ -143,5 +143,33 @@ options = [ ] } ] + }, + { + "name": "Oral Vore", + "id": "oralVore", + "optional": true, + "entries": + [ + { + "name": "Digestion time", + "id": "oralDigestTime", + "type": "float", + "default": "15" + } + ] + }, + { + "name": "Anal Vore", + "id": "analVore", + "optional": true, + "entries": + [ + { + "name": "Digestion time", + "id": "analDigestTime", + "type": "float", + "default": "15" + } + ] } ]; diff --git a/game.js b/game.js index 2f93442..462994d 100644 --- a/game.js +++ b/game.js @@ -3399,8 +3399,11 @@ function gooButtons(molten) { setButton("melt", !molten); setButton("solidify", molten); setButton("flood", molten); - setButton("goo_stomach_pull", molten); - setButton("goo_stomach_push", molten); + + if (macro.oralVore) { + setButton("goo_stomach_pull", molten); + setButton("goo_stomach_push", molten); + } if (macro.analVore) { setButton("goo_bowels_pull", molten); @@ -4202,25 +4205,11 @@ function startGame(e) { enable_panel("options"); enable_panel("body"); - enable_button("feed"); - - if (macro.oralDigestTime == 0) { - enable_button("digest_stomach"); - } - - if (macro.cropEnabled) { - enable_button("crop_swallow"); - } enable_panel("paws"); enable_button("stomp"); - if (macro.vomitEnabled) { - enable_button("vomit"); - enable_victim("vomit"); - } - if (macro.footType != "hoof") enable_button("flex_toes"); @@ -4233,8 +4222,6 @@ function startGame(e) { if (macro.brutality > 0) { warns.push("Fatal actions are enabled."); - enable_button("chew"); - enable_victim("chew","Chewed"); } if (macro.droolEnabled) { @@ -4254,6 +4241,28 @@ function startGame(e) { document.querySelector("#edgeMeter").style.display = 'inline-block'; } + if (macro.oralVore) { + enable_button("feed"); + + if (macro.brutality > 0) { + enable_button("chew"); + enable_victim("chew","Chewed"); + } + + if (macro.oralDigestTime == 0) { + enable_button("digest_stomach"); + } + + if (macro.cropEnabled) { + enable_button("crop_swallow"); + } + + if (macro.vomitEnabled) { + enable_button("vomit"); + enable_victim("vomit"); + } + } + if (macro.analVore) { enable_button("anal_vore"); enable_victim("anal-vore","Anal vore"); @@ -4788,17 +4797,32 @@ function construct_options() { let cat_div = document.createElement("div"); cat_div.classList.add("custom-category"); - let header_div = document.createElement("div"); + let header; if (category.optional) { - header_div.classList.add("custom-header"); + header = document.createElement("label"); + let input = document.createElement("input"); + input.classList.add("custom-header-checkbox"); + input.setAttribute("type", "checkbox"); + input.id = category.id; + input.name = category.id; + + cat_div.appendChild(input); + + header.classList.add("custom-header"); + header.setAttribute("for", category.id); } else { - header_div.classList.add("custom-header-static"); + header = document.createElement("div"); + header.classList.add("custom-header-static"); } - header_div.innerText = name; + header.innerText = name; - let options_div = document.createElement("div"); + let options_div = document.createElement("div") + + if (category.optional) { + options_div.classList.add("reveal-if-active"); + } category.entries.forEach(function(option) { let li = document.createElement("li"); @@ -4934,7 +4958,7 @@ function construct_options() { }); - cat_div.appendChild(header_div); + cat_div.appendChild(header); cat_div.appendChild(options_div); root.appendChild(cat_div); }); diff --git a/stroll.html b/stroll.html index d0bfdb3..d12e04e 100644 --- a/stroll.html +++ b/stroll.html @@ -569,7 +569,7 @@ - +