From c8e561eeecab4dc38749db78a0fe6d757b4b73e7 Mon Sep 17 00:00:00 2001 From: onpon4 Date: Fri, 25 Nov 2016 17:23:23 -0500 Subject: [PATCH] Added a "Credits" option to the main menu. --- src/defs.h | 1 + src/title.cpp | 31 ++++++++++++++++++++++--------- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/src/defs.h b/src/defs.h index d110353..53fdd14 100644 --- a/src/defs.h +++ b/src/defs.h @@ -499,6 +499,7 @@ enum { TS_LOAD_GAME, TS_CONTINUE_CURRENT_GAME, TS_OPTIONS, + TS_CREDITS, TS_CHEAT_OPTIONS, TS_QUIT, TS_SOUND, diff --git a/src/title.cpp b/src/title.cpp index dd5e694..789bc4b 100644 --- a/src/title.cpp +++ b/src/title.cpp @@ -28,21 +28,22 @@ static int showGameMenu(int continueSaveSlot) screen_blitText(TS_CONTINUE_CURRENT_GAME); } screen_blitText(TS_OPTIONS); + screen_blitText(TS_CREDITS); if (engine.cheat) { - gfx_textSprites[TS_QUIT].y = screen->h / 3 + 150; + gfx_textSprites[TS_QUIT].y = screen->h / 3 + 170; screen_blitText(TS_CHEAT_OPTIONS); } else { - gfx_textSprites[TS_QUIT].y = screen->h / 3 + 130; + gfx_textSprites[TS_QUIT].y = screen->h / 3 + 150; } screen_blitText(TS_QUIT); if (engine.cheat) - return 6; + return 7; - return 5; + return 6; } static int showLoadMenu() @@ -206,7 +207,7 @@ int title_show() int selectedOption = 1; int skip = 0; - int listLength = 5; // menu list length + int listLength = 6; // menu list length int menuType = MENU_MAIN; game_init(); @@ -253,10 +254,12 @@ int title_show() -1, screen->h / 3 + 90, FONT_WHITE); gfx_createTextObject(TS_OPTIONS, "OPTIONS", -1, screen->h / 3 + 110, FONT_WHITE); + gfx_createTextObject(TS_CREDITS, "CREDITS", + -1, screen->h / 3 + 130, FONT_WHITE); gfx_createTextObject(TS_CHEAT_OPTIONS, "CHEAT OPTIONS", - -1, screen->h / 3 + 130, FONT_WHITE); + -1, screen->h / 3 + 150, FONT_WHITE); gfx_createTextObject(TS_QUIT, "QUIT", - -1, screen->h / 3 + 130, FONT_WHITE); + -1, screen->h / 3 + 150, FONT_WHITE); createOptionsMenu(); createDifficultyMenu(); @@ -463,6 +466,10 @@ int title_show() selectedOption = 1; } else if (selectedOption == 5) + { + engine.done = 1; + } + else if (selectedOption == 6) { if (engine.cheat) { @@ -472,7 +479,7 @@ int title_show() else engine.done = 1; } - else if (selectedOption == 6) + else if (selectedOption == 7) engine.done = 1; break; @@ -592,8 +599,14 @@ int title_show() selectedOption = save_load(continueSaveSlot); } + if (selectedOption == 5) + { + title_showCredits(); + selectedOption = 0; + } + // Send back a negative number... - if (selectedOption > 4) + if (selectedOption > 5) { selectedOption = -1; exit(0);