Update PreferencesMenu.hx

This commit is contained in:
AwesomezPro99
2025-08-02 11:10:03 +03:00
committed by Mihai Alexandru
parent 0d6bc2bedd
commit 3d88fbb11f
+3 -2
View File
@@ -65,7 +65,6 @@ class PreferencesMenu extends Page<OptionsState.OptionsMenuPageName>
createPrefDescription(); createPrefDescription();
camFollow = new FlxObject(FlxG.width / 2, 0, 140, 70); camFollow = new FlxObject(FlxG.width / 2, 0, 140, 70);
if (items != null) camFollow.y = items.selectedItem.y;
menuCamera.follow(camFollow, null, 0.085); menuCamera.follow(camFollow, null, 0.085);
var margin = 160; var margin = 160;
@@ -73,7 +72,6 @@ class PreferencesMenu extends Page<OptionsState.OptionsMenuPageName>
menuCamera.minScrollY = 0; menuCamera.minScrollY = 0;
items.onChange.add(function(selected) { items.onChange.add(function(selected) {
camFollow.y = selected.y;
itemDesc.text = preferenceDesc[items.selectedIndex]; itemDesc.text = preferenceDesc[items.selectedIndex];
}); });
@@ -204,6 +202,9 @@ class PreferencesMenu extends Page<OptionsState.OptionsMenuPageName>
{ {
super.update(elapsed); super.update(elapsed);
// Positions the camera to the selected item.
if (items != null) camFollow.y = items.selectedItem.y;
// Indent the selected item. // Indent the selected item.
items.forEach(function(daItem:TextMenuItem) { items.forEach(function(daItem:TextMenuItem) {
var thyOffset:Int = 0; var thyOffset:Int = 0;