From 38fdd252a7892157bf2fcaead71d338f58c3bcb4 Mon Sep 17 00:00:00 2001 From: Sam Mercer Date: Thu, 7 May 2020 23:16:40 +0100 Subject: [PATCH] Add Flags + Add Toggle Names Mod --- .../CameraToolsPlugin.csproj | 9 +-- .../CameraToolsPlugin/Plugin.cs | 9 +-- .../CameraToolsPlugin/SetInjectionFlag.cs | 16 +++++ Mods/DontAnnoyBaggers/DontAnnoyBaggers.csproj | 64 +++++++++++++++++ Mods/DontAnnoyBaggers/Plugin.cs | 16 +++++ .../Properties/AssemblyInfo.cs | 36 ++++++++++ Mods/ToggleCharacterNames/Plugin.cs | 30 ++++++++ .../Properties/AssemblyInfo.cs | 36 ++++++++++ Mods/ToggleCharacterNames/SetInjectionFlag.cs | 16 +++++ .../ToggleCharacterNames.csproj | 68 +++++++++++++++++++ TalespireModding.sln | 37 ++++++++++ 11 files changed, 329 insertions(+), 8 deletions(-) create mode 100644 Mods/CameraToolsPlugin/CameraToolsPlugin/SetInjectionFlag.cs create mode 100644 Mods/DontAnnoyBaggers/DontAnnoyBaggers.csproj create mode 100644 Mods/DontAnnoyBaggers/Plugin.cs create mode 100644 Mods/DontAnnoyBaggers/Properties/AssemblyInfo.cs create mode 100644 Mods/ToggleCharacterNames/Plugin.cs create mode 100644 Mods/ToggleCharacterNames/Properties/AssemblyInfo.cs create mode 100644 Mods/ToggleCharacterNames/SetInjectionFlag.cs create mode 100644 Mods/ToggleCharacterNames/ToggleCharacterNames.csproj create mode 100644 TalespireModding.sln diff --git a/Mods/CameraToolsPlugin/CameraToolsPlugin/CameraToolsPlugin.csproj b/Mods/CameraToolsPlugin/CameraToolsPlugin/CameraToolsPlugin.csproj index 711aa77..af32578 100644 --- a/Mods/CameraToolsPlugin/CameraToolsPlugin/CameraToolsPlugin.csproj +++ b/Mods/CameraToolsPlugin/CameraToolsPlugin/CameraToolsPlugin.csproj @@ -37,12 +37,12 @@ E:\Steam 2\steamapps\common\TaleSpire\TaleSpire_Data\Managed\Bouncyrock.BouncePackage.Runtime.dll - - False + E:\Steam 2\steamapps\common\TaleSpire\TaleSpire_Data\Managed\Bouncyrock.TaleSpire.BounceTools.Runtime.dll - - ..\Libs\Bouncyrock.TaleSpire.Runtime.dll + + False + E:\Steam 2\steamapps\common\TaleSpire\TaleSpire_Data\Managed\Bouncyrock.TaleSpire.Runtime.dll @@ -59,6 +59,7 @@ + diff --git a/Mods/CameraToolsPlugin/CameraToolsPlugin/Plugin.cs b/Mods/CameraToolsPlugin/CameraToolsPlugin/Plugin.cs index d15457b..781db78 100644 --- a/Mods/CameraToolsPlugin/CameraToolsPlugin/Plugin.cs +++ b/Mods/CameraToolsPlugin/CameraToolsPlugin/Plugin.cs @@ -81,8 +81,8 @@ private void toggleOrthographicCamera() { var cam = CameraController.Instance; - cam.GetType().GetField("_minTilt", flags)?.SetValue(cam, 0.0f); - cam.GetType().GetField("_maxTilt", flags)?.SetValue(cam, 120.0f); + cam.GetType().GetField("_minTilt", flags)?.SetValue(cam, 90.0f); + cam.GetType().GetField("_maxTilt", flags)?.SetValue(cam, 90.0f); //cam.GetType().GetField("_maxFov", flags).SetValue(cam, 120.0f); this._orthEnabled = true; } @@ -145,16 +145,17 @@ void Update() { toggleOrthographicCamera(); } + if(Input.GetKeyUp(KeyCode.Tab)) if(_orthEnabled) { if (Input.GetAxis("Mouse ScrollWheel") > 0) { - Camera.main.orthographicSize -= .25f; + Camera.main.orthographicSize -= 1f; } else if (Input.GetAxis("Mouse ScrollWheel") < 0) { - Camera.main.orthographicSize += .25f; + Camera.main.orthographicSize += 1f; } } diff --git a/Mods/CameraToolsPlugin/CameraToolsPlugin/SetInjectionFlag.cs b/Mods/CameraToolsPlugin/CameraToolsPlugin/SetInjectionFlag.cs new file mode 100644 index 0000000..fb68cf0 --- /dev/null +++ b/Mods/CameraToolsPlugin/CameraToolsPlugin/SetInjectionFlag.cs @@ -0,0 +1,16 @@ +using BepInEx; +using UnityEngine; + +namespace CameraToolsPlugin +{ + [BepInPlugin("org.generic.plugins.setInjectionFlag", "Set Injection Flag Plugin", "1.0.0.0")] + [BepInProcess("TaleSpire.exe")] + class SetInjectionFlag : BaseUnityPlugin + { + void Awake() + { + UnityEngine.Debug.Log("SetInjectionFlag Plug-in loaded"); + AppStateManager.UsingCodeInjection = true; + } + } +} \ No newline at end of file diff --git a/Mods/DontAnnoyBaggers/DontAnnoyBaggers.csproj b/Mods/DontAnnoyBaggers/DontAnnoyBaggers.csproj new file mode 100644 index 0000000..027914d --- /dev/null +++ b/Mods/DontAnnoyBaggers/DontAnnoyBaggers.csproj @@ -0,0 +1,64 @@ + + + + + Debug + AnyCPU + {F786C502-ADC7-4C7E-A0FF-059C798C454D} + Library + Properties + DontAnnoyBaggers + DontAnnoyBaggers + v4.7.2 + 512 + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\..\Libs\BepInEx.dll + + + E:\Steam 2\steamapps\common\TaleSpire\TaleSpire_Data\Managed\Bouncyrock.TaleSpire.Runtime.dll + + + + + + + + + + + ..\..\Libs\UnityEngine.dll + + + E:\Steam 2\steamapps\common\TaleSpire\TaleSpire_Data\Managed\UnityEngine.CoreModule.dll + + + False + E:\Steam 2\steamapps\common\TaleSpire\TaleSpire_Data\Managed\UnityEngine.InputLegacyModule.dll + + + + + + + + \ No newline at end of file diff --git a/Mods/DontAnnoyBaggers/Plugin.cs b/Mods/DontAnnoyBaggers/Plugin.cs new file mode 100644 index 0000000..19cb2b0 --- /dev/null +++ b/Mods/DontAnnoyBaggers/Plugin.cs @@ -0,0 +1,16 @@ +using BepInEx; +using UnityEngine; + +namespace DontAnnoyBaggers +{ + [BepInPlugin("org.generic.plugins.setInjectionFlag", "Set Injection Flag Plugin", "1.0.0.0")] + [BepInProcess("TaleSpire.exe")] + class SetInjectionFlag : BaseUnityPlugin + { + void Awake() + { + UnityEngine.Debug.Log("SetInjectionFlag Plug-in loaded"); + AppStateManager.UsingCodeInjection = true; + } + } +} \ No newline at end of file diff --git a/Mods/DontAnnoyBaggers/Properties/AssemblyInfo.cs b/Mods/DontAnnoyBaggers/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..15ec37d --- /dev/null +++ b/Mods/DontAnnoyBaggers/Properties/AssemblyInfo.cs @@ -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("DontAnnoyBaggers")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("DontAnnoyBaggers")] +[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("f786c502-adc7-4c7e-a0ff-059c798c454d")] + +// 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")] diff --git a/Mods/ToggleCharacterNames/Plugin.cs b/Mods/ToggleCharacterNames/Plugin.cs new file mode 100644 index 0000000..db886e9 --- /dev/null +++ b/Mods/ToggleCharacterNames/Plugin.cs @@ -0,0 +1,30 @@ +using BepInEx; +using UnityEngine; + +namespace ToggleCharacterNames +{ + [BepInPlugin("org.mercer.plugins.ToggleCharacterNames", "Toggle Character Names", "1.0.0")] + [BepInProcess("TaleSpire.exe")] + public class Plugin : BaseUnityPlugin + { + private bool _enabled = false; + void Awake() + { + Debug.Log("Starting Toggle Characters Plugin"); + } + + private void ToggleTextLayer() + { + ToolIndicatorUI.TextLayerEnabled = !_enabled; + this._enabled = !_enabled; + } + + void Update() + { + if (Input.GetKeyUp(KeyCode.F7)) + { + ToggleTextLayer(); + } + } + } +} diff --git a/Mods/ToggleCharacterNames/Properties/AssemblyInfo.cs b/Mods/ToggleCharacterNames/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..b36a39a --- /dev/null +++ b/Mods/ToggleCharacterNames/Properties/AssemblyInfo.cs @@ -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("ToggleCharacterNames")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("ToggleCharacterNames")] +[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("0fa94683-146e-4eac-95a3-ccaf9933065d")] + +// 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")] diff --git a/Mods/ToggleCharacterNames/SetInjectionFlag.cs b/Mods/ToggleCharacterNames/SetInjectionFlag.cs new file mode 100644 index 0000000..fb68cf0 --- /dev/null +++ b/Mods/ToggleCharacterNames/SetInjectionFlag.cs @@ -0,0 +1,16 @@ +using BepInEx; +using UnityEngine; + +namespace CameraToolsPlugin +{ + [BepInPlugin("org.generic.plugins.setInjectionFlag", "Set Injection Flag Plugin", "1.0.0.0")] + [BepInProcess("TaleSpire.exe")] + class SetInjectionFlag : BaseUnityPlugin + { + void Awake() + { + UnityEngine.Debug.Log("SetInjectionFlag Plug-in loaded"); + AppStateManager.UsingCodeInjection = true; + } + } +} \ No newline at end of file diff --git a/Mods/ToggleCharacterNames/ToggleCharacterNames.csproj b/Mods/ToggleCharacterNames/ToggleCharacterNames.csproj new file mode 100644 index 0000000..744157f --- /dev/null +++ b/Mods/ToggleCharacterNames/ToggleCharacterNames.csproj @@ -0,0 +1,68 @@ + + + + + Debug + AnyCPU + {0FA94683-146E-4EAC-95A3-CCAF9933065D} + Library + Properties + ToggleCharacterNames + ToggleCharacterNames + v4.7.2 + 512 + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\..\Libs\BepInEx.dll + + + E:\Steam 2\steamapps\common\TaleSpire\TaleSpire_Data\Managed\Bouncyrock.BouncePackage.Runtime.dll + + + E:\Steam 2\steamapps\common\TaleSpire\TaleSpire_Data\Managed\Bouncyrock.TaleSpire.BounceTools.Runtime.dll + + + E:\Steam 2\steamapps\common\TaleSpire\TaleSpire_Data\Managed\Bouncyrock.TaleSpire.Runtime.dll + + + + + + + + + + + + E:\Steam 2\steamapps\common\TaleSpire\TaleSpire_Data\Managed\UnityEngine.CoreModule.dll + + + E:\Steam 2\steamapps\common\TaleSpire\TaleSpire_Data\Managed\UnityEngine.InputLegacyModule.dll + + + + + + + + + \ No newline at end of file diff --git a/TalespireModding.sln b/TalespireModding.sln new file mode 100644 index 0000000..c1b7198 --- /dev/null +++ b/TalespireModding.sln @@ -0,0 +1,37 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29411.108 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CameraToolsPlugin", "Mods\CameraToolsPlugin\CameraToolsPlugin\CameraToolsPlugin.csproj", "{461CF153-4423-4BC2-B10D-0DB24D5B6E1D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DontAnnoyBaggers", "Mods\DontAnnoyBaggers\DontAnnoyBaggers.csproj", "{F786C502-ADC7-4C7E-A0FF-059C798C454D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ToggleCharacterNames", "Mods\ToggleCharacterNames\ToggleCharacterNames.csproj", "{0FA94683-146E-4EAC-95A3-CCAF9933065D}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {461CF153-4423-4BC2-B10D-0DB24D5B6E1D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {461CF153-4423-4BC2-B10D-0DB24D5B6E1D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {461CF153-4423-4BC2-B10D-0DB24D5B6E1D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {461CF153-4423-4BC2-B10D-0DB24D5B6E1D}.Release|Any CPU.Build.0 = Release|Any CPU + {F786C502-ADC7-4C7E-A0FF-059C798C454D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F786C502-ADC7-4C7E-A0FF-059C798C454D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F786C502-ADC7-4C7E-A0FF-059C798C454D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F786C502-ADC7-4C7E-A0FF-059C798C454D}.Release|Any CPU.Build.0 = Release|Any CPU + {0FA94683-146E-4EAC-95A3-CCAF9933065D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0FA94683-146E-4EAC-95A3-CCAF9933065D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0FA94683-146E-4EAC-95A3-CCAF9933065D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0FA94683-146E-4EAC-95A3-CCAF9933065D}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A3AB9696-650E-45D3-9F7D-50426F74D917} + EndGlobalSection +EndGlobal