rnd-20140307-2-src
authorHolger Schemel <info@artsoft.org>
Fri, 7 Mar 2014 10:02:33 +0000 (11:02 +0100)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 09:01:15 +0000 (11:01 +0200)
src/conf_gfx.c
src/conf_var.c
src/conftime.h
src/game.c
src/main.h
src/tape.c
src/tape.h

index 82f508fd6af3630670d6e7987dd62bf59b3aa2ae..a2406193916f55446bda0078db9d2aad31392c9b 100644 (file)
@@ -6023,8 +6023,6 @@ struct ConfigInfo image_config[] =
   { "main.input.name.valign",                  "top"                   },
   { "main.input.name.font",                    "font.input_1"          },
 
-  { "main.show_game_buttons",                  "false"                 },
-
   { "preview.x",                               "272"                   },
   { "preview.y",                               "380"                   },
   { "preview.align",                           "center"                },
@@ -7081,6 +7079,8 @@ struct ConfigInfo image_config[] =
   { "tape.text.time.digits",                   "-1"                    },
   { "tape.text.time.font",                     "font.tape_recorder"    },
 
+  { "tape.show_game_buttons",                  "false"                 },
+
   { "editor.palette.x",                                "5"                     },
   { "editor.palette.y",                                "30"                    },
   { "editor.palette.cols",                     "4"                     },
index 73f119678a6ebfe22cebcfcfed11cafe9c089cfd..03ab11dd55ae577483766f92e8a8696af065bd02 100644 (file)
@@ -2044,10 +2044,6 @@ struct TokenIntPtrInfo image_config_vars[] =
     "main.input.name.font",
     &menu.main.input.name.font
   },
-  {
-    "main.show_game_buttons",
-    &menu.main.show_game_buttons
-  },
   {
     "preview.x",
     &preview.x
@@ -6088,6 +6084,10 @@ struct TokenIntPtrInfo image_config_vars[] =
     "tape.text.time.font",
     &tape.text.time.font
   },
+  {
+    "tape.show_game_buttons",
+    &tape.show_game_buttons
+  },
   {
     "editor.palette.x",
     &editor.palette.x
index 45332a0ac05c50da0f3c2c33737ac9cb785d3afe..725b3fdc8fa8bf2076037f579b523266b0a23dc9 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "2014-03-07 01:21"
+#define COMPILE_DATE_STRING "2014-03-07 10:48"
index 11a6fed866271b03c2f5ff544ec29cd68827848c..1a201dc120978a4f2f6d4fc32558b6b672731a10 100644 (file)
@@ -16831,6 +16831,8 @@ void CreateGameButtons()
     int button_type;
     boolean checked;
     unsigned int event_mask;
+    int base_x = (tape.show_game_buttons ? VX : DX);
+    int base_y = (tape.show_game_buttons ? VY : DY);
     int gd_x   = gfx->src_x;
     int gd_y   = gfx->src_y;
     int gd_xp  = gfx->src_x + gfx->pressed_xoffset;
@@ -16870,8 +16872,8 @@ void CreateGameButtons()
 
     gi = CreateGadget(GDI_CUSTOM_ID, id,
                      GDI_INFO_TEXT, gamebutton_info[i].infotext,
-                     GDI_X, DX + GDI_ACTIVE_POS(pos->x),
-                     GDI_Y, DY + GDI_ACTIVE_POS(pos->y),
+                     GDI_X, base_x + GDI_ACTIVE_POS(pos->x),
+                     GDI_Y, base_y + GDI_ACTIVE_POS(pos->y),
                      GDI_WIDTH, gfx->width,
                      GDI_HEIGHT, gfx->height,
                      GDI_TYPE, button_type,
@@ -16927,12 +16929,19 @@ void RedrawGameButtons()
 
 static void HandleGameButtonsExt(int id)
 {
-  if (game_status != GAME_MODE_PLAYING)
+  boolean handle_game_buttons =
+    (game_status == GAME_MODE_PLAYING ||
+     (game_status == GAME_MODE_MAIN && tape.show_game_buttons));
+
+  if (!handle_game_buttons)
     return;
 
   switch (id)
   {
     case GAME_CTRL_ID_STOP:
+      if (game_status == GAME_MODE_MAIN)
+       break;
+
       if (tape.playing)
        TapeStop();
       else
@@ -16940,7 +16949,7 @@ static void HandleGameButtonsExt(int id)
       break;
 
     case GAME_CTRL_ID_PAUSE:
-      if (options.network)
+      if (options.network && game_status == GAME_MODE_PLAYING)
       {
 #if defined(NETWORK_AVALIABLE)
        if (tape.pausing)
@@ -16954,7 +16963,11 @@ static void HandleGameButtonsExt(int id)
       break;
 
     case GAME_CTRL_ID_PLAY:
-      if (tape.pausing)
+      if (game_status == GAME_MODE_MAIN)
+      {
+        StartGameActions(options.network, setup.autorecord, level.random_seed);
+      }
+      else if (tape.pausing)
       {
 #if defined(NETWORK_AVALIABLE)
        if (options.network)
index 5653a982b81c2a393c22e44c89bd39ec5aec74ad..2a335bbade494560f7f7ef708ff67ecce5f5f042 100644 (file)
@@ -2240,8 +2240,6 @@ struct MenuMainInfo
   struct MenuMainButtonInfo button;
   struct MenuMainTextInfo text;
   struct MenuMainInputInfo input;
-
-  boolean show_game_buttons;
 };
 
 struct TitleFadingInfo
index cebc92890274fa9331dfe881bfcfe97db6d21f06..782db9be781affbca9471a3678b0c198195e056f 100644 (file)
@@ -1471,6 +1471,9 @@ void MapTapeButtons()
 
   if (tape.recording || tape.playing)
     MapTapeWarpButton();
+
+  if (tape.show_game_buttons)
+    MapGameButtons();
 }
 
 void UnmapTapeButtons()
index 6a5107cb5a849fecd6d4c55ffab3804fd4dc0495..f23d7c9aa9db9d393e8f4e56f34f4ecf2aea6bcc 100644 (file)
@@ -178,6 +178,8 @@ struct TapeInfo
   struct TapeLabelInfo label;
   struct TapeTextInfo text;
 
+  boolean show_game_buttons;   /* show game buttons in tape viewport */
+
   boolean no_valid_file;       /* set when tape file missing or invalid */
 };