minor code cleanup
[rocksndiamonds.git] / src / screens.c
index 29ce84dc807dc78761e1542d66965c41cfddf803..81643f1c87be7a397c623d50a703721b2f9d0673 100644 (file)
@@ -4258,15 +4258,13 @@ static void HandleTypeNameExt(boolean initialize, Key key)
 
     name[xpos] = 0;
   }
-  else if (key == KSYM_Return)
+  else if (key == KSYM_Return || key == KSYM_Escape)
   {
-    setTypeNameValues(name, pos, TRUE);
+    boolean changed = (key == KSYM_Return);
 
-    active = FALSE;
-  }
-  else if (key == KSYM_Escape)
-  {
-    setTypeNameValues(name, pos, FALSE);
+    StopTextInput();
+
+    setTypeNameValues(name, pos, changed);
 
     active = FALSE;
   }
@@ -4275,8 +4273,6 @@ static void HandleTypeNameExt(boolean initialize, Key key)
 
   if (!active)
   {
-    StopTextInput();
-
     SetGameStatus(game_status_last_screen);
 
     if (game_status == GAME_MODE_MAIN)
@@ -4879,9 +4875,7 @@ void DrawChoosePlayerName(void)
 
   for (i = 0; i < MAX_PLAYER_NAMES; i++)
   {
-    boolean team_mode = (!network.enabled && setup.team_mode);
-    int tree_type = (team_mode ? TREE_TYPE_PLAYER_TEAM : TREE_TYPE_PLAYER_NAME);
-    TreeInfo *ti = newTreeInfo_setDefaults(tree_type);
+    TreeInfo *ti = newTreeInfo_setDefaults(TREE_TYPE_PLAYER_NAME);
     char identifier[32], name[MAX_PLAYER_NAME_LEN + 1];
     int value = i;
 
@@ -6696,6 +6690,7 @@ static struct TokenInfo setup_info_engines[] =
   { TYPE_SWITCH,       &setup.forced_scroll_delay, "Scroll Delay:"     },
   { TYPE_ECS_AGA,      &setup.prefer_aga_graphics, "Amiga Graphics Chipset:" },
   { TYPE_SWITCH,       &setup.prefer_lowpass_sounds,"Low-Pass Filter Sounds:" },
+  { TYPE_SWITCH,       &setup.prefer_extra_panel_items,"Show Dynamite and Keys:" },
   { TYPE_EMPTY,                NULL,                   ""                      },
   { TYPE_HEADLINE,     NULL,                   "Supaplex"              },
   { TYPE_SWITCH,       &setup.sp_show_border_elements, "Border Elements:" },