PDA

View Full Version : Player Portrait widget piece after update



celestian
December 14th, 2023, 05:21
Currently I am unable to get the setDecorator() to work as expected.

In the 2E ruleset I have it set to this.



CharacterListManager.setDecorator("init_rolled", addInitiativeWidget);


IT seems that the previously passed identity is always nil.




function addInitiativeWidget(control, sIdentity)
Debug.chat("addInitiativeWidget", control, sIdentity)
...





s'addInitiativeWidget' | genericcontrol = { name = s'', x,y,w,h = 0,0,0,0 } | nil


I've also noticed when I call update for my code from elsewhere when I do have a identity (the id of the character such as id-00001) when doing this:



local sPath = CharacterListManager.convertIdentityToPath(
User.getCurrentIdentity(sIdentity));


It returns nil.

I have to do this to get the control for that identity, that has changed to a path variable.
(local ctrlChar = CharacterListManager.getDisplayControlByPath(sPath );)


What is the sIdentity suppose to be if not id-00001?

celestian
December 14th, 2023, 06:19
The issue turned out to be how I was trying to use the convertIdentityToPath() function.

Dropped the User.* piece and worked out the rest.