FG Spreadshirt Swag
  1. #1

    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!

  2. #2

  3. #3
    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")
    Instead, I had to pass an empty string for the databasenode parameter:

    Code:
    Interface.findWindow("charselect_client", "")
    This does return the right windowinstance. From here, I can get access to the contained windowlist, which has the right number of windows (characters).

    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...

  4. #4
    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", "");
    This essentially replicates the manual closing and re-opening of the window, refreshing it with the latest character list.

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
STAR TREK 2d20

Log in

Log in