Move battery status text to the presentation adapter
Sam::status, Comps::describe/worst and Sam::parts_text formatted player-facing Russian in the simulation. The adapter now owns that text: battery_view::sam_status for the panel and map, why_view::parts and why_view::worst for the monitor and the status line. The core keeps the data and gains only the accessors the adapter needs (preparing_cell, public cells/reload_time/magazine/gun facts). Texts are unchanged; the adapter tests pin the existing strings. Co-Authored-By: Kimi Code <noreply@moonshot.ai>
This commit is contained in:
@@ -209,7 +209,7 @@ fn cell(sim: &Sim, index: usize, x: f32, y: f32, w: f32, h: f32, s: &mut Vec<Sha
|
||||
// Worn or failed parts, over the picture: orange, red when one has failed.
|
||||
if !sam.comps.whole() {
|
||||
let failed = crate::sim::Part::ALL.iter().any(|p| sam.part_state(*p) == crate::sim::PartState::Failed);
|
||||
s.push(text(fit(sam.parts_text(), cw * 0.55), cx + 3.0, cy + 3.0, if failed { 0xFFFF4040 } else { 0xFFFFB030 }));
|
||||
s.push(text(fit(crate::why_view::parts(&sam.comps, sam.kind), cw * 0.55), cx + 3.0, cy + 3.0, if failed { 0xFFFF4040 } else { 0xFFFFB030 }));
|
||||
}
|
||||
// Crosshair.
|
||||
s.push(fill(cx + cw / 2.0 - 0.5, cy + 3.0, 1.0, ch * 0.18, 0x90FFFFFF));
|
||||
|
||||
Reference in New Issue
Block a user