From 24b5d7c6e7c7f17ec09ddb3de2127c092aa6f874 Mon Sep 17 00:00:00 2001 From: frank Date: Sat, 3 Dec 2022 12:43:16 -0500 Subject: [PATCH] option to disable auto audio load --- pgfw/Audio.py | 5 +++-- pgfw/Configuration.py | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pgfw/Audio.py b/pgfw/Audio.py index 6728400..cc129ed 100644 --- a/pgfw/Audio.py +++ b/pgfw/Audio.py @@ -27,9 +27,10 @@ class Audio(Animation): self.audio_panel = None self.subscribe(self.respond) self.sfx = {} - self.load_sfx() self.bgm = {} - self.load_bgm() + if self.get_configuration("audio", "auto-load"): + self.load_sfx() + self.load_bgm() self.set_volume(self.get_configuration("audio", "volume")) def set_volume(self, volume=None, increment=None, mute=False, unmute=False): diff --git a/pgfw/Configuration.py b/pgfw/Configuration.py index 20865a0..5364395 100644 --- a/pgfw/Configuration.py +++ b/pgfw/Configuration.py @@ -157,6 +157,7 @@ class Configuration(RawConfigParser): set_option(section, "volume", "1.0", False) set_option(section, "panel-enabled", "no", False) set_option(section, "panel-font", None, False) + set_option(section, "auto-load", "yes", False) section = "interpolator-gui" add_section(section) set_option(section, "margin", "80", False) @@ -455,7 +456,7 @@ class TypeDeclarations(dict): "float": ["sfx-volume", "bgm-volume", "volume"], - "bool": "panel-enabled" + "bool": ["panel-enabled", "auto-load"] },