Skip to content

Commit

Permalink
Move stockpiling button to upper-right corner
Browse files Browse the repository at this point in the history
  • Loading branch information
Ouaz committed Feb 13, 2024
1 parent 3d42281 commit b5d443a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/window/building/distribution.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ static struct {
};

static generic_button primary_product_producer_button_stockpiling[] = {
{360, 3, 24, 24, button_stockpiling, button_none, 0, 0}
{0, 0, 24, 24, button_stockpiling, button_none, 0, 0}
};

static struct {
Expand Down Expand Up @@ -600,14 +600,14 @@ int window_building_handle_mouse_distributor_orders(const mouse *m, building_inf
int window_building_handle_mouse_primary_product_producer(const mouse *m, building_info_context *c)
{
data.building_id = c->building_id;
return generic_buttons_handle_mouse(m, c->x_offset, c->y_offset + BLOCK_SIZE * c->height_blocks - 40,
return generic_buttons_handle_mouse(m, c->x_offset + BLOCK_SIZE * c->width_blocks - 30, c->y_offset + 10,
primary_product_producer_button_stockpiling, 1, &data.primary_product_stockpiling_id);
}

void window_building_draw_primary_product_stockpiling(building_info_context *c)
{
int x = c->x_offset + primary_product_producer_button_stockpiling->x;
int y = c->y_offset + primary_product_producer_button_stockpiling->y + BLOCK_SIZE * c->height_blocks - 40;
int x = c->x_offset + primary_product_producer_button_stockpiling->x + BLOCK_SIZE * c->width_blocks - 30;
int y = c->y_offset + primary_product_producer_button_stockpiling->y + 10;
button_border_draw(x, y, 20, 20, data.primary_product_stockpiling_id);
if (building_stockpiling_enabled(building_get(c->building_id))) {
image_draw(assets_get_image_id("UI", "Warehousing"), x + 4, y + 4, COLOR_MASK_NONE, SCALE_NONE);
Expand Down

0 comments on commit b5d443a

Please sign in to comment.