From 484b17d259cee26faf5e9f24c79c2b6fb5ecbac7 Mon Sep 17 00:00:00 2001 From: galaxyhaxz Date: Tue, 23 Jul 2019 20:41:32 -0500 Subject: [PATCH] Add Select Hero enum (#1330) --- Source/mainmenu.cpp | 14 +++++++------- enums.h | 12 ++++++------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Source/mainmenu.cpp b/Source/mainmenu.cpp index da7feddbe..cc207b213 100644 --- a/Source/mainmenu.cpp +++ b/Source/mainmenu.cpp @@ -35,7 +35,7 @@ int __stdcall mainmenu_select_hero_dialog( BOOL *multi) { BOOL hero_is_created = TRUE; - int dlgresult = NEW_GAME; + int dlgresult = 0; if (gbMaxPlayers == 1) { if (!UiSelHeroSingDialog( pfile_ui_set_hero_infos, @@ -47,7 +47,7 @@ int __stdcall mainmenu_select_hero_dialog( &gnDifficulty)) app_fatal("Unable to display SelHeroSing"); - if (dlgresult == LOAD_GAME) + if (dlgresult == SELHERO_CONTINUE) gbLoadGame = TRUE; else gbLoadGame = FALSE; @@ -62,7 +62,7 @@ int __stdcall mainmenu_select_hero_dialog( gszHero)) { app_fatal("Can't load multiplayer dialog"); } - if (dlgresult == EXIT_MENU) { + if (dlgresult == SELHERO_PREVIOUS) { SErrSetLastError(1223); return 0; } @@ -122,19 +122,19 @@ void mainmenu_loop() BOOL mainmenu_single_player() { gbMaxPlayers = 1; - return mainmenu_init_menu(1); + return mainmenu_init_menu(SELHERO_NEW_DUNGEON); } BOOL mainmenu_init_menu(int type) { BOOL success; - if (type == 4) + if (type == SELHERO_PREVIOUS) return TRUE; music_stop(); - success = StartGame(type != 2, type != 3); + success = StartGame(type != SELHERO_CONTINUE, type != SELHERO_CONNECT); if (success) mainmenu_refresh_music(); @@ -144,7 +144,7 @@ BOOL mainmenu_init_menu(int type) BOOL mainmenu_multi_player() { gbMaxPlayers = MAX_PLRS; - return mainmenu_init_menu(3); + return mainmenu_init_menu(SELHERO_CONNECT); } void mainmenu_play_intro() diff --git a/enums.h b/enums.h index 5c4b712dc..939256f00 100644 --- a/enums.h +++ b/enums.h @@ -2266,12 +2266,12 @@ typedef enum _mainmenu_selections { MAINMENU_ATTRACT_MODE = 6, } _mainmenu_selections; -typedef enum dlgresults -{ - NEW_GAME = 0, - LOAD_GAME = 2, - EXIT_MENU = 4, -} dlgresults; +typedef enum _selhero_selections { + SELHERO_NEW_DUNGEON = 1, + SELHERO_CONTINUE = 2, + SELHERO_CONNECT = 3, + SELHERO_PREVIOUS = 4 +} _selhero_selections; typedef enum panel_button_id { PANBTN_CHARINFO = 0,