Fantasy Grounds Merchandise
  1. #1

    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!

  2. #2
    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());
    end
    Last 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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
TALES of the VALIANT

Log in

Log in