A few updates to the save/load menu (bug #291), from Paxtez
1) The boxes and text is drawn in the same batch as the rest of the summary, so the fade-in's now have the text and it doesn't appear a split second later. 2) Widens the rects to closer match the PC version (4 of 4 people polled prefered the new look. 3) Adds a little bound check for when the SAVES_PER_PAGE doesn't divide evenly into MAXED_SAVED_GAMES 4) Expands the black rect to cover the safe-x expanded bars. 5) When displaying more then 99 saves will display 3 digits. git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@1241 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
+30
-28
@@ -34,7 +34,7 @@ void SaveProblem (void);
|
|||||||
#define SUMMARY_X_OFFS 14
|
#define SUMMARY_X_OFFS 14
|
||||||
#define SUMMARY_SIDE_OFFS 7
|
#define SUMMARY_SIDE_OFFS 7
|
||||||
#define MAX_NAME_CHARS 15
|
#define MAX_NAME_CHARS 15
|
||||||
#define SAVES_PER_PAGE 5 //Should divide evenly into MAX_SAVED_GAMES for 'Per-Page' Scrolling
|
#define SAVES_PER_PAGE 5
|
||||||
|
|
||||||
static PMENU_STATE pLocMenuState;
|
static PMENU_STATE pLocMenuState;
|
||||||
static BYTE prev_save; //keeps track of the last slot that was saved or loaded
|
static BYTE prev_save; //keeps track of the last slot that was saved or loaded
|
||||||
@@ -1159,30 +1159,8 @@ ChangeGameSelection:
|
|||||||
pMS->CurState = NewState;
|
pMS->CurState = NewState;
|
||||||
ShowSummary (&((SUMMARY_DESC *)pMS->CurString)[pMS->CurState]);
|
ShowSummary (&((SUMMARY_DESC *)pMS->CurString)[pMS->CurState]);
|
||||||
|
|
||||||
if (LastActivity == CHECK_LOAD)
|
|
||||||
{
|
|
||||||
BYTE clut_buf[] = {FadeAllToColor};
|
|
||||||
|
|
||||||
UnbatchGraphics ();
|
|
||||||
|
|
||||||
LastActivity = 0;
|
|
||||||
XFormColorMap ((COLORMAPPTR)clut_buf, ONE_SECOND / 2);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (first_time)
|
|
||||||
{
|
|
||||||
r.corner.x = SIS_ORG_X;
|
|
||||||
r.corner.y = SIS_ORG_Y;
|
|
||||||
r.extent.width = SIS_SCREEN_WIDTH;
|
|
||||||
r.extent.height = SIS_SCREEN_HEIGHT;
|
|
||||||
|
|
||||||
ScreenTransition (3, &r);
|
|
||||||
}
|
|
||||||
UnbatchGraphics ();
|
|
||||||
}
|
|
||||||
SetContextFont (TinyFont);
|
SetContextFont (TinyFont);
|
||||||
r.extent.width = 230;
|
r.extent.width = 240;
|
||||||
r.extent.height = 65;
|
r.extent.height = 65;
|
||||||
r.corner.x = 1;
|
r.corner.x = 1;
|
||||||
r.corner.y = 160;
|
r.corner.y = 160;
|
||||||
@@ -1207,7 +1185,7 @@ ChangeGameSelection:
|
|||||||
else // 'Per-Page' Scrolling
|
else // 'Per-Page' Scrolling
|
||||||
#endif
|
#endif
|
||||||
SHIFT = NewState - ((NewState / SAVES_PER_PAGE) * SAVES_PER_PAGE);
|
SHIFT = NewState - ((NewState / SAVES_PER_PAGE) * SAVES_PER_PAGE);
|
||||||
for (i = 0; i < SAVES_PER_PAGE; i++)
|
for (i = 0; i < SAVES_PER_PAGE && NewState - SHIFT + i < MAX_SAVED_GAMES; i++)
|
||||||
{
|
{
|
||||||
SetContextForeGroundColor ((i == SHIFT) ?
|
SetContextForeGroundColor ((i == SHIFT) ?
|
||||||
(BUILD_COLOR (MAKE_RGB15 (0x1B, 0x00, 0x1B), 0x33)):
|
(BUILD_COLOR (MAKE_RGB15 (0x1B, 0x00, 0x1B), 0x33)):
|
||||||
@@ -1215,14 +1193,16 @@ ChangeGameSelection:
|
|||||||
r.extent.width = 15;
|
r.extent.width = 15;
|
||||||
if (MAX_SAVED_GAMES > 99)
|
if (MAX_SAVED_GAMES > 99)
|
||||||
r.extent.width += 5;
|
r.extent.width += 5;
|
||||||
r.extent.height = 9;
|
r.extent.height = 11;
|
||||||
r.corner.x = 8;
|
r.corner.x = 8;
|
||||||
r.corner.y = 161 + (i * 13);
|
r.corner.y = 160 + (i * 13);
|
||||||
DrawRectangle (&r);
|
DrawRectangle (&r);
|
||||||
|
|
||||||
t.baseline.x = r.corner.x + 3;
|
t.baseline.x = r.corner.x + 3;
|
||||||
t.baseline.y = r.corner.y + 7;
|
t.baseline.y = r.corner.y + 8;
|
||||||
wsprintf (buf, "%02i", NewState - SHIFT + i);
|
wsprintf (buf, "%02i", NewState - SHIFT + i);
|
||||||
|
if (MAX_SAVED_GAMES > 99)
|
||||||
|
wsprintf (buf, "%03i", NewState - SHIFT + i);
|
||||||
font_DrawText (&t);
|
font_DrawText (&t);
|
||||||
|
|
||||||
r.extent.width = 204 - SAFE_X;
|
r.extent.width = 204 - SAFE_X;
|
||||||
@@ -1242,6 +1222,28 @@ ChangeGameSelection:
|
|||||||
}
|
}
|
||||||
font_DrawText (&t);
|
font_DrawText (&t);
|
||||||
}
|
}
|
||||||
|
if (LastActivity == CHECK_LOAD)
|
||||||
|
{
|
||||||
|
BYTE clut_buf[] = {FadeAllToColor};
|
||||||
|
|
||||||
|
UnbatchGraphics ();
|
||||||
|
|
||||||
|
LastActivity = 0;
|
||||||
|
XFormColorMap ((COLORMAPPTR)clut_buf, ONE_SECOND / 2);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (first_time)
|
||||||
|
{
|
||||||
|
r.corner.x = SIS_ORG_X;
|
||||||
|
r.corner.y = SIS_ORG_Y;
|
||||||
|
r.extent.width = SIS_SCREEN_WIDTH;
|
||||||
|
r.extent.height = SIS_SCREEN_HEIGHT;
|
||||||
|
|
||||||
|
ScreenTransition (3, &r);
|
||||||
|
}
|
||||||
|
UnbatchGraphics ();
|
||||||
|
}
|
||||||
SetFlashRect (0, (FRAME)0);
|
SetFlashRect (0, (FRAME)0);
|
||||||
UnlockCrossThreadMutex (GraphicsLock);
|
UnlockCrossThreadMutex (GraphicsLock);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user