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

Add leaderboard sorting for custom fields #380

Open
Muparadzi opened this issue Sep 20, 2024 · 0 comments
Open

Add leaderboard sorting for custom fields #380

Muparadzi opened this issue Sep 20, 2024 · 0 comments
Assignees
Labels
area/mod enhancement New feature or request

Comments

@Muparadzi
Copy link
Collaborator

Bannerlord uses something like this to allow sorting for kills. We should use a custom MissionScoreboardPlayerSortControllerVM to allow us to make custom sortable fields.

<StringBasedVisibilityWidget Id="KillSortWidget" WidthSizePolicy="StretchToParent" HeightSizePolicy="StretchToParent" FirstString="kill" SecondString="@HeaderID" VerticalAlignment="Center" MarginLeft="5">
  <Children>
    <SortButtonWidget DataSource="{PlayerSortController}" DoNotPassEventsToChildren="true" WidthSizePolicy="StretchToParent" HeightSizePolicy="StretchToParent" Command.Click="ExecuteSortByKill" IsSelected="@IsKillSelected" SortState="@KillState" SortVisualWidget="List\KillSortVisualWidget" UpdateChildrenStates="true" >
      <Children>
        <ListPanel UpdateChildrenStates="true" Id="List" WidthSizePolicy="StretchToParent" HeightSizePolicy="StretchToParent" StackLayout.LayoutMethod="HorizontalCentered">
          <Children>
            <TextWidget WidthSizePolicy="StretchToParent" HeightSizePolicy="StretchToParent" Brush="MPScoreboard.Sortable.TitleText" Text="@KillText" />
            <BrushWidget Id="KillSortVisualWidget" WidthSizePolicy="Fixed" HeightSizePolicy="Fixed" SuggestedWidth="9" SuggestedHeight="7" MarginRight="5" VerticalAlignment="Center" Brush="MPScoreboard.Sort.ArrowBrush"  />
          </Children>
        </ListPanel>
      </Children>
    </SortButtonWidget>
  </Children>
</StringBasedVisibilityWidget>
@Muparadzi Muparadzi added enhancement New feature or request area/mod labels Sep 20, 2024
@Muparadzi Muparadzi self-assigned this Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/mod enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant