From 0c90ab215a83b605ab242b51a7f1d3c0c86fbf5a Mon Sep 17 00:00:00 2001 From: Craig Banks Date: Sat, 18 Feb 2023 21:35:18 +0000 Subject: [PATCH] fixes terk asked for + a few things --- .gitignore | 1 + project/Terkoiz.Freecam/Freecam.cs | 3 ++ project/Terkoiz.Freecam/FreecamController.cs | 4 +++ project/Terkoiz.Freecam/FreecamPatch.cs | 2 +- project/Terkoiz.Freecam/FreecamPlugin.cs | 4 ++- .../Properties/AssemblyInfo.cs | 36 +++++++++++++++++++ .../Terkoiz.Freecam/Terkoiz.Freecam.csproj | 30 ++++++++++------ 7 files changed, 67 insertions(+), 13 deletions(-) create mode 100644 project/Terkoiz.Freecam/Properties/AssemblyInfo.cs diff --git a/.gitignore b/.gitignore index 1af21c3..9aa56aa 100644 --- a/.gitignore +++ b/.gitignore @@ -244,6 +244,7 @@ orleans.codegen.cs .idea Freecam.sln.DotSettings.user Project/.idea/ +Project/Shared/* # Including strong name files can present a security risk # (https://github.com/github/gitignore/pull/2483#issue-259490424) diff --git a/project/Terkoiz.Freecam/Freecam.cs b/project/Terkoiz.Freecam/Freecam.cs index a865504..9d92586 100644 --- a/project/Terkoiz.Freecam/Freecam.cs +++ b/project/Terkoiz.Freecam/Freecam.cs @@ -1,3 +1,4 @@ +using JetBrains.Annotations; using UnityEngine; namespace Terkoiz.Freecam @@ -13,6 +14,7 @@ namespace Terkoiz.Freecam { public bool IsActive = false; + [UsedImplicitly] public void Update() { if (!IsActive) @@ -81,6 +83,7 @@ namespace Terkoiz.Freecam } } + [UsedImplicitly] private void OnDestroy() { Destroy(this); diff --git a/project/Terkoiz.Freecam/FreecamController.cs b/project/Terkoiz.Freecam/FreecamController.cs index ccd6937..12fe66c 100644 --- a/project/Terkoiz.Freecam/FreecamController.cs +++ b/project/Terkoiz.Freecam/FreecamController.cs @@ -3,6 +3,7 @@ using EFT; using EFT.CameraControl; using EFT.UI; using HarmonyLib; +using JetBrains.Annotations; using UnityEngine; namespace Terkoiz.Freecam @@ -26,6 +27,7 @@ namespace Terkoiz.Freecam // Button to toggle between camera and player movement // Independent FoV setting for Freecam mode (_mainCamera.GetComponent().fieldOfView = ...) + [UsedImplicitly] public void Start() { // Find Main Camera @@ -44,6 +46,7 @@ namespace Terkoiz.Freecam FreecamPlugin.Logger.LogError("Failed to locate GamePlayerOwner"); } + [UsedImplicitly] public void Update() { if (FreecamPlugin.ToggleUi.Value.IsDown()) @@ -227,6 +230,7 @@ namespace Terkoiz.Freecam return gameWorld.MainPlayer; } + [UsedImplicitly] private void OnDestroy() { // Destroy FreeCamScript before FreeCamController if exists diff --git a/project/Terkoiz.Freecam/FreecamPatch.cs b/project/Terkoiz.Freecam/FreecamPatch.cs index 04fd939..0311d0c 100644 --- a/project/Terkoiz.Freecam/FreecamPatch.cs +++ b/project/Terkoiz.Freecam/FreecamPatch.cs @@ -21,7 +21,7 @@ namespace Terkoiz.Freecam return; // Add FreeCamController to GameWorld GameObject - gameworld.GetOrAddComponent(); + gameworld.gameObject.AddComponent(); } } } \ No newline at end of file diff --git a/project/Terkoiz.Freecam/FreecamPlugin.cs b/project/Terkoiz.Freecam/FreecamPlugin.cs index 2bc6ee4..4bfa227 100644 --- a/project/Terkoiz.Freecam/FreecamPlugin.cs +++ b/project/Terkoiz.Freecam/FreecamPlugin.cs @@ -1,6 +1,7 @@ using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; +using JetBrains.Annotations; using UnityEngine; using KeyboardShortcut = BepInEx.Configuration.KeyboardShortcut; @@ -32,6 +33,7 @@ namespace Terkoiz.Freecam internal static ConfigEntry CameraRememberLastPosition; public static ConfigEntry FallDamageToggle; + [UsedImplicitly] internal void Start() { new FreecamPatch().Enable(); @@ -123,7 +125,7 @@ namespace Terkoiz.Freecam TogglesSectionName, "FallHeightToggle", true, - "True disables fall damage, False doesn't simplez"); + "If enabled, will disable all fall damage for the player."); } } } diff --git a/project/Terkoiz.Freecam/Properties/AssemblyInfo.cs b/project/Terkoiz.Freecam/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..074a8d1 --- /dev/null +++ b/project/Terkoiz.Freecam/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("Terkoiz.Freecam")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Terkoiz.Freecam")] +[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("be2de623-48ff-4807-9696-167a17787718")] + +// 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")] \ No newline at end of file diff --git a/project/Terkoiz.Freecam/Terkoiz.Freecam.csproj b/project/Terkoiz.Freecam/Terkoiz.Freecam.csproj index 37a2632..446a092 100644 --- a/project/Terkoiz.Freecam/Terkoiz.Freecam.csproj +++ b/project/Terkoiz.Freecam/Terkoiz.Freecam.csproj @@ -7,38 +7,46 @@ - ..\..\Shared\0Harmony.dll + ..\Shared\0Harmony.dll - ..\..\Shared\Aki.Reflection.dll + ..\Shared\Aki.Reflection.dll - ..\..\Shared\Assembly-CSharp.dll + ..\Shared\Assembly-CSharp.dll - ..\..\Shared\BepInEx.dll + ..\Shared\BepInEx.dll - ..\..\Shared\Comfort.dll + ..\Shared\Comfort.dll - ..\..\Shared\ConfigurationManager.dll + ..\Shared\ConfigurationManager.dll - ..\..\Shared\ItemComponent.Types.dll + ..\Shared\ItemComponent.Types.dll - ..\..\Shared\UnityEngine.dll + ..\Shared\UnityEngine.dll - ..\..\Shared\UnityEngine.CoreModule.dll + ..\Shared\UnityEngine.CoreModule.dll - ..\..\Shared\UnityEngine.InputLegacyModule.dll + ..\Shared\UnityEngine.InputLegacyModule.dll - ..\..\Shared\UnityEngine.UIModule.dll + ..\Shared\UnityEngine.UIModule.dll + + + + + + + +