Skip to content

Commit

Permalink
created ensure arrows visibility
Browse files Browse the repository at this point in the history
  • Loading branch information
WeylonSantana committed Feb 22, 2025
1 parent c9947b9 commit 2964c1a
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions Intersect.Client.Core/Interface/Menu/SelectCharacterWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -173,14 +173,7 @@ protected override void EnsureInitialized()
SizeToChildren(recursive: true);

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

// 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;
}
_ensureArrowsVisibility();
}

//Methods
Expand Down Expand Up @@ -348,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

0 comments on commit 2964c1a

Please sign in to comment.