
Background:
I've been working on introducing tabs and a few other options to the Star Wars D6 sheet, but somehow a few classes or features have become interconnected without me having any idea how it's possible. I'm not that great at these things yet, and
Earlier I introduced a Setting Menu (pulled from Gumshoe Official) with a few checkboxes to hide some sections of the sheet, and one checkbox to toggle between PC/NPC version of the sheet, and the current version works fine, with all chatboxes and the resulting hiding of sections or switches between PC/NPC working fine.
Problem:
Then I introduced tabs(pulled from Shadowrun 5th) and a new checkbox that regulates "wild die" rolls(through a sheetworker). Now, in some way the previously independent checkboxes didn't work independent anymore, as when the "wild die" checkbox is unchecked, for some reason the sheet shows both PC&NPC sections even if I've seen no connection between them.
Here is snippets from what I think are central to the problem:
CSS:
input.sheet-wilddie:checked ~ input.sheet-selector-switch:checked ~ .sheet-master-container .sheet-wild-hide, input.sheet-npc:checked ~ input.sheet-selector-switch:checked ~ .sheet-master-container .sheet-npc-hide , input.sheet-selector-switch:checked ~ .sheet-master-container .sheet-pc-hide, input.sheet-gmroll:checked ~ input.sheet-selector-switch:checked ~ .sheet-master-container .sheet-gmroll-hide { display: none; }
input.sheet-selector-switch:checked ~ .sheet-master-container div.sheet-npc-hide{ display: inline-block; } input.sheet-npc:checked ~ input.sheet-selector-switch:checked ~ .sheet-master-container .sheet-pc-hide { display: inherit; }
HTML:
<input class="sheet-selector-switch sheet-npc" name="attr_npcswitch" type="checkbox" value="1"> <input class="sheet-selector-switch sheet-wilddie" name="attr_wildswitch" type="checkbox" value="1">
<div class="sheet-input-row sheet-top-row sheet-bold"> <span title="Shows a more dense statblock for NPCs. Equipment sections uses the first field from the PC version">Use NPC sheet</span> <input name="attr_npcswitch" type="checkbox" value="1"> </div> ... <div class="sheet-input-row sheet-top-row sheet-bold"> <span>Use 1E rules?</span> <input name="attr_wildswitch" type="checkbox" value="1"> </div>
<div class="content6 sheet-section sheet-equipment-hide"><!------------Equipment --------------> <div class="sheet-npc-hide"> <!-- Equipment PC--> <label style="text-align: center;">Equipment</label> <table style="width:97%"> <tr> <td style="text-align: right;"> <textarea name="attr_geartext1"></textarea> <textarea name="attr_geartext2"></textarea> </td> <td style="text-align: center;"> <textarea name="attr_geartext3"></textarea> <textarea name="attr_geartext4"></textarea> </td> <td style="text-align: Left;"> <textarea name="attr_geartext5"></textarea> <textarea name="attr_geartext6"></textarea> </td> </tr> </table> </div> <div class="sheet-pc-hide"><!-- Equipment NPC--> <label style="text-align: center">Equipment</label> <textarea style="height:7em;width:96%" name="attr_geartext1"></textarea> </div> </div>
Test Campaign to witness the problem
I'm aware that
input.sheet-npc:checked ~ input.sheet-selector-switch:checked ~ .sheet-master-container .sheet-pc-hide { display: inherit; }
might lead to some problem as property inheritance can be a tricky thing, but changing it to something else or removing only made the situation wrong. Any pointers or suggestions what I should look for is welcome. In worst case I'll remove the (fairly minor) NPC variation from the sheet and try to add it in again later in some other way, hopefully not ending up in a similar situation.