Skip to content

Commit

Permalink
Fixed: Cast button not showing up on spell add
Browse files Browse the repository at this point in the history
  • Loading branch information
rhagelstrom committed Dec 14, 2022
1 parent e8c84e3 commit 6c48f32
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Arcane Ward

**Current Version:** 1.12
**Current Version:** 1.13
**Updated::** 12/13/22

Arcane Ward is Fantasy Grounds extension for 5E that automates the School of Abjuration trait Arcane Ward. Also mostly automates legacy NPCs with the trait Arcane Ward. This extension also helps automate and track spell/pact slot usage. This extension is useful even if no one in the party is an Abjuration Wizard.
Expand Down
2 changes: 0 additions & 2 deletions campaign/record_char_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
</number_charwounds>

<basicnumber name="arcaneward_hp" source="hp.arcaneward" >
<!-- <script file="campaign/scripts/char_aw.lua" /> -->
<anchored to="temphp" position="righthigh" offset="70,0" width="40" height="30"/>
<font>reference-b-large</font>
<color>a063eb</color>
Expand Down Expand Up @@ -67,7 +66,6 @@
</basicnumber>

<label_charfieldtop name="awhp_label">
<!-- <script file="campaign/scripts/char_aw.lua" /> -->
<script>
function onInit()
if super and super.onInit then
Expand Down
8 changes: 5 additions & 3 deletions campaign/scripts/power_item.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,17 @@ function onInit()
end
OptionsManager.registerCallback("ARCANE_WARD_SPELL_CAST_GAME", optionChange)
OptionsManager.registerCallback("ARCANE_WARD_SPELL_CAST", optionChange)

local node = getDatabaseNode()
DB.addHandler(node.getPath() .. ".group", "onUpdate", onDisplayChanged);
windowlist.onChildWindowAdded(self)
--Don't show button by default until we are sure we should
header.subwindow.button_abjuration.setVisible(false)
optionChange()
end

function onClose()
local node = getDatabaseNode()
DB.removeHandler(node.getPath() .. ".group" , "onUpdate", onDisplayChanged)
OptionsManager.unregisterCallback("ARCANE_WARD_SPELL_CAST_GAME", optionChange)
OptionsManager.unregisterCallback("ARCANE_WARD_SPELL_CAST", optionChange)
optionChange(true)
Expand Down Expand Up @@ -113,15 +116,14 @@ function onDisplayChanged()
local bProcess = false
local aCastInfo

for _,vGroup in pairs(DB.getChildren(node.getParent().getParent(), "powergroup")) do
for _,vGroup in pairs(DB.getChildren(node, "...powergroup")) do
local sPowerGroup = DB.getValue(vGroup, "name", "");
if sPowerGroup == sGroup and DB.getValue(vGroup, "castertype", "") == "memorization" then
bProcess = true
aCastInfo = ArcaneWard.getCurrentCastInfo(node)
break
end
end

if sDisplayMode == "summary"then
header.subwindow.button_abjuration.setVisible(false);
header.subwindow.arcaneward_text_label.setVisible(false);
Expand Down
4 changes: 2 additions & 2 deletions extension.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<root release="3.0" version="3">
<announcement text="Arcane Ward v1.12\rby Ryan Hagelstrom\rContribution Zarestia 2022" font="emotefont" icon="ArcaneWard"/>
<announcement text="Arcane Ward v1.13\rby Ryan Hagelstrom\rContribution Zarestia 2022" font="emotefont" icon="ArcaneWard"/>
<properties>
<!-- Loadorder has to be 141 to sit between CA and SAI -->
<loadorder>141</loadorder>
<name>Feature: Arcane Ward</name>
<version>1.12</version>
<version>1.13</version>
<author>Ryan Hagelstrom</author>
<description>Automates Arcane Ward Trait</description>
<ruleset>
Expand Down

0 comments on commit 6c48f32

Please sign in to comment.