rnd-20060802-2-src
authorHolger Schemel <info@artsoft.org>
Wed, 2 Aug 2006 17:12:43 +0000 (19:12 +0200)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:52:32 +0000 (10:52 +0200)
src/conftime.h
src/libgame/setup.h
src/screens.c

index cd365815f9207e911175af0e2f29a44296f78e06..81bf69db8a92adeee236786bd7c35221ee3093a8 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "[2006-08-02 01:51]"
+#define COMPILE_DATE_STRING "[2006-08-02 19:10]"
index e55217c01259ee73c0b6345dd07b03e4665887f9..8002e96f376e5ea66f2debaa4e0ad2bf6a55c9d3 100644 (file)
                                         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"
 
index 199d83761e0e7e077564ddec5f647651db3f3a28..6655bd88ac34ea271f013a07917ae3033d981a36 100644 (file)
@@ -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()