diff --git a/ActionMenuApi/AMAPI.cs b/ActionMenuApi/AMAPI.cs index 5201623..5a97170 100644 --- a/ActionMenuApi/AMAPI.cs +++ b/ActionMenuApi/AMAPI.cs @@ -289,7 +289,7 @@ public static void AddModFolder(string text, Action openFunc, Texture2D icon = n AMAPI.AddSubMenuToSubMenu(text, openFunc, icon, null); }); } - + private static void AddPedalToList(ActionMenuPageType pageType, PedalStruct customPedal, Insertion insertion) { switch (pageType) diff --git a/ActionMenuApi/ActionMenuApi.csproj b/ActionMenuApi/ActionMenuApi.csproj index df48bed..3d378d7 100644 --- a/ActionMenuApi/ActionMenuApi.csproj +++ b/ActionMenuApi/ActionMenuApi.csproj @@ -57,6 +57,9 @@ ..\..\..\..\..\..\Programs\Software\SteamLibrary\steamapps\common\VRChat\MelonLoader\Managed\UnityEngine.dll + + ..\..\..\..\..\..\Programs\Software\SteamLibrary\steamapps\common\VRChat\MelonLoader\Managed\UnityEngine.AssetBundleModule.dll + ..\..\..\..\..\..\Programs\Software\SteamLibrary\steamapps\common\VRChat\MelonLoader\Managed\UnityEngine.CoreModule.dll @@ -96,6 +99,9 @@ + + + COPY "$(MSBuildProjectDirectory)\bin\ActionMenuApi.dll" "E:\Windows\Programs\Software\SteamLibrary\steamapps\common\VRChat\Mods" diff --git a/ActionMenuApi/ModMenu/ModsFolder.cs b/ActionMenuApi/ModMenu/ModsFolder.cs index 385f763..7740429 100644 --- a/ActionMenuApi/ModMenu/ModsFolder.cs +++ b/ActionMenuApi/ModMenu/ModsFolder.cs @@ -1,7 +1,10 @@ using System; using System.Collections.Generic; +using System.IO; +using System.Reflection; using ActionMenuApi.Pedals; using MelonLoader; +using UnhollowerRuntimeLib; using UnityEngine; namespace ActionMenuApi.ModMenu @@ -40,7 +43,19 @@ public void AddMainPageButton() public static void CreateInstance() { - if(instance == null) new ModsFolder("Mods", Texture2D.whiteTexture); //TEMP Texture //TODO: Swap to a different texture + if (instance != null) return; + AssetBundle iconsAssetBundle; + using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("ActionMenuApi.actionmenuapi.icons")) + using (var tempStream = new MemoryStream((int)stream.Length)) + { + stream.CopyTo(tempStream); + + iconsAssetBundle = AssetBundle.LoadFromMemory_Internal(tempStream.ToArray(), 0); + iconsAssetBundle.hideFlags |= HideFlags.DontUnloadUnusedAsset; + } + Texture2D modsSectionIcon = iconsAssetBundle.LoadAsset_Internal("Assets/ActionMenuApi/vrcmg.png", Il2CppType.Of()).Cast(); + modsSectionIcon.hideFlags |= HideFlags.DontUnloadUnusedAsset; + new ModsFolder("Mods", modsSectionIcon); //TEMP Texture //TODO: Swap to a different texture } } } \ No newline at end of file diff --git a/ActionMenuApi/actionmenuapi.icons b/ActionMenuApi/actionmenuapi.icons new file mode 100644 index 0000000..84fd053 Binary files /dev/null and b/ActionMenuApi/actionmenuapi.icons differ