diff --git a/source/funkin/ui/options/PreferencesMenu.hx b/source/funkin/ui/options/PreferencesMenu.hx index 75bc0fdb3..4e9e0bca8 100644 --- a/source/funkin/ui/options/PreferencesMenu.hx +++ b/source/funkin/ui/options/PreferencesMenu.hx @@ -124,12 +124,15 @@ class PreferencesMenu extends Page for (pref in prefs) { - pref.x = 0; if (pref.ID == curSelected) { - pref.x = 30; + pref.onSelect(true); camFollow.y = pref.y; } + else + { + pref.onSelect(false); + } } } @@ -159,6 +162,8 @@ class PreferenceItem extends FlxTypedSpriteGroup public var description:String = ""; public function handleInput(elapsed:Float):Void {} + + public function onSelect(isSelected:Bool):Void {} } class NumberedPreferenceItem extends PreferenceItem @@ -239,10 +244,27 @@ class NumberedPreferenceItem extends PreferenceItem } } + var isSelected:Bool = false; + + public override function onSelect(isSelected:Bool):Void + { + this.isSelected = isSelected; + if (isSelected) + { + preferenceText.x = valueText.x + valueText.width + 60; + preferenceText.alpha = 1.0; + } + else + { + preferenceText.x = valueText.x + valueText.width + 30; + preferenceText.alpha = 0.6; + } + } + function updateText():Void { valueText.text = '$currentValue'; - preferenceText.x = valueText.x + valueText.width + 30; + preferenceText.x = valueText.x + valueText.width + (isSelected ? 60 : 30); } } @@ -309,4 +331,18 @@ class CheckboxPreferenceItem extends PreferenceItem }); } } + + public override function onSelect(isSelected:Bool):Void + { + if (isSelected) + { + preferenceText.x = 150; + preferenceText.alpha = 1.0; + } + else + { + preferenceText.alpha = 0.6; + preferenceText.x = 120; + } + } }