Skip to content

Commit 9cea2c6

Browse files
author
Wil Thieme
committed
Color Player unID'd Items Red
1 parent cb62170 commit 9cea2c6

3 files changed

Lines changed: 63 additions & 2 deletions

File tree

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
--
2+
-- Please see the LICENSE.md file included with this distribution for attribution and copyright information.
3+
--
4+
-- luacheck: globals onValueChanged ignorehost class nonIDColor
5+
6+
local nodeSrc = nil;
7+
function onInit()
8+
nodeSrc = window.getDatabaseNode();
9+
if nodeSrc then
10+
onValueChanged();
11+
DB.addHandler(DB.getPath(nodeSrc, "isidentified"), "onUpdate", onValueChanged);
12+
end
13+
end
14+
15+
function onClose()
16+
if nodeSrc then
17+
DB.removeHandler(DB.getPath(nodeSrc, "isidentified"), "onUpdate", onValueChanged);
18+
end
19+
end
20+
21+
function nonIDColor(bID)
22+
if not bID and Session.IsHost then
23+
window.nonid_name.setColor(ColorManager.COLOR_HEALTH_CRIT_WOUNDS);
24+
else
25+
window.nonid_name.setColor(ColorManager.COLOR_FULL);
26+
end
27+
end
28+
29+
function onValueChanged()
30+
if window.onIDChanged then
31+
window.onIDChanged();
32+
elseif class then
33+
local bIgnoreHost = false;
34+
if ignorehost then bIgnoreHost = true; end
35+
local bID = LibraryData.getIDState(class[1], nodeSrc, bIgnoreHost);
36+
window.name.setVisible(bID);
37+
window.nonid_name.setVisible(not bID);
38+
39+
-- bmos color-coding nonID names
40+
nonIDColor(bID)
41+
end
42+
end

common/template_records.xml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0" encoding="iso-8859-1"?>
2+
3+
<!--
4+
Please see the LICENSE.md file included with this distribution for
5+
attribution and copyright information.
6+
-->
7+
8+
<root>
9+
<template name="hidden_record_isidentified">
10+
<genericcontrol>
11+
<bounds>0,0,0,0</bounds>
12+
<invisible />
13+
<script file="common/scripts/hidden_record_isidentified.lua" />
14+
</genericcontrol>
15+
</template>
16+
</root>

extension.xml

Lines changed: 5 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.5</version>
6+
<version>1.6</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.5\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.6\nBy Llisandur, updated by bmos.\rAdds identify buttons to party sheet and parcels." font="emotefont"/>
1313

1414
<base>
1515
<!-- Party sheet -->
@@ -18,6 +18,9 @@
1818
<!-- Campaign records -->
1919
<includefile source="campaign/record_parcel.xml" />
2020

21+
<!-- Templates -->
22+
<includefile source="common/template_records.xml" />
23+
2124
<!-- Scripts -->
2225
<script name="PartyInventoryIDOptions" file="scripts/pii-options.lua" />
2326

0 commit comments

Comments
 (0)