-
October 16th, 2020, 19:17 #1
- Join Date
- Jan 2020
- Posts
- 222
Any way to get position of a character portrait (in the top left screen list)?
Is there any way to find the coordinates of a particular character portrait in the portrait "list" on the top of the desktop? I have the character ID, I was thinking maybe using Interface.findWindow but I don't know (and can't figure out from CoreRPG or 5E code) what the windowclass is for it.
Thoughts? Suggestions?
-
October 16th, 2020, 21:27 #2
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,570
The window is named "characterlist"; and each character within the list is one control named <"ctrl_" .. sIdentity>. It's a generic control that doesn't display anything directly; but instead uses widgets to display portrait, color, name, etc.
Regards,
JPG
-
October 17th, 2020, 02:57 #3
- Join Date
- Jan 2020
- Posts
- 222
Excellent! Thanks!
-
October 17th, 2020, 03:37 #4
- Join Date
- Jan 2020
- Posts
- 222
So.... characterlist even has a function (in characterlist.lua) to find the correct control (findControlForIdentity(v)), but I'm really struggling trying to figure out how to get a pointer to the characterlist window itself, using Interface.findWindow, without knowing the window's datasource. In fact, from all the code I've looked at in CoreRPG, it doesn't seem to have a direct link to a database entry...it's a weird window from what I can tell as it's backed by a table maybe? and not a DB node. I can't tell, because nowhere in the Desktop code can I find where the characterlist window itself is actually created. I've found panel definitions and such, but if it's created in the normal way, I can't figure it out.
Once I have the window, I'm sure I can reference the correct portrait's control using <"ctrl_"...sIdentity> or even the function I found in characterlist.lua to find the control, but I need the window first. And I'm totally stuck. -sigh-
Any more suggestions how I can get a pointer to that characterlist window in my own code?
Thanks again. Sorry for the trouble.Last edited by zuilin; October 17th, 2020 at 04:00. Reason: more info
-
October 17th, 2020, 04:43 #5
- Join Date
- Jan 2020
- Posts
- 222
Oh. My. Gosh.
local theCharacterListWindow = Interface.findWindow("characterlist","");
Sorry for all the crazy posts above.
-
October 17th, 2020, 05:32 #6
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,570
All top-level windows (including panels) are uniquely defined by a window class and a database path. An empty database path is used to indicate a sourceless window (i.e. not connected to database); which most panels are. There are other top level windows that are sourceless (color picker, portrait picker, options, etc.)
Regards,
JPG
-
October 17th, 2020, 06:59 #7
- Join Date
- Jan 2020
- Posts
- 222
-
October 17th, 2020, 08:15 #8
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,570
This one:
https://fantasygroundsunity.atlassia...ace#findWindow
Points to this one via a link on the datasource parameter:
https://fantasygroundsunity.atlassia...windowinstance
Second paragraph outlines the second parameter.
Regards,
JPG
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks