mirror of
https://github.com/D1GQ/BetterAmongUs.git
synced 2026-10-20 01:46:19 +00:00
Add touch support to favorite colors
This commit is contained in:
1 parent
84be9c4fcd
commit
cc45563640
1 file changed
+34
-12
@@ -113,24 +113,46 @@ internal static class PlayerTabPatch
|
||||
colorChip.Button.OnClick = new();
|
||||
colorChip.Button.OnClick.AddListener(() =>
|
||||
{
|
||||
// Shift+Click = toggle favorite
|
||||
if (Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift))
|
||||
if (ActiveInputManager.currentControlType == ActiveInputManager.InputType.Keyboard)
|
||||
{
|
||||
if (BAUConfigs.FavoriteColor.Value == index)
|
||||
// Shift+Click to toggle favorite
|
||||
if (Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift))
|
||||
{
|
||||
BAUConfigs.FavoriteColor.Value = -1; // Remove favorite
|
||||
}
|
||||
else
|
||||
{
|
||||
BAUConfigs.FavoriteColor.Value = index; // Set favorite
|
||||
if (BAUConfigs.FavoriteColor.Value == index)
|
||||
{
|
||||
BAUConfigs.FavoriteColor.Value = -1; // Remove favorite
|
||||
}
|
||||
else
|
||||
{
|
||||
BAUConfigs.FavoriteColor.Value = index; // Set favorite
|
||||
}
|
||||
|
||||
UpdateFavorite();
|
||||
return;
|
||||
}
|
||||
|
||||
UpdateFavorite();
|
||||
return;
|
||||
playerTab.ClickEquip();
|
||||
}
|
||||
else
|
||||
{
|
||||
// Click Color to toggle favorite if color is already taken
|
||||
if (DataManager.Player.Customization.Color == index || !playerTab.AvailableColors.Contains(index))
|
||||
{
|
||||
if (BAUConfigs.FavoriteColor.Value == index)
|
||||
{
|
||||
BAUConfigs.FavoriteColor.Value = -1; // Remove favorite
|
||||
}
|
||||
else
|
||||
{
|
||||
BAUConfigs.FavoriteColor.Value = index; // Set favorite
|
||||
}
|
||||
|
||||
// Normal click = equip color
|
||||
playerTab.ClickEquip();
|
||||
UpdateFavorite();
|
||||
return;
|
||||
}
|
||||
|
||||
playerTab.SelectColor(index);
|
||||
}
|
||||
});
|
||||
|
||||
// Add favorite star indicator
|
||||
|
||||
Reference in new issue
Block a user