Support emulating low battery
This commit is contained in:
@@ -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| {
|
||||
|
||||
Reference in New Issue
Block a user