summaryrefslogtreecommitdiff
path: root/src/scenes/place_detail.c
diff options
context:
space:
mode:
authorAldrik Ramaekers <aldrikboy@gmail.com>2024-11-25 14:52:56 +0100
committerAldrik Ramaekers <aldrikboy@gmail.com>2024-11-25 14:52:56 +0100
commit82419840618418daa9020029a5347fc0f6e5edc5 (patch)
treea571a917c081abb1bb2fc2db3d55066518dd3141 /src/scenes/place_detail.c
parent269be26f06ff9506cf33da603342bb0963a3339c (diff)
location score. close #1, close #7, close #6
Diffstat (limited to 'src/scenes/place_detail.c')
-rw-r--r--src/scenes/place_detail.c31
1 files changed, 27 insertions, 4 deletions
diff --git a/src/scenes/place_detail.c b/src/scenes/place_detail.c
index 707ae0f..4519cfa 100644
--- a/src/scenes/place_detail.c
+++ b/src/scenes/place_detail.c
@@ -131,7 +131,7 @@ static scheduled_job create_empty_job_schedule(job_offer* job)
scheduled_job new_job;
new_job.location = _active_location;
new_job.offer = *job;
- new_job.trust = 1.0f;
+ new_job.trust = JOB_STARTING_TRUST;
for (s32 i = 0; i < MAX_SHIPDAYS; i++) {
new_job.timeslots[i] = (scheduled_job_time){-1, -1, 0, 0};
}
@@ -1567,11 +1567,34 @@ static tab place_detail_draw_tabs(platform_window* window)
return place_detail_draw_tab_bg(window);
}
+#define DRAW_STARS(_x, _y, _txt, _count){\
+s32 textw = renderer->render_text(fnt, _x, _y, _txt, COLOR_TEXT);\
+_x += (scale*5);\
+for (s32 i = 0; i < 5; i++)\
+{\
+ if (i < _count) renderer->render_image(img_star, _x + textw + (i*(fnt->px_h+2)), _y, fnt->px_h, fnt->px_h);\
+ else renderer->render_image_tint(img_star, _x + textw + (i*(fnt->px_h+2)), _y, fnt->px_h, fnt->px_h, rgba(255,255,255,30));\
+}}
+
+static void place_detail_draw_location_stats(platform_window* window)
+{
+ font* fnt = fnt_rd20;
+ float text_pad = scale * 40.0;
+
+ //s32 w = (area.w * 0.9 - (offset*2));
+
+ s32 text_x = area.x + text_pad + (area.w*0.75);
+ s32 text_y = area.y + text_pad + (area.w*0.05);
+
+ DRAW_STARS(text_x, text_y, "Score: ", 5);
+}
+
static void place_detail_draw_title(platform_window* window)
{
char buf[200];
if (current_detail_state == PLACE_DETAIL_SHOW_MAIN) {
strcpy(buf, _active_location->name);
+ place_detail_draw_location_stats(window);
}
else if (current_detail_state == PLACE_DETAIL_SHOW_RESUMES) {
strcpy(buf, "Hire new employees");
@@ -1596,8 +1619,8 @@ static void place_detail_draw_title(platform_window* window)
font* fnt = fnt_rd36;
float text_pad = scale * 40.0;
- s32 text_x = text_pad + area.x + (area.w*0.05);
- s32 text_y = text_pad + area.y + (area.w*0.05);
+ s32 text_x = area.x + text_pad + (area.w*0.05);
+ s32 text_y = area.y + text_pad + (area.w*0.05);
// Title
{
@@ -1739,7 +1762,7 @@ void place_detail_scene_render(platform_window* window)
if (selected_tab_index == PLACE_DETAIL_SCHEDULE) {
selected_tab_index = PLACE_DETAIL_SHOW_MAIN;
current_detail_state = PLACE_DETAIL_SHOW_SCHEDULE;
- }
+ }
}
if (current_detail_state == PLACE_DETAIL_SHOW_RESUMES) {
place_detail_draw_resumes(window);