Exit confirmation dialog is prettier and safer, from Nic
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@1032 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
Changes towards version 0.3:
|
Changes towards version 0.3:
|
||||||
|
- Exit confirmation dialog is prettier and safer, from Nic
|
||||||
- Exiting from the main menu with F10 now exits the game -Michael
|
- Exiting from the main menu with F10 now exits the game -Michael
|
||||||
- Changed lander speed to 35 FPS, which matches reported 3DO speed
|
- Changed lander speed to 35 FPS, which matches reported 3DO speed
|
||||||
(Bug #22) -Michael
|
(Bug #22) -Michael
|
||||||
|
|||||||
+37
-13
@@ -23,7 +23,7 @@
|
|||||||
#include "libs/sound/trackplayer.h"
|
#include "libs/sound/trackplayer.h"
|
||||||
|
|
||||||
#define CONFIRM_WIN_WIDTH 80
|
#define CONFIRM_WIN_WIDTH 80
|
||||||
#define CONFIRM_WIN_HEIGHT 26
|
#define CONFIRM_WIN_HEIGHT 22
|
||||||
|
|
||||||
static void
|
static void
|
||||||
DrawConfirmationWindow (BOOLEAN answer)
|
DrawConfirmationWindow (BOOLEAN answer)
|
||||||
@@ -32,19 +32,43 @@ DrawConfirmationWindow (BOOLEAN answer)
|
|||||||
FONT oldfont = SetContextFont (StarConFont);
|
FONT oldfont = SetContextFont (StarConFont);
|
||||||
RECT r;
|
RECT r;
|
||||||
TEXT t;
|
TEXT t;
|
||||||
|
|
||||||
r.extent.width = CONFIRM_WIN_WIDTH;
|
|
||||||
r.extent.height = CONFIRM_WIN_HEIGHT;
|
|
||||||
r.corner.x = (SCREEN_WIDTH - r.extent.width) >> 1;
|
|
||||||
r.corner.y = (SCREEN_HEIGHT - r.extent.height) >> 1;
|
|
||||||
|
|
||||||
BatchGraphics ();
|
BatchGraphics ();
|
||||||
|
|
||||||
|
r.corner.x = ((SCREEN_WIDTH - CONFIRM_WIN_WIDTH) >> 1) - 2;
|
||||||
|
r.corner.y = ((SCREEN_HEIGHT - CONFIRM_WIN_HEIGHT) >> 1) - 2;
|
||||||
|
r.extent.width = CONFIRM_WIN_WIDTH + 4;
|
||||||
|
r.extent.height = CONFIRM_WIN_HEIGHT + 4;
|
||||||
|
SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0x8, 0x8, 0x8), 0x1F));
|
||||||
DrawFilledRectangle (&r);
|
DrawFilledRectangle (&r);
|
||||||
|
|
||||||
|
r.corner.x = ((SCREEN_WIDTH - CONFIRM_WIN_WIDTH) >> 1);
|
||||||
|
r.corner.y = ((SCREEN_HEIGHT - CONFIRM_WIN_HEIGHT) >> 1);
|
||||||
|
r.extent.width = CONFIRM_WIN_WIDTH + 2;
|
||||||
|
r.extent.height = CONFIRM_WIN_HEIGHT + 2;
|
||||||
|
SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0x10, 0x10, 0x10), 0x19));
|
||||||
|
DrawFilledRectangle (&r);
|
||||||
|
|
||||||
|
r.corner.x = ((SCREEN_WIDTH - CONFIRM_WIN_WIDTH) >> 1) - 1;
|
||||||
|
r.corner.y = ((SCREEN_HEIGHT + CONFIRM_WIN_HEIGHT) >> 1) + 1;
|
||||||
|
r.extent.height = 1;
|
||||||
|
DrawFilledRectangle (&r);
|
||||||
|
|
||||||
|
r.corner.x = ((SCREEN_WIDTH + CONFIRM_WIN_WIDTH) >> 1) + 1;
|
||||||
|
r.corner.y = ((SCREEN_HEIGHT - CONFIRM_WIN_HEIGHT) >> 1) - 1;
|
||||||
|
r.extent.width = 1;
|
||||||
|
DrawFilledRectangle (&r);
|
||||||
|
|
||||||
|
r.corner.x = (SCREEN_WIDTH - CONFIRM_WIN_WIDTH) >> 1;
|
||||||
|
r.corner.y = (SCREEN_HEIGHT - CONFIRM_WIN_HEIGHT) >> 1;
|
||||||
|
r.extent.width = CONFIRM_WIN_WIDTH;
|
||||||
|
r.extent.height = CONFIRM_WIN_HEIGHT;
|
||||||
|
SetContextForeGroundColor (MENU_BACKGROUND_COLOR);
|
||||||
|
DrawFilledRectangle (&r);
|
||||||
|
|
||||||
SetContextForeGroundColor (MENU_TEXT_COLOR);
|
SetContextForeGroundColor (MENU_TEXT_COLOR);
|
||||||
t.baseline.x = r.corner.x + (r.extent.width >> 1);
|
t.baseline.x = r.corner.x + (r.extent.width >> 1);
|
||||||
t.baseline.y = r.corner.y + 10;
|
t.baseline.y = r.corner.y + 8;
|
||||||
t.pStr = "Really quit?";
|
t.pStr = "Really Quit?";
|
||||||
t.align = ALIGN_CENTER;
|
t.align = ALIGN_CENTER;
|
||||||
t.valign = VALIGN_BOTTOM;
|
t.valign = VALIGN_BOTTOM;
|
||||||
t.CharCount = ~0;
|
t.CharCount = ~0;
|
||||||
@@ -56,7 +80,7 @@ DrawConfirmationWindow (BOOLEAN answer)
|
|||||||
font_DrawText (&t);
|
font_DrawText (&t);
|
||||||
t.baseline.x += (r.extent.width >> 1);
|
t.baseline.x += (r.extent.width >> 1);
|
||||||
t.pStr = "No";
|
t.pStr = "No";
|
||||||
SetContextForeGroundColor (answer ? MENU_TEXT_COLOR : MENU_HIGHLIGHT_COLOR);
|
SetContextForeGroundColor (answer ? MENU_TEXT_COLOR : MENU_HIGHLIGHT_COLOR);
|
||||||
font_DrawText (&t);
|
font_DrawText (&t);
|
||||||
|
|
||||||
UnbatchGraphics ();
|
UnbatchGraphics ();
|
||||||
@@ -91,13 +115,13 @@ DoConfirmExit (void)
|
|||||||
STAMP s;
|
STAMP s;
|
||||||
FRAME F;
|
FRAME F;
|
||||||
CONTEXT oldContext;
|
CONTEXT oldContext;
|
||||||
BOOLEAN response = TRUE, done;
|
BOOLEAN response = FALSE, done;
|
||||||
|
|
||||||
in_confirm = TRUE;
|
in_confirm = TRUE;
|
||||||
oldContext = SetContext (ScreenContext);
|
oldContext = SetContext (ScreenContext);
|
||||||
|
|
||||||
r.extent.width = CONFIRM_WIN_WIDTH;
|
r.extent.width = CONFIRM_WIN_WIDTH + 4;
|
||||||
r.extent.height = CONFIRM_WIN_HEIGHT;
|
r.extent.height = CONFIRM_WIN_HEIGHT + 4;
|
||||||
r.corner.x = (SCREEN_WIDTH - r.extent.width) >> 1;
|
r.corner.x = (SCREEN_WIDTH - r.extent.width) >> 1;
|
||||||
r.corner.y = (SCREEN_HEIGHT - r.extent.height) >> 1;
|
r.corner.y = (SCREEN_HEIGHT - r.extent.height) >> 1;
|
||||||
s.origin = r.corner;
|
s.origin = r.corner;
|
||||||
|
|||||||
Reference in New Issue
Block a user