Skip to content

Commit

Permalink
Fix for spell components
Browse files Browse the repository at this point in the history
  • Loading branch information
ZarestiaDev committed Aug 21, 2022
1 parent 80ab74d commit ad57c1c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
19 changes: 12 additions & 7 deletions campaign/scripts/visibility_components.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,22 @@ end

function setComponentsText()
local sComponents = DB.getValue(window.getDatabaseNode(), "components", "");
--Exception for e.g. Tome of Battle prerequisites, set all components with digits to empty
if sComponents:match("%d") then

-- Exception for e.g. Tome of Battle prerequisites, set all components with digits and no gp to empty
if sComponents:match("%d") and not sComponents:match("gp") then
sComponents = "";
end

--Getting rid of spaces because of width
-- Getting rid of spaces because of width
sComponents = sComponents:gsub("%s", "");

--Getting rid of paranthesis and text inbewteen for 5e

-- Capturing and appending the gold cost with an $ because of width reasons
if sComponents:match("%d+gp") then
sComponents = sComponents .. ",$";
end

-- Getting rid of paranthesis and text inbewteen for 5e
sComponents = sComponents:gsub("%b()", "");

setValue(sComponents);
end
4 changes: 2 additions & 2 deletions extension.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<root version="3.3" >
<properties>
<name>Feature: Spell Action Info</name>
<version>3.9</version>
<version>3.10</version>
<loadorder>142</loadorder>
<description>
<text>Spell Action Info</text>
Expand All @@ -20,7 +20,7 @@
</ruleset>
</properties>

<announcement text="https://forge.fantasygrounds.com/shop/items/242/view\n3.5E/PFRPG/5E Spell Action Info - v3.9 \rby Zarestia, compatibility contributions by MeAndUnique, 2022" font="emotefont" icon="sai_icon" />
<announcement text="https://forge.fantasygrounds.com/shop/items/242/view\n3.5E/PFRPG/5E Spell Action Info - v3.10 \rby Zarestia, compatibility contributions by MeAndUnique, 2022" font="emotefont" icon="sai_icon" />

<base>
<!-- Campaign -->
Expand Down

0 comments on commit ad57c1c

Please sign in to comment.