Merge branch 'develop-unlocks' into 'master'

Develop unlocks

See merge request KartKrew/Kart!1322
This commit is contained in:
Oni 2023-07-02 02:40:32 +00:00
commit a06f93eb8c
2 changed files with 23 additions and 7 deletions

View file

@ -146,12 +146,15 @@ static UINT8 cheatf_devmode(void)
gamedata->unlocked[i] = true; gamedata->unlocked[i] = true;
} }
G_SetUsedCheats(); // This is a developer feature, you know how to delete ringdata
// G_SetUsedCheats();
S_StartSound(0, sfx_kc42); S_StartSound(0, sfx_kc42);
devparm = true; devparm = true;
cht_debug |= 0x8000; cht_debug |= 0x8000;
G_SaveGameData();
return 1; return 1;
} }
#endif #endif

View file

@ -287,10 +287,10 @@ void M_Challenges(INT32 choice)
M_SetupNextMenu(&MISC_ChallengesDef, false); M_SetupNextMenu(&MISC_ChallengesDef, false);
} }
static boolean M_CanKeyHiliTile(void) static boolean M_CanKeyHiliTile(boolean devskip)
{ {
// No keys to do it with? // No keys to do it with?
if (gamedata->chaokeys == 0) if (gamedata->chaokeys == 0 && !devskip)
return false; return false;
// No tile data? // No tile data?
@ -306,14 +306,15 @@ static boolean M_CanKeyHiliTile(void)
return false; return false;
// Marked as unskippable? // Marked as unskippable?
if (unlockables[challengesmenu.currentunlock].majorunlock == true) if (unlockables[challengesmenu.currentunlock].majorunlock == true && !devskip)
return false; return false;
UINT16 i = (challengesmenu.hilix * CHALLENGEGRIDHEIGHT) + challengesmenu.hiliy; UINT16 i = (challengesmenu.hilix * CHALLENGEGRIDHEIGHT) + challengesmenu.hiliy;
// Not a hinted tile OR a fresh board. // Not a hinted tile OR a fresh board.
if (!(challengesmenu.extradata[i].flags & CHE_HINT) if (!(challengesmenu.extradata[i].flags & CHE_HINT)
&& (challengesmenu.unlockcount[CC_UNLOCKED] + challengesmenu.unlockcount[CC_TALLY] > 0)) && (challengesmenu.unlockcount[CC_UNLOCKED] + challengesmenu.unlockcount[CC_TALLY] > 0)
&& !devskip)
return false; return false;
// All good! // All good!
@ -366,7 +367,12 @@ void M_ChallengesTick(void)
if (challengesmenu.chaokeyhold) if (challengesmenu.chaokeyhold)
{ {
if (M_MenuExtraHeld(pid) && M_CanKeyHiliTile()) boolean devskip = false;
#ifdef DEVELOP
devskip = M_MenuButtonHeld(pid, MBT_Z);
#endif
// A little messy, but don't freak out, this is just so devs don't crash the game on non-tiles
if ((devskip || M_MenuExtraHeld(pid)) && M_CanKeyHiliTile(devskip))
{ {
// Not pressed just this frame? // Not pressed just this frame?
if (!M_MenuExtraPressed(pid)) if (!M_MenuExtraPressed(pid))
@ -605,7 +611,7 @@ boolean M_ChallengesInputs(INT32 ch)
} }
else if (M_MenuExtraPressed(pid)) else if (M_MenuExtraPressed(pid))
{ {
if (M_CanKeyHiliTile()) if (M_CanKeyHiliTile(false))
{ {
challengesmenu.chaokeyhold = 1; challengesmenu.chaokeyhold = 1;
} }
@ -628,6 +634,13 @@ boolean M_ChallengesInputs(INT32 ch)
} }
return true; return true;
} }
#ifdef DEVELOP
else if (M_MenuButtonPressed(pid, MBT_Z))
{
challengesmenu.chaokeyhold = 1;
return true;
}
#endif
else else
{ {
if (M_MenuBackPressed(pid) || start) if (M_MenuBackPressed(pid) || start)