diff --git a/js/sr2ini.js b/js/sr2ini.js index 79da508..d0e33e9 100644 --- a/js/sr2ini.js +++ b/js/sr2ini.js @@ -309,7 +309,6 @@ function newRound() { let $dice = $(this).find(".combatantDice"); if ( $dice.text() == "" ) { $ini.text(1); - $ini.text(1); } else { $ini.text(rollForInitiative($dice.text(), $(this).find(".combatantRea").text())); } @@ -322,35 +321,14 @@ function newRound() { // add test combatant for testing purposes (duh) function addTestCombatant() { - // construct jQuery object for table row - let $tr = $($.parseHTML( [ - '\n', - 'Test-Goon\n', - '12\n', - '2D+6\n', - '\n', - '
\n', - '\n', - '\n', - '\n', - '
\n', - '\n', - ''].join("") - )); - - // add handlers to table row buttons - $tr.find("button.edit-button").on("click", handleEditButtonClick); - $tr.find("button.act-button").on("click", handleActButtonClick); - $tr.find("button.remove-button").on("click", handleRemoveButtonClick); - - // add handlers to table cells (click to edit) - $tr.find(".combatantName, .combatantIni, .combatantDiceAndRea").on("click", handleEditButtonClick); - - // add row to table and sort - $("#combatantsTable").append($tr); - sortTable(); + $("#addCombatantButton").click(); + $("#combatantModalName").val("Goon1"); + $("#combatantModalDice").val(2); + $("#combatantModalRea").val(6); + $("#combatantModalIni").val(12); + setTimeout(function(){ + $("#combatantModalAddOkButton").click(); + },500); } @@ -377,6 +355,6 @@ $(document).ready(function(){ $("#combatantModal input[id*='combatantModal']").val(""); }) -// addTestCombatant(); + addTestCombatant(); });