diff --git a/CommunityBugFixCollection/CommunityBugFixCollection.csproj b/CommunityBugFixCollection/CommunityBugFixCollection.csproj index e2e71a6..f0359fc 100644 --- a/CommunityBugFixCollection/CommunityBugFixCollection.csproj +++ b/CommunityBugFixCollection/CommunityBugFixCollection.csproj @@ -44,5 +44,7 @@ + + diff --git a/CommunityBugFixCollection/HighlightHomeWorldInInventory.cs b/CommunityBugFixCollection/HighlightHomeWorldInInventory.cs new file mode 100644 index 0000000..ac4a6bb --- /dev/null +++ b/CommunityBugFixCollection/HighlightHomeWorldInInventory.cs @@ -0,0 +1,29 @@ +using FrooxEngine; +using HarmonyLib; +using MonkeyLoader.Resonite; +using SkyFrost.Base; +using System; +using System.Collections.Generic; +using System.Text; + +namespace CommunityBugFixCollection +{ + [HarmonyPatchCategory(nameof(HighlightHomeWorldInInventory))] + [HarmonyPatch(typeof(InventoryBrowser), nameof(InventoryBrowser.ProcessItem))] + internal sealed class HighlightHomeWorldInInventory : ResoniteMonkey + { + public override bool CanBeDisabled => true; + + private static void Postfix(InventoryBrowser __instance, InventoryItemUI item) + { + if (InventoryBrowser.ClassifyItem(item) != InventoryBrowser.SpecialItemType.World + || __instance.GetItemWorldUri(item) != __instance.Engine.Cloud.Profile.GetCurrentFavorite(FavoriteEntity.Home)) + return; + + item.NormalColor.Value = InventoryBrowser.FAVORITE_COLOR; + item.SelectedColor.Value = InventoryBrowser.FAVORITE_COLOR.MulRGB(2f); + } + + private static bool Prepare() => Enabled; + } +} \ No newline at end of file