Smooth camera and unit motion: display positions, camera target smoothing, pan speed setting

This commit is contained in:
Richard Zink committed 2026-11-04 13:56:11 +01:00
1 parent 583c3fcdaf
commit eb11cca8cb
10 files changed
+107 -23

No files matched your search

+2 -2
View File
@@ -479,7 +479,7 @@ impl Ui {
UiAction::Consumed
}
TBtn::OvRow(id) => match g.ents.iter().find(|e| e.id == id) {
Some(e) => UiAction::MinimapJump(e.x, e.y),
Some(e) => UiAction::MinimapJump(e.disp_x, e.disp_y),
None => UiAction::Consumed,
},
TBtn::Tool(i) if !g.tool_allowed(i) => {
@@ -779,7 +779,7 @@ impl Ui {
Color::new(0.4, 0.6, 1.0, 1.0)
}
} else if e.kind == EK::Worker { Color::new(1.0, 0.6, 0.3, 1.0) } else { Color::new(1.0, 0.25, 0.25, 1.0) };
draw_rectangle((mrx + e.x.floor() * ms).floor(), (mry + e.y.floor() * ms).floor(), dot, dot, c);
draw_rectangle((mrx + e.disp_x.floor() * ms).floor(), (mry + e.disp_y.floor() * ms).floor(), dot, dot, c);
}
}
if let Some(f) = g.flag {