Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: select character arrow visibility #2616

Merged
merged 4 commits into from
Feb 22, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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();
}
}
}
Loading