Merge branch 'main' into feature/robust-logging
All checks were successful
Smoke tests / Build and smoke test (pull_request) Successful in 1m28s
Smoke tests / Build and smoke test (push) Successful in 1m28s

This commit is contained in:
2026-03-19 21:11:44 -06:00
12 changed files with 185 additions and 4 deletions

View File

@@ -180,6 +180,14 @@ fn attitude_color(att: Attitude) -> &'static str {
}
}
pub fn get_time_of_day(tick: u64) -> &'static str {
let day_tick = tick % 1440;
if day_tick < 360 { "Night" }
else if day_tick < 720 { "Morning" }
else if day_tick < 1080 { "Afternoon" }
else { "Evening" }
}
pub fn render_room_view(
room_id: &str,
player_id: usize,
@@ -195,13 +203,19 @@ pub fn render_room_view(
.map(|c| c.player.name.as_str())
.unwrap_or("");
let time_of_day = get_time_of_day(st.tick_count);
let mut out = format!(
"\r\n{} {}\r\n {}\r\n",
"\r\n{} {} {}\r\n {}\r\n",
ansi::room_name(&room.name),
ansi::system_msg(&format!("[{}]", room.region)),
ansi::color(ansi::YELLOW, &format!("[{}]", time_of_day)),
room.description
);
if room.outdoors {
out.push_str(&format!(" {}\r\n", ansi::color(ansi::CYAN, st.weather.kind.description())));
}
let npc_strs: Vec<String> = room
.npcs
.iter()