PSA: Single-panel refresh

Discussion in 'Mod Discussions' started by wondible, August 17, 2014.

  1. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    Or: Dang it, why didn't I look sooner. I posted this in another thread, but bears repeating and wider visibility for modders.

    I actually looked and the reload page call takes a page id, so after months of superscene total refreshes, it's possible to refresh only a target scene without destroying and recreating it (and changing it's debugger url)

    Code:
    api.game.debug.reloadScene(api.Panel.pageId);
    This has to be done in the target scene. I don't trust pageId's to stay the same, but it would proabably be possible to have your mod set a session variable in the appropriate scene, and then have a keybinding which used it, if you didn't want to go to the debugger and hit up-arrow.
    proeleert, Mereth and SXX like this.
  2. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    Haven't seen this thread before. What you suggest probably has the same effect as pressing F5 in the console of the debugger for the target scene?
  3. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    That's my understanding. F5 calls this on the the current page, which should be the main scene - but reloading the main scene often destroys and recreates it's child scenes.
  4. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    F5 in the debugger console of a child scene only reloads that child scene.
  5. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    Ooops s/scene/panel/ And 'main' is a bit ambiguous; I was talking about live_game etc, but there is also the master grandparent panel which is actually named main.

Share This Page