Skip to content

Commit a665386

Browse files
author
Wil Thieme
committed
move ps_parcelitem script to discrete file
1 parent 910a398 commit a665386

3 files changed

Lines changed: 29 additions & 25 deletions

File tree

extension.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
<root version="3.1">
44
<properties>
55
<name>Feature: Party Item Identified</name>
6-
<version>1.4</version>
6+
<version>1.5</version>
77
<author>Llisandur</author>
88
<description>Adds identify buttons to party sheet and parcels</description>
99
<loadorder>200</loadorder>
1010
</properties>
1111

12-
<announcement text="https://www.fantasygrounds.com/forums/showthread.php?40686-Extension-Party-Inventory-Identified\rCoreRPG - Party Item Identified v1.4\nFor Fantasy Grounds v3.3+\nBy Llisandur, updated by bmos.\rAdds identify buttons to party sheet and parcels." font="emotefont"/>
12+
<announcement text="https://www.fantasygrounds.com/forums/showthread.php?40686-Extension-Party-Inventory-Identified\rCoreRPG - Party Item Identified v1.5\nFor Fantasy Grounds v3.3+\nBy Llisandur, updated by bmos.\rAdds identify buttons to party sheet and parcels." font="emotefont"/>
1313

1414
<base>
1515
<!-- Party sheet -->

ps/ps_inventory.xml

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -18,29 +18,7 @@
1818
<sheetdata>
1919
<hidden_record_isidentified name="isidentified">
2020
<class>item</class>
21-
<script>
22-
function onInit()
23-
if super.onInit then
24-
super.onInit();
25-
end
26-
27-
OptionsManager.registerCallback("PS-NONID-NAME", hideOrShowID);
28-
hideOrShowID();
29-
end
30-
31-
function hideOrShowID()
32-
if super then
33-
super.ignorehost = (OptionsManager.isOption("PS-NONID-NAME", "on") and Session.IsHost)
34-
if super.onValueChanged then
35-
super.onValueChanged()
36-
end
37-
end
38-
end
39-
40-
function onClose()
41-
OptionsManager.unregisterCallback("PS-NONID-NAME", hideOrShowID);
42-
end
43-
</script>
21+
<script file="campaign/scripts/ps_parcelitem.lua" />
4422
</hidden_record_isidentified>
4523

4624
<button_record_isidentified name="identifyitem" insertbefore="assign">

ps/scripts/ps_parcelitem.lua

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
--
2+
-- Please see the LICENSE.md file included with this distribution for attribution and copyright information.
3+
--
4+
-- luacheck: globals hideOrShowID
5+
6+
function hideOrShowID()
7+
if super then
8+
super.ignorehost = (OptionsManager.isOption("PS-NONID-NAME", "on") and Session.IsHost)
9+
if super.onValueChanged then
10+
super.onValueChanged()
11+
end
12+
end
13+
end
14+
15+
function onInit()
16+
if super.onInit then
17+
super.onInit();
18+
end
19+
20+
OptionsManager.registerCallback("PS-NONID-NAME", hideOrShowID);
21+
hideOrShowID();
22+
end
23+
24+
function onClose()
25+
OptionsManager.unregisterCallback("PS-NONID-NAME", hideOrShowID);
26+
end

0 commit comments

Comments
 (0)