Correct some issues with the previous commit.

- Unlock explosions should occour relative to the highlighted coords, not the selected coords. (Yes, they can be disjoint.)
- I got the comments for left and right on challenge tile auto focus swapped.
- The rightwards cap on auto focus scroll for large tiles was handled incorrectly.
This commit is contained in:
toaster 2022-12-10 21:05:06 +00:00
parent 358305d872
commit d2c9c7027d
2 changed files with 15 additions and 12 deletions

View file

@ -4615,8 +4615,8 @@ void M_DrawChallenges(void)
if (challengegridloops)
{
if (!challengesmenu.col && challengesmenu.hilix)
x -= gamedata->challengegridwidth*16;
//if (!challengesmenu.col && challengesmenu.hilix)
//x -= gamedata->challengegridwidth*16;
i = challengesmenu.col + challengesmenu.focusx;
explodex = x - (i*16);

View file

@ -6924,7 +6924,16 @@ static void M_ChallengesAutoFocus(UINT8 unlockid, boolean fresh)
if (work > 0)
{
// Offset left, scroll right?
// We only need to scroll as far as the rightward edge.
if (unlockables[unlockid].majorunlock)
{
work--;
challengesmenu.col++;
if (challengesmenu.col >= gamedata->challengegridwidth)
challengesmenu.col = 0;
}
// Offset right, scroll left?
if (work > LEFTUNLOCKSCROLL)
{
work -= LEFTUNLOCKSCROLL;
@ -6938,13 +6947,7 @@ static void M_ChallengesAutoFocus(UINT8 unlockid, boolean fresh)
}
else if (work < 0)
{
// We only need to scroll as far as the rightward edge.
if (unlockables[unlockid].majorunlock)
{
work++;
}
// Offset right, scroll left?
// Offset left, scroll right?
if (work < -RIGHTUNLOCKSCROLL)
{
challengesmenu.focusx = -RIGHTUNLOCKSCROLL;
@ -7113,10 +7116,10 @@ void M_ChallengesTick(void)
}
i = (ref->majorunlock && M_RandomChance(FRACUNIT/2)) ? 1 : 0;
M_SetupReadyExplosions(false, challengesmenu.col, challengesmenu.row+i, bombcolor);
M_SetupReadyExplosions(false, challengesmenu.hilix, challengesmenu.hiliy+i, bombcolor);
if (ref->majorunlock)
{
M_SetupReadyExplosions(false, challengesmenu.col+1, challengesmenu.row+(1-i), bombcolor);
M_SetupReadyExplosions(false, challengesmenu.hilix+1, challengesmenu.hiliy+(1-i), bombcolor);
}
S_StartSound(NULL, sfx_s3k4e);