Skip to content

Commit

Permalink
Fixed compatibility issue with SWADE ruleset's combat tracker
Browse files Browse the repository at this point in the history
  • Loading branch information
Gtaray committed Apr 7, 2023
1 parent 9f121a0 commit bacb5e5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
4 changes: 4 additions & 0 deletions ct/ct_entries.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@
<windowclass name="client_ct_entry" merge="join">
<script file="ct/scripts/ct_onCardDrop.lua" />
</windowclass>

<windowclass name="combatant" merge="join" ruleset="SWADE">
<script file="ct/scripts/ct_onCardDrop.lua" />
</windowclass>
</root>
9 changes: 8 additions & 1 deletion ct/scripts/ct_onCardDrop.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
function onDrop(x, y, draginfo)
return CardsManager.onDropCard(draginfo, getDatabaseNode());
local handled = CardsManager.onDropCard(draginfo, getDatabaseNode());

-- For some reason the onDrop call isn't propogating to other objects in the stack, so we call it manually here if present.
if not handled and super and super.onDrop then
return super.onDrop(x, y, draginfo);
end

return handled;
end
4 changes: 3 additions & 1 deletion scripts/decked_out_messages.lua
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,8 @@ function resolveIdentityName(sIdentity, sMessageIdentity)
if sIdentity == "gm" then
return "the GM";
else
-- return User.getIdentityLabel(sIdentity); // This doesn't work unless someone is connected to and controlling the pc otherwise it seems to return nil
-- I'm not sure how this works though, since individual players can't access other charsheet nodes, so the display name shouldn't work there either.
return ActorManager.getDisplayName(
ActorManager.resolveActor(
DB.findNode(
Expand All @@ -501,7 +503,7 @@ function resolvePronouns(sSender, sReceiver, sMessageId, sDefault)
return "their";
end
else
-- If there is a receiver, then we use 'yourself, 'themselves', and 'name
-- If there is a receiver, then we use 'yourself, 'themselves', and 'name'
if sSender == sReceiver and sSender == sMessageId then
return "yourself";
end
Expand Down

0 comments on commit bacb5e5

Please sign in to comment.