Page MenuHomeWildfire Games

Remove calls to Engine.IsGameStarted in loadgame/*
ClosedPublic

Authored by phosit on Oct 4 2023, 7:03 PM.

Details

Summary

Whether to open the save or the load dialog should not be dependent on a singleton neither on "if a game is started".
Things like loading a game while another game is running becomes possible.
The singleton Engine.IsGameStarted is now only called at one place. We might remove it in a future diff.

If the caller provides an object with a savedGameData attribute (which isn't fallsy) the save dialog is opened, otherwise the load dialog is opened.
Is this ok or should the caller explicitly have to provide a operation attribute which is checked for === "Load" and === "Save"?

Test Plan

Load and save games from different location {main menue (load), campain menue (load), in game menue (save)}.

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

phosit created this revision.Oct 4 2023, 7:03 PM
Vulcan added a comment.Oct 4 2023, 7:04 PM

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/macos-differential/7361/display/redirect

Vulcan added a comment.Oct 4 2023, 7:11 PM

Successful build - Chance fights ever on the side of the prudent.

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/8450/display/redirect

phosit requested review of this revision.Oct 4 2023, 7:21 PM
phosit updated this revision to Diff 22371.Oct 6 2023, 6:34 PM

Remove the enabled = true because that's the default.

Vulcan added a comment.Oct 6 2023, 6:35 PM

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/macos-differential/7370/display/redirect

phosit added inline comments.Oct 6 2023, 6:36 PM
binaries/data/mods/public/gui/loadgame/SavegameWriter.js
30 ↗(On Diff #22371)

This line seems to come from a time (past or possible future) where the SavegameWriter and the SavegameLoader are combined.

Vulcan added a comment.Oct 6 2023, 6:37 PM

Successful build - Chance fights ever on the side of the prudent.

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/8459/display/redirect

This revision was not accepted when it landed; it landed in state Needs Review.Oct 12 2023, 9:07 PM
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Owners added a subscriber: Restricted Owners Package.Oct 12 2023, 9:07 PM