mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-17 15:22:10 +08:00
BigUI WIP: Vehicle Panel state update
This commit is contained in:
@@ -648,6 +648,7 @@ class StarPilotVehicleSettingsLayout(_SettingsPage):
|
||||
if current_model not in available:
|
||||
self._params.remove("CarModel")
|
||||
self._params.remove("CarModelName")
|
||||
starpilot_state.update()
|
||||
|
||||
dialog = MultiOptionDialog(tr("Select Make"), makes, default_make, callback=on_select)
|
||||
gui_app.push_widget(dialog)
|
||||
@@ -675,6 +676,7 @@ class StarPilotVehicleSettingsLayout(_SettingsPage):
|
||||
self._params.put("CarModel", opt.value)
|
||||
self._params.put("CarModelName", opt.label)
|
||||
self._params.put("CarMake", make)
|
||||
starpilot_state.update()
|
||||
|
||||
dialog = MultiOptionDialog(tr("Select Model"), option_labels, default_option, callback=on_select)
|
||||
gui_app.push_widget(dialog)
|
||||
|
||||
@@ -77,12 +77,8 @@ class StarPilotState:
|
||||
self.update()
|
||||
|
||||
def _apply_desktop_fallback(self, starpilot_toggles: dict):
|
||||
fallback_make = starpilot_toggles.get("car_make", "")
|
||||
fallback_model = starpilot_toggles.get("car_model", "")
|
||||
if not fallback_make:
|
||||
fallback_make = "gm"
|
||||
if not fallback_model:
|
||||
fallback_model = "CHEVROLET_BOLT_ACC_2022_2023"
|
||||
fallback_make = starpilot_toggles.get("car_make") or self.params.get("CarMake", encoding="utf-8") or "gm"
|
||||
fallback_model = starpilot_toggles.get("car_model") or self.params.get("CarModel", encoding="utf-8") or "CHEVROLET_BOLT_ACC_2022_2023"
|
||||
|
||||
self.car_state.hasModeStarButtons = self.car_state.isHKGCanFd
|
||||
self.car_state.hasPedal = starpilot_toggles.get("has_pedal", True)
|
||||
|
||||
Reference in New Issue
Block a user