This repository has been archived by the owner on May 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ddb6a51
commit 0cf4f1c
Showing
4 changed files
with
295 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio 15 | ||
VisualStudioVersion = 15.0.28307.1062 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UniversalFavsExporter", "UniversalFavsExporter\UniversalFavsExporter.csproj", "{3828BDA0-0525-439D-B0EC-34FFA58130BF}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{3828BDA0-0525-439D-B0EC-34FFA58130BF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{3828BDA0-0525-439D-B0EC-34FFA58130BF}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{3828BDA0-0525-439D-B0EC-34FFA58130BF}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{3828BDA0-0525-439D-B0EC-34FFA58130BF}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {D3BA3258-45FA-4E36-AE07-9F8F9B4884D7} | ||
EndGlobalSection | ||
EndGlobal |
129 changes: 129 additions & 0 deletions
129
UniversalFavsExporter/UniversalFavsExporter/FavsExporterByPlague.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
using System; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using MelonLoader; | ||
using Newtonsoft.Json; | ||
using UIExpansionKit.API; | ||
using UnhollowerRuntimeLib; | ||
using UnityEngine; | ||
using UnityEngine.Events; | ||
using UnityEngine.UI; | ||
|
||
[assembly: MelonInfo(typeof(UniversalFavsExporter.FavsExporterByPlague), "Universal Favs Exporter", "1.0", "Plague")] | ||
[assembly: MelonGame("VRChat", "VRChat")] | ||
|
||
namespace UniversalFavsExporter | ||
{ | ||
public class FavsExporterByPlague : MelonMod | ||
{ | ||
public override void VRChat_OnUiManagerInit() | ||
{ | ||
MelonCoroutines.Start(DelayedUIInit()); | ||
} | ||
|
||
public IEnumerator DelayedUIInit() | ||
{ | ||
//Get All Fav Lists | ||
var AvatarFavsArea = | ||
GameObject.Find("UserInterface/MenuContent/Screens/Avatar/Vertical Scroll View/Viewport/Content/"); | ||
|
||
while (AvatarFavsArea == null || !AvatarFavsArea.active) | ||
{ | ||
yield return new WaitForSeconds(1f); | ||
|
||
AvatarFavsArea = GameObject.Find("UserInterface/MenuContent/Screens/Avatar/Vertical Scroll View/Viewport/Content/"); | ||
} | ||
|
||
for (var i = 0; i < AvatarFavsArea.transform.childCount; i++) | ||
{ | ||
var Child = AvatarFavsArea.transform.GetChild(i); | ||
|
||
if (Child.GetComponent<UiAvatarList>() != null) // Is A Avi List | ||
{ | ||
//Make Button | ||
var Dupe = UnityEngine.Object.Instantiate(GameObject.Find("UserInterface/MenuContent/Screens/Avatar/Change Button"), Child.transform); | ||
|
||
Dupe.transform.localPosition = new Vector3(-125f, 219f, 0f); | ||
Dupe.GetComponentInChildren<Text>(true).text = "Export"; | ||
Dupe.GetComponent<RectTransform>().sizeDelta = new Vector2(150f, 80f); | ||
Dupe.GetComponent<Button>().onClick = new Button.ButtonClickedEvent(); | ||
Dupe.GetComponent<Button>().onClick.AddListener(DelegateSupport.ConvertDelegate<UnityAction>( | ||
new Action(() => | ||
{ | ||
var FavsInList = Child.GetComponentsInChildren<VRCUiContentButton>(true).Select(o => o.field_Public_String_0).Where(p => p != null); | ||
|
||
var Json = JsonConvert.SerializeObject(FavsInList); | ||
|
||
if (!Directory.Exists(Environment.CurrentDirectory + "\\ExportedFavs")) | ||
{ | ||
Directory.CreateDirectory(Environment.CurrentDirectory + "\\ExportedFavs"); | ||
} | ||
|
||
var FilePath = Environment.CurrentDirectory + "\\ExportedFavs\\" + | ||
Child.Find("Button/TitleText").GetComponent<Text>().text + ".json"; | ||
|
||
File.WriteAllText(FilePath, Json); | ||
|
||
ChillOkayPopup("Alert", "Your Fav List Was Exported To: " + FilePath + "\n\nYou Can Move It To " + Environment.CurrentDirectory + "\\UserData\\FavCatImport\\ To Import The Fav List Into Plague's Modpack.", PopupType.FullScreen); | ||
}))); | ||
|
||
//Fix Collapsing Issue | ||
var CollapseButton = | ||
GameObject.Find( | ||
"UserInterface/MenuContent/Screens/Avatar/Vertical Scroll View/Viewport/Content/Personal Avatar List/Button/"); | ||
|
||
CollapseButton.GetComponent<Button>().onClick.AddListener(DelegateSupport.ConvertDelegate<UnityAction>( | ||
new Action(() => | ||
{ | ||
//This Should Run AFTER The Original, So It Should Be Opposite. | ||
Dupe.transform.localPosition = CollapseButton.transform.Find("ToggleIcon").GetComponent<Image>().activeSprite.name == | ||
"collapsebutton" ? new Vector3(-125f, 219f, 0f) : new Vector3(-125f, 114f, 0f); | ||
}))); | ||
} | ||
} | ||
|
||
MelonLogger.Msg("Init!"); | ||
|
||
yield break; | ||
} | ||
|
||
internal enum PopupType | ||
{ | ||
FullScreen, | ||
QuickMenu | ||
} | ||
|
||
internal static void ChillOkayPopup(string Title, string Content, PopupType type, string OkayText = "Okay", Action OkayAction = null) | ||
{ | ||
ICustomShowableLayoutedMenu Popup = null; | ||
|
||
if (type == PopupType.FullScreen) | ||
{ | ||
Popup = ExpansionKitApi.CreateCustomFullMenuPopup(LayoutDescription.WideSlimList); | ||
} | ||
else | ||
{ | ||
Popup = ExpansionKitApi.CreateCustomQuickMenuPage(LayoutDescription.WideSlimList); | ||
} | ||
|
||
Popup.AddSimpleButton(Title, delegate () { }); | ||
Popup.AddLabel(Content); | ||
Popup.AddSpacer(); | ||
Popup.AddSpacer(); | ||
Popup.AddSpacer(); | ||
Popup.AddSpacer(); | ||
Popup.AddSpacer(); | ||
Popup.AddSimpleButton(OkayText, () => | ||
{ | ||
Popup.Hide(); | ||
OkayAction?.Invoke(); | ||
}); | ||
|
||
Popup.Show(); | ||
} | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
UniversalFavsExporter/UniversalFavsExporter/Properties/AssemblyInfo.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using System.Reflection; | ||
using System.Runtime.CompilerServices; | ||
using System.Runtime.InteropServices; | ||
|
||
// General Information about an assembly is controlled through the following | ||
// set of attributes. Change these attribute values to modify the information | ||
// associated with an assembly. | ||
[assembly: AssemblyTitle("UniversalFavsExporter")] | ||
[assembly: AssemblyDescription("")] | ||
[assembly: AssemblyConfiguration("")] | ||
[assembly: AssemblyCompany("")] | ||
[assembly: AssemblyProduct("UniversalFavsExporter")] | ||
[assembly: AssemblyCopyright("Copyright © 2021")] | ||
[assembly: AssemblyTrademark("")] | ||
[assembly: AssemblyCulture("")] | ||
|
||
// Setting ComVisible to false makes the types in this assembly not visible | ||
// to COM components. If you need to access a type in this assembly from | ||
// COM, set the ComVisible attribute to true on that type. | ||
[assembly: ComVisible(false)] | ||
|
||
// The following GUID is for the ID of the typelib if this project is exposed to COM | ||
[assembly: Guid("3828bda0-0525-439d-b0ec-34ffa58130bf")] | ||
|
||
// Version information for an assembly consists of the following four values: | ||
// | ||
// Major Version | ||
// Minor Version | ||
// Build Number | ||
// Revision | ||
// | ||
// You can specify all the values or you can default the Build and Revision Numbers | ||
// by using the '*' as shown below: | ||
// [assembly: AssemblyVersion("1.0.*")] | ||
[assembly: AssemblyVersion("1.0.0.0")] | ||
[assembly: AssemblyFileVersion("1.0.0.0")] |
105 changes: 105 additions & 0 deletions
105
UniversalFavsExporter/UniversalFavsExporter/UniversalFavsExporter.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProjectGuid>{3828BDA0-0525-439D-B0EC-34FFA58130BF}</ProjectGuid> | ||
<OutputType>Library</OutputType> | ||
<AppDesignerFolder>Properties</AppDesignerFolder> | ||
<RootNamespace>UniversalFavsExporter</RootNamespace> | ||
<AssemblyName>UniversalFavsExporter</AssemblyName> | ||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion> | ||
<FileAlignment>512</FileAlignment> | ||
<Deterministic>true</Deterministic> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>bin\Debug\</OutputPath> | ||
<DefineConstants>DEBUG;TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<DebugType>pdbonly</DebugType> | ||
<Optimize>true</Optimize> | ||
<OutputPath>bin\Release\</OutputPath> | ||
<DefineConstants>TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="Assembly-CSharp"> | ||
<HintPath>G:\Games\SteamLibrary\steamapps\common\VRChat\MelonLoader\Managed\Assembly-CSharp.dll</HintPath> | ||
<Private>False</Private> | ||
</Reference> | ||
<Reference Include="Assembly-CSharp-firstpass"> | ||
<HintPath>G:\Games\SteamLibrary\steamapps\common\VRChat\MelonLoader\Managed\Assembly-CSharp-firstpass.dll</HintPath> | ||
<Private>False</Private> | ||
</Reference> | ||
<Reference Include="Il2Cppmscorlib"> | ||
<HintPath>G:\Games\SteamLibrary\steamapps\common\VRChat\MelonLoader\Managed\Il2Cppmscorlib.dll</HintPath> | ||
<Private>False</Private> | ||
</Reference> | ||
<Reference Include="ModpackLoader"> | ||
<HintPath>G:\Games\SteamLibrary\steamapps\common\VRChat\MelonLoader\ModpackLoader.dll</HintPath> | ||
<Private>False</Private> | ||
</Reference> | ||
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> | ||
<SpecificVersion>False</SpecificVersion> | ||
<HintPath>G:\Games\SteamLibrary\steamapps\common\VRChat\MelonLoader\Managed\Newtonsoft.Json.dll</HintPath> | ||
<Private>False</Private> | ||
</Reference> | ||
<Reference Include="System" /> | ||
<Reference Include="System.Core" /> | ||
<Reference Include="System.Xml.Linq" /> | ||
<Reference Include="System.Data.DataSetExtensions" /> | ||
<Reference Include="Microsoft.CSharp" /> | ||
<Reference Include="System.Data" /> | ||
<Reference Include="System.Net.Http" /> | ||
<Reference Include="System.Xml" /> | ||
<Reference Include="UIExpansionKit"> | ||
<HintPath>G:\Games\SteamLibrary\steamapps\common\VRChat\Mods\UIExpansionKit.dll</HintPath> | ||
<Private>False</Private> | ||
</Reference> | ||
<Reference Include="UnhollowerBaseLib"> | ||
<HintPath>G:\Games\SteamLibrary\steamapps\common\VRChat\MelonLoader\Managed\UnhollowerBaseLib.dll</HintPath> | ||
<Private>False</Private> | ||
</Reference> | ||
<Reference Include="UnityEngine"> | ||
<HintPath>G:\Games\SteamLibrary\steamapps\common\VRChat\MelonLoader\Managed\UnityEngine.dll</HintPath> | ||
<Private>False</Private> | ||
</Reference> | ||
<Reference Include="UnityEngine.CoreModule"> | ||
<HintPath>G:\Games\SteamLibrary\steamapps\common\VRChat\MelonLoader\Managed\UnityEngine.CoreModule.dll</HintPath> | ||
<Private>False</Private> | ||
</Reference> | ||
<Reference Include="UnityEngine.UI"> | ||
<HintPath>G:\Games\SteamLibrary\steamapps\common\VRChat\MelonLoader\Managed\UnityEngine.UI.dll</HintPath> | ||
<Private>False</Private> | ||
</Reference> | ||
<Reference Include="UnityEngine.UIElementsModule"> | ||
<HintPath>G:\Games\SteamLibrary\steamapps\common\VRChat\MelonLoader\Managed\UnityEngine.UIElementsModule.dll</HintPath> | ||
<Private>False</Private> | ||
</Reference> | ||
<Reference Include="UnityEngine.UIModule"> | ||
<HintPath>G:\Games\SteamLibrary\steamapps\common\VRChat\MelonLoader\Managed\UnityEngine.UIModule.dll</HintPath> | ||
<Private>False</Private> | ||
</Reference> | ||
<Reference Include="VRCCore-Editor"> | ||
<HintPath>G:\Games\SteamLibrary\steamapps\common\VRChat\MelonLoader\Managed\VRCCore-Editor.dll</HintPath> | ||
<Private>False</Private> | ||
</Reference> | ||
<Reference Include="VRCCore-Standalone"> | ||
<HintPath>G:\Games\SteamLibrary\steamapps\common\VRChat\MelonLoader\Managed\VRCCore-Standalone.dll</HintPath> | ||
<Private>False</Private> | ||
</Reference> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="FavsExporterByPlague.cs" /> | ||
<Compile Include="Properties\AssemblyInfo.cs" /> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | ||
</Project> |