Support emulating low battery

This commit is contained in:
2026-08-15 00:52:40 -04:00
parent 3a00497942
commit 762f43fd42
4 changed files with 35 additions and 0 deletions
+11
View File
@@ -72,6 +72,7 @@ impl GameWindow {
sim_id: SimId,
) -> Self {
let config = SimConfig::load(&persistence, sim_id);
let _ = proxy.send_event(UserEvent::LowBattery(sim_id, config.low_battery));
let toasts = Toasts::new()
.with_anchor(Anchor::BottomLeft)
.with_margin((10.0, 10.0).into())
@@ -389,6 +390,16 @@ impl GameWindow {
{
pollster::block_on(self.take_screenshot());
}
ui.separator();
let low_battery = self.config.low_battery;
if ui.selectable_button(low_battery, "Low Battery").clicked() {
self.update_config(|c| {
c.low_battery = !low_battery;
});
let _ = self
.proxy
.send_event(UserEvent::LowBattery(self.sim_id, !low_battery));
}
});
ui.menu_button("Options", |ui| self.show_options_menu(ui));
ui.menu_button("Multiplayer", |ui| {