diff --git a/missions/Traut/DANGER1.DF b/dogfights/Traut/DANGER1.DF similarity index 100% rename from missions/Traut/DANGER1.DF rename to dogfights/Traut/DANGER1.DF diff --git a/missions/Traut/DANGER2.DF b/dogfights/Traut/DANGER2.DF similarity index 100% rename from missions/Traut/DANGER2.DF rename to dogfights/Traut/DANGER2.DF diff --git a/missions/Traut/SUICTND1.DF b/dogfights/Traut/SUICTND1.DF similarity index 100% rename from missions/Traut/SUICTND1.DF rename to dogfights/Traut/SUICTND1.DF diff --git a/missions/Traut/SUICTND2.DF b/dogfights/Traut/SUICTND2.DF similarity index 100% rename from missions/Traut/SUICTND2.DF rename to dogfights/Traut/SUICTND2.DF diff --git a/missions/Traut/SUICTND3.DF b/dogfights/Traut/SUICTND3.DF similarity index 100% rename from missions/Traut/SUICTND3.DF rename to dogfights/Traut/SUICTND3.DF diff --git a/missions/Willie/Army.df b/dogfights/Willie/Army.df similarity index 100% rename from missions/Willie/Army.df rename to dogfights/Willie/Army.df diff --git a/missions/Willie/Dodc.df b/dogfights/Willie/Dodc.df similarity index 100% rename from missions/Willie/Dodc.df rename to dogfights/Willie/Dodc.df diff --git a/missions/Willie/Dodgtw.df b/dogfights/Willie/Dodgtw.df similarity index 100% rename from missions/Willie/Dodgtw.df rename to dogfights/Willie/Dodgtw.df diff --git a/missions/Willie/Govtest.df b/dogfights/Willie/Govtest.df similarity index 100% rename from missions/Willie/Govtest.df rename to dogfights/Willie/Govtest.df diff --git a/src/mainmenu.c b/src/mainmenu.c index e70260413..bcac35a06 100644 --- a/src/mainmenu.c +++ b/src/mainmenu.c @@ -168,7 +168,7 @@ int SelectCampaign(int dogFight, int cmd) static int dogfightIndex = 0; int count, y, i, j; struct FileEntry *list = dogFight ? dogfightList : campaignList; - char *prefix = dogFight ? "dogfights/" : "missions/"; + const char *prefix = dogFight ? CDOGS_DOGFIGHT_DIR : CDOGS_CAMPAIGN_DIR; int *index = dogFight ? &dogfightIndex : &campaignIndex; struct FileEntry *f; @@ -1534,11 +1534,52 @@ void MenuDisplaySubmenus(menu_t *menu, int isCentered) } } +#define ARROW_UP "\036" +#define ARROW_DOWN "\037" + // Display menu items for options switch (menu->u.normal.optionType) { case MENU_OPTION_TYPE_CAMPAIGNS: - assert(0); + { + int count = 0, y, j; + struct FileEntry *list = campaignList; + struct FileEntry *f = list; + i = 0; + while (f != NULL && i <= menu->u.normal.index - 12) + { + count++; + i++; + f = f->next; + } + + y = CenterY(12 * CDogsTextHeight()); + + if (i != 0) + { + DisplayMenuItem(CenterX(CDogsTextWidth(ARROW_UP)), y - 2 - CDogsTextHeight(), ARROW_UP, 0); + } + + for (j = 0; f != NULL && j < 12; f = f->next, i++, j++) + { + int isSelected = i == menu->u.normal.index; + DisplayMenuItem(CenterX(CDogsTextWidth(f->info)), y, f->info, isSelected); + + if (isSelected) + { + char s[255]; + sprintf(s, "( %s )", strlen(f->name) == 0 ? "Internal" : f->name); + CDogsTextStringSpecial(s, TEXT_XCENTER | TEXT_BOTTOM, 0, SCREEN_WIDTH / 12); + } + + y += CDogsTextHeight(); + } + + if (f != NULL) + { + DisplayMenuItem(CenterX(CDogsTextWidth(ARROW_DOWN)), y + 2, ARROW_DOWN, 0); + } + } break; case MENU_OPTION_TYPE_DOGFIGHTS: assert(0); diff --git a/src/sys_config.h b/src/sys_config.h index f5fe16703..fc1f704dd 100644 --- a/src/sys_config.h +++ b/src/sys_config.h @@ -39,6 +39,9 @@ #define CDOGS_GAME_MUSIC_DIR CDOGS_MUSIC_DIR "game/" #define CDOGS_MENU_MUSIC_DIR CDOGS_MUSIC_DIR "menu/" +#define CDOGS_CAMPAIGN_DIR "missions/" +#define CDOGS_DOGFIGHT_DIR "dogfights/" + #define CDOGS_TEMP_DIR "/tmp/cdogs/" #endif diff --git a/src/sys_config.h.cmake b/src/sys_config.h.cmake index 71e89083e..5e821be88 100644 --- a/src/sys_config.h.cmake +++ b/src/sys_config.h.cmake @@ -39,6 +39,9 @@ #define CDOGS_GAME_MUSIC_DIR CDOGS_MUSIC_DIR "game/" #define CDOGS_MENU_MUSIC_DIR CDOGS_MUSIC_DIR "menu/" +#define CDOGS_CAMPAIGN_DIR "missions/" +#define CDOGS_DOGFIGHT_DIR "dogfights/" + #define CDOGS_TEMP_DIR "@CDOGS_TEMP_DIR@" #endif