Thread: Refreshing client character list
-
March 8th, 2020, 03:46 #1
- Join Date
- Jul 2018
- Posts
- 71
Refreshing client character list
I'm building an extension to randomly generate characters (for the DCC ruleset, but I believe my issue applies to CoreRPG as well). This is triggered by either a slash command or a newly added button on the PC list.
Both work fine already, with one minor issue:
When triggering this on the host, the PC list shows the newly added character. But when triggering on a client, the PC list does not update. I have to manually close and re-open it.
Is there a way to force a refresh on the client? (I realize I might need to use OOB to notify the client that the character was successfully added. I'm already using OOB for the client to trigger character creation on the host, as clients can't add db nodes directly.)
Possibly related:
When my client starts up, it automatically shows a "Character Selection" window. I would expect this to be the "charselect_client" (or possibly "charselect_local") windowinstance, but when I try to locate this using Interface.findWindow(), it doesn't come up. However, after manually closing and re-opening the window (using the "PC" button in the right sidebar) and running Interface.findWindow() again, it now successfully comes up. If the initial visible windowinstance isn't "charselect_client", what is it? If I can get a handle to it, I assume I can force a refresh.
Thanks in advance!
-
March 8th, 2020, 03:51 #2
I dont know the answer but I can confirm that the player view requires closing/reopening to refresh.
-
March 8th, 2020, 04:40 #3
- Join Date
- Jul 2018
- Posts
- 71
Good to know - perhaps I'll just live with that and ask players to refresh after creating characters, even if that's a bit clunky.
I did get marginally further:
The initially visible character list is indeed the "charselect_client" windowinstance. I was trying to look it up with the following call, which returned nil:
Code:Interface.findWindow("charselect_client", "charsheet")
Code:Interface.findWindow("charselect_client", "")
I still can't figure out a call to force a reload of the character list, though - either on the windowinstance or windowlist level. Will keep trying...
-
March 8th, 2020, 04:49 #4
- Join Date
- Jul 2018
- Posts
- 71
Success - sort of: I found a hacky workaround, by simply toggling visibility of the window twice:
Code:Interface.toggleWindow("charselect_client", ""); Interface.toggleWindow("charselect_client", "");
The slight flicker is annoying, but not a big deal.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks