-
December 20th, 2024, 03:36 #1
- Join Date
- Feb 2021
- Posts
- 449
I only want to show effect summaries in the CT for players for their own character
I found a setting to turn off effects descriptions, but basically I only want to show full descriptions of effects for the players own character, everything else I just want to show the symbols on the tokens.
I found this piece of code in ct_effect_summary.lua
function onEffectsChanged()
-- Set the effect summary string
local sEffects = EffectManager.getEffectsString(window.getDatabaseN ode());
if sEffects ~= "" then
setValue(Interface.getString("ct_label_effects") .. " " .. sEffects);
else
setValue(nil);
end
So I need to somehow figure out that the CT entry is the player logged in and have an AND condition after "if sEffects ~= "" " but I'm not sure how to do this. I think I get can get the nodeChar by getting window.getParent().getParent() and then finding the "owner", but how do I get the logged in players login name?
Thanks!
-
December 20th, 2024, 04:18 #2
- Join Date
- Feb 2021
- Posts
- 449
I actually figured it out myself, I found a function called "isCTEntryOwner()"
I just got the node inside onEffectsChanged()
nodeCT = window.getDatabaseNode();
then added
if sEffects ~= "" and isCTEntryOwner(nodeCT) then
function isCTEntryOwner(nodeCT)
if not nodeCT then
return false;
end
if Session.IsHost then
return true;
end
Debug.chat ("Owner" .. DB.getValue(nodeCT, "owner", ""));
Debug.chat ("username " ..User.getUsername());
return (DB.getValue(nodeCT, "owner", "") == User.getUsername());
endLast edited by alloowishus; December 25th, 2024 at 02:47.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks