summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/sliceitoff/settings/settings.py6
-rw-r--r--src/sliceitoff/sfx/sfx.py3
2 files changed, 6 insertions, 3 deletions
diff --git a/src/sliceitoff/settings/settings.py b/src/sliceitoff/settings/settings.py
index 19cca7d..2d4b28f 100644
--- a/src/sliceitoff/settings/settings.py
+++ b/src/sliceitoff/settings/settings.py
@@ -3,12 +3,14 @@ import os
from pathlib import Path
from .static import DEFAULT_SETTINGS
+TEST_CONFIG_FILE = os.getenv("TEST_CONFIG_FILE")
+
class Settings:
""" Handles loading and saving settings from config file"""
def __init__(self, filename = None):
self.settings=[]
- if filename:
- self.config_filename = filename
+ if TEST_CONFIG_FILE:
+ self.config_filename = Path(TEST_CONFIG_FILE)
else:
if os.name == 'nt':
self.config_filename = (Path.home().resolve()
diff --git a/src/sliceitoff/sfx/sfx.py b/src/sliceitoff/sfx/sfx.py
index 8f3371e..a72df0b 100644
--- a/src/sliceitoff/sfx/sfx.py
+++ b/src/sliceitoff/sfx/sfx.py
@@ -52,7 +52,8 @@ class Sfx:
self.music_volume += 1
self.music_volume %= 11
settings.replace_value("music_volume", self.music_volume)
- self.sound[self.bgm].set_volume(self.music_volume / 10)
+ if self.bgm:
+ self.sound[self.bgm].set_volume(self.music_volume / 10)
def play(self, sample):
""" Just plays named sample loaded from assets directory """