re-arranged buttons to select network player in request dialog
authorHolger Schemel <info@artsoft.org>
Wed, 6 Jun 2018 21:37:27 +0000 (23:37 +0200)
committerHolger Schemel <info@artsoft.org>
Mon, 18 Jun 2018 17:47:32 +0000 (19:47 +0200)
src/conf_gfx.c
src/tools.c

index 20bb68308b27546d698cea883a529cc82c1d4c85..d24150738af9202d140e95b417e273212dbec91b 100644 (file)
@@ -9369,20 +9369,20 @@ struct ConfigInfo image_config[] =
   { "request.button.no.y",                     "250"                   },
   { "request.button.confirm.x",                        "2"                     },
   { "request.button.confirm.y",                        "250"                   },
-  { "request.button.player_1.x",               "20"                    },
-  { "request.button.player_1.y",               "200"                   },
+  { "request.button.player_1.x",               "35"                    },
+  { "request.button.player_1.y",               "185"                   },
   { "request.button.player_1.draw_player",     "true"                  },
   { "request.button.player_1.tile_size",       "16"                    },
-  { "request.button.player_2.x",               "50"                    },
-  { "request.button.player_2.y",               "200"                   },
+  { "request.button.player_2.x",               "65"                    },
+  { "request.button.player_2.y",               "215"                   },
   { "request.button.player_2.draw_player",     "true"                  },
   { "request.button.player_2.tile_size",       "16"                    },
-  { "request.button.player_3.x",               "20"                    },
-  { "request.button.player_3.y",               "230"                   },
+  { "request.button.player_3.x",               "35"                    },
+  { "request.button.player_3.y",               "245"                   },
   { "request.button.player_3.draw_player",     "true"                  },
   { "request.button.player_3.tile_size",       "16"                    },
-  { "request.button.player_4.x",               "50"                    },
-  { "request.button.player_4.y",               "230"                   },
+  { "request.button.player_4.x",               "5                    },
+  { "request.button.player_4.y",               "215"                   },
   { "request.button.player_4.draw_player",     "true"                  },
   { "request.button.player_4.tile_size",       "16"                    },
 
index 5c259419dc967e6c4d54dc43c52c186dbf1e6f33..19965d47a3c9ab9f08a41928f16ce316f48223c5 100644 (file)
@@ -5351,33 +5351,30 @@ void CreateToolButtons()
       if (x < 0 || x + gfx->width  > request.width ||
          y < 0 || y + gfx->height > request.height)
       {
-       // use left padding of "yes" button as default border padding
-       int padding = toolbutton_info[TOOL_CTRL_ID_YES].pos->x;
-
        if (id == TOOL_CTRL_ID_YES)
        {
-         x = padding;
-         y = request.height - 2 * request.border_size - gfx->height - padding;
+         x = 0;
+         y = request.height - 2 * request.border_size - gfx->height;
        }
        else if (id == TOOL_CTRL_ID_NO)
        {
-         x = request.width  - 2 * request.border_size - gfx->width  - padding;
-         y = request.height - 2 * request.border_size - gfx->height - padding;
+         x = request.width  - 2 * request.border_size - gfx->width;
+         y = request.height - 2 * request.border_size - gfx->height;
        }
        else if (id == TOOL_CTRL_ID_CONFIRM)
        {
          x = (request.width - 2 * request.border_size - gfx->width) / 2;
-         y = request.height - 2 * request.border_size - gfx->height - padding;
+         y = request.height - 2 * request.border_size - gfx->height;
        }
        else if (id >= TOOL_CTRL_ID_PLAYER_1 && id <= TOOL_CTRL_ID_PLAYER_4)
        {
          int player_nr = id - TOOL_CTRL_ID_PLAYER_1;
 
          x = (request.width - 2 * request.border_size - gfx->width) / 2;
-         y = request.height - 2 * request.border_size - gfx->height - padding;
+         y = request.height - 2 * request.border_size - gfx->height * 2;
 
-         x += (player_nr % 2 ? +1 : -1) * gfx->width / 2;
-         y += (player_nr / 2 ?  0 : -1) * gfx->height;
+         x += (player_nr == 3 ? -1 : player_nr == 1 ? +1 : 0) * gfx->width;
+         y += (player_nr == 0 ? -1 : player_nr == 2 ? +1 : 0) * gfx->height;
        }
       }
     }