Skip to content

Commit

Permalink
fix: select character arrow visibility (#2616)
Browse files Browse the repository at this point in the history
* fix: select character arrow visibility

* created ensure arrows visibility
  • Loading branch information
WeylonSantana authored Feb 22, 2025
1 parent 25cedf3 commit a682b84
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion Intersect.Client.Core/Interface/Menu/SelectCharacterWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ protected override void EnsureInitialized()
SizeToChildren(recursive: true);

LoadJsonUi(GameContentManager.UI.Menu, Graphics.Renderer?.GetResolutionString());
EnsureArrowsVisibility();
}

//Methods
Expand Down Expand Up @@ -340,6 +341,18 @@ public override void Show()
_selectedCharacterIndex = 0;
UpdateDisplay();
base.Show();
EnsureArrowsVisibility();
}

private void EnsureArrowsVisibility()
{
// in case the json load is changing the visibility of the arrows when it shouldn't
// lets ensure the right value
if (CharacterSelectionPreviews != default)
{
_selectCharacterRightButton.IsHidden = CharacterSelectionPreviews.Length <= 1;
_selectCharacterLeftButton.IsHidden = CharacterSelectionPreviews.Length <= 1;
}
}

private void _buttonLogout_Clicked(Base sender, MouseButtonState arguments)
Expand Down Expand Up @@ -435,4 +448,4 @@ public void ButtonPlay_Clicked(Base? sender, MouseButtonState? arguments)
_buttonDelete.Disable();
_buttonLogout.Disable();
}
}
}

0 comments on commit a682b84

Please sign in to comment.