Skip to content

Commit

Permalink
Add Logistics overlay
Browse files Browse the repository at this point in the history
- Replace the Warehouses overlay
- Show granaries, warehouses, cart depots, warehousemen and depot cart pushers
- Warehouses and cart depots are relative to Logistics overlay
- Add a hotkey for Logistics overlay
  • Loading branch information
Ouaz committed Jan 18, 2024
1 parent 4306fb3 commit 06467af
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/core/hotkey_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ static const char *ini_keys[] = {
"storage_order",
"show_overlay_efficiency",
"show_overlay_food_stocks",
"show_overlay_warehouse",
"show_overlay_entertainment",
"show_overlay_education",
"show_overlay_school",
Expand Down
1 change: 1 addition & 0 deletions src/core/hotkey_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ typedef enum {
HOTKEY_STORAGE_ORDER,
HOTKEY_SHOW_OVERLAY_EFFICIENCY,
HOTKEY_SHOW_OVERLAY_FOOD_STOCKS,
HOTKEY_SHOW_OVERLAY_WAREHOUSE,
HOTKEY_SHOW_OVERLAY_ENTERTAINMENT,
HOTKEY_SHOW_OVERLAY_EDUCATION,
HOTKEY_SHOW_OVERLAY_SCHOOL,
Expand Down
4 changes: 4 additions & 0 deletions src/input/hotkey.c
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,10 @@ static void set_definition_for_action(hotkey_action action, hotkey_definition *d
def->action = &data.hotkey_state.show_overlay;
def->value = OVERLAY_FOOD_STOCKS;
break;
case HOTKEY_SHOW_OVERLAY_WAREHOUSE:
def->action = &data.hotkey_state.show_overlay;
def->value = OVERLAY_WAREHOUSE;
break;
case HOTKEY_SHOW_OVERLAY_ENTERTAINMENT:
def->action = &data.hotkey_state.show_overlay;
def->value = OVERLAY_ENTERTAINMENT;
Expand Down
3 changes: 2 additions & 1 deletion src/translation/english.c
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@ static translation_string all_strings[] = {
{TR_OVERLAY_MOTHBALL, "Mothballed"},
{TR_OVERLAY_ENEMY, "Enemies"},
{TR_BUILDING_TAVERN_DESC_5, "Citizens love visiting this establishment in their free time to socialize over fine food and wine." },
{TR_OVERLAY_WAREHOUSES, "Warehouses" },
{TR_OVERLAY_WAREHOUSES, "Logistics" },
{TR_WINDOW_RACE_BLUE_HORSE_DESCRIPTION, "The Blue team - favourites of Neptune. These are the most promising of Rome's young charioteers who wish to prove themselves." },
{TR_WINDOW_RACE_RED_HORSE_DESCRIPTION, "The Red team - known as the team of the most successful charioteer in the history of Rome - a former oarsman and saviour of a Roman consul." },
{TR_WINDOW_RACE_WHITE_HORSE_DESCRIPTION, "The White team - founded by former gladiators. They have combat in their blood, and even as free men they live for the challenge." },
Expand Down Expand Up @@ -817,6 +817,7 @@ static translation_string all_strings[] = {
{TR_CITY_WARNING_BUILD_SENATE, "Build a senate"},
{TR_HOTKEY_SHOW_OVERLAY_EFFICIENCY, "Efficiency overlay"},
{TR_HOTKEY_SHOW_OVERLAY_FOOD_STOCKS, "Food Stocks overlay"},
{TR_HOTKEY_SHOW_OVERLAY_WAREHOUSE, "Logistics overlay" },
{TR_HOTKEY_SHOW_OVERLAY_ENTERTAINMENT, "Entertainment overlay" },
{TR_HOTKEY_SHOW_OVERLAY_EDUCATION, "Education overlay" },
{TR_HOTKEY_SHOW_OVERLAY_SCHOOL, "Schools overlay" },
Expand Down
1 change: 1 addition & 0 deletions src/translation/translation.h
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,7 @@ typedef enum {
TR_CITY_WARNING_BUILD_SENATE,
TR_HOTKEY_SHOW_OVERLAY_EFFICIENCY,
TR_HOTKEY_SHOW_OVERLAY_FOOD_STOCKS,
TR_HOTKEY_SHOW_OVERLAY_WAREHOUSE,
TR_HOTKEY_SHOW_OVERLAY_ENTERTAINMENT,
TR_HOTKEY_SHOW_OVERLAY_EDUCATION,
TR_HOTKEY_SHOW_OVERLAY_SCHOOL,
Expand Down
9 changes: 3 additions & 6 deletions src/widget/city_overlay_other.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ static int show_building_mothball(const building *b)

static int show_building_warehouses(const building *b)
{
return b->type == BUILDING_WAREHOUSE || b->type == BUILDING_WAREHOUSE_SPACE;
return b->type == BUILDING_WAREHOUSE || b->type == BUILDING_WAREHOUSE_SPACE ||
b->type == BUILDING_GRANARY || b->type == BUILDING_DEPOT;
}

static int show_building_storages(const building *b)
Expand Down Expand Up @@ -156,11 +157,7 @@ static int show_figure_tax_income(const figure *f)

static int show_figure_warehouses(const figure *f)
{
if (f->type != FIGURE_WAREHOUSEMAN) {
return 0;
}
building *b = building_get(f->building_id);
return b->type == BUILDING_WAREHOUSE;
return f->type == FIGURE_WAREHOUSEMAN || f->type == FIGURE_DEPOT_CART_PUSHER;
}

static int show_figure_none(const figure *f)
Expand Down
1 change: 1 addition & 0 deletions src/window/city.c
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,7 @@ static void show_overlay_from_grid_offset(int grid_offset)
break;
case BUILDING_WAREHOUSE:
case BUILDING_WAREHOUSE_SPACE:
case BUILDING_DEPOT:
overlay = OVERLAY_WAREHOUSE;
break;
case BUILDING_DOCK:
Expand Down
1 change: 1 addition & 0 deletions src/window/hotkey_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ static hotkey_widget hotkey_widgets[] = {
{HOTKEY_SHOW_OVERLAY_CRIME, TR_HOTKEY_SHOW_OVERLAY_CRIME},
{HOTKEY_SHOW_OVERLAY_PROBLEMS, TR_HOTKEY_SHOW_OVERLAY_PROBLEMS},
{HOTKEY_SHOW_OVERLAY_FOOD_STOCKS, TR_HOTKEY_SHOW_OVERLAY_FOOD_STOCKS},
{HOTKEY_SHOW_OVERLAY_WAREHOUSE, TR_HOTKEY_SHOW_OVERLAY_WAREHOUSE},
{HOTKEY_SHOW_OVERLAY_ENTERTAINMENT, TR_HOTKEY_SHOW_OVERLAY_ENTERTAINMENT},
{HOTKEY_SHOW_OVERLAY_EDUCATION, TR_HOTKEY_SHOW_OVERLAY_EDUCATION},
{HOTKEY_SHOW_OVERLAY_SCHOOL, TR_HOTKEY_SHOW_OVERLAY_SCHOOL},
Expand Down

0 comments on commit 06467af

Please sign in to comment.