Closed Caballero-Arepa closed 4 months ago
Thanks a lot!
Hmmm going through the description this is not actually 100% solved, didn't check the 'reset to default' &c
... and that commit sounds like a misunderstanding. One shouldn't throw away the UI elements and rebuild them, but update their state ... ~modCheckboxes.setBaseRuleset(gameParameters.baseRuleset)
is one step better,~ but the problem is more likely gameParameters being changed without notifying these widgets.
...(hours later)...
Considering this patch:
As you can see less trivial and fly-by fixing some other inconsistencies. I'm just a little unsure whether some of that (e.g. the if (newBaseRulesetHash != baseRulesetHash)
thing) is really necessary.
@Caballero-Arepa since I'm not 100% confident about that merged PR, could you test some more?
Sure! As always, we appreciate your work
Uh... Already found two R E A L L Y embarrassing blunders... See #11398
Unfortunately, the bug is not solved.
I got a good screen recorder and I'll show you. https://youtu.be/_rNy5_Op-1A
Important note: The mouse is hidden, but when I go to the Main menu, and then back inside New Game, the Latam mod is turned on BY ITSELF! I didn't check it.
Lat-am is supposed to activate if a map using it automatically activates - other than that, the bugs fixed in #11398 will confuse things to a degree it will seem mysterious. Probably most of what that video shows is due to checkbox visuals not matching internal on/off state.
Lat-am is supposed to activate if a map using it automatically activates
Of course, but as you can see, I change the map to a generated one, and it still forces me to a Custom map
as you can see
Wasn't too clear in the vid - but neither is it clear that the recent fix merged in 4.11.2 would fix such a problem. Maybe - or not. Re-testing in order.
Edit: Seems OK - I update Lat-am, go new game, custom & a map is preselected, change to generated and go -> it's a fresh pangaea... Reopen if you find a sequence of steps to fail.
Edit 2: Nope, there's still a wrong assumption in there: GameOptionsTable.updateRuleset should call modCheckboxes.updateSelection before modCheckboxes.setBaseRuleset - I assumed the latter would include the former but no, it actually relied on the checkboxes instead of on gameParameters.mods. Also, need to look into why mod-specific players stay when their mod is deselected - I thought there was a cleanup code for that?
Edit 3: Aaand - there's the thing with mutability. The mods
reference ModCheckboxTable
keeps does get out of date when GameOptionsTable
's var gameParameters
is overwritten.
But - @Caballero-Arepa - your maps do not consistently select Lat-am as mod (what the map editor saves as mod selection): America XXL no, America XL yes. And there's too many starting locations for non-Latam civs to really appreciate a "take nations from map" button. Aaand - I think we'll need to spruce up starting locations in the editor to have a "On new game: ignore / AI / human" attribute that can control such a button. Aaaand - wouldn't it be nice to have a mod option to specify which map will be preselected (unzip on Linux won't preserve timestamps from the zip, even if github did meaningful ones, as we do a move that overwrites them)? Some futures...
Is there an existing issue for this?
Game Version
4.10.21
Describe the bug
It has been happening for a long time now. I believe it has something to do with the code that automatically sets a recently saved map [from the Map Editor] in the New Game settup.
It mostly happens when you have few maps or is your first time downloading the mod. For some it is fixed by closing and opening the game, but for others it stays.
The bug is that the mod with the maps is forced to be played, even if you manually change the map to a generated map, or not select the mod, and even using the Reset to Default, once you start the match, the app will deselect all the other mods, activate the map mod and use a custom map.
Steps to Reproduce
Screenshots
No response
Link to save file
No response
Operating System
Windows
Additional Information
No response