Browse Source

Fix alignment of radio options; add tooltips

tags/v1.1.0
Fen Dweller 5 years ago
parent
commit
ae4f2ea325
3 changed files with 18 additions and 8 deletions
  1. +8
    -5
      features.js
  2. +7
    -0
      game.js
  3. +3
    -3
      stroll.html

+ 8
- 5
features.js View File

@@ -646,7 +646,6 @@ options = [
"type": "radio", "type": "radio",
"id": "difficulty", "id": "difficulty",
"default": "0", "default": "0",
"tooltip": "Grow how you want, when you want.",
"choices": "choices":
[ [
{ {
@@ -782,22 +781,26 @@ options = [
[ [
{ {
"name": "Non-fatal", "name": "Non-fatal",
"value": "0"
"value": "0",
"tooltip": "All actions are explicitly safe."
}, },
{ {
"name": "Fatal", "name": "Fatal",
"value": "1", "value": "1",
"warning": "Fatal actions are enabled"
"warning": "Fatal actions are enabled",
"tooltip": "Actions can have fatal consequences, but don't go into detail."
}, },
{ {
"name": "Gory", "name": "Gory",
"value": "2", "value": "2",
"warning": "Gory actions are enabled"
"warning": "Gory actions are enabled",
"tooltip": "Descriptions are violent, but not excessively so."
}, },
{ {
"name": "Sadistic", "name": "Sadistic",
"value": "3", "value": "3",
"warning": "Brutal actions are enabled"
"warning": "Brutal actions are enabled",
"tooltip": "Cronch."
}, },
] ]
} }


+ 7
- 0
game.js View File

@@ -5578,6 +5578,13 @@ function render_radio_option(options_div, option) {
label.setAttribute("for", option.id + "-" + choice.value); label.setAttribute("for", option.id + "-" + choice.value);
label.innerText = choice.name; label.innerText = choice.name;


label.classList.add("solo")

if (choice.tooltip) {
label.classList.add("has-tooltip")
label.title = choice.tooltip;
}

attach_form_data(input, choice); attach_form_data(input, choice);


li.appendChild(input); li.appendChild(input);


+ 3
- 3
stroll.html View File

@@ -278,9 +278,9 @@
<div class="custom-category"> <div class="custom-category">
<p>Or export/import your character to text here. Copy and paste to share.</p> <p>Or export/import your character to text here. Copy and paste to share.</p>
<div class> <div class>
<button type="button" class="option-button" id="button-export-clear">Clear Space</button>
<button type="button" class="option-button" id="button-export-preset">Export Your Character</button>
<button type="button" class="option-button" id="button-import-preset">Import Your Character</button>
<button type="button" class="option-button" id="button-export-clear">Clear</button>
<button type="button" class="option-button" id="button-export-preset">Export</button>
<button type="button" class="option-button" id="button-import-preset">Import</button>


<p><input autocomplete="off" type="text" id="export-area" placeholder="Paste character data here..."></p> <p><input autocomplete="off" type="text" id="export-area" placeholder="Paste character data here..."></p>
</div> </div>


Loading…
Cancel
Save