From 62cabd98e22fc20243f53fd3219d3547822d0991 Mon Sep 17 00:00:00 2001 From: Fen Dweller Date: Tue, 1 Jan 2019 21:16:43 -0600 Subject: [PATCH] Moved all buttons to features.js, except for complex ones. No testing lol --- features.js | 106 ++++++++++++++++++++++++++++++++---------- game.js | 129 +++++----------------------------------------------- 2 files changed, 94 insertions(+), 141 deletions(-) diff --git a/features.js b/features.js index 0ca8c8b..e4bcbe5 100644 --- a/features.js +++ b/features.js @@ -697,7 +697,7 @@ options = [ "id": "oralVore", "optional": true, "buttons": [ - "eat", "chew" + "feed", "chew" ], "entries": [ @@ -710,7 +710,8 @@ options = [ { "name": "Manual digestion", "id": "oralDigestManual", - "type": "checkbox" + "type": "checkbox", + "buttons": ["digest_stomach"] }, { "name": "Same-size vore", @@ -721,7 +722,9 @@ options = [ { "name": "Vomiting", "id": "vomitEnabled", - "type": "checkbox" + "type": "checkbox", + "warning": "Vomiting is enabled", + "buttons": ["vomit"] } ] }, @@ -729,6 +732,7 @@ options = [ "name": "Anal Vore", "id": "analVore", "optional": true, + "buttons": ["anal_vore"], "entries": [ { @@ -747,7 +751,8 @@ options = [ { "name": "Manual digestion", "id": "analDigestManual", - "type": "checkbox" + "type": "checkbox", + "buttons": ["digest_anal"] }, { "name": "Same-size vore", @@ -772,6 +777,7 @@ options = [ "name": "Socks", "id": "footSockEnabled", "type": "subcategory", + "buttons": ["remove_socks", "wear_socks", "stuff_socks", "dump_socks"], "entries": [ { @@ -796,6 +802,7 @@ options = [ "name": "Shoes", "id": "footShoeEnabled", "type": "subcategory", + "buttons": ["remove_shoes", "wear_shoes", "stuff_shoes", "dump_shoes"], "entries": [ { @@ -859,6 +866,7 @@ options = [ "name": "Tail", "id": "hasTail", "optional": true, + "buttons": ["tail_slap"], "entries": [ { @@ -908,7 +916,8 @@ options = [ { "name": "Manual digestion", "id": "tailDigestManual", - "type": "checkbox" + "type": "checkbox", + "buttons": ["digest_tail"] }, { "name": "Same-size vore", @@ -929,12 +938,14 @@ options = [ "name": "Pouch", "id": "hasPouch", "optional": true, + "buttons": ["pouch_stuff", "pouch_rub"], "entries": [ { "name": "Absorption", "id": "pouchAbsorption", - "type": "checkbox" + "type": "checkbox", + "buttons": ["pouch_absorb"] } ] }, @@ -942,6 +953,7 @@ options = [ "name": "Male Genitals", "id": "maleParts", "optional": true, + "buttons": ["cockslap", "ball_smother"], "entries": [ { @@ -995,6 +1007,7 @@ options = [ "name": "Cock Vore", "id": "cockVoreEnabled", "type": "subcategory", + "buttons": ["cock_vore"], "entries": [ { @@ -1018,7 +1031,8 @@ options = [ { "name": "Manual digestion", "id": "cockDigestManual", - "type": "checkbox" + "type": "checkbox", + "buttons": ["digest_cock"] }, { "name": "Same-size vore", @@ -1037,12 +1051,14 @@ options = [ "name": "Sheath", "id": "hasSheath", "type": "subcategory", + "buttons": ["sheath_stuff", "sheath_toy", "sheath_clench"], "entries": [ { "name": "Absorption", "id": "sheathAbsorptionEnabled", - "type": "checkbox" + "type": "checkbox", + "buttons": ["sheath_absorb"] } ] }, @@ -1050,12 +1066,14 @@ options = [ "name": "Foreskin", "id": "hasForeskin", "type": "subcategory", + "buttons": ["foreskin_stuff", "foreskin_toy", "foreskin_clench"], "entries": [ { "name": "Absorption", "id": "foreskinAbsorptionEnabled", - "type": "checkbox" + "type": "checkbox", + "buttons": ["foreskin_absorb"] } ] }, @@ -1079,6 +1097,7 @@ options = [ "name": "Female Genitals", "id": "femaleParts", "optional": true, + "buttons": ["slit_toy"], "entries": [ { @@ -1125,6 +1144,7 @@ options = [ "name": "Unbirth", "id": "unbirthEnabled", "type": "subcategory", + "buttons": ["unbirth"], "entries": [ { @@ -1148,7 +1168,8 @@ options = [ { "name": "Manual digestion", "id": "unbirthDigestManual", - "type": "checkbox" + "type": "checkbox", + "buttons": ["digest_unbirth"] }, { "name": "Same-size vore", @@ -1183,6 +1204,7 @@ options = [ "name": "Breasts", "id": "hasBreasts", "optional": true, + "buttons": ["breast_crush", "breast_toy", "cleavage_stuff", "cleavage_crush", "cleavage_drop", "cleavage_absorb"], "entries": [ { @@ -1196,6 +1218,7 @@ options = [ "name": "Lactation", "id": "lactationEnabled", "type": "subcategory", + "buttons": ["breast_milk"], "entries": [ { @@ -1223,6 +1246,7 @@ options = [ "name": "Breast Vore", "id": "breastVore", "type": "subcategory", + "buttons": ["breast_vore", "digest_breast"], "entries": [ { @@ -1304,12 +1328,14 @@ options = [ { "name": "Belching", "id": "belchEnabled", - "type": "checkbox" + "type": "checkbox", + "buttons": ["belch"] }, { "name": "Farting", "id": "fartEnabled", - "type": "checkbox" + "type": "checkbox", + "buttons": ["fart"] }, { "name": "Passive gas production", @@ -1341,6 +1367,7 @@ options = [ "name": "Soul Vore", "id": "soulVoreEnabled", "optional": true, + "buttons": ["soul_vore", "soul_absorb_paw"], "entries": [ { @@ -1352,7 +1379,8 @@ options = [ { "name": "Manual digestion", "id": "soulDigestManual", - "type": "checkbox" + "type": "checkbox", + "buttons": ["digest_soul"] }, { "type": "radio", @@ -1380,6 +1408,7 @@ options = [ "name": "Piss", "id": "pissEnabled", "optional": true, + "buttons": ["piss"], "entries": [ { @@ -1399,6 +1428,7 @@ options = [ "name": "Bladder Vore", "id": "bladderVore", "type": "subcategory", + "buttons": ["bladder_vore"], "entries": [ { @@ -1429,7 +1459,8 @@ options = [ { "name": "Manual digestion", "id": "bladderDigestManual", - "type": "checkbox" + "type": "checkbox", + "buttons": ["digest_bladder"], }, { "name": "Same-size vore", @@ -1450,6 +1481,7 @@ options = [ "name": "Scat", "id": "scatEnabled", "optional": true, + "buttons": ["scat"], "entries": [ { @@ -1482,6 +1514,7 @@ options = [ "name": "Goo", "id": "gooEnabled", "optional": true, + "buttons": ["melt"], "entries": [ { @@ -1509,6 +1542,7 @@ options = [ "name": "Paw Vore", "id": "pawVoreEnabled", "optional": true, + "buttons": ["paw_vore"], "entries": [ { @@ -1520,7 +1554,8 @@ options = [ { "name": "Manual digestion", "id": "pawDigestManual", - "type": "checkbox" + "type": "checkbox", + "buttons": ["digest_paws"] }, { "name": "Same-size vore", @@ -1534,6 +1569,7 @@ options = [ "name": "Crop", "id": "cropEnabled", "optional": true, + "buttons": ["crop_swallow"], "entries": [ { @@ -1548,6 +1584,7 @@ options = [ "name": "Breath", "id": "breathEnabled", "optional": true, + "buttons": ["breath_line", "breath_cone"], "entries": [ { @@ -1560,32 +1597,38 @@ options = [ { "name": "Fire", "id": "breathFire", - "type": "checkbox" + "type": "checkbox", + "buttons": ["breath_fire"] }, { "name": "Ice", "id": "breathIce", - "type": "checkbox" + "type": "checkbox", + "buttons": ["breath_ice"] }, { "name": "Electric", "id": "breathElectric", - "type": "checkbox" + "type": "checkbox", + "buttons": ["breath_electric"] }, { "name": "Smoke", "id": "breathSmoke", - "type": "checkbox" + "type": "checkbox", + "buttons": ["breath_smoke"] }, { "name": "Radiation", "id": "breathRadiation", - "type": "checkbox" + "type": "checkbox", + "buttons": ["breath_radiation"] }, { "name": "Foul", "id": "breathFoul", - "type": "checkbox" + "type": "checkbox", + "buttons": ["breath_foul"] }, ] }, @@ -1593,6 +1636,7 @@ options = [ "name": "Drool", "id": "droolEnabled", "optional": true, + "buttons": ["drool"], "entries": [ { @@ -1610,13 +1654,27 @@ options = [ "optional": true, "entries": [ - + { + "name": "Shrinking magic", + "id": "magicShrink", + "type": "checkbox", + "buttons": ["magic_shrink"], + "default": true, + }, + { + "name": "Fast digestion", + "id": "magicFastDigestion", + "type": "checkbox", + "buttons": ["magic_fast_digestion"], + "default": true, + }, ] }, { "name": "Wings", "id": "hasWings", "optional": true, + "buttons": ["wings_flap"], "entries": [ { @@ -1643,6 +1701,7 @@ options = [ "name": "Wing Vore", "id": "wingVoreEnabled", "type": "subcategory", + "buttons": ["wings_vore"], "entries": [ { @@ -1654,7 +1713,8 @@ options = [ { "name": "Manual digestion", "id": "wingDigestManual", - "type": "checkbox" + "type": "checkbox", + "buttons": ["digest_wings"] }, { "name": "Same-size vore", diff --git a/game.js b/game.js index e940955..02bf473 100644 --- a/game.js +++ b/game.js @@ -4273,7 +4273,6 @@ function loadPreset() { } function grabFormData(form, warnings, panels, buttons) { - console.log(form); if (form.hasAttribute("data-warning")) { warnings.push(form.getAttribute("data-warning")); } @@ -4477,6 +4476,7 @@ function enable_victim(category) { } function enable_button(name) { + console.log(name); document.getElementById("button-action-" + name).style.display = "inline"; } @@ -4559,13 +4559,13 @@ function startGame(e) { enable_panel("paws"); enable_button("stomp"); + enable_button("sit"); + enable_button("grind"); + enable_button("ass_grind"); if (macro.footType != "hoof") enable_button("flex_toes"); - enable_button("sit"); - enable_button("grind"); - enable_button("ass_grind"); enable_growth_part("body"); enable_growth_part("ass"); @@ -4575,14 +4575,11 @@ function startGame(e) { } if (macro.droolEnabled) { - enable_button("drool"); enable_victim("drool","Drenched in drool"); } if (macro.magicEnabled) { enable_panel("magic"); - enable_button("magic_shrink"); - enable_button("magic_fast_digestion"); } if (macro.arousalEnabled) { @@ -4592,40 +4589,24 @@ function startGame(e) { } if (macro.oralVore) { - enable_button("feed"); if (macro.brutality > 0) { enable_button("chew"); enable_victim("chew","Chewed"); } - if (macro.oralDigestManual) { - 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"); - - if (macro.analDigestManual) { - enable_button("digest_anal"); - } } if (macro.tailCount > 0) { enable_panel("tails"); enable_growth_part("tail"); - enable_button("tail_slap"); enable_victim("tail-slap","Tail slapped"); if (macro.tailMaw) { @@ -4639,10 +4620,6 @@ function startGame(e) { } else { enable_button("tail_vore_only"); } - - if (macro.tailDigestManual) { - enable_button("digest_tail"); - } } } @@ -4652,19 +4629,10 @@ function startGame(e) { enable_victim("cock-slap","Cockslapped"); enable_victim("ball-smother","Smothered under balls"); - enable_button("cockslap"); - if (macro.cockVoreEnabled){ - enable_button("cock_vore"); enable_victim("cock-vore","Cock vore"); - - if (macro.cockDigestManual) { - enable_button("digest_cock"); - } } - enable_button("ball_smother"); - enable_stat("cum"); enable_growth_part("dick"); @@ -4674,28 +4642,16 @@ function startGame(e) { enable_victim("sheath-crush","Crushed in sheath"); if (macro.sheathAbsorptionEnabled) { - enable_button("sheath_absorb"); enable_victim("sheath-absorb","Absorbed by sheath"); } - - - enable_button("sheath_stuff"); - enable_button("sheath_toy"); - enable_button("sheath_clench"); } if (macro.hasForeskin) { enable_victim("foreskin-crush"); if (macro.foreskinAbsorptionEnabled) { - enable_button("foreskin_absorb"); enable_victim("foreskin-absorb"); } - - - enable_button("foreskin_stuff"); - enable_button("foreskin_toy"); - enable_button("foreskin_clench"); } if (macro.arousalEnabled) { @@ -4713,11 +4669,8 @@ function startGame(e) { enable_panel("vagina"); if (macro.unbirthEnabled) { - enable_button("unbirth"); enable_victim("unbirth","Unbirthed"); } - enable_button("slit_toy"); - enable_stat("femcum"); enable_growth_part("slit"); @@ -4731,10 +4684,6 @@ function startGame(e) { enable_victim("female-orgasm-musk","Inundated in feminine cum musk"); } } - - if (macro.unbirthDigestManual) { - enable_button("digest_unbirth"); - } } if (macro.hasBreasts) { @@ -4745,31 +4694,17 @@ function startGame(e) { enable_panel("breasts"); - enable_button("breast_crush"); - enable_button("breast_toy"); - enable_button("cleavage_stuff"); - enable_button("cleavage_crush"); - enable_button("cleavage_drop"); - enable_button("cleavage_absorb"); - enable_growth_part("breasts"); if (macro.lactationEnabled) { warns.push("Lactation is enabled."); enable_victim("milk-flood","Flooded by milk"); - enable_button("breast_milk"); enable_stat("milk"); } if (macro.breastVore) { enable_victim("breast-vore","Stuffed into breasts"); - - enable_button("breast_vore"); - - if (macro.breastDigestManual) { - enable_button("digest_breast"); - } } } @@ -4778,11 +4713,9 @@ function startGame(e) { enable_panel("misc"); - enable_button("pouch_stuff"); - enable_button("pouch_rub"); - enable_button("pouch_eat"); - enable_button("pouch_absorb"); - + if (macro.oralVoreEnabled) { + enable_button("pouch_eat"); + } } if (macro.soulVoreEnabled) { @@ -4791,14 +4724,6 @@ function startGame(e) { enable_victim("soul-paw","Souls absorbed underfoot"); enable_panel("souls"); - - enable_button("soul_vore"); - enable_button("soul_absorb_paw"); - - if (macro.soulDigestManual) { - enable_button("digest_soul"); - } - } if (macro.stenchEnabled) { @@ -4812,12 +4737,10 @@ function startGame(e) { enable_stat("gas"); if (macro.belchEnabled) { enable_panel("waste"); - enable_button("belch"); enable_victim("gas-belch","Belched on"); } if (macro.fartEnabled) { enable_panel("waste"); - enable_button("fart"); enable_victim("gas-fart","Farted on"); } } @@ -4835,20 +4758,12 @@ function startGame(e) { warns.push("Watersports are enabled."); enable_panel("waste"); - enable_button("piss"); - enable_stat("piss"); enable_victim("piss","Pissed away"); if (macro.bladderVore) { - enable_button("bladder_vore"); - enable_victim("bladder-vore","Dissolved into piss"); - - if (macro.bladderDigestManual) { - enable_button("digest_bladder"); - } } if (macro.stenchEnabled) { @@ -4860,8 +4775,6 @@ function startGame(e) { warns.push("Scat is enabled."); enable_panel("waste"); - enable_button("scat"); - enable_stat("scat"); enable_victim("scat","Shat on"); @@ -4874,72 +4787,50 @@ function startGame(e) { if (macro.gooEnabled) { enable_panel("goo"); - enable_button("melt"); - if (macro.gooDigestion) { enable_victim("goo","Absorbed into the goo"); } } if (macro.pawVoreEnabled) { - enable_button("paw_vore"); enable_victim("paw-vore","Absorbed into paws"); - - if (macro.pawDigestManual) { - enable_button("digest_paws"); - } } if (macro.breathEnabled) { enable_panel("breath"); - enable_button("breath_line"); - enable_button("breath_cone"); - if (macro.breathFire) { - enable_button("breath_fire"); enable_victim("breath-fire","Incinerated by fiery breath"); } if (macro.breathIce) { - enable_button("breath_ice"); enable_victim("breath-ice","Frozen in icy breath"); } if (macro.breathElectric) { - enable_button("breath_electric"); enable_victim("breath-electric","Fried by an electric gale"); } if (macro.breathSmoke) { - enable_button("breath_smoke"); enable_victim("breath-smoke","Snuffed out by smoke"); } if (macro.breathRadiation) { - enable_button("breath_radiation"); enable_victim("breath-radiation","Vaporized by radioactive power"); } if (macro.breathFoul) { - enable_button("breath_foul"); enable_victim("breath-foul","Smothered in humid breath"); } } if (macro.hasWings) { enable_panel("misc"); - enable_button("wings_flap"); enable_victim("wings-flap"); if (macro.wingVoreEnabled) { - enable_button("wings_vore"); enable_victim("wings-vore"); - - if (macro.wingDigestManual) { - enable_button("digest_wings"); - } } } @@ -5304,6 +5195,8 @@ function render_checkbox_option(li, option) { label.setAttribute("for", option.id); label.innerText = option.name; + attach_form_data(input, option); + li.appendChild(input); li.appendChild(label); } @@ -5362,6 +5255,8 @@ function render_subcategory_option(li, option) { sub_div_inner.appendChild(li); }); + attach_form_data(sub_input, option); + sub_div.appendChild(sub_ul); li.appendChild(sub_div); @@ -5394,8 +5289,6 @@ function render_option(root_div, li, option) { render_subcategory_option(li, option); } - attach_form_data(li, option); - root_div.appendChild(li); }