Skip to content

Commit

Permalink
Adding cart depot ressources
Browse files Browse the repository at this point in the history
  • Loading branch information
dvincent56 committed Mar 25, 2024
1 parent 8b0e880 commit edb3b72
Showing 1 changed file with 76 additions and 2 deletions.
78 changes: 76 additions & 2 deletions src/widget/city_without_overlay.c
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,77 @@ static void draw_plague(building *b, int x, int y, color_t color_mask)
}
}

static void draw_depot_ressource(building *b, int x, int y, color_t color_mask)
{
if (b->num_workers > 0) {
int img_id;
switch(b->data.depot.current_order.resource_type) {
case RESOURCE_VEGETABLES:
img_id = assets_get_image_id("Admin_Logistics", "Cart_Depot_Vegetables");
break;
case RESOURCE_FRUIT:
img_id = assets_get_image_id("Admin_Logistics", "Cart_Depot_Fruit");
break;
case RESOURCE_MEAT:
img_id = assets_get_image_id("Admin_Logistics", "Cart_Depot_Meat");
break;
case RESOURCE_VINES:
img_id = assets_get_image_id("Admin_Logistics", "Cart_Depot_Grapes");
break;
case RESOURCE_POTTERY:
img_id = assets_get_image_id("Admin_Logistics", "Cart_Depot_Pottery");
break;
case RESOURCE_FURNITURE:
img_id = assets_get_image_id("Admin_Logistics", "Cart_Depot_Furniture");
break;
case RESOURCE_OIL:
img_id = assets_get_image_id("Admin_Logistics", "Cart_Depot_Oil");
break;
case RESOURCE_WINE:
img_id = assets_get_image_id("Admin_Logistics", "Cart_Depot_Wine");
break;
case RESOURCE_MARBLE:
img_id = assets_get_image_id("Admin_Logistics", "Cart_Depot_Marble");
break;
case RESOURCE_WEAPONS:
img_id = assets_get_image_id("Admin_Logistics", "Cart_Depot_Weapons");
break;
case RESOURCE_CLAY:
img_id = assets_get_image_id("Admin_Logistics", "Cart_Depot_Clay");
break;
case RESOURCE_TIMBER:
img_id = assets_get_image_id("Admin_Logistics", "Cart_Depot_Timber");
break;
case RESOURCE_OLIVES:
img_id = assets_get_image_id("Admin_Logistics", "Cart_Depot_Olives");
break;
case RESOURCE_IRON:
img_id = assets_get_image_id("Admin_Logistics", "Cart_Depot_Iron");
break;
case RESOURCE_GOLD:
img_id = assets_get_image_id("Admin_Logistics", "Cart_Depot_Gold");
break;
case RESOURCE_SAND:
img_id = assets_get_image_id("Admin_Logistics", "Cart_Depot_Sand");
break;
case RESOURCE_STONE:
img_id = assets_get_image_id("Admin_Logistics", "Cart_Depot_Stone");
break;
case RESOURCE_CONCRETE:
img_id = assets_get_image_id("Admin_Logistics", "Cart_Depot_Wheat");
break;
case RESOURCE_BRICKS:
img_id = assets_get_image_id("Admin_Logistics", "Cart_Depot_Bricks");
break;
case RESOURCE_WHEAT:
default:
img_id = assets_get_image_id("Admin_Logistics", "Cart_Depot_Wheat");
break;
}
image_draw(img_id, x + 11, y, COLOR_MASK_NONE, draw_context.scale);
}
}

static void draw_dock_workers(const building *b, int x, int y, color_t color_mask)
{
if (!b->has_plague) {
Expand Down Expand Up @@ -656,6 +727,9 @@ static void draw_animation(int x, int y, int grid_offset)
int overlay_id = assets_get_image_id("Monuments", "Col Base Overlay") + festival_id;
image_draw(overlay_id, x + extra_x, y + extra_y - y_offset, color_mask, draw_context.scale);
}
if (b->type == BUILDING_DEPOT) {
draw_depot_ressource(b, x, y, color_mask);
}
}
if (b->has_plague) {
draw_plague(b, x, y, color_mask);
Expand All @@ -665,7 +739,7 @@ static void draw_animation(int x, int y, int grid_offset)
draw_plague(b, x, y, color_mask);
} else if (map_sprite_bridge_at(grid_offset)) {
city_draw_bridge(x, y, draw_context.scale, grid_offset);
} else if (building_get(map_building_at(grid_offset))->type == BUILDING_FORT) {
} else if (b->type == BUILDING_FORT) {
if (map_property_is_draw_tile(grid_offset)) {
building *fort = building_get(map_building_at(grid_offset));
image_id = assets_get_image_id("Military", "Fort_Jav_Flag_Central");
Expand All @@ -690,7 +764,7 @@ static void draw_animation(int x, int y, int grid_offset)
image_draw(image_id, x + 81, y + 5,
draw_building_as_deleted(fort) ? COLOR_MASK_RED : COLOR_MASK_NONE, draw_context.scale);
}
} else if (building_get(map_building_at(grid_offset))->type == BUILDING_GATEHOUSE) {
} else if (b->type == BUILDING_GATEHOUSE) {
int xy = map_property_multi_tile_xy(grid_offset);
int orientation = city_view_orientation();
if ((orientation == DIR_0_TOP && xy == EDGE_X1Y1) ||
Expand Down

0 comments on commit edb3b72

Please sign in to comment.