Redone fast file select#1854
Conversation
|
Will this check if the file is loadable (i.e. will it not attempt to load an MQ file with only a vanilla OTR)? I looked through the code and didn't immediately see it but maybe I'm missing something. |
| if (this->buttonIndex == 0xFF) { | ||
| Sram_InitDebugSave(); |
There was a problem hiding this comment.
it's not clear what's happening here, will this not get hit if we already created a debug save in file 1?
There was a problem hiding this comment.
This* debug save is not tied to a file slot, this for the 4th option specifically. The underlying code is already set up to handle fileNum = 255 (0xFF)
Good question, I guess I assume this wasn't handled previously by fast file select right? But I'll make sure it's handled 👍 |
|
I probably should've put this in the description of the PR, but effectively this is just using the file choose screen and manually setting state to load the file, so that fast file select acts exactly as loading a file from the file choose screen should. |
@leggettc18 thanks for making this so easy for me :D 8ed5cb8 |
Yeah fast file select predates this sort of thing where we actually wouldn't want to load a save file at all. Probably attempting to a load an incompatible save file should just spit you out to the file select screen (so still skips the title screen at least). |
| } | ||
|
|
||
| if (CVar_GetS32("gSkipLogoTitle", 0) && CVar_GetS32("gSaveFileID", 0) < 3) { | ||
| if (Save_Exist(CVar_GetS32("gSaveFileID", 0)) && FileChoose_IsSaveCompatible(Save_GetSaveMetaInfo(CVar_GetS32("gSaveFileID", 0)))) { |
There was a problem hiding this comment.
So it looks like if we have an incompatible save file we set the CVar to 4 and don't set any menuMode or selectMode, how does that actually look in-game?
There was a problem hiding this comment.
Just loads you into the file select screen as if you already had 4 selected
| this->menuMode = FS_MENU_MODE_SELECT; | ||
| this->selectMode = SM_LOAD_GAME; | ||
| } else { | ||
| CVar_SetS32("gSaveFileID", 4); |
There was a problem hiding this comment.
This will change the CVar permanently and result in essentially disabling Fast File Select until it is manually re-enabled. Maybe we should save the CVar value into a local variable and operate based on that? That way if the player puts the right OTR in place to make the save file compatible, Fast File Select won't have to be manually re-enabled first.
There was a problem hiding this comment.
Setting it back to a value that is valid seems okay for this situation IMO, but I can be convinced otherwise
There was a problem hiding this comment.
Right, so my main issue with this is that this will change the user's configuration file without their consent, It seems like this CVar is only used in this file, meaning that changing it should be easily avoidable. I have a similar situation with the gMasterQuest CVar, and I may refactor it at some point, but the reason I haven't yet is that the CVar is used across multiple files that don't necessarily have shared state I can use. This CVar is only used in this one file, so it should be easy to grab a copy of the current CVar value and work with that rather than actually changing the CVar globally (which is actually what the previous iteration of this feature did).
That way, if the user fixes the issue with their OTRs or whatever other setting that was preventing Fast File Select from working, they won't have to re-configure anything else to get it working again. Just feels like a better UX to me.
There was a problem hiding this comment.
so we need to account for a couple different situations here:
| only vanilla otr | only mq otr | both vanilla and mq otr | mq enabled | fast file select save type | behavior |
|---|---|---|---|---|---|
| ✔️ | ❌ | ❌ | ❌ | vanilla | load save |
| ✔️ | ❌ | ❌ | ❌ | mq | ? |
| ✔️ | ❌ | ❌ | ❌ | rando w/ only vanilla dungeons | load save |
| ✔️ | ❌ | ❌ | ❌ | rando w/ only mq dungeons | ? |
| ✔️ | ❌ | ❌ | ❌ | rando w/ both vanilla and mq dungeons | ? |
| ❌ | ✔️ | ❌ | ✔️ | vanilla | ? |
| ❌ | ✔️ | ❌ | ✔️ | mq | load save |
| ❌ | ✔️ | ❌ | ✔️ | rando w/ only vanilla dungeons | ? |
| ❌ | ✔️ | ❌ | ✔️ | rando w/ only mq dungeons | load save |
| ❌ | ✔️ | ❌ | ✔️ | rando w/ both vanilla and mq dungeons | ? |
| ❌ | ❌ | ✔️ | ❌ | vanilla | load save |
| ❌ | ❌ | ✔️ | ❌ | mq | ? |
| ❌ | ❌ | ✔️ | ❌ | rando w/ only vanilla dungeons | load save |
| ❌ | ❌ | ✔️ | ❌ | rando w/ only mq dungeons | load save |
| ❌ | ❌ | ✔️ | ❌ | rando w/ both vanilla and mq dungeons | load save |
| ❌ | ❌ | ✔️ | ✔️ | vanilla | ? |
| ❌ | ❌ | ✔️ | ✔️ | mq | load save |
| ❌ | ❌ | ✔️ | ✔️ | rando w/ only vanilla dungeons | load save |
| ❌ | ❌ | ✔️ | ✔️ | rando w/ only mq dungeons | load save |
| ❌ | ❌ | ✔️ | ✔️ | rando w/ both vanilla and mq dungeons | load save |
There was a problem hiding this comment.
Pretty much all of the question marks should result in going back to the file select screen, which should be correctly handled by this. There is one exception I can see right now, and that's the "both OTRs and MQ disabled" case.
The MQ checkbox only controls whether the save file gets created with the isMasterQuest value as true or false. As long as you have an MQ OTR you can play it even with the Checkbox disabled (basically the same way rando works, rando doesn't have to be enabled to play a previously created rando save file, MQ just has the extra wrinkle of needing the MQ OTR present to play).
EDIT: meant to say "both OTRs and MQ disabled"
There was a problem hiding this comment.
tl;dr, the value of the gMasterQuest CVar is only relevant during save file creation, afterwards use a combo of gSaveContext.isMasterQuest, ResourceMgr_GameHasMasterQuest(), and ResourceMgr_GameHasOriginal()
There was a problem hiding this comment.
I’ll get this change made to not update the cvar 👍
Also I think the weirdness with the gMasterQuest will go away once “the thing” is implemented
|
Ready to go I think 👍 |
windows build is failing with a sdl link error, not sure what's going on there |
|
i'm going to merge this because the only issue with it was the sdl2-net stuff that was fixed by #1870 |
* Redone fast file select * Update soh/src/overlays/gamestates/ovl_title/z_title.c * Prevent loading incompatible saves * Dont change cvar on incompatible file
* Redone fast file select * Update soh/src/overlays/gamestates/ovl_title/z_title.c * Prevent loading incompatible saves * Dont change cvar on incompatible file
* Redone fast file select * Update soh/src/overlays/gamestates/ovl_title/z_title.c * Prevent loading incompatible saves * Dont change cvar on incompatible file
* Redone fast file select * Update soh/src/overlays/gamestates/ovl_title/z_title.c * Prevent loading incompatible saves * Dont change cvar on incompatible file
Should resolve #1850 and prevent much further inconsistencies when loading from fast file select vs from the file select screen.
Effectively this is just using the file choose screen and manually setting state to load the file, so that fast file select acts exactly as loading a file from the file choose screen should.