added switch state
This commit is contained in:
parent
f300ae8b52
commit
bf9598eb8f
28
index.php
28
index.php
@ -205,8 +205,8 @@
|
||||
<div class="card-content white-text">
|
||||
<span class="card-title">Health kind</span>
|
||||
<span>Are we using Max, Average or rolled HP?</span><br />
|
||||
<label> <input id="mob_hp_type_averages" name="mob_hp_type" type="radio" checked onchange="usingHPDice(false)" /> <span>Averages</span> </label>
|
||||
<label> <input id="mob_hp_type_rolled" name="mob_hp_type" type="radio" onchange="usingHPDice(true)" /> <span>Hit Dice</span> </label>
|
||||
<label> <input id="mob_hp_type_averages" name="mob_hp_type" type="radio" checked onchange="usingHPDice('averages')" /> <span>Averages</span> </label>
|
||||
<label> <input id="mob_hp_type_rolled" name="mob_hp_type" type="radio" onchange="usingHPDice('dice')" /> <span>Hit Dice</span> </label>
|
||||
<label> <input id="mob_hp_type_max" name="mob_hp_type" type="radio" onchange="usingHPDice('max')" /> <span>Max</span> </label>
|
||||
</div>
|
||||
</div>
|
||||
@ -987,7 +987,8 @@
|
||||
}
|
||||
|
||||
function usingHPDice(e) {
|
||||
if (e) {
|
||||
switch (e) {
|
||||
case "dice":
|
||||
$("#HP_max_card").hide("fast");
|
||||
$("#HP_average_card").hide("fast");
|
||||
$("#HP_hitdice_card").show("fast");
|
||||
@ -996,8 +997,8 @@
|
||||
$("#mob_hp_dice_ammount").val("");
|
||||
$("#mob_hp_dice_type").val("");
|
||||
$("#mob_hp_max").val("");
|
||||
|
||||
} else if (e == false) {
|
||||
break;
|
||||
case "averages":
|
||||
$("#HP_max_card").hide("fast");
|
||||
$("#HP_hitdice_card").hide("fast");
|
||||
$("#HP_average_card").show("fast");
|
||||
@ -1007,7 +1008,20 @@
|
||||
$("#mob_hp_dice_type").val("");
|
||||
$("#mob_hp_max").val("");
|
||||
|
||||
} else if (e == "max") {
|
||||
break;
|
||||
case "averages":
|
||||
$("#HP_max_card").hide("fast");
|
||||
$("#HP_hitdice_card").hide("fast");
|
||||
$("#HP_average_card").show("fast");
|
||||
|
||||
$("#mob_hp_avg").val("");
|
||||
$("#mob_hp_dice_ammount").val("");
|
||||
$("#mob_hp_dice_type").val("");
|
||||
$("#mob_hp_max").val("");
|
||||
|
||||
break;
|
||||
case "max":
|
||||
|
||||
|
||||
$("#HP_max_card").show("fast");
|
||||
$("#HP_hitdice_card").hide("fast");
|
||||
@ -1017,6 +1031,8 @@
|
||||
$("#mob_hp_dice_ammount").val("");
|
||||
$("#mob_hp_dice_type").val("");
|
||||
$("#mob_hp_max").val("");
|
||||
break;
|
||||
|
||||
}
|
||||
calcDiff();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user