Skip to content
This repository has been archived by the owner on Jun 27, 2024. It is now read-only.

Commit

Permalink
Formatting diff
Browse files Browse the repository at this point in the history
  • Loading branch information
Exomanz committed Dec 16, 2022
1 parent 1aaf024 commit 74699fd
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 26 deletions.
42 changes: 21 additions & 21 deletions MenuSaberColors/MenuSaberColorManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@ public class MenuSaberColorManager : MonoBehaviour
[Inject] private readonly Patches.HookMenuEnvironmentManager managerHook;
[Inject] private readonly SiraLog Logger;

public static MenuSaberColorManager Instance { get; private set; }
public MethodInfo setColorsMethod = typeof(SetSaberGlowColor).GetMethod("SetColors");
public SetSaberGlowColor[] leftSideSabers = new SetSaberGlowColor[2];
public SetSaberGlowColor[] rightSideSabers = new SetSaberGlowColor[2];
public static MenuSaberColorManager Instance { get; private set; }
public MethodInfo setColorsMethod = typeof(SetSaberGlowColor).GetMethod("SetColors");
public SetSaberGlowColor[] leftSideSabers = new SetSaberGlowColor[2];
public SetSaberGlowColor[] rightSideSabers = new SetSaberGlowColor[2];

private static readonly FieldAccessor<ColorSchemesSettings, Dictionary<string, ColorScheme>>.Accessor dictionaryAccessor = FieldAccessor<ColorSchemesSettings, Dictionary<string, ColorScheme>>.GetAccessor("_colorSchemesDict");
private static readonly FieldAccessor<ColorSchemesSettings, Dictionary<string, ColorScheme>>.Accessor dictionaryAccessor = FieldAccessor<ColorSchemesSettings, Dictionary<string, ColorScheme>>.GetAccessor("_colorSchemesDict");
private ColorSchemesSettings playerColorSchemesSettings;
private Dictionary<string, ColorScheme> colorSchemeDictionary;
private string key;

public void Start()
{
Instance = this;
playerColorSchemesSettings = playerDataModel.playerData.colorSchemesSettings;
playerColorSchemesSettings = playerDataModel.playerData.colorSchemesSettings;

managerHook.menuEnvironmentDidChangeEvent += this.RefreshData;
}
Expand All @@ -41,16 +41,16 @@ public void GetSabers()
// Array.Length doesn't always work for me, so this is more reliable.
if (leftSideSabers?[0] != null && rightSideSabers?[0] != null) return;

VRController[] controllers = Resources.FindObjectsOfTypeAll<VRController>().Where(go => go.transform.root.name == "Wrapper").ToArray();
leftSideSabers = controllers[1]?.GetComponentsInChildren<SetSaberGlowColor>();
rightSideSabers = controllers[0]?.GetComponentsInChildren<SetSaberGlowColor>();
}
VRController[] controllers = Resources.FindObjectsOfTypeAll<VRController>().Where(go => go.transform.root.name == "Wrapper").ToArray();
leftSideSabers = controllers[1]?.GetComponentsInChildren<SetSaberGlowColor>();
rightSideSabers = controllers[0]?.GetComponentsInChildren<SetSaberGlowColor>();
}

public void RefreshData()
{
this.GetSabers();
{
this.GetSabers();

try
try
{
colorSchemeDictionary = dictionaryAccessor(ref playerColorSchemesSettings);
}
Expand Down Expand Up @@ -81,8 +81,8 @@ private void UpdateSaberColors()
{
ColorManager colorManager = obj?.GetField<ColorManager, SetSaberGlowColor>("_colorManager");
colorManager?.SetField("_colorScheme", colorScheme);
setColorsMethod?.Invoke(obj, null);
}
setColorsMethod?.Invoke(obj, null);
}
}
}

Expand Down Expand Up @@ -205,14 +205,14 @@ public void Update()
pointerMaterial.color = rainbow;

foreach (SetSaberGlowColor obj in colorManager.leftSideSabers)
{
colorManager.setColorsMethod?.Invoke(obj, null);
}
{
colorManager.setColorsMethod?.Invoke(obj, null);
}

foreach (SetSaberGlowColor obj in colorManager.rightSideSabers)
{
colorManager.setColorsMethod?.Invoke(obj, null);
}
{
colorManager.setColorsMethod?.Invoke(obj, null);
}
}
}
}
Expand Down
10 changes: 5 additions & 5 deletions MenuSaberColors/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ namespace MenuSaberColors
public class Plugin
{
public static bool isAprilFools
{
get
{
{
get
{
DateTime time = DateTime.Now;
return time.Month == 4 && time.Day == 1;
}
}
}
}

[Init] public Plugin(IPALogger logger, Zenjector zenjector)
{
Expand Down

0 comments on commit 74699fd

Please sign in to comment.