mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-08 07:02:06 +08:00
pedals in galaxy
This commit is contained in:
@@ -1903,8 +1903,25 @@
|
||||
"description": "On-screen gas and brake indicators.\n\nDynamic: Opacity changes according to how much openpilot is accelerating or braking\nStatic: Full when active, dim when not",
|
||||
"data_type": "bool",
|
||||
"ui_type": "toggle",
|
||||
"is_parent_toggle": true,
|
||||
"parent_key": "CustomUI"
|
||||
},
|
||||
{
|
||||
"key": "DynamicPedalsOnUI",
|
||||
"label": "Dynamic",
|
||||
"description": "Fade the gas and brake indicators based on how much openpilot is accelerating or braking.",
|
||||
"data_type": "bool",
|
||||
"ui_type": "toggle",
|
||||
"parent_key": "PedalsOnUI"
|
||||
},
|
||||
{
|
||||
"key": "StaticPedalsOnUI",
|
||||
"label": "Static",
|
||||
"description": "Show full-strength gas and brake indicators when active, and dim them when inactive.",
|
||||
"data_type": "bool",
|
||||
"ui_type": "toggle",
|
||||
"parent_key": "PedalsOnUI"
|
||||
},
|
||||
{
|
||||
"key": "RotatingWheel",
|
||||
"label": "Rotating Steering Wheel",
|
||||
|
||||
@@ -4004,6 +4004,22 @@ def setup(app):
|
||||
"updated": updated,
|
||||
}), 200
|
||||
|
||||
if key in {"DynamicPedalsOnUI", "StaticPedalsOnUI"}:
|
||||
enabled = str_val.strip() in ("1", "true", "True")
|
||||
params.put_bool(key, enabled)
|
||||
|
||||
updated = {key: enabled}
|
||||
if enabled:
|
||||
other_key = "StaticPedalsOnUI" if key == "DynamicPedalsOnUI" else "DynamicPedalsOnUI"
|
||||
params.put_bool(other_key, False)
|
||||
updated[other_key] = False
|
||||
|
||||
update_starpilot_toggles()
|
||||
return jsonify({
|
||||
"message": f"Parameter '{key}' updated successfully.",
|
||||
"updated": updated,
|
||||
}), 200
|
||||
|
||||
if key in {"ConditionalExperimental", "ConditionalChill"}:
|
||||
enabled = str_val.strip() in ("1", "true", "True")
|
||||
params.put_bool(key, enabled)
|
||||
|
||||
Reference in New Issue
Block a user