diff --git a/NoteTweaks/Configuration/PluginConfig.cs b/NoteTweaks/Configuration/PluginConfig.cs index 2fd2474..88b83aa 100644 --- a/NoteTweaks/Configuration/PluginConfig.cs +++ b/NoteTweaks/Configuration/PluginConfig.cs @@ -6,6 +6,7 @@ namespace NoteTweaks.Configuration { + // ReSharper disable once ClassNeverInstantiated.Global internal class PluginConfig { public static PluginConfig Instance { get; set; } diff --git a/NoteTweaks/Installers/AppInstaller.cs b/NoteTweaks/Installers/AppInstaller.cs index b671d5f..3667e20 100644 --- a/NoteTweaks/Installers/AppInstaller.cs +++ b/NoteTweaks/Installers/AppInstaller.cs @@ -1,9 +1,9 @@ using NoteTweaks.Configuration; -using NoteTweaks.Patches; using Zenject; namespace NoteTweaks.Installers { + // ReSharper disable once ClassNeverInstantiated.Global internal class AppInstaller : Installer { private readonly PluginConfig _config; diff --git a/NoteTweaks/Installers/GameInstaller.cs b/NoteTweaks/Installers/GameInstaller.cs index 53c787e..6bcac92 100644 --- a/NoteTweaks/Installers/GameInstaller.cs +++ b/NoteTweaks/Installers/GameInstaller.cs @@ -1,13 +1,12 @@ -using NoteTweaks.Patches; -using Zenject; +using Zenject; namespace NoteTweaks.Installers { + // ReSharper disable once ClassNeverInstantiated.Global internal class GameInstaller : Installer { public override void InstallBindings() { - // Container.BindInterfacesTo().AsSingle(); } } } \ No newline at end of file diff --git a/NoteTweaks/Installers/MenuInstaller.cs b/NoteTweaks/Installers/MenuInstaller.cs index 3a3f6c3..e7eb601 100644 --- a/NoteTweaks/Installers/MenuInstaller.cs +++ b/NoteTweaks/Installers/MenuInstaller.cs @@ -1,9 +1,9 @@ -using NoteTweaks.Patches; -using NoteTweaks.UI; +using NoteTweaks.UI; using Zenject; namespace NoteTweaks.Installers { + // ReSharper disable once ClassNeverInstantiated.Global internal class MenuInstaller : Installer { public override void InstallBindings() diff --git a/NoteTweaks/Patches/ColorBoostPatch.cs b/NoteTweaks/Patches/ColorBoostPatch.cs index 4881a16..67ab9b6 100644 --- a/NoteTweaks/Patches/ColorBoostPatch.cs +++ b/NoteTweaks/Patches/ColorBoostPatch.cs @@ -1,16 +1,13 @@ -using System.Linq; -using System.Reflection; -using HarmonyLib; +using HarmonyLib; using UnityEngine; -// ReSharper disable InconsistentNaming namespace NoteTweaks.Patches { [HarmonyPatch] internal class NoteColorTweaks { - private static Color originalLeftColor; - private static Color originalRightColor; + private static Color _originalLeftColor; + private static Color _originalRightColor; [HarmonyPatch(typeof(StandardLevelScenesTransitionSetupDataSO), "InitColorInfo")] [HarmonyPostfix] @@ -25,17 +22,17 @@ private static void InitColorInfoPatch(StandardLevelScenesTransitionSetupDataSO float leftScale = 1.0f + Plugin.Config.ColorBoostLeft; float rightScale = 1.0f + Plugin.Config.ColorBoostRight; - if (originalLeftColor != oldScheme._saberAColor && originalLeftColor != (oldScheme._saberAColor * leftScale)) + if (_originalLeftColor != oldScheme._saberAColor && _originalLeftColor != (oldScheme._saberAColor * leftScale)) { - originalLeftColor = oldScheme._saberAColor; + _originalLeftColor = oldScheme._saberAColor; } - if (originalRightColor != oldScheme._saberBColor && originalRightColor != (oldScheme._saberBColor * rightScale)) + if (_originalRightColor != oldScheme._saberBColor && _originalRightColor != (oldScheme._saberBColor * rightScale)) { - originalRightColor = oldScheme._saberBColor; + _originalRightColor = oldScheme._saberBColor; } - oldScheme._saberAColor = originalLeftColor * leftScale; - oldScheme._saberBColor = originalRightColor * rightScale; + oldScheme._saberAColor = _originalLeftColor * leftScale; + oldScheme._saberBColor = _originalRightColor * rightScale; __instance.colorScheme = oldScheme; } diff --git a/NoteTweaks/Patches/NoteArrowPatch.cs b/NoteTweaks/Patches/NoteArrowPatch.cs index 3fc483d..c12e10f 100644 --- a/NoteTweaks/Patches/NoteArrowPatch.cs +++ b/NoteTweaks/Patches/NoteArrowPatch.cs @@ -1,8 +1,5 @@ -using System; -using System.Linq; +using System.Linq; using System.Reflection; -using BeatmapLevelSaveDataVersion4; -using BeatSaberMarkupLanguage; using HarmonyLib; using UnityEngine; using Object = UnityEngine.Object; @@ -13,8 +10,8 @@ namespace NoteTweaks.Patches internal class NotePhysicalTweaks { private static GameplayModifiers _gameplayModifiers; - internal static Material ReplacementDotMaterial; - internal static Material DotGlowMaterial; + private static Material _replacementDotMaterial; + private static Material _dotGlowMaterial; private static readonly GameObject DotObject = GameObject.CreatePrimitive(PrimitiveType.Sphere).gameObject; private static readonly Mesh DotMesh = DotObject.GetComponent().mesh; private static Mesh _dotGlowMesh; @@ -114,18 +111,18 @@ internal static void Postfix(ColorNoteVisuals __instance, ref MeshRenderer[] ___ return; } - if (ReplacementDotMaterial == null) + if (_replacementDotMaterial == null) { Plugin.Log.Info("Creating replacement dot material"); - ReplacementDotMaterial = new Material(Shader.Find("Standard")) + _replacementDotMaterial = new Material(Shader.Find("Standard")) { color = new Color(1f, 1f, 1f, 0f) }; } - if(DotGlowMaterial == null) { + if(_dotGlowMaterial == null) { Plugin.Log.Info("Creating new dot glow material"); Texture dotGlowTexture = Resources.FindObjectsOfTypeAll().ToList().Find(x => x.name == "NoteCircleGlow").mainTexture; - DotGlowMaterial = new Material(Resources.FindObjectsOfTypeAll().ToList().Find(x => x.name == "NoteArrowGlow")) + _dotGlowMaterial = new Material(Resources.FindObjectsOfTypeAll().ToList().Find(x => x.name == "NoteArrowGlow")) { mainTexture = dotGlowTexture }; @@ -208,8 +205,8 @@ internal static void Postfix(ColorNoteVisuals __instance, ref MeshRenderer[] ___ meshRenderer.GetComponent().mesh = DotMesh; - meshRenderer.material = ReplacementDotMaterial; - meshRenderer.sharedMaterial = ReplacementDotMaterial; + meshRenderer.material = _replacementDotMaterial; + meshRenderer.sharedMaterial = _replacementDotMaterial; if (!Plugin.Config.EnableFaceGlow) { @@ -223,8 +220,8 @@ internal static void Postfix(ColorNoteVisuals __instance, ref MeshRenderer[] ___ newGlowObject.transform.localScale = glowScale; MeshRenderer newGlowMeshRenderer = newGlowObject.GetComponent(); - newGlowMeshRenderer.material = DotGlowMaterial; - newGlowMeshRenderer.sharedMaterial = DotGlowMaterial; + newGlowMeshRenderer.material = _dotGlowMaterial; + newGlowMeshRenderer.sharedMaterial = _dotGlowMaterial; Color noteColor = originalDot.parent.parent.GetComponent()._noteColor; noteColor *= Plugin.Config.GlowIntensity; newGlowMeshRenderer.material.color = noteColor; diff --git a/NoteTweaks/Plugin.cs b/NoteTweaks/Plugin.cs index 31e662a..0845fd9 100644 --- a/NoteTweaks/Plugin.cs +++ b/NoteTweaks/Plugin.cs @@ -1,5 +1,4 @@ -using System.Linq; -using System.Reflection; +using System.Reflection; using HarmonyLib; using IPA; using IPA.Config; @@ -13,6 +12,7 @@ namespace NoteTweaks { [Plugin(RuntimeOptions.DynamicInit)] [NoEnableDisable] + // ReSharper disable once ClassNeverInstantiated.Global internal class Plugin { internal static IPALogger Log { get; private set; } diff --git a/NoteTweaks/UI/MenuButtonManager.cs b/NoteTweaks/UI/MenuButtonManager.cs index 75ceefe..9d51c31 100644 --- a/NoteTweaks/UI/MenuButtonManager.cs +++ b/NoteTweaks/UI/MenuButtonManager.cs @@ -4,6 +4,7 @@ namespace NoteTweaks.UI { + // ReSharper disable once ClassNeverInstantiated.Global internal class MenuButtonManager : IInitializable, IDisposable { private readonly MainFlowCoordinator _mainFlowCoordinator; diff --git a/NoteTweaks/UI/PreviewViewController.cs b/NoteTweaks/UI/PreviewViewController.cs index b656080..2bf69bc 100644 --- a/NoteTweaks/UI/PreviewViewController.cs +++ b/NoteTweaks/UI/PreviewViewController.cs @@ -1,7 +1,5 @@ -using System.Linq; -using BeatSaberMarkupLanguage.Attributes; +using BeatSaberMarkupLanguage.Attributes; using BeatSaberMarkupLanguage.ViewControllers; -using UnityEngine; namespace NoteTweaks.UI { diff --git a/NoteTweaks/UI/SettingsViewController.cs b/NoteTweaks/UI/SettingsViewController.cs index 96f3d13..40e8f1a 100644 --- a/NoteTweaks/UI/SettingsViewController.cs +++ b/NoteTweaks/UI/SettingsViewController.cs @@ -1,7 +1,6 @@ using BeatSaberMarkupLanguage.Attributes; using BeatSaberMarkupLanguage.ViewControllers; using NoteTweaks.Configuration; -using NoteTweaks.Patches; using UnityEngine; using Zenject; diff --git a/NoteTweaks/manifest.json b/NoteTweaks/manifest.json index 5b66c46..f22c1dc 100644 --- a/NoteTweaks/manifest.json +++ b/NoteTweaks/manifest.json @@ -3,7 +3,7 @@ "id": "NoteTweaks", "name": "NoteTweaks", "author": "TheBlackParrot", - "version": "0.0.3", + "version": "0.1.0", "description": "Change various aspects of the default note", "gameVersion": "1.39.1", "dependsOn": {