Rianilothe / FS22_GlobalExplorer

FS22 mod developer tool for viewing live game data
0 stars 0 forks source link

HistoryList locks GlobalExplorer to be non-functional when switching between saves #1

Open GMNGjoy opened 1 month ago

GMNGjoy commented 1 month ago

Steps to reproduce

  1. Load new save on Elm Creek
  2. Open GlobalExplorer, navigate around deep into the productionPoints list the last selection being g_currentMission.productionChainManager.productionPoints[10]
  3. Your history should look something like this:
    <historyList>
    <historyItem name="g_currentMission.productionChainManager.productionPoints[10]"/>
    <historyItem name="g_currentMission.productionChainManager.productionPoints"/>
    <historyItem name="g_currentMission.productionChainManager"/>
    <historyItem name="g_currentMission"/>
    </historyList>
  4. Close that savegame, open a new savegaeme on a simple map, ie: NoMansLand
  5. Open GlobalExplorer again

Expected

history to be flushed because I'm not on the same savegame

Actual

Global Explorer opens with the last history item, but since that item doesn't exist in the current global object tree - the UI hangs, with the only option to exit. There is no cursor, no means of selecting anything, no means of clearing the input.

Manual Fix

Opening the config file at modSettings/FS22_GlobalExplorer/history.xml, and deleting all non-valid (on the new map) history items and re-launching the game fixes the issue.

<historyList>
    <historyItem name="g_currentMission"/>
</historyList>

Suggestions

Rianilothe commented 1 month ago

Thanks for the verbose bug report. I think validating the history items when they're loaded is the best solution. I have a few other tweaks I'll be adding to the next release. Thanks again!