SHA256
Improve scrDecorationPatch Code Consistency
This commit is contained in:
1 parent
2eb26fe748
commit
5d7cfb68ea
1 file changed
+7
-21
@@ -1,5 +1,4 @@
|
|||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
namespace ADOFAIRenderer.Patch.ClassPatch
|
namespace ADOFAIRenderer.Patch.ClassPatch
|
||||||
{
|
{
|
||||||
@@ -12,44 +11,31 @@ namespace ADOFAIRenderer.Patch.ClassPatch
|
|||||||
// ReSharper disable once InconsistentNaming
|
// ReSharper disable once InconsistentNaming
|
||||||
public static bool SetRotationPrefix(scrDecoration __instance)
|
public static bool SetRotationPrefix(scrDecoration __instance)
|
||||||
{
|
{
|
||||||
if (__instance == null || !__instance || __instance.pivotTrans == null)
|
return __instance != null && __instance && __instance.pivotTrans != null;
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[HarmonyPrefix]
|
[HarmonyPrefix]
|
||||||
[HarmonyPatch("SetScale")]
|
[HarmonyPatch("SetScale")]
|
||||||
|
// ReSharper disable once InconsistentNaming
|
||||||
public static bool SetScalePrefix(scrDecoration __instance)
|
public static bool SetScalePrefix(scrDecoration __instance)
|
||||||
{
|
{
|
||||||
if (__instance == null || !__instance || __instance.pivotTrans == null)
|
return __instance != null && __instance && __instance.pivotTrans != null;
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[HarmonyPrefix]
|
[HarmonyPrefix]
|
||||||
[HarmonyPatch("SetOpacity")]
|
[HarmonyPatch("SetOpacity")]
|
||||||
|
// ReSharper disable once InconsistentNaming
|
||||||
public static bool SetOpacityPrefix(scrDecoration __instance)
|
public static bool SetOpacityPrefix(scrDecoration __instance)
|
||||||
{
|
{
|
||||||
if (__instance == null || !__instance)
|
return __instance != null && __instance;
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[HarmonyPrefix]
|
[HarmonyPrefix]
|
||||||
[HarmonyPatch("UpdatePosition")]
|
[HarmonyPatch("UpdatePosition")]
|
||||||
|
// ReSharper disable once InconsistentNaming
|
||||||
public static bool UpdatePositionPrefix(scrDecoration __instance)
|
public static bool UpdatePositionPrefix(scrDecoration __instance)
|
||||||
{
|
{
|
||||||
if (__instance == null || !__instance || __instance.pivotTrans == null)
|
return __instance != null && __instance && __instance.pivotTrans != null;
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user