Skip to content

Commit

Permalink
fix(rolls): fix formatting of multi-dice type rolls going into TS (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
aptmac committed Sep 3, 2024
1 parent f2abc99 commit d2826eb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion extension/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ document.addEventListener('keydown', function(e) {
*/
function determineRollType(element) {
let rollName = getRollNameFromString(element.getAttribute("name"));
console.warn(rollName);
if (rollName == "initiative") {
return ROLL_TYPES.Initiative;
} else if (rollName == "hit_dice") {
Expand Down Expand Up @@ -267,5 +266,6 @@ function getAttackRollInformation(element) {
function getDamageRollInformation(element) {
let roll = element.getElementsByTagName("input")[0].value;
modifier = parseDamageRollModifier(roll);
roll = roll.replace(/\s/g, ''); // TaleSpire does not like whitespaces in dice roll strings
return new RollInformation(ROLL_TYPES.Damage, ROLL_TYPES.Damage, roll, modifier);
}
1 change: 1 addition & 0 deletions extension/js/popup.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Fetch the input data from the popup and send it to TaleSpire
document.getElementById("submitButton").addEventListener("click", async function() {
let roll = document.getElementById("rollInput").value
roll = roll.replace(/\s/g, ''); // TaleSpire does not like whitespaces in dice roll strings
let rollName = document.getElementById("rollNameInput").value || `${roll}`;

// Takes a look at the advantage toggles and determines what the roll query is
Expand Down
2 changes: 1 addition & 1 deletion extension/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Roll20 to TaleSpire",
"version": "0.0.1",
"version": "0.0.2",
"description": "A TaleSpire companion application, used to send dice rolls from your Roll20 character sheet directly into your TaleSpire dice tray.",
"manifest_version": 3,
"author": "aptmac",
Expand Down

0 comments on commit d2826eb

Please sign in to comment.