From 9b96b8d9b8efc71cc4c9ee0155fd06cdde77712c Mon Sep 17 00:00:00 2001 From: gewlitys Date: Thu, 18 Sep 2003 20:51:01 +0000 Subject: [PATCH] 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 --- sc2/src/sc2code/gameopt.c | 58 ++++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 28 deletions(-) diff --git a/sc2/src/sc2code/gameopt.c b/sc2/src/sc2code/gameopt.c index 11eee8deb..83af61993 100644 --- a/sc2/src/sc2code/gameopt.c +++ b/sc2/src/sc2code/gameopt.c @@ -34,7 +34,7 @@ void SaveProblem (void); #define SUMMARY_X_OFFS 14 #define SUMMARY_SIDE_OFFS 7 #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 BYTE prev_save; //keeps track of the last slot that was saved or loaded @@ -1159,30 +1159,8 @@ ChangeGameSelection: pMS->CurState = NewState; 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); - r.extent.width = 230; + r.extent.width = 240; r.extent.height = 65; r.corner.x = 1; r.corner.y = 160; @@ -1207,7 +1185,7 @@ ChangeGameSelection: else // 'Per-Page' Scrolling #endif 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) ? (BUILD_COLOR (MAKE_RGB15 (0x1B, 0x00, 0x1B), 0x33)): @@ -1215,14 +1193,16 @@ ChangeGameSelection: r.extent.width = 15; if (MAX_SAVED_GAMES > 99) r.extent.width += 5; - r.extent.height = 9; + r.extent.height = 11; r.corner.x = 8; - r.corner.y = 161 + (i * 13); + r.corner.y = 160 + (i * 13); DrawRectangle (&r); 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); + if (MAX_SAVED_GAMES > 99) + wsprintf (buf, "%03i", NewState - SHIFT + i); font_DrawText (&t); r.extent.width = 204 - SAFE_X; @@ -1242,6 +1222,28 @@ ChangeGameSelection: } 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); UnlockCrossThreadMutex (GraphicsLock); }