From c99297cc1443cbf41fc7fc53600c7e0856008b70 Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Tue, 6 Apr 2021 12:27:07 -0400 Subject: [PATCH] lol mute debug thing! --- source/TitleState.hx | 4 ++-- source/ui/PreferencesMenu.hx | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) 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);