diff --git a/.gitignore b/.gitignore index 4ce6fdd..ecd44a3 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,8 @@ ## files generated by popular Visual Studio add-ons. ## ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore +# Yes. +.idea # User-specific files *.rsuser diff --git a/CustomServersClient.sln b/CustomServersClient.sln index 2569723..8b34eda 100644 --- a/CustomServersClient.sln +++ b/CustomServersClient.sln @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.30320.27 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CustomServersClient", "CustomServersClient\CustomServersClient.csproj", "{8424C5D8-334F-4CAB-B3C8-4D7635283B7F}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CustomServersClient", "CustomServersClient\CustomServersClient.csproj", "{8424C5D8-334F-4CAB-B3C8-4D7635283B7F}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -13,14 +13,14 @@ Global Steam-Release|Any CPU = Steam-Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {8424C5D8-334F-4CAB-B3C8-4D7635283B7F}.Itch-Debug|Any CPU.ActiveCfg = Itch-Debug|Any CPU - {8424C5D8-334F-4CAB-B3C8-4D7635283B7F}.Itch-Debug|Any CPU.Build.0 = Itch-Debug|Any CPU + {8424C5D8-334F-4CAB-B3C8-4D7635283B7F}.Itch-Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8424C5D8-334F-4CAB-B3C8-4D7635283B7F}.Itch-Debug|Any CPU.Build.0 = Debug|Any CPU {8424C5D8-334F-4CAB-B3C8-4D7635283B7F}.Itch-Release|Any CPU.ActiveCfg = Itch-Release|Any CPU {8424C5D8-334F-4CAB-B3C8-4D7635283B7F}.Itch-Release|Any CPU.Build.0 = Itch-Release|Any CPU {8424C5D8-334F-4CAB-B3C8-4D7635283B7F}.Steam-Debug|Any CPU.ActiveCfg = Steam-Debug|Any CPU {8424C5D8-334F-4CAB-B3C8-4D7635283B7F}.Steam-Debug|Any CPU.Build.0 = Steam-Debug|Any CPU - {8424C5D8-334F-4CAB-B3C8-4D7635283B7F}.Steam-Release|Any CPU.ActiveCfg = Steam-Release|Any CPU - {8424C5D8-334F-4CAB-B3C8-4D7635283B7F}.Steam-Release|Any CPU.Build.0 = Steam-Release|Any CPU + {8424C5D8-334F-4CAB-B3C8-4D7635283B7F}.Steam-Release|Any CPU.ActiveCfg = Debug|Any CPU + {8424C5D8-334F-4CAB-B3C8-4D7635283B7F}.Steam-Release|Any CPU.Build.0 = Debug|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/CustomServersClient/CustomServersClient.csproj b/CustomServersClient/CustomServersClient.csproj index 0a44fdd..8964510 100644 --- a/CustomServersClient/CustomServersClient.csproj +++ b/CustomServersClient/CustomServersClient.csproj @@ -1,127 +1,34 @@ - - - + + - Debug - AnyCPU - {8424C5D8-334F-4CAB-B3C8-4D7635283B7F} - Library - Properties - CustomServersClient - CustomServersClient - v4.7.2 - 512 - true + netstandard2.1 + 1.3.0 + 2020.12.9s + NuclearPowered/Mappings:0.1.2 + + andruzzzhka - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - bin\Steam-Release\ - TRACE;STEAM - true - - - bin\Steam-Debug\ - DEBUG;TRACE;STEAM - - - bin\Itch-Release\ - TRACE;ITCH - true - AnyCPU - - - bin\Itch-Debug\ - TRACE;DEBUG;ITCH - - - - ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Among Us\BepInEx\unhollowed\Assembly-CSharp.dll - False - - - ..\..\..\..\..\..\Games\among-us-windows\AmongUs\BepInEx\unhollowed\Assembly-CSharp.dll - False - - - False - - - False - False - - - False - - - False - - - False - - - False - - - False - - - False - - - False - - - - - - - - - - - - - - - - - - Form - - - EditServerForm.cs - - - - Form - - - ServersManagementForm.cs - - - - - EditServerForm.cs - - - ServersManagementForm.cs - - - - \ No newline at end of file + + 2020.12.9s + $(DefineConstants);STEAM + + + + 2020.11.17i + $(DefineConstants);ITCH + + + + + + + + + + $(AmongUs)\mono\Managed\System.Windows.Forms.dll + + + + + + diff --git a/CustomServersClient/CustomServersPatches.cs b/CustomServersClient/CustomServersPatches.cs index e8cf64d..6223bcb 100644 --- a/CustomServersClient/CustomServersPatches.cs +++ b/CustomServersClient/CustomServersPatches.cs @@ -7,24 +7,6 @@ using UnhollowerBaseLib; using CustomServersClient.UI; -#if STEAM -using RegionMenu = CLIGCNHFBCO; -using RegionMenuButtonCallback = CLIGCNHFBCO.EEJIMLMHMGO; -using RegionInfo = OIBMKGDLGOG; -using ServerInfo = PLFDMKKDEMI; -using ServerManager = AOBNFCIHAJL; -using ObjectPoolBehavior = FJBFFDFFBFO; -using PassiveButton = HHMBANDDIOA; -#elif ITCH -using RegionMenu = KIPLKPEOBEO; -using RegionMenuButtonCallback = KIPLKPEOBEO.KKOJKDJKEIK; -using RegionInfo = KMFCKPLMGDK; -using ServerInfo = PIOPAJCMNDK; -using ServerManager = CJPEJFOJIOC; -using ObjectPoolBehavior = NKEKOACGIFD; -using PassiveButton = AJGGJOBLDCP; -#endif - namespace CustomServersClient { public static class CustomServersPatches @@ -110,26 +92,17 @@ public static void ClearOnClickAction(ObjectPoolBehavior buttonPool) } - [HarmonyPatch(typeof(RegionMenuButtonCallback), nameof(RegionMenuButtonCallback.Method_Internal_Void_0))] + [HarmonyPatch(typeof(RegionMenu.c__DisplayClass2_0), "Method_Internal_Void_0")] public static class RegionMenuChooseOptionPatch { - public static bool Prefix(ref RegionMenuButtonCallback __instance) + public static bool Prefix(ref RegionMenu.c__DisplayClass2_0 __instance) { -#if STEAM - string buttonName = __instance.region.CBMOEHMADOC; -#elif ITCH - string buttonName = __instance.region.BEIIALBBLIK; -#endif - if (buttonName == "MANAGE_SERVERS") + if (__instance.region.PingServer == "MANAGE_SERVERS") { if (_managementForm == null || _managementForm.IsDisposed) _managementForm = new ServersManagementForm(); -#if STEAM - _managementForm.regionMenu = __instance.field_Public_CLIGCNHFBCO_0; -#elif ITCH - _managementForm.regionMenu = __instance.field_Public_KIPLKPEOBEO_0; -#endif + _managementForm.regionMenu = __instance.__this; if (_managementForm.Visible) _managementForm.Focus(); diff --git a/CustomServersClient/Properties/AssemblyInfo.cs b/CustomServersClient/Properties/AssemblyInfo.cs deleted file mode 100644 index 7777b2d..0000000 --- a/CustomServersClient/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -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("CustomServersClient")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("CustomServersClient")] -[assembly: AssemblyCopyright("Copyright © 2020")] -[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("8424c5d8-334f-4cab-b3c8-4d7635283b7f")] - -// 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.3.0.0")] -[assembly: AssemblyFileVersion("1.3.0.0")] diff --git a/CustomServersClient/UI/ServersManagementForm.cs b/CustomServersClient/UI/ServersManagementForm.cs index f254730..a22ff8e 100644 --- a/CustomServersClient/UI/ServersManagementForm.cs +++ b/CustomServersClient/UI/ServersManagementForm.cs @@ -4,11 +4,6 @@ using System.IO; using System.Windows.Forms; -#if STEAM -using RegionMenu = CLIGCNHFBCO; -#elif ITCH -using RegionMenu = KIPLKPEOBEO; -#endif namespace CustomServersClient.UI { diff --git a/README.md b/README.md index d35dd05..3df70b8 100644 --- a/README.md +++ b/README.md @@ -4,12 +4,21 @@ An in-game client for custom servers for Among Us. This works on both the Steam Works on Steam as of **v2020.12.9s**. Works on Itch as of **v2020.11.17i**. -## Building - -1. Download the source code -2. Add references to the required DLLs, add the paths for `Assembly-CSharp-Steam` and `Assembly-CSharp-Itch` by manually editing `CustomServersClient.csproj` in a text editor. (You don't need to add both if you're only building one.) -3. Change the Solution Configuration depending on what version you want to build (both debug and release versions exist for both versions). -4. Build the solution, `CustomServersClient.dll` will be in it's own directory depending on the version built. +## Installation +1. Download latest [BepInEx (Reactor fork)](https://github.com/NuclearPowered/BepInEx/releases) +2. Extract all files from zipped archive and put them in Among Us directory (where Among Us.exe is) +3. Download latest [Reactor.dll](https://nightly.link/NuclearPowered/Reactor/workflows/main/master) and put it in `YourAmongUsDirectory/BepInEx/plugins` +4. Download latest CustomServersClient.zip from releases +5. Unzip it, paste it into `YourAmongUsDirectory` +## Building +1. Install [Reactor](https://docs.reactor.gg/docs/) (Quick Start guide) +2. Open `CustomServersClient.sln` in your favorite IDE +3. Select correct option (for example Steam-Release) and build it. +4. Compiled dll should be automatically copied to your `BepInEx/plugins` folder (Reactor feature) ## Screenshot ![screenshot_0](https://cdn.discordapp.com/attachments/759066383090188308/763331715740729364/unknown.png) + +## TO-DO +- Change WinForms to imgui from Reactor +- Make newet screenshot \ No newline at end of file