Skip to content

Commit

Permalink
clean up version bump etc etc
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBlackParrot committed Dec 25, 2024
1 parent 721a5d3 commit 08ca87e
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 39 deletions.
1 change: 1 addition & 0 deletions NoteTweaks/Configuration/PluginConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

namespace NoteTweaks.Configuration
{
// ReSharper disable once ClassNeverInstantiated.Global
internal class PluginConfig
{
public static PluginConfig Instance { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion NoteTweaks/Installers/AppInstaller.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
5 changes: 2 additions & 3 deletions NoteTweaks/Installers/GameInstaller.cs
Original file line number Diff line number Diff line change
@@ -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<CutSoundPatch>().AsSingle();
}
}
}
4 changes: 2 additions & 2 deletions NoteTweaks/Installers/MenuInstaller.cs
Original file line number Diff line number Diff line change
@@ -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()
Expand Down
21 changes: 9 additions & 12 deletions NoteTweaks/Patches/ColorBoostPatch.cs
Original file line number Diff line number Diff line change
@@ -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]
Expand All @@ -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;
}

Expand Down
25 changes: 11 additions & 14 deletions NoteTweaks/Patches/NoteArrowPatch.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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<MeshFilter>().mesh;
private static Mesh _dotGlowMesh;
Expand Down Expand Up @@ -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<Material>().ToList().Find(x => x.name == "NoteCircleGlow").mainTexture;
DotGlowMaterial = new Material(Resources.FindObjectsOfTypeAll<Material>().ToList().Find(x => x.name == "NoteArrowGlow"))
_dotGlowMaterial = new Material(Resources.FindObjectsOfTypeAll<Material>().ToList().Find(x => x.name == "NoteArrowGlow"))
{
mainTexture = dotGlowTexture
};
Expand Down Expand Up @@ -208,8 +205,8 @@ internal static void Postfix(ColorNoteVisuals __instance, ref MeshRenderer[] ___

meshRenderer.GetComponent<MeshFilter>().mesh = DotMesh;

meshRenderer.material = ReplacementDotMaterial;
meshRenderer.sharedMaterial = ReplacementDotMaterial;
meshRenderer.material = _replacementDotMaterial;
meshRenderer.sharedMaterial = _replacementDotMaterial;

if (!Plugin.Config.EnableFaceGlow)
{
Expand All @@ -223,8 +220,8 @@ internal static void Postfix(ColorNoteVisuals __instance, ref MeshRenderer[] ___
newGlowObject.transform.localScale = glowScale;

MeshRenderer newGlowMeshRenderer = newGlowObject.GetComponent<MeshRenderer>();
newGlowMeshRenderer.material = DotGlowMaterial;
newGlowMeshRenderer.sharedMaterial = DotGlowMaterial;
newGlowMeshRenderer.material = _dotGlowMaterial;
newGlowMeshRenderer.sharedMaterial = _dotGlowMaterial;
Color noteColor = originalDot.parent.parent.GetComponent<ColorNoteVisuals>()._noteColor;
noteColor *= Plugin.Config.GlowIntensity;
newGlowMeshRenderer.material.color = noteColor;
Expand Down
4 changes: 2 additions & 2 deletions NoteTweaks/Plugin.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Linq;
using System.Reflection;
using System.Reflection;
using HarmonyLib;
using IPA;
using IPA.Config;
Expand All @@ -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; }
Expand Down
1 change: 1 addition & 0 deletions NoteTweaks/UI/MenuButtonManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace NoteTweaks.UI
{
// ReSharper disable once ClassNeverInstantiated.Global
internal class MenuButtonManager : IInitializable, IDisposable
{
private readonly MainFlowCoordinator _mainFlowCoordinator;
Expand Down
4 changes: 1 addition & 3 deletions NoteTweaks/UI/PreviewViewController.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using System.Linq;
using BeatSaberMarkupLanguage.Attributes;
using BeatSaberMarkupLanguage.Attributes;
using BeatSaberMarkupLanguage.ViewControllers;
using UnityEngine;

namespace NoteTweaks.UI
{
Expand Down
1 change: 0 additions & 1 deletion NoteTweaks/UI/SettingsViewController.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using BeatSaberMarkupLanguage.Attributes;
using BeatSaberMarkupLanguage.ViewControllers;
using NoteTweaks.Configuration;
using NoteTweaks.Patches;
using UnityEngine;
using Zenject;

Expand Down
2 changes: 1 addition & 1 deletion NoteTweaks/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down

0 comments on commit 08ca87e

Please sign in to comment.