From 8e8a0eddc70d1581ecbd18ff9bad3db3485956b7 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Wed, 2 Aug 2006 19:12:43 +0200 Subject: [PATCH] rnd-20060802-2-src --- src/conftime.h | 2 +- src/libgame/setup.h | 9 ++++++--- src/screens.c | 45 +++++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 50 insertions(+), 6 deletions(-) diff --git a/src/conftime.h b/src/conftime.h index cd365815..81bf69db 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2006-08-02 01:51]" +#define COMPILE_DATE_STRING "[2006-08-02 19:10]" diff --git a/src/libgame/setup.h b/src/libgame/setup.h index e55217c0..8002e96f 100644 --- a/src/libgame/setup.h +++ b/src/libgame/setup.h @@ -68,13 +68,16 @@ TYPE_STRING | \ TYPE_GHOSTED) -#define TYPE_ENTER_OR_LEAVE (TYPE_ENTER_SCREEN | \ - TYPE_LEAVE_SCREEN | \ +#define TYPE_ENTER (TYPE_ENTER_SCREEN | \ TYPE_ENTER_MENU | \ + TYPE_ENTER_LIST) + +#define TYPE_LEAVE (TYPE_LEAVE_SCREEN | \ TYPE_LEAVE_MENU | \ - TYPE_ENTER_LIST | \ TYPE_LEAVE_LIST) +#define TYPE_ENTER_OR_LEAVE (TYPE_ENTER | TYPE_LEAVE) + /* cookie token for file identifier and version number */ #define TOKEN_STR_FILE_IDENTIFIER "file_identifier" diff --git a/src/screens.c b/src/screens.c index 199d8376..6655bd88 100644 --- a/src/screens.c +++ b/src/screens.c @@ -1114,7 +1114,7 @@ void HandleInfoScreen_Main(int mx, int my, int dx, int dy, int button) { if (dx) { - int menu_navigation_type = (dx < 0 ? TYPE_LEAVE_MENU : TYPE_ENTER_MENU); + int menu_navigation_type = (dx < 0 ? TYPE_LEAVE : TYPE_ENTER); if (info_info[choice].type & menu_navigation_type || info_info[choice].type & TYPE_ENTER_SCREEN || @@ -3192,6 +3192,7 @@ void HandleSetupScreen_Generic(int mx, int my, int dx, int dy, int button) choice_store[setup_mode] = choice; drawCursor(choice, FC_RED); + return; } else if (button == MB_MENU_LEAVE) @@ -3203,6 +3204,7 @@ void HandleSetupScreen_Generic(int mx, int my, int dx, int dy, int button) void (*menu_callback_function)(void) = setup_info[y].value; menu_callback_function(); + break; /* absolutely needed because function changes 'setup_info'! */ } } @@ -3219,7 +3221,7 @@ void HandleSetupScreen_Generic(int mx, int my, int dx, int dy, int button) { if (dx) { - int menu_navigation_type = (dx < 0 ? TYPE_LEAVE_MENU : TYPE_ENTER_MENU); + int menu_navigation_type = (dx < 0 ? TYPE_LEAVE : TYPE_ENTER); if (setup_info[choice].type & menu_navigation_type || setup_info[choice].type & TYPE_BOOLEAN_STYLE) @@ -3234,6 +3236,44 @@ void HandleSetupScreen_Generic(int mx, int my, int dx, int dy, int button) y += dy; } +#if 1 + if (IN_VIS_FIELD(x, y) && y >= 0 && y < num_setup_info) + { + if (button) + { + if (y != choice && setup_info[y].type & ~TYPE_SKIP_ENTRY) + { + drawCursor(y, FC_RED); + drawCursor(choice, FC_BLUE); + choice = choice_store[setup_mode] = y; + } + } + else if (!(setup_info[y].type & TYPE_GHOSTED)) + { + /* when selecting key headline, execute function for key value change */ + if (setup_info[y].type & TYPE_KEYTEXT && + setup_info[y + 1].type & TYPE_KEY) + y++; + + /* when selecting string value, execute function for list selection */ + if (setup_info[y].type & TYPE_STRING && y > 0 && + setup_info[y - 1].type & TYPE_ENTER_LIST) + y--; + + if (setup_info[y].type & TYPE_ENTER_OR_LEAVE) + { + void (*menu_callback_function)(void) = setup_info[y].value; + + menu_callback_function(); + } + else + { + if (setup_info[y].type & TYPE_VALUE) + changeSetupValue(y); + } + } + } +#else if (IN_VIS_FIELD(x, y) && y >= 0 && y < num_setup_info && setup_info[y].type & ~TYPE_SKIP_ENTRY) { @@ -3265,6 +3305,7 @@ void HandleSetupScreen_Generic(int mx, int my, int dx, int dy, int button) } } } +#endif } void DrawSetupScreen_Input() -- 2.34.1