UnofficialCrusaderPatch / UCP3-GUI

Dev work on the UCP3 gui
GNU Affero General Public License v3.0
0 stars 0 forks source link

Improve atom interdependencies to make restart unnecessary #129

Open gynt opened 9 months ago

gynt commented 9 months ago

The game folder atom should be used by the ucp state atom (which it is I believe) The ucp state atom should be used by the initializeGameFolder function. The latter is now included in the game folder atom but that is a little strange since interpreting a game folder only makes sense if it is a verified ucp installation

end goal: not need a refresh after installation

gynt commented 1 week ago

Currently, GAME_FOLDER_ATOM has a companion GAME_FOLDER_INTERFACE_ASYNC_ATOM. The interface atom should be used to set the game folder, as is currently the case always I believe. The final action of the interface atom is to set the game folder atom.

The setter logic though should also clear any existing state in order to be able to start from scratch, which it currently doesn't do I believe (it borrows the existing extensions state).

Overview of logic

set(GAME_FOLDER_INTERFACE_ASYNC_ATOM, 'folder path') => initialize game folder

Initialize game folder

Set a loading indicator

  1. Read the version if available
  2. Read the extensions
  3. Create a new empty extensions state
  4. Read the ucp-config.yml file if present
  5. Apply the ucp-config.yml if available Finally, set the new folder path variable (this is the moment GUI components reflect the new folder path) Clear the loading indicator

Dependencies of Modding Framework version state

  1. Overview tab
  2. Footer

Dependencies of extensions state

  1. Content tab
  2. Customisations tab
  3. Store tab

Dependencies of config

  1. Content tab
  2. Customisations tab