diff --git a/source/TitleState.hx b/source/TitleState.hx index 13fa1bd06..84b6b9269 100644 --- a/source/TitleState.hx +++ b/source/TitleState.hx @@ -20,8 +20,6 @@ import lime.app.Application; import lime.ui.Window; import openfl.Assets; import shaderslmfao.ColorSwap; -import sys.FileSystem; -import sys.io.File; import ui.PreferencesMenu; using StringTools; @@ -30,6 +28,8 @@ using StringTools; import Discord.DiscordClient; #end #if desktop +import sys.FileSystem; +import sys.io.File; import sys.thread.Thread; #end diff --git a/source/ui/PreferencesMenu.hx b/source/ui/PreferencesMenu.hx index d843b7d88..30d11e1c7 100644 --- a/source/ui/PreferencesMenu.hx +++ b/source/ui/PreferencesMenu.hx @@ -57,6 +57,12 @@ class PreferencesMenu extends ui.OptionsState.Page return preferences.get(pref); } + // easy shorthand? + public static function setPref(pref:String, value:Dynamic):Void + { + preferences.set(pref, value); + } + public static function initPrefs():Void { preferenceCheck('censor-naughty', false); @@ -65,6 +71,12 @@ class PreferencesMenu extends ui.OptionsState.Page preferenceCheck('camera-zoom', true); preferenceCheck('fps-counter', true); preferenceCheck('auto-pause', false); + preferenceCheck('master-volume', 1); + + #if muted + setPref('master-volume', 0); + FlxG.sound.muted = true; + #end if (!getPref('fps-counter')) FlxG.stage.removeChild(Main.fpsCounter);