Skip to content
This repository has been archived by the owner on Nov 19, 2021. It is now read-only.

Commit

Permalink
Merge branch 'main' of https://github.com/loukylor/VRC-Mods into main
Browse files Browse the repository at this point in the history
  • Loading branch information
loukylor committed Aug 16, 2021
2 parents 9204028 + de852f8 commit ce9c721
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions PlayerList/Config/PlayerListConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public static class PlayerListConfig

public static EntryWrapper<PlayerEntry.DisplayNameColorMode> displayNameColorMode;

public static EntryWrapper<bool> freezeSortWhenVisible;
public static EntryWrapper<bool> reverseBaseSort;
public static EntryWrapper<EntrySortManager.SortType> currentBaseSort;
public static EntryWrapper<bool> reverseUpperSort;
Expand Down Expand Up @@ -67,6 +68,7 @@ public static void RegisterSettings()
displayNameToggle = CreateEntry(nameof(displayNameToggle), true, is_hidden: true);
displayNameColorMode = CreateEntry(nameof(displayNameColorMode), PlayerEntry.DisplayNameColorMode.TrustAndFriends, is_hidden: true);

freezeSortWhenVisible = CreateEntry(nameof(freezeSortWhenVisible), false, is_hidden: true);
reverseBaseSort = CreateEntry(nameof(reverseBaseSort), false, is_hidden: true);
currentBaseSort = CreateEntry(nameof(currentBaseSort), EntrySortManager.SortType.None, is_hidden: true);
reverseUpperSort = CreateEntry(nameof(reverseUpperSort), false, is_hidden: true);
Expand Down
4 changes: 3 additions & 1 deletion PlayerList/EntrySortManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,9 @@ public static void SortAllPlayers() // This only runs when sort type is changed
}
public static void SortPlayer(PlayerLeftPairEntry sortEntry)
{
if (IsSortTypeInAllUses(SortType.None) || (PlayerListConfig.showSelfAtTop.Value && sortEntry.playerEntry.isSelf))
if (IsSortTypeInAllUses(SortType.None) ||
(PlayerListConfig.showSelfAtTop.Value && sortEntry.playerEntry.isSelf) ||
(PlayerListConfig.freezeSortWhenVisible.Value && MenuManager.playerList.active))
return;

// This method is good like 0.2ms
Expand Down
1 change: 1 addition & 0 deletions PlayerList/MenuManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ public static void CreateSubMenus()
new ToggleButton(playerListMenus[2].gameObject, new Vector3(2, 1), "Reverse Upper", "Disabled", new Action<bool>((state) => PlayerListConfig.reverseUpperSort.Value = state), "Toggle reverse order of upper sort", "Toggle reverse order of upper sort", "UpperReverseToggle", PlayerListConfig.reverseUpperSort.Value, true);
new ToggleButton(playerListMenus[2].gameObject, new Vector3(3, 1), "Reverse Highest", "Disabled", new Action<bool>((state) => PlayerListConfig.reverseHighestSort.Value = state), "Toggle reverse order of upper sort", "Toggle reverse order of upper sort", "HighestReverseToggle", PlayerListConfig.reverseHighestSort.Value, true);
new ToggleButton(playerListMenus[2].gameObject, new Vector3(1, 2), "Show Self On Top", "Disabled", new Action<bool>((state) => PlayerListConfig.showSelfAtTop.Value = state), "Show the local player on top of the list always", "Show the local player on top of the list always", "ShowSelfOnTopToggle", PlayerListConfig.showSelfAtTop.Value, true);
new ToggleButton(playerListMenus[2].gameObject, new Vector3(2, 2), "Freeze sort when visible", "Disabled", new Action<bool>((state) => PlayerListConfig.freezeSortWhenVisible.Value = state), "Freeze sorting while the list is visible", "Freeze sorting while the list is visible", "FreezeSortWhenVisibleToggle", PlayerListConfig.freezeSortWhenVisible.Value, true);

// Initialize PlayerList Customization menu
playerListMenus.Add(new SubMenu("UserInterface/QuickMenu", "PlayerListMenuPage4"));
Expand Down

0 comments on commit ce9c721

Please sign in to comment.