From 7b5889667e928c4991fad45930d4ad891863caa2 Mon Sep 17 00:00:00 2001 From: Aldrik Ramaekers Date: Sat, 30 Nov 2024 21:40:43 +0100 Subject: close #12 --- src/scenes/place_detail.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/scenes/place_detail.c') diff --git a/src/scenes/place_detail.c b/src/scenes/place_detail.c index a3e549b..372a659 100644 --- a/src/scenes/place_detail.c +++ b/src/scenes/place_detail.c @@ -334,13 +334,24 @@ static void place_detail_draw_trucks(platform_window* window, tab tab, float x, } } +static s32 place_get_nr_of_internal_employees() +{ + s32 count = 0; + for (s32 i = 0; i < _active_location->employees.length; i++) { + employee* emp = *(employee**)array_at(&_active_location->employees, i); + bool is_internal = (emp->original_location_id == _active_location->id); + if (is_internal) count++; + } + return count; +} + static void place_detail_draw_employees(platform_window* window, tab tab, float x, float y, float w, float h) { HANDLE_TAB_START(_active_location->employees.length+2, 5); HANDLE_TAB_SCROLL; char info_buf[50]; - sprintf(info_buf, "%d Employees currently on site.", _active_location->employees.length); + sprintf(info_buf, "%d Employees on payroll.", place_get_nr_of_internal_employees()); HANDLE_TAB_INFO(info_buf, "Hire", PLACE_DETAIL_SHOW_RESUMES); s32 current_index = 0; -- cgit v1.2.3-70-g09d2