shpaass / yafc-ce

Powerful Factorio calculator/analyser that works with mods
GNU General Public License v3.0
40 stars 15 forks source link

Fix 5676ce7a, where returning to the Welcome screen and opening a project again could break panels in the main window. #157

Closed DaleStan closed 1 month ago

DaleStan commented 1 month ago

To reproduce this, open the Milestones Editor, NEI Explorer, Preferences screen, a single-object selection screen (the full list of fuels or modules is most likely), the Shopping list, the module customization screen, or the module templates screen. Then select "Return to starting screen" from the main menu, load or create any project, and try to interact with any screen you previously opened.

<Escape> and maybe <Enter> will work, but mouse interaction will not work.

shpaass commented 1 month ago

Any idea why it could've happened? Were the instances disposed of?

DaleStan commented 1 month ago

Each Instance gets the first MainScreen's InputSystem, and continues to interact with that system even after the new InputSystem is created for the second MainScreen. Recreating the PseudoScreens every time forces them to reread MainScreen.Instance.InputSystem, and interact with the current system.