mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-10-28 00:53:45 +08:00
Trick or Treat
This commit is contained in:
@@ -16,7 +16,7 @@ from openpilot.common.swaglog import cloudlog
|
||||
from openpilot.system import micd
|
||||
from openpilot.system.hardware import HARDWARE
|
||||
|
||||
from openpilot.starpilot.common.starpilot_variables import ACTIVE_THEME_PATH, ERROR_LOGS_PATH, RANDOM_EVENTS_PATH, get_starpilot_toggles
|
||||
from openpilot.starpilot.common.starpilot_variables import ERROR_LOGS_PATH, RANDOM_EVENTS_PATH, get_starpilot_toggles
|
||||
from openpilot.starpilot.system.bluetooth.audio import BluetoothAudioSink
|
||||
|
||||
SAMPLE_RATE = 48000
|
||||
@@ -539,10 +539,7 @@ class Soundd:
|
||||
if sound not in self.volume_map:
|
||||
self.volume_map[sound] = 1.01
|
||||
|
||||
if self.starpilot_toggles.sound_pack != "stock":
|
||||
self.sound_directory = ACTIVE_THEME_PATH / "sounds"
|
||||
else:
|
||||
self.sound_directory = Path(BASEDIR) / "selfdrive" / "assets" / "sounds"
|
||||
self.sound_directory = Path(BASEDIR) / "selfdrive" / "assets" / "sounds"
|
||||
|
||||
sound_source_signature = self.get_sound_source_signature()
|
||||
should_reload = self.starpilot_toggles.sound_pack != self.previous_sound_pack
|
||||
|
||||
@@ -584,7 +584,7 @@ class ThemeManager:
|
||||
"color_scheme": ("colors", self.holiday_theme),
|
||||
"distance_icons": ("distance_icons", self.holiday_theme),
|
||||
"icon_pack": ("icons", self.holiday_theme),
|
||||
"sound_pack": ("sounds", self.holiday_theme),
|
||||
"sound_pack": ("sounds", "stock"),
|
||||
"turn_signal_pack": ("signals", self.holiday_theme),
|
||||
"wheel_image": ("wheel_image", self.holiday_theme)
|
||||
}
|
||||
@@ -601,7 +601,7 @@ class ThemeManager:
|
||||
"color_scheme": ("colors", selected_theme.replace("-animated", "")),
|
||||
"distance_icons": ("distance_icons", self.randomize_distance_icons(available_themes, selected_theme.replace("-animated", ""))),
|
||||
"icon_pack": ("icons", selected_theme),
|
||||
"sound_pack": ("sounds", selected_theme.replace("-animated", "")),
|
||||
"sound_pack": ("sounds", "stock"),
|
||||
"turn_signal_pack": ("signals", selected_theme.replace("-animated", "")),
|
||||
"wheel_image": ("wheel_image", self.randomize_wheel_image(available_themes, selected_theme.replace("-animated", "")))
|
||||
}
|
||||
@@ -611,7 +611,7 @@ class ThemeManager:
|
||||
"color_scheme": ("colors", starpilot_toggles.color_scheme),
|
||||
"distance_icons": ("distance_icons", starpilot_toggles.distance_icons),
|
||||
"icon_pack": ("icons", starpilot_toggles.icon_pack),
|
||||
"sound_pack": ("sounds", starpilot_toggles.sound_pack),
|
||||
"sound_pack": ("sounds", "stock"),
|
||||
"turn_signal_pack": ("signals", starpilot_toggles.signal_icons),
|
||||
"wheel_image": ("wheel_image", starpilot_toggles.wheel_image)
|
||||
}
|
||||
@@ -646,7 +646,10 @@ class ThemeManager:
|
||||
def update_theme_asset(self, asset_type, theme, boot_run=False):
|
||||
save_location = ACTIVE_THEME_PATH / asset_type
|
||||
|
||||
if self.holiday_theme != "stock":
|
||||
if asset_type == "sounds":
|
||||
theme = "stock"
|
||||
asset_location = STOCKOP_THEME_PATH / asset_type
|
||||
elif self.holiday_theme != "stock":
|
||||
asset_location = HOLIDAY_THEME_PATH / self.holiday_theme / asset_type
|
||||
elif theme in HOLIDAY_SLUGS:
|
||||
asset_location = HOLIDAY_THEME_PATH / theme / asset_type
|
||||
|
||||
@@ -995,7 +995,7 @@ class StarPilotVariables:
|
||||
toggle.distance_icons = self.get_value("DistanceIconPack", cast=None, condition=custom_themes, default="stock")
|
||||
toggle.icon_pack = self.get_value("IconPack", cast=None, condition=custom_themes, default="stock")
|
||||
toggle.signal_icons = self.get_value("SignalAnimation", cast=None, condition=custom_themes, default="stock")
|
||||
toggle.sound_pack = self.get_value("SoundPack", cast=None, condition=custom_themes, default="stock")
|
||||
toggle.sound_pack = "stock"
|
||||
toggle.random_themes = self.get_value("RandomThemes", condition=custom_themes)
|
||||
toggle.random_themes_holidays = self.get_value("RandomThemesHolidays", condition=toggle.random_themes)
|
||||
if toggle.random_themes:
|
||||
@@ -1176,7 +1176,6 @@ class StarPilotVariables:
|
||||
toggle.distance_icons = toggle.current_holiday_theme
|
||||
toggle.icon_pack = toggle.current_holiday_theme
|
||||
toggle.signal_icons = toggle.current_holiday_theme
|
||||
toggle.sound_pack = toggle.current_holiday_theme
|
||||
toggle.wheel_image = toggle.current_holiday_theme
|
||||
|
||||
toggle.lane_changes = self.get_value("LaneChanges")
|
||||
|
||||
Reference in New Issue
Block a user