From 07a7a096592c7e62992c2acee74b27388545e0a6 Mon Sep 17 00:00:00 2001 From: avolkov Date: Thu, 9 Jul 2009 05:24:40 +0000 Subject: [PATCH] Game settings Quit menu now delegates to F10 quit; bug #462 git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3174 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/ChangeLog | 1 + sc2/content/base/gamestrings.txt | 16 ------ sc2/content/base/ui/playmenu-065.png | Bin 1815 -> 0 bytes sc2/content/base/ui/playmenu-066.png | Bin 1372 -> 0 bytes sc2/content/base/ui/playmenu.ani | 2 - sc2/src/sc2code/gameopt.c | 82 ++------------------------- sc2/src/sc2code/gamestr.h | 4 +- sc2/src/sc2code/menu.c | 16 ------ sc2/src/sc2code/mouse_err.c | 2 +- sc2/src/sc2code/restart.c | 2 +- sc2/src/sc2code/sis.h | 3 - 11 files changed, 9 insertions(+), 119 deletions(-) delete mode 100644 sc2/content/base/ui/playmenu-065.png delete mode 100644 sc2/content/base/ui/playmenu-066.png diff --git a/sc2/ChangeLog b/sc2/ChangeLog index 4a432db38..83c557643 100644 --- a/sc2/ChangeLog +++ b/sc2/ChangeLog @@ -1,4 +1,5 @@ Changes towards version 0.7: +- Game settings Quit menu now delegates to F10 quit (bug #462) - Alex - Do not pause the game in places where not relevant (bug #984) - Alex - Fixed crashes and potential weirdness when loading savegames from a Homeworld encounter screen (bug #997) - Alex diff --git a/sc2/content/base/gamestrings.txt b/sc2/content/base/gamestrings.txt index 98ac9caa5..887a28ef3 100644 --- a/sc2/content/base/gamestrings.txt +++ b/sc2/content/base/gamestrings.txt @@ -1862,14 +1862,6 @@ Yes No -#(Don't Quit) -Don't Quit - - -#(Quit Game) -Quit Game - - #(Cr) Cr @@ -2178,14 +2170,6 @@ exit menu -#(no, play!) -no, play! - - -#(yes, quit!) -yes, quit! - - #(scan) scan diff --git a/sc2/content/base/ui/playmenu-065.png b/sc2/content/base/ui/playmenu-065.png deleted file mode 100644 index e6b7ca861d6be019741664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E;}~+@JhB_&?{*o^_d+Z|qQx%pLBV zF?n{@Iv<444VvAjr@QtopS^Br{bvI8RU~iB^g6Y1CpXtcCkIOmNJkN9oR3)|4Z~eCBU`6tw0}8cT`R>^DoTA`+rYDw!u%RBM zz2WQ5nrk&TiZ0bOznJExm27VnjVdC%Dt=t#%SAVK#5Q&oUM_@#;!tw3&~2=L;jS{r z`lKpRhM zh~|*mc7D@$@kG!AH`X^~*M_$DF6!JTe>l>&c97ULU$-s%%3#g=o877ikE5ZNC-lY( z5AOGN#J4RJ;fBvnYz?2O4m0P5tvL6?+Rnmvb#DWg0>e(WEV*x}#(U??{YGZapiW4R JZ&Rk_{T~QH_-z0H diff --git a/sc2/content/base/ui/playmenu-066.png b/sc2/content/base/ui/playmenu-066.png deleted file mode 100644 index e45117be30fbc7b44ed055ee3f3ef5796f6bb989..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1372 zcmWO5TTl~c6u|MrEu>qBh#QfZWYJI!QL&_ek#0Al5TQ_9Fd7Z4RT_~9!=R*NtV^^O zDq^r87L^^9C}^x0tiniliZZQ^HnCc1DXbNTq9S;Mp;No#wfpd$Grx!b+xd2rSxZ9^ z83F*I>1ioB!cG#NUK}9IuibM_0R#YStK`{Rae`PQhgeox%!2$#Q{ITiN zvEblfM4%in1PKQ$e2M@J0}SM#P$)0}3`H?4T#BLCWSA;+iU6eqLn9R+m12>RexcIX z*jPdaC`tsz2I3L|QR4)G5@NA`Ad#3zNF)+epbiKWjRqommH>hP0(6j+ltcg!YBfPb zYX~(l6XptCk_eX*YHbo|G=x^`FVm!^rc$#(siZ`yBD0j5gqtZ!Nri+2h^XvrN-C8q z1sZ`;DieW9TquB|fC3|!OeP9|!f}d9)KfV10W20e(>rDjg=d&RuctCH0%q&;^780- zP^)Qip4cv@QPNJ+YC0?|P)rvW({j07EwB`5wK@&xv`hgs4K$R3&1RzkXp*GqG$T#Y zDX>cDY$0|XOErX(xP!qf)7~0-eBU zwPs+(U0uy)0gkgF z)gkQ~R%vf%S)83VO%%c&JH~1>8eE_oSR5|~ws^AumIW5v;PH4^0M>42*d{}4L zxQY1!skB zWZHNs-*jyR+;0BbHF2SPxKk$+zJ#AGCu=z@8tyLu@JG^9l8tG*ul$)@QW+H{8eF*d z>e|saPir!sujzho>5Q@Hih8>fxjxt(HL-@V$r7esdZSvU+M$0JF4%|4UnsyXYbn}M zv+dI1Ams)7xhwv%JAA^!8~5xw{gxw}y32{7MNys9afNIwD(JJ@QqZcZHS z&K~*AHcv4TXG|Ly@_U(&Zayi!BCRSztRT>+HA`m-rD$Z_02|a#kn7y=IDU~dkVkOye1buY@N03*1ri4@Z;w#-XHGiT3vTC z`%Hx$Rjpry#;6{%r|p&<`u^pZoL}+zNBb$Z^5H`?E5jN)}5ZYetz%%$JS>LKG}#o zDX6yQ@5xzDoE-kEeWkbbb@@i;&xdPMFYUYiU0*)M{-?P+>(`U68V*Mp2cf-{tu@)7+nAW diff --git a/sc2/content/base/ui/playmenu.ani b/sc2/content/base/ui/playmenu.ani index e47c91965..8eb5133e7 100644 --- a/sc2/content/base/ui/playmenu.ani +++ b/sc2/content/base/ui/playmenu.ani @@ -37,8 +37,6 @@ playmenu-034.png 0 0 0 10 playmenu-035.png 0 0 0 10 playmenu-036.png 0 0 0 10 playmenu-037.png 0 0 1 10 -playmenu-065.png 0 0 1 10 -playmenu-066.png 0 0 1 10 playmenu-058.png 0 0 -1 -12 playmenu-059.png 0 0 -138 -93 playmenu-060.png 0 0 0 0 diff --git a/sc2/src/sc2code/gameopt.c b/sc2/src/sc2code/gameopt.c index 00fc3ef4d..22301bb39 100644 --- a/sc2/src/sc2code/gameopt.c +++ b/sc2/src/sc2code/gameopt.c @@ -123,12 +123,6 @@ enum EXIT_MENU_SETTING }; -enum -{ - NO_QUIT_MENU, - YES_QUIT_MENU -}; - static void FeedbackSetting (BYTE which_setting) { @@ -190,26 +184,6 @@ FeedbackSetting (BYTE which_setting) UnlockMutex (GraphicsLock); } -static void -FeedbackQuit (BYTE which_setting) -{ - const UNICODE *buf = ""; - - switch (which_setting) - { - case NO_QUIT_MENU: - buf = GAME_STRING (QUITMENU_STRING_BASE + 3); // "Don't Quit" - break; - case YES_QUIT_MENU: - buf = GAME_STRING (QUITMENU_STRING_BASE + 4); // "Quit Game" - break; - } - - LockMutex (GraphicsLock); - DrawStatusMessage (buf); - UnlockMutex (GraphicsLock); -} - #define DDSHS_NORMAL 0 #define DDSHS_EDIT 1 #define DDSHS_BLOCKCUR 2 @@ -499,52 +473,6 @@ DoSettings (MENU_STATE *pMS) return (TRUE); } -static BOOLEAN -DoQuitMenu (MENU_STATE *pMS) -{ - if (GLOBAL (CurrentActivity) & CHECK_ABORT) - return (FALSE); - - SetMenuSounds (MENU_SOUND_ARROWS, MENU_SOUND_SELECT); - - if (!pMS->Initialized) - { - DrawMenuStateStrings (PM_NO_QUIT, pMS->CurState); - FeedbackQuit (pMS->CurState); - pMS->Initialized = TRUE; - pMS->InputFunc = DoQuitMenu; - } - else if (PulsedInputState.menu[KEY_MENU_CANCEL] - || (PulsedInputState.menu[KEY_MENU_SELECT] - && pMS->CurState == NO_QUIT_MENU)) - { - LockMutex (GraphicsLock); - DrawStatusMessage (NULL); - UnlockMutex (GraphicsLock); - - pMS->CurState = QUIT_GAME; - pMS->InputFunc = DoGameOptions; - pMS->Initialized = 0; - } - else if (PulsedInputState.menu[KEY_MENU_SELECT]) - { - switch (pMS->CurState) - { - case NO_QUIT_MENU: - break; - case YES_QUIT_MENU: - GLOBAL (CurrentActivity) |= CHECK_ABORT; - ExitRequested = FALSE; - break; - } - FeedbackQuit (pMS->CurState); - } - else if (DoMenuChooser (pMS, PM_NO_QUIT)) - FeedbackQuit (pMS->CurState); - - return (TRUE); -} - static void DrawCargo (COUNT redraw_state) { @@ -778,8 +706,7 @@ ShowSummary (SUMMARY_DESC *pSD) { s.origin.x = SUMMARY_X_OFFS - SUMMARY_SIDE_OFFS + 6; s.origin.y = 0; - s.frame = SetRelFrameIndex ( - pLocMenuState->ModuleFrame, 0); + s.frame = SetRelFrameIndex (pLocMenuState->ModuleFrame, 0); DrawStamp (&s); s.origin.x = SUMMARY_X_OFFS + SUMMARY_SIDE_OFFS; s.frame = IncFrameIndex (s.frame); @@ -940,7 +867,7 @@ DoPickGame (MENU_STATE *pMS) { extern FRAME PlayFrame; - pMS->ModuleFrame = SetAbsFrameIndex (PlayFrame, 41); + pMS->ModuleFrame = SetAbsFrameIndex (PlayFrame, 39); } LockMutex (GraphicsLock); @@ -1330,9 +1257,8 @@ DoGameOptions (MENU_STATE *pMS) // to a FRAME. return PickGame (pMS); case QUIT_GAME: - pMS->Initialized = FALSE; - pMS->CurState = NO_QUIT_MENU; - pMS->InputFunc = DoQuitMenu; + if (ConfirmExit ()) + return FALSE; break; case SETTINGS: pMS->Initialized = FALSE; diff --git a/sc2/src/sc2code/gamestr.h b/sc2/src/sc2code/gamestr.h index 48ff394b9..0fa242b65 100644 --- a/sc2/src/sc2code/gamestr.h +++ b/sc2/src/sc2code/gamestr.h @@ -41,11 +41,11 @@ #define MELEE_STRING_COUNT 9 #define SAVEGAME_STRING_COUNT 5 #define OPTION_STRING_COUNT 5 -#define QUITMENU_STRING_COUNT 5 +#define QUITMENU_STRING_COUNT 3 #define STATUS_STRING_COUNT 6 #define FLAGSHIP_STRING_COUNT 13 #define ORBITSCAN_STRING_COUNT 19 -#define MAINMENU_STRING_COUNT 57 +#define MAINMENU_STRING_COUNT 55 #define NETMELEE_STRING_COUNT 19 enum { diff --git a/sc2/src/sc2code/menu.c b/sc2/src/sc2code/menu.c index d8fa37336..5d1c992e5 100644 --- a/sc2/src/sc2code/menu.c +++ b/sc2/src/sc2code/menu.c @@ -150,9 +150,6 @@ GetEndMenuState (BYTE BaseState) case PM_SOUND_ON: return PM_EXIT_MENU4; break; - case PM_NO_QUIT: - return PM_YES_QUIT; - break; case PM_ALT_SCAN: case PM_ALT_STARMAP: return PM_ALT_NAVIGATE; @@ -533,19 +530,6 @@ DrawMenuStateStrings (BYTE beg_index, SWORD NewState) break; } } - if (beg_index == PM_NO_QUIT) - { - end_index = beg_index + 1; - switch (beg_index + NewState) - { - case PM_NO_QUIT: - NewState = 0; - break; - case PM_YES_QUIT: - NewState = 1; - break; - } - } r.extent.height = RADAR_HEIGHT + 11; DrawPCMenu (beg_index, end_index, (BYTE)NewState, hilite, &r); s.frame = 0; diff --git a/sc2/src/sc2code/mouse_err.c b/sc2/src/sc2code/mouse_err.c index 453e3e2d3..0eaaeae59 100644 --- a/sc2/src/sc2code/mouse_err.c +++ b/sc2/src/sc2code/mouse_err.c @@ -20,5 +20,5 @@ void MouseError (void) { - DoPopupWindow (GAME_STRING (MAINMENU_STRING_BASE + 56)); + DoPopupWindow (GAME_STRING (MAINMENU_STRING_BASE + 54)); } diff --git a/sc2/src/sc2code/restart.c b/sc2/src/sc2code/restart.c index e81de6b83..17b6497df 100644 --- a/sc2/src/sc2code/restart.c +++ b/sc2/src/sc2code/restart.c @@ -245,7 +245,7 @@ DoRestart (MENU_STATE *pMS) LockMutex (GraphicsLock); SetFlashRect (NULL, (FRAME)0); UnlockMutex (GraphicsLock); - DoPopupWindow (GAME_STRING (MAINMENU_STRING_BASE + 56)); + DoPopupWindow (GAME_STRING (MAINMENU_STRING_BASE + 54)); // Mouse not supported message SetMenuSounds (MENU_SOUND_UP | MENU_SOUND_DOWN, MENU_SOUND_SELECT); SetTransitionSource (NULL); diff --git a/sc2/src/sc2code/sis.h b/sc2/src/sc2code/sis.h index 1400ce855..49f767f0f 100644 --- a/sc2/src/sc2code/sis.h +++ b/sc2/src/sc2code/sis.h @@ -51,9 +51,6 @@ enum PM_CHANGE_SHIP, PM_EXIT_MENU4, - PM_NO_QUIT, - PM_YES_QUIT, - PM_ALT_SCAN, PM_ALT_STARMAP, PM_ALT_MANIFEST,