Thanks for your reply.
Now i have a new problem : When i set a new frame for a character sheet, it does not change dynamically for the host and the client, i must close the sheets and open it for see the new one... any idea ?
Thanks
Printable View
Thanks for your reply.
Now i have a new problem : When i set a new frame for a character sheet, it does not change dynamically for the host and the client, i must close the sheets and open it for see the new one... any idea ?
Thanks
If you use a value in the database to control which frame to use write a <databasenode>.onUpdate function that triggers on all clients when this database value is changed and use code in the function to change the frame.
thanks but i do not understand all, how can i do that ? Do you have an exemple ?
See campaign\record_npc.xml in CoreRPG, the "npc" windowclass has the following script section:
onInit uses the DB.addHandler function to define the onUpdate event handler that runs the onLockChanged function when the node specified (sNode..".locked") changes.Code:<script>
function onInit()
local sNode = getDatabaseNode().getNodeName();
DB.addHandler(sNode .. ".locked", "onUpdate", onLockChanged);
onLockChanged();
end
function onClose()
local sNode = getDatabaseNode().getNodeName();
DB.removeHandler(sNode .. ".locked", "onUpdate", onLockChanged);
end
function onLockChanged()
if header.subwindow then
header.subwindow.update();
end
if main.subwindow then
main.subwindow.update();
end
local bReadOnly = WindowManager.getReadOnlyState(getDatabaseNode());
notes.setReadOnly(bReadOnly);
end
</script>
See also the "Handler Functions" section here: https://www.fantasygrounds.com/modguide/scripting.xcp Note that the line "node.onUpdate = sourceUpdate;" in this should be "node.onUpdate = onSourceUpdate;"
thanks, it's work
Hello, my second extension is in progress. For now, we can change character sheet between werewolf and vampire. I am on mage V20 now, and after NPC sheet. See my signature to download it.
EDIT : i have updated VtDA and VtM on my dropbox for now.
Hello, i have a problem for change npc sheet frame, see my code :
description is a subwindow and it does not go to the if for call onInstanceCreated() function.Quote:
function onMenuSelection(selection, subselection, subsubselection)
if selection == 1 then
window.getDatabaseNode().getChild("race").setValue ("vampire_npc");
if window.description then
window.description.onInstanceCreated();
window.combat.onInstanceCreated();
window.other.onInstanceCreated();
window.other3.onInstanceCreated();
window.other4.onInstanceCreated();
window.other5.onInstanceCreated();
end
end
end
Problem solved :
Code:local wnd = Interface.findWindow("npc",window.getDatabaseNode());
if wnd then
wnd.description.onInstanceCreated();
wnd.combat.onInstanceCreated();
wnd.other.onInstanceCreated();
wnd.other3.onInstanceCreated();
wnd.other4.onInstanceCreated();
wnd.other5.onInstanceCreated();
end
Extension "Crossover.ext" updated : NPC werewolf sheet OK.
By right clicking on "more" button, we can change PC & NPC sheets between Mage 20th, Vampire 20th, Werewolf 20th.
EDIT : Any bug ?