Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of Aicho Advanced Building v1.0.1
Aicho_AdvancedBuilding.dll
Decompiled a week ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using TMPro; using UnityEngine; using UnityEngine.Rendering; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("Aicho_AdvancedBuilding")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("Aicho_AdvancedBuilding")] [assembly: AssemblyTitle("Aicho_AdvancedBuilding")] [assembly: AssemblyVersion("1.0.0.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace AichoBuildGizmo { [BepInPlugin("aicho.buildgizmo", "Aicho Advanced Building", "0.1.0")] public class Plugin : BaseUnityPlugin { public const string Guid = "aicho.buildgizmo"; public const string PluginVersion = "0.1.0"; internal static ManualLogSource Log; internal static ConfigFile Hidden; public static ConfigEntry<int> SnapDivisions; public static ConfigEntry<KeyboardShortcut> XRotationKey; public static ConfigEntry<KeyboardShortcut> ZRotationKey; public static ConfigEntry<KeyboardShortcut> ResetRotationKey; public static ConfigEntry<KeyboardShortcut> ResetAllRotationKey; public static ConfigEntry<KeyboardShortcut> ToggleAxesKey; public static ConfigEntry<KeyboardShortcut> CopyPieceRotation; public static ConfigEntry<KeyboardShortcut> FlipPieceKey; public static ConfigEntry<KeyboardShortcut> SelectTargetPieceKey; public static ConfigEntry<KeyboardShortcut> SnapDivisionIncrement; public static ConfigEntry<KeyboardShortcut> SnapDivisionDecrement; public static ConfigEntry<KeyboardShortcut> FreezeKey; public static ConfigEntry<KeyboardShortcut> RotationModeKey; public static ConfigEntry<bool> RotationModeStartsActive; public static ConfigEntry<bool> DeactivateOnHammerUnequip; public static ConfigEntry<bool> ReleaseOnPlace; public static ConfigEntry<bool> ReleaseOnPieceChange; public static ConfigEntry<bool> LocalFrameMode; public static ConfigEntry<bool> IgnoreTerrainOpPrefab; public static ConfigEntry<string> IgnorePrefabNameList; public static ConfigEntry<bool> ShowGizmo; public static ConfigEntry<bool> GlobalPivotAtCursor; public static ConfigEntry<bool> LocalPivotAtCenter; public static ConfigEntry<bool> GizmoIntro; public static ConfigEntry<bool> LocalGizmoPlacement; public static ConfigEntry<float> GizmoIntroSpin; public static ConfigEntry<float> GizmoIntroScale; public static ConfigEntry<float> GizmoIntroSeconds; public static ConfigEntry<Color> XGizmoColor; public static ConfigEntry<Color> YGizmoColor; public static ConfigEntry<Color> ZGizmoColor; public static ConfigEntry<bool> DebugLog; public static ConfigEntry<bool> AreaRepair; public static ConfigEntry<float> AreaRepairRadius; public static ConfigEntry<bool> MoveEnabled; public static ConfigEntry<KeyboardShortcut> ResetOffsetKey; public static ConfigEntry<KeyboardShortcut> MoveWheelLargeStepKey; public static ConfigEntry<KeyboardShortcut> MoveWheelFineStepKey; public static ConfigEntry<KeyboardShortcut> MoveForwardKey; public static ConfigEntry<KeyboardShortcut> MoveSidewaysKey; public static ConfigEntry<KeyboardShortcut> MoveVerticalKey; public static ConfigEntry<string> BlockedGameButtons; public static ConfigEntry<bool> MoveWheelInvert; public static ConfigEntry<float> MoveAmount; public static ConfigEntry<float> MoveAmountLarge; public static ConfigEntry<float> MoveAmountFine; public static ConfigEntry<bool> ResetOffsetOnPieceChange; public static ConfigEntry<bool> ResetOffsetOnPlace; public static ConfigEntry<bool> RespectPlaceDistance; public static ConfigEntry<bool> HideUnselectedAxes; public static ConfigEntry<float> AxisFocusSeconds; public static ConfigEntry<float> WheelFocusHold; public static ConfigEntry<bool> RingsReturnToNormal; public static ConfigEntry<float> GizmoOpacity; public static ConfigEntry<float> GizmoLineThickness; public static ConfigEntry<float> ArrowLengthDegrees; public static ConfigEntry<float> ArrowHeadSize; public static ConfigEntry<float> ArrowHeadLength; public static ConfigEntry<float> ArrowShaftThickness; public static ConfigEntry<float> DashLengthDegrees; public static ConfigEntry<float> DashThickness; public static ConfigEntry<float> GizmoSizeMultiplier; public static ConfigEntry<float> EmissionFactorX; public static ConfigEntry<float> EmissionFactorY; public static ConfigEntry<float> EmissionFactorZ; public static ConfigEntry<bool> ShowMoveLine; public static ConfigEntry<bool> MoveLinePreview; internal static Fixed<bool> FloatingMessages; internal static Fixed<bool> MessagePreview; internal static Fixed<bool> MessageOutline; internal static Fixed<Color> MessageColor; internal static Fixed<string> TextWorkbench; internal static Fixed<string> MessageFont; internal static Fixed<float> MessageSize; internal static Fixed<float> MessageSeconds; internal static Fixed<float> MessageFadeSeconds; internal static Fixed<float> MessageHeight; internal static Fixed<float> MessageSide; internal static Fixed<float> MessageForward; internal static Fixed<float> MessageScreenX; internal static Fixed<float> MessageScreenY; public static ConfigEntry<KeyboardShortcut> FreeCamKey; public static ConfigEntry<KeyboardShortcut> FreeCamUpKey; public static ConfigEntry<KeyboardShortcut> FreeCamDownKey; public static ConfigEntry<KeyboardShortcut> FreeCamFastKey; public static ConfigEntry<bool> FreeCamRequireWorkbench; public static ConfigEntry<bool> FreeCamCollide; public static ConfigEntry<bool> FreeCamCircletLight; public static ConfigEntry<bool> AdvancedRequiresWorkbench; public static ConfigEntry<string> FreeCamStationName; public static ConfigEntry<float> FreeCamStationRange; public static ConfigEntry<float> FreeCamMaxDistance; public static ConfigEntry<float> FreeCamRangeMultiplier; public static ConfigEntry<float> FreeCamSpeed; public static ConfigEntry<float> FreeCamFastMultiplier; public static ConfigEntry<float> FreeCamCollisionRadius; public static ConfigEntry<float> FreeCamCircletRange; public static ConfigEntry<float> FreeCamCircletIntensity; public static ConfigEntry<int> FreeCamMinComfort; public static ConfigEntry<string> MoveLinePreviewAxis; public static readonly string[] PreviewAxisNames = new string[4] { "Los tres", "Adelante / Atras", "Izquierda / Derecha", "Arriba / Abajo" }; public static ConfigEntry<Color> MoveLineColor; public static ConfigEntry<float> MoveLineLength; public static ConfigEntry<float> MoveLineBrightness; public static ConfigEntry<float> MoveLineThickness; public static ConfigEntry<float> MoveLineHeadSize; public static ConfigEntry<float> MoveLineHeadLength; public static ConfigEntry<float> MoveLineHeadWidth; public static ConfigEntry<float> MoveLineHeadOffset; public static ConfigEntry<float> MoveLineStemSize; public static ConfigEntry<float> MoveLineStemLength; public static ConfigEntry<float> MoveLineStemWidth; public static ConfigEntry<float> MoveLineDashFill; public static ConfigEntry<float> MoveLineDashWidth; public static ConfigEntry<float> MoveLineOffsetX; public static ConfigEntry<float> MoveLineOffsetY; public static ConfigEntry<float> MoveLineOffsetZ; public static ConfigEntry<int> MoveLineDashes; private bool _configDirty; private float _configDirtyTime; private static void ClearOrphans(ConfigFile config) { try { PropertyInfo property = typeof(ConfigFile).GetProperty("OrphanedEntries", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); ((property != null) ? (property.GetValue(config, null) as Dictionary<ConfigDefinition, string>) : null)?.Clear(); } catch (Exception ex) { Log.LogWarning((object)("Could not clean old entries from the config: " + ex.Message)); } } private void OnApplicationQuit() { if (_configDirty) { ((BaseUnityPlugin)this).Config.Save(); } } private void Update() { Patches.ActiveAxis(); Patches.UpdateToggleState(); if (_configDirty && Time.unscaledTime - _configDirtyTime > 1f) { _configDirty = false; ((BaseUnityPlugin)this).Config.Save(); } } private void Awake() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_0285: Unknown result type (might be due to invalid IL or missing references) //IL_0442: Unknown result type (might be due to invalid IL or missing references) //IL_044c: Expected O, but got Unknown //IL_047f: Unknown result type (might be due to invalid IL or missing references) //IL_0489: Expected O, but got Unknown //IL_04bc: Unknown result type (might be due to invalid IL or missing references) //IL_04c6: Expected O, but got Unknown //IL_04ef: Unknown result type (might be due to invalid IL or missing references) //IL_0527: Unknown result type (might be due to invalid IL or missing references) //IL_055f: Unknown result type (might be due to invalid IL or missing references) //IL_05a9: Unknown result type (might be due to invalid IL or missing references) //IL_05d4: Unknown result type (might be due to invalid IL or missing references) //IL_05ff: Unknown result type (might be due to invalid IL or missing references) //IL_062d: Unknown result type (might be due to invalid IL or missing references) //IL_065b: Unknown result type (might be due to invalid IL or missing references) //IL_06d1: Unknown result type (might be due to invalid IL or missing references) //IL_0713: Unknown result type (might be due to invalid IL or missing references) //IL_071d: Expected O, but got Unknown //IL_0750: Unknown result type (might be due to invalid IL or missing references) //IL_075a: Expected O, but got Unknown //IL_078d: Unknown result type (might be due to invalid IL or missing references) //IL_0797: Expected O, but got Unknown //IL_0812: Unknown result type (might be due to invalid IL or missing references) //IL_0898: Unknown result type (might be due to invalid IL or missing references) //IL_08a2: Expected O, but got Unknown //IL_08c9: Unknown result type (might be due to invalid IL or missing references) //IL_08d3: Expected O, but got Unknown //IL_0906: Unknown result type (might be due to invalid IL or missing references) //IL_0910: Expected O, but got Unknown //IL_0942: Unknown result type (might be due to invalid IL or missing references) //IL_094c: Expected O, but got Unknown //IL_097e: Unknown result type (might be due to invalid IL or missing references) //IL_0988: Expected O, but got Unknown //IL_09ba: Unknown result type (might be due to invalid IL or missing references) //IL_09c4: Expected O, but got Unknown //IL_09df: Unknown result type (might be due to invalid IL or missing references) //IL_0a0c: Unknown result type (might be due to invalid IL or missing references) //IL_0a39: Unknown result type (might be due to invalid IL or missing references) //IL_0a99: Unknown result type (might be due to invalid IL or missing references) //IL_0aa3: Expected O, but got Unknown //IL_0af6: Unknown result type (might be due to invalid IL or missing references) //IL_0b00: Expected O, but got Unknown //IL_0b33: Unknown result type (might be due to invalid IL or missing references) //IL_0b3d: Expected O, but got Unknown //IL_0b8b: Unknown result type (might be due to invalid IL or missing references) //IL_0c89: Unknown result type (might be due to invalid IL or missing references) //IL_0c93: Expected O, but got Unknown //IL_0d05: Unknown result type (might be due to invalid IL or missing references) //IL_0d0f: Expected O, but got Unknown //IL_0d41: Unknown result type (might be due to invalid IL or missing references) //IL_0d4b: Expected O, but got Unknown //IL_0d9e: Unknown result type (might be due to invalid IL or missing references) //IL_0da8: Expected O, but got Unknown //IL_0dda: Unknown result type (might be due to invalid IL or missing references) //IL_0de4: Expected O, but got Unknown //IL_0e16: Unknown result type (might be due to invalid IL or missing references) //IL_0e20: Expected O, but got Unknown //IL_0e52: Unknown result type (might be due to invalid IL or missing references) //IL_0e5c: Expected O, but got Unknown //IL_0e8e: Unknown result type (might be due to invalid IL or missing references) //IL_0e98: Expected O, but got Unknown //IL_0eca: Unknown result type (might be due to invalid IL or missing references) //IL_0ed4: Expected O, but got Unknown //IL_0f06: Unknown result type (might be due to invalid IL or missing references) //IL_0f10: Expected O, but got Unknown //IL_0f42: Unknown result type (might be due to invalid IL or missing references) //IL_0f4c: Expected O, but got Unknown //IL_0f7f: Unknown result type (might be due to invalid IL or missing references) //IL_0f89: Expected O, but got Unknown //IL_0ff7: Unknown result type (might be due to invalid IL or missing references) //IL_1001: Expected O, but got Unknown //IL_102a: Unknown result type (might be due to invalid IL or missing references) //IL_106b: Unknown result type (might be due to invalid IL or missing references) //IL_1075: Expected O, but got Unknown //IL_10a8: Unknown result type (might be due to invalid IL or missing references) //IL_10b2: Expected O, but got Unknown //IL_10e4: Unknown result type (might be due to invalid IL or missing references) //IL_10ee: Expected O, but got Unknown //IL_1120: Unknown result type (might be due to invalid IL or missing references) //IL_112a: Expected O, but got Unknown //IL_115c: Unknown result type (might be due to invalid IL or missing references) //IL_1166: Expected O, but got Unknown //IL_1198: Unknown result type (might be due to invalid IL or missing references) //IL_11a2: Expected O, but got Unknown //IL_11d4: Unknown result type (might be due to invalid IL or missing references) //IL_11de: Expected O, but got Unknown //IL_1210: Unknown result type (might be due to invalid IL or missing references) //IL_121a: Expected O, but got Unknown //IL_124c: Unknown result type (might be due to invalid IL or missing references) //IL_1256: Expected O, but got Unknown //IL_1288: Unknown result type (might be due to invalid IL or missing references) //IL_1292: Expected O, but got Unknown //IL_12ba: Unknown result type (might be due to invalid IL or missing references) //IL_12c4: Expected O, but got Unknown //IL_12f6: Unknown result type (might be due to invalid IL or missing references) //IL_1300: Expected O, but got Unknown //IL_1332: Unknown result type (might be due to invalid IL or missing references) //IL_133c: Expected O, but got Unknown //IL_1371: Unknown result type (might be due to invalid IL or missing references) //IL_137b: Expected O, but got Unknown //IL_13a0: Unknown result type (might be due to invalid IL or missing references) //IL_13aa: Expected O, but got Unknown //IL_13cf: Unknown result type (might be due to invalid IL or missing references) //IL_13d9: Expected O, but got Unknown //IL_140e: Unknown result type (might be due to invalid IL or missing references) //IL_1418: Expected O, but got Unknown //IL_143d: Unknown result type (might be due to invalid IL or missing references) //IL_1447: Expected O, but got Unknown //IL_146c: Unknown result type (might be due to invalid IL or missing references) //IL_1476: Expected O, but got Unknown //IL_14bf: Unknown result type (might be due to invalid IL or missing references) Log = ((BaseUnityPlugin)this).Logger; ((BaseUnityPlugin)this).Config.SaveOnConfigSet = false; Hidden = new ConfigFile(Path.Combine(Path.GetTempPath(), "aicho_advancedbuilding_hidden.cfg"), false); Hidden.SaveOnConfigSet = false; SnapDivisions = Hidden.Bind<int>("Gizmo", "SnapDivisions", 16, new ConfigDescription("Cantidad de angulos de snap por cada 180 grados. Vanilla usa 8.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(2, 256), Array.Empty<object>())); XRotationKey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Keys", "XRotationKey", new KeyboardShortcut((KeyCode)306, Array.Empty<KeyCode>()), "Manten esta tecla y usa la rueda para rotar en el eje X (circulo rojo)."); ZRotationKey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Keys", "ZRotationKey", new KeyboardShortcut((KeyCode)308, Array.Empty<KeyCode>()), "Manten esta tecla y usa la rueda para rotar en el eje Z (circulo azul). Sin ninguna tecla, la rueda rota en Y (circulo verde)."); ResetRotationKey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Keys", "ResetRotationKey", new KeyboardShortcut((KeyCode)118, Array.Empty<KeyCode>()), "Pulsa esta tecla para devolver a cero el eje seleccionado (el de la tecla que mantengas; Y si no mantienes ninguna)."); ResetAllRotationKey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Keys", "ResetAllRotationKey", new KeyboardShortcut((KeyCode)118, Array.Empty<KeyCode>()), "Pulsa esta tecla para devolver a cero la rotacion de todos los ejes."); ToggleAxesKey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Keys", "ToggleAxesKey", new KeyboardShortcut((KeyCode)284, Array.Empty<KeyCode>()), "Alterna los ejes entre globales (alineados con el mundo) y locales (alineados con la pieza), como en Blender. La pieza no cambia de rotacion."); CopyPieceRotation = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Keys", "CopyPieceRotation", new KeyboardShortcut((KeyCode)116, Array.Empty<KeyCode>()), "Pulsa esta tecla para copiar la rotacion de la pieza a la que apuntas (sin cambiar la pieza que vas a construir)."); FlipPieceKey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Keys", "FlipPieceKey", new KeyboardShortcut((KeyCode)116, (KeyCode[])(object)new KeyCode[1] { (KeyCode)304 }), "Da la vuelta a la pieza: la cara de atras queda al frente. Gira 180 grados sobre el eje vertical de la propia pieza, asi conserva su inclinacion (por ejemplo la del eje X). Solo con la construccion avanzada activada. Si usa la misma tecla que CopyPieceRotation (T), con Shift solo se voltea."); SelectTargetPieceKey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Keys", "SelectTargetPieceKey", new KeyboardShortcut((KeyCode)112, Array.Empty<KeyCode>()), "Pulsa esta tecla para seleccionar la pieza a la que apuntas como la pieza a construir, con su rotacion."); SnapDivisionIncrement = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Keys", "SnapDivisionsIncreaseKey", new KeyboardShortcut((KeyCode)289, Array.Empty<KeyCode>()), "Duplica las divisiones de snap actuales."); SnapDivisionDecrement = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Keys", "SnapDivisionsDecreaseKey", new KeyboardShortcut((KeyCode)288, Array.Empty<KeyCode>()), "Reduce a la mitad las divisiones de snap actuales."); RotationModeKey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Keys", "RotationModeKey", new KeyboardShortcut((KeyCode)114, (KeyCode[])(object)new KeyCode[1] { (KeyCode)304 }), "Activa o desactiva la rotacion libre del mod (gizmo, ejes y atajos de rotacion). Desactivada: la rotacion es la de Valheim. No guarda ni saca el arma."); FreezeKey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Keys", "FreezeKey", new KeyboardShortcut((KeyCode)282, Array.Empty<KeyCode>()), "Congela la posicion de la pieza donde esta (alterna). Puedes seguir rotandola; al colocarla se descongela."); DeactivateOnHammerUnequip = Hidden.Bind<bool>("Modes", "DeactivateOnHammerUnequip", true, "Al guardar el martillo se desactiva la construccion avanzada (la rotacion libre vuelve a su estado inicial) y se quitan los paneles."); RotationModeStartsActive = Hidden.Bind<bool>("Modes", "RotationModeStartsActive", false, "La rotacion libre del mod empieza activada al iniciar el juego."); LocalFrameMode = Hidden.Bind<bool>("Modes", "LocalFrameMode", true, "Orientacion inicial de los ejes: false = globales (mundo), true = locales (pieza). Se alterna en juego con ToggleAxesKey."); ReleaseOnPlace = Hidden.Bind<bool>("Freeze", "ReleaseOnPlace", false, "Descongela la posicion automaticamente despues de colocar cada pieza. Desactivado: la posicion sigue congelada hasta que pulses F1 otra vez, guardes el martillo o salgas de la construccion avanzada."); ReleaseOnPieceChange = Hidden.Bind<bool>("Freeze", "ReleaseOnPieceChange", false, "Descongela la posicion al elegir una pieza distinta. Desactivado: sigue congelada al cambiar de pieza (guardar el martillo si la descongela siempre)."); IgnoreTerrainOpPrefab = Hidden.Bind<bool>("Ignored", "IgnoreTerrainOpPrefab", false, "Si esta activo, la rotacion libre se ignora en las piezas que modifican el terreno (se usa la rotacion vanilla)."); IgnorePrefabNameList = Hidden.Bind<string>("Ignored", "IgnorePrefabNameList", "", "Lista de prefabs (separados por comas) en los que se ignora la rotacion libre."); ShowGizmo = ((BaseUnityPlugin)this).Config.Bind<bool>("UI", "ShowGizmo", true, "Muestra los tres circulos de rotacion alrededor de la pieza al construir."); GlobalPivotAtCursor = ((BaseUnityPlugin)this).Config.Bind<bool>("UI", "GlobalPivotAtCursor", true, "Con los ejes globales (F3) el gizmo y el centro del giro van al punto al que apuntas (el cursor de la mirilla; no se mueve al girar la pieza) y la pieza orbita alrededor de el al girarla; con los ejes locales el gizmo vuelve a la pieza y esta gira sobre si misma. Desactivado: el gizmo siempre esta en la pieza y esta siempre gira sobre si misma."); LocalPivotAtCenter = ((BaseUnityPlugin)this).Config.Bind<bool>("UI", "LocalPivotAtCenter", true, "Con los ejes locales el gizmo y el giro van al centro de la pieza (el medio de sus mallas) y esta gira sobre su centro, aunque su origen este en la base o en un extremo (paredes, postes, vigas). Desactivado: el centro es el origen de la pieza, como en el juego normal."); LocalGizmoPlacement = Hidden.Bind<bool>("UI", "LocalGizmoPlacement", true, "Con los ejes locales la pieza se coloca con la logica del propio juego, como en ComfyGizmo: al girarla siempre se apoya en lo que apuntas y no atraviesa el suelo. Con los ejes globales no cambia nada. Desactivado: con los locales la pieza gira sobre su centro (puede atravesar el suelo)."); GizmoIntro = ((BaseUnityPlugin)this).Config.Bind<bool>("UI", "GizmoIntro", true, "Al activar la construccion avanzada (Shift + R), los circulos de rotacion aparecen girando y mas pequenos, y se acomodan en su sitio con el mismo movimiento con el que vuelven despues de girar un eje."); GizmoIntroSpin = Hidden.Bind<float>("UI", "GizmoIntroSpin", 160f, new ConfigDescription("Cuanto giran los circulos (en grados, cada uno sobre su propio eje) al aparecer antes de acomodarse. 0 = no giran.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 360f), Array.Empty<object>())); GizmoIntroScale = ((BaseUnityPlugin)this).Config.Bind<float>("UI", "GizmoIntroScale", 0.55f, new ConfigDescription("Tamano con el que aparecen los circulos respecto a su tamano normal (1 = no cambian de tamano).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 1f), Array.Empty<object>())); GizmoIntroSeconds = ((BaseUnityPlugin)this).Config.Bind<float>("UI", "GizmoIntroSeconds", 0.12f, new ConfigDescription("Rapidez con la que se acomodan los circulos al aparecer, en segundos (mas alto = mas lento). La vuelta normal tras girar un eje usa 0.1.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.03f, 1f), Array.Empty<object>())); XGizmoColor = ((BaseUnityPlugin)this).Config.Bind<Color>("UI", "XGizmoColor", new Color(1f, 0f, 0f, 0.5f), "Color del circulo del eje X."); YGizmoColor = ((BaseUnityPlugin)this).Config.Bind<Color>("UI", "YGizmoColor", new Color(0f, 1f, 0f, 0.5f), "Color del circulo del eje Y."); ZGizmoColor = ((BaseUnityPlugin)this).Config.Bind<Color>("UI", "ZGizmoColor", new Color(0f, 0f, 1f, 0.5f), "Color del circulo del eje Z."); MoveEnabled = Hidden.Bind<bool>("Move", "MoveEnabled", true, "Permite desplazar la pieza con precision con el teclado (mismo sistema que Infinity Hammer). Si usas Infinity Hammer a la vez, desactiva sus teclas de mover para que no se sumen."); MoveForwardKey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Move", "MoveForwardKey", new KeyboardShortcut((KeyCode)120, Array.Empty<KeyCode>()), "Manten esta tecla y gira la rueda del raton para mover la pieza hacia adelante / atras. Con la tecla pulsada la rueda no gira la pieza."); MoveSidewaysKey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Move", "MoveSidewaysKey", new KeyboardShortcut((KeyCode)99, Array.Empty<KeyCode>()), "Manten esta tecla y gira la rueda del raton para mover la pieza a la izquierda / derecha."); MoveVerticalKey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Move", "MoveVerticalKey", new KeyboardShortcut((KeyCode)118, Array.Empty<KeyCode>()), "Manten esta tecla y gira la rueda del raton para subir / bajar la pieza. Si es la misma que la de reiniciar la rotacion (V), un toque rapido sin usar la rueda reinicia la rotacion."); MoveWheelLargeStepKey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Move", "MoveWheelLargeStepKey", new KeyboardShortcut((KeyCode)304, Array.Empty<KeyCode>()), "Manten esta tecla junto con la de mover mientras giras la rueda para usar el paso grande (MoveAmountLarge) en lugar de MoveAmount."); MoveWheelFineStepKey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Move", "MoveWheelFineStepKey", new KeyboardShortcut((KeyCode)308, Array.Empty<KeyCode>()), "Manten esta tecla junto con la de mover mientras giras la rueda para usar el paso fino (MoveAmountFine) en lugar de MoveAmount. Si tambien tienes pulsada la de paso grande, gana el paso fino."); BlockedGameButtons = Hidden.Bind<string>("Move", "BlockedGameButtons", "Sit,ToggleWalk,AutoPickup,OpenRadial,OpenEmote", "Botones del juego (separados por comas) que se anulan mientras usas las teclas de mover, para que X, C o V no hagan sentar al personaje, cambiar andar/correr o recoger automaticamente, ni abrir los menus radiales (G, T). Vacio = no se anula ninguno."); MoveWheelInvert = Hidden.Bind<bool>("Move", "MoveWheelInvert", false, "Invierte el sentido de la rueda al mover la pieza."); ResetOffsetKey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Move", "ResetPositionKey", new KeyboardShortcut((KeyCode)118, (KeyCode[])(object)new KeyCode[1] { (KeyCode)306 }), "Pulsa esta tecla para reiniciar la posicion de la pieza: quita el desplazamiento que hayas hecho con las teclas de mover. Si usa la misma tecla que una de mover (V), con Ctrl solo reinicia."); MoveAmount = ((BaseUnityPlugin)this).Config.Bind<float>("Move", "MoveAmount", 0.1f, new ConfigDescription("Metros que se mueve la pieza por pulsacion.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.01f, 2f), Array.Empty<object>())); MoveAmountLarge = ((BaseUnityPlugin)this).Config.Bind<float>("Move", "MoveAmountLarge", 1f, new ConfigDescription("Metros que se mueve la pieza por pulsacion con la tecla de paso grande.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.05f, 10f), Array.Empty<object>())); MoveAmountFine = ((BaseUnityPlugin)this).Config.Bind<float>("Move", "MoveAmountFine", 0.01f, new ConfigDescription("Metros que se mueve la pieza por pulsacion con la tecla de paso fino.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.001f, 0.5f), Array.Empty<object>())); ResetOffsetOnPieceChange = ((BaseUnityPlugin)this).Config.Bind<bool>("Move", "ResetOffsetOnPieceChange", true, "Quita el desplazamiento al elegir una pieza distinta o guardar el martillo. Colocar una pieza NO lo quita (usa ResetOffsetOnPlace para eso), asi puedes seguir colocando piezas iguales en el mismo sitio."); RespectPlaceDistance = Hidden.Bind<bool>("Move", "RespectPlaceDistance", true, "Juego normal: el desplazamiento y la posicion congelada no permiten colocar piezas mas lejos de la distancia normal de construccion."); ResetOffsetOnPlace = ((BaseUnityPlugin)this).Config.Bind<bool>("Move", "ResetOffsetOnPlace", false, "Quita el desplazamiento despues de colocar cada pieza."); FreeCamKey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Camara libre", "FreeCamKey", new KeyboardShortcut((KeyCode)98, Array.Empty<KeyCode>()), "Activa y desactiva la camara libre: la camara se despega del personaje (que se queda quieto) y se mueve libremente para colocar piezas en sitios a los que no llegarias. Se mira con el raton, W A S D mueven, Espacio sube, Control baja y Mayus acelera. Se apaga al volver a pulsar esta tecla, al guardar el martillo (o la herramienta) o al salir del rango del banco de trabajo."); FreeCamRequireWorkbench = ((BaseUnityPlugin)this).Config.Bind<bool>("Camara libre", "RequireWorkbench", true, "Para activar la camara libre (y mantenerla) debe haber un banco de trabajo dentro de StationRange del personaje. Si sales de ese rango, se apaga."); FreeCamStationName = ((BaseUnityPlugin)this).Config.Bind<string>("Camara libre", "StationName", "$piece_workbench", "Nombre de la estacion que hace falta cerca ($piece_workbench = banco de trabajo). Se usa su propio rango (StationRange); no se modifica el area de efecto de la estacion."); FreeCamStationRange = ((BaseUnityPlugin)this).Config.Bind<float>("Camara libre", "StationRange", 20f, new ConfigDescription("Distancia maxima, en metros, entre el personaje y el banco de trabajo.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 200f), Array.Empty<object>())); FreeCamMinComfort = Hidden.Bind<int>("Camara libre", "MinComfort", 0, new ConfigDescription("Nivel minimo de comodidad (ambiente acogedor) del personaje para activar la camara libre. 0 = sin requisito.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 30), Array.Empty<object>())); FreeCamMaxDistance = ((BaseUnityPlugin)this).Config.Bind<float>("Camara libre", "MaxDistance", 60f, new ConfigDescription("Distancia maxima, en metros, a la que la camara puede alejarse del personaje.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(5f, 500f), Array.Empty<object>())); FreeCamRangeMultiplier = Hidden.Bind<float>("Camara libre", "RangeMultiplier", 1f, new ConfigDescription("Multiplicador del rango de la camara (MaxDistance x este valor).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 5f), Array.Empty<object>())); FreeCamSpeed = Hidden.Bind<float>("Camara libre", "Speed", 12f, new ConfigDescription("Velocidad de la camara en metros por segundo.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 100f), Array.Empty<object>())); FreeCamFastMultiplier = Hidden.Bind<float>("Camara libre", "FastMultiplier", 3f, new ConfigDescription("Cuanto se acelera la camara al mantener la tecla rapida (Mayus).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 10f), Array.Empty<object>())); FreeCamUpKey = Hidden.Bind<KeyboardShortcut>("Camara libre", "UpKey", new KeyboardShortcut((KeyCode)32, Array.Empty<KeyCode>()), "Tecla para subir la camara."); FreeCamDownKey = Hidden.Bind<KeyboardShortcut>("Camara libre", "DownKey", new KeyboardShortcut((KeyCode)306, Array.Empty<KeyCode>()), "Tecla para bajar la camara."); FreeCamFastKey = Hidden.Bind<KeyboardShortcut>("Camara libre", "FastKey", new KeyboardShortcut((KeyCode)304, Array.Empty<KeyCode>()), "Mantenla pulsada para mover la camara mas rapido."); FreeCamCollide = Hidden.Bind<bool>("Camara libre", "Collide", true, "La camara no atraviesa el terreno, las piezas ni las rocas."); FreeCamCollisionRadius = Hidden.Bind<float>("Camara libre", "CollisionRadius", 0.4f, new ConfigDescription("Tamano de la camara para las colisiones, en metros.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.05f, 2f), Array.Empty<object>())); FreeCamCircletLight = ((BaseUnityPlugin)this).Config.Bind<bool>("Camara libre", "CircletLight", true, "La luz de la diadema Dvergr equipada (tambien en ranuras de otros mods) sigue a la camara."); FreeCamCircletRange = ((BaseUnityPlugin)this).Config.Bind<float>("Camara libre", "CircletLightRange", 0f, new ConfigDescription("Alcance de la luz de la diadema mientras sigue a la camara. 0 = conserva el de la diadema equipada.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 100f), Array.Empty<object>())); FreeCamCircletIntensity = ((BaseUnityPlugin)this).Config.Bind<float>("Camara libre", "CircletLightIntensity", 0f, new ConfigDescription("Intensidad de la luz de la diadema mientras sigue a la camara. 0 = conserva la de la diadema equipada.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 10f), Array.Empty<object>())); AdvancedRequiresWorkbench = Hidden.Bind<bool>("Camara libre", "AdvancedModeRequiresWorkbench", false, "Si esta activo, la construccion avanzada (Shift + R) tambien pide un banco de trabajo cerca para activarse (con los mismos StationName y StationRange)."); FloatingMessages = new Fixed<bool>(value: true); MessagePreview = new Fixed<bool>(value: false); MessageColor = new Fixed<Color>(new Color(1f, 0.851f, 0.149f, 1f)); MessageFont = new Fixed<string>("Hud"); MessageSize = new Fixed<float>(32.62911f); MessageOutline = new Fixed<bool>(value: false); MessageSeconds = new Fixed<float>(3f); MessageFadeSeconds = new Fixed<float>(0.6f); MessageHeight = new Fixed<float>(1.637793f); MessageSide = new Fixed<float>(0.35f); MessageForward = new Fixed<float>(0.3661972f); MessageScreenX = new Fixed<float>(136.1502f); MessageScreenY = new Fixed<float>(4.694836f); TextWorkbench = new Fixed<string>("Falta un banco de Trabajo"); AreaRepair = ((BaseUnityPlugin)this).Config.Bind<bool>("Reparacion", "AreaRepair", true, "Reparacion en area: al reparar una pieza con el martillo tambien se reparan las piezas danadas que haya a su alrededor (dentro de AreaRadius). Siempre activa; ponlo en false para desactivarla."); AreaRepairRadius = ((BaseUnityPlugin)this).Config.Bind<float>("Reparacion", "AreaRadius", 4f, new ConfigDescription("Metros alrededor de la pieza reparada en los que tambien se reparan las demas piezas danadas.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.5f, 30f), Array.Empty<object>())); DebugLog = Hidden.Bind<bool>("Debug", "DebugLog", false, "Escribe en el log (LogOutput.log) los cambios de seleccion de eje y de visibilidad del gizmo, para diagnosticar problemas."); HideUnselectedAxes = ((BaseUnityPlugin)this).Config.Bind<bool>("UI", "HideUnselectedAxes", true, "Mientras mantienes la tecla de un eje (X o Z), solo se ve ese eje y se ocultan los demas. Sin teclas se ven los tres."); AxisFocusSeconds = ((BaseUnityPlugin)this).Config.Bind<float>("UI", "AxisFocusHold", 0.15f, new ConfigDescription("Segundos que sigue visible solo el eje que acabas de girar con la rueda (tambien el Y, que no tiene tecla) antes de que los demas reaparezcan. Valores bajos = reaparecen casi de inmediato. 0 = solo se aisla mientras mantienes la tecla de X o Z.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 5f), Array.Empty<object>())); WheelFocusHold = Hidden.Bind<float>("UI", "WheelFocusHold", 0.65f, new ConfigDescription("Segundos que sigue visible solo el eje Y despues de girar con la rueda sola (sin teclas) antes de que los demas reaparezcan. Es mayor que AxisFocusHold para evitar parpadeos entre pasos de la rueda.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 5f), Array.Empty<object>())); RingsReturnToNormal = ((BaseUnityPlugin)this).Config.Bind<bool>("UI", "RingsReturnToNormal", true, "Los circulos giran con la pieza mientras la rotas y, al dejar de girar, vuelven a su forma normal (la pieza se queda girada). Desactivado: los circulos conservan el giro acumulado."); GizmoOpacity = ((BaseUnityPlugin)this).Config.Bind<float>("UI", "GizmoOpacity", 0.5f, new ConfigDescription("Opacidad del gizmo (0 = invisible, 1 = opaco). Sustituye al canal alfa de los colores. El eje activo se muestra mas opaco.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>())); GizmoLineThickness = Hidden.Bind<float>("UI", "GizmoLineThickness", 1f, new ConfigDescription("Grosor de las lineas, flechas y nodos del gizmo.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.2f, 5f), Array.Empty<object>())); ArrowLengthDegrees = Hidden.Bind<float>("UI", "ArrowLengthDegrees", 25.78403f, new ConfigDescription("Largo total de cada flecha doble <--->, en grados del anillo.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(10f, 80f), Array.Empty<object>())); ArrowHeadSize = Hidden.Bind<float>("UI", "ArrowHeadSize", 0.6577465f, new ConfigDescription("Tamano de las puntas de las flechas < y >.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.3f, 3f), Array.Empty<object>())); ArrowHeadLength = Hidden.Bind<float>("UI", "ArrowHeadLength", 2.566667f, new ConfigDescription("Multiplicador extra del largo de las puntas < y > (se suma al efecto de ArrowHeadSize, que escala ancho y largo a la vez).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.3f, 5f), Array.Empty<object>())); ArrowShaftThickness = Hidden.Bind<float>("UI", "ArrowShaftThickness", 0.943662f, new ConfigDescription("Grosor de la linea que va dentro de las puntas ---.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.2f, 5f), Array.Empty<object>())); DashLengthDegrees = Hidden.Bind<float>("UI", "DashLengthDegrees", 5.631455f, new ConfigDescription("Largo de cada guion - , en grados del anillo.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.5f, 15f), Array.Empty<object>())); DashThickness = Hidden.Bind<float>("UI", "DashThickness", 0.6394366f, new ConfigDescription("Grosor de cada guion -.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.2f, 5f), Array.Empty<object>())); GizmoSizeMultiplier = ((BaseUnityPlugin)this).Config.Bind<float>("UI", "GizmoSizeMultiplier", 1.244836f, new ConfigDescription("Multiplicador del tamano del gizmo respecto al tamano de la pieza.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.25f, 3f), Array.Empty<object>())); ShowMoveLine = ((BaseUnityPlugin)this).Config.Bind<bool>("MoveLine", "Show", true, "Mientras mantienes una tecla de mover (X, C o V) se ocultan los circulos de rotacion y se ve solo una linea con puntas, tallo y guiones <-- - - - --> a lo largo del eje en que mueves la pieza."); MoveLinePreview = Hidden.Bind<bool>("MoveLine", "Preview", false, "VISTA PREVIA: mantiene visible la linea de movimiento (en lugar de los circulos de rotacion) mientras estas en modo construccion con una pieza elegida, para poder ajustar su aspecto desde el gestor de configuracion sin pulsar las teclas de mover. Desactivala al terminar."); MoveLinePreviewAxis = Hidden.Bind<string>("MoveLine", "PreviewAxis", PreviewAxisNames[0], new ConfigDescription("Que linea se ve en la vista previa: las tres a la vez o solo la de una direccion.", (AcceptableValueBase)(object)new AcceptableValueList<string>(PreviewAxisNames), Array.Empty<object>())); MoveLineColor = ((BaseUnityPlugin)this).Config.Bind<Color>("MoveLine", "Color", new Color(1f, 0.82f, 0.2f, 0.75f), "Color y opacidad de la linea de movimiento (amarillo por defecto)."); MoveLineBrightness = Hidden.Bind<float>("MoveLine", "Brightness", 3f, new ConfigDescription("Brillo (emision) de la linea de movimiento.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 3f), Array.Empty<object>())); MoveLineLength = ((BaseUnityPlugin)this).Config.Bind<float>("MoveLine", "Length", 0.982629f, new ConfigDescription("Largo de la linea respecto al tamano de la pieza (1 = de lado a lado del gizmo). Mide de una punta a la otra.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.3f, 4f), Array.Empty<object>())); MoveLineThickness = Hidden.Bind<float>("MoveLine", "Thickness", 1.073239f, new ConfigDescription("Grosor de las lineas (tallo y guiones) a la vez. Se multiplica por StemWidth y DashWidth.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.2f, 8f), Array.Empty<object>())); MoveLineHeadSize = Hidden.Bind<float>("MoveLine", "HeadSize", 1f, new ConfigDescription("Tamano de las puntas < y > (largo y ancho a la vez). Se multiplica por HeadLength y HeadWidth.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.2f, 5f), Array.Empty<object>())); MoveLineHeadLength = Hidden.Bind<float>("MoveLine", "HeadLength", 2.292958f, new ConfigDescription("Largo de las puntas (de la base a la punta).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.2f, 5f), Array.Empty<object>())); MoveLineHeadWidth = Hidden.Bind<float>("MoveLine", "HeadWidth", 0.9f, new ConfigDescription("Ancho de las puntas.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.2f, 5f), Array.Empty<object>())); MoveLineHeadOffset = Hidden.Bind<float>("MoveLine", "HeadOffset", 0f, new ConfigDescription("Posicion de las puntas: mueve las dos hacia afuera (positivo) o hacia adentro (negativo) respecto al extremo de la linea, en unidades del tamano de la pieza.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(-1f, 1f), Array.Empty<object>())); MoveLineStemSize = Hidden.Bind<float>("MoveLine", "StemSize", 0.3464788f, new ConfigDescription("Tamano de la linea pegada a cada punta (<-): largo y grosor a la vez. Se multiplica por StemLength y StemWidth.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.2f, 6f), Array.Empty<object>())); MoveLineStemLength = Hidden.Bind<float>("MoveLine", "StemLength", 1.225352f, new ConfigDescription("Largo de la linea pegada a cada punta (<-). 0 = sin esa linea; los guiones empiezan justo detras de la punta.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 6f), Array.Empty<object>())); MoveLineStemWidth = Hidden.Bind<float>("MoveLine", "StemWidth", 5.732395f, new ConfigDescription("Grosor de la linea pegada a cada punta.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.2f, 8f), Array.Empty<object>())); MoveLineDashes = Hidden.Bind<int>("MoveLine", "Dashes", 12, new ConfigDescription("Cantidad de guiones entre las dos lineas pegadas a las puntas.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 24), Array.Empty<object>())); MoveLineDashFill = Hidden.Bind<float>("MoveLine", "DashFill", 0.6746479f, new ConfigDescription("Largo de cada guion respecto a su hueco: 0.1 = guiones muy cortos y huecos largos, 0.95 = casi una linea continua.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 0.95f), Array.Empty<object>())); MoveLineDashWidth = Hidden.Bind<float>("MoveLine", "DashWidth", 0.8f, new ConfigDescription("Grosor de cada guion.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.2f, 8f), Array.Empty<object>())); AcceptableValueRange<float> val = new AcceptableValueRange<float>(-5f, 5f); MoveLineOffsetX = ((BaseUnityPlugin)this).Config.Bind<float>("MoveLine", "OffsetX", 0f, new ConfigDescription("Mueve toda la linea a la derecha (positivo) o a la izquierda (negativo) de la pieza, en metros.", (AcceptableValueBase)(object)val, Array.Empty<object>())); MoveLineOffsetY = ((BaseUnityPlugin)this).Config.Bind<float>("MoveLine", "OffsetY", 0f, new ConfigDescription("Mueve toda la linea hacia arriba (positivo) o abajo (negativo) de la pieza, en metros.", (AcceptableValueBase)(object)val, Array.Empty<object>())); MoveLineOffsetZ = ((BaseUnityPlugin)this).Config.Bind<float>("MoveLine", "OffsetZ", 0f, new ConfigDescription("Mueve toda la linea hacia adelante (positivo) o atras (negativo) de la pieza, en metros.", (AcceptableValueBase)(object)val, Array.Empty<object>())); AcceptableValueRange<float> val2 = new AcceptableValueRange<float>(0f, 3f); EmissionFactorX = ((BaseUnityPlugin)this).Config.Bind<float>("UI", "EmissionFactorX", 3f, new ConfigDescription("Factor de emision (brillo) del circulo X.", (AcceptableValueBase)(object)val2, Array.Empty<object>())); EmissionFactorY = ((BaseUnityPlugin)this).Config.Bind<float>("UI", "EmissionFactorY", 3f, new ConfigDescription("Factor de emision (brillo) del circulo Y.", (AcceptableValueBase)(object)val2, Array.Empty<object>())); EmissionFactorZ = ((BaseUnityPlugin)this).Config.Bind<float>("UI", "EmissionFactorZ", 3f, new ConfigDescription("Factor de emision (brillo) del circulo Z.", (AcceptableValueBase)(object)val2, Array.Empty<object>())); BuildPanel.BindConfig(((BaseUnityPlugin)this).Config); RotState.Local = LocalFrameMode.Value; RotState.Active = RotationModeStartsActive.Value; ClearOrphans(((BaseUnityPlugin)this).Config); LocConfig.Apply(((BaseUnityPlugin)this).Config); new Harmony("aicho.buildgizmo").PatchAll(typeof(Plugin).Assembly); ((BaseUnityPlugin)this).Config.Save(); ((BaseUnityPlugin)this).Config.SettingChanged += delegate { _configDirty = true; _configDirtyTime = Time.unscaledTime; }; Log.LogInfo((object)"Aicho Advanced Building 0.1.0 loaded."); } } internal static class RotState { public static Quaternion Rot = Quaternion.identity; public static bool Local; public static bool Active; public static bool SkipNextDiff; public static int LastAxis = 1; public static float LastRotateTime = -100f; public static float VX; public static float VY; public static float VZ; public static float IntroX; public static float IntroY; public static float IntroZ; public static float Step => 180f / (float)Plugin.SnapDivisions.Value; public static Quaternion AxesFrame { get { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) if (!Local) { return Quaternion.identity; } return Rot; } } private static Vector3 AxisVector(int axis) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) return (Vector3)(axis switch { 1 => Vector3.up, 0 => Vector3.right, _ => Vector3.forward, }); } public static void Rotate(int axis, int steps) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) LastAxis = axis; LastRotateTime = Time.time; float num = (float)steps * Step; AddSpin(axis, num); Quaternion val = Quaternion.AngleAxis(num, AxisVector(axis)); if (Local) { SetRotInPlace(Rot * val); } else if (Plugin.GlobalPivotAtCursor.Value) { OffsetState.Engage(); Rot = Normalize(val * Rot); OffsetState.Orbit(val); } else { SetRotInPlace(val * Rot); } } private static void SetRotInPlace(Quaternion newRotation) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) OffsetState.Engage(); Rot = Normalize(newRotation); } private static Quaternion Normalize(Quaternion q) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.Sqrt(q.x * q.x + q.y * q.y + q.z * q.z + q.w * q.w); if (num < 1E-06f) { return Quaternion.identity; } return new Quaternion(q.x / num, q.y / num, q.z / num, q.w / num); } public static void Flip() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) LastAxis = 1; LastRotateTime = Time.time; AddSpin(1, 180f); SetRotInPlace(Rot * Quaternion.AngleAxis(180f, Vector3.up)); } public static void ToggleLocal() { OffsetState.BeforeAxesToggle(); Local = !Local; } public static void ResetAxis(int axis) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) Vector3 eulerAngles = ((Quaternion)(ref Rot)).eulerAngles; switch (axis) { case 0: eulerAngles.x = 0f; break; case 1: eulerAngles.y = 0f; break; default: eulerAngles.z = 0f; break; } SetRotInPlace(Quaternion.Euler(eulerAngles)); switch (axis) { case 0: VX = 0f; break; case 1: VY = 0f; break; default: VZ = 0f; break; } } public static void ResetAll() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) SetRotInPlace(Quaternion.identity); VX = (VY = (VZ = 0f)); } public static void CopyFromPiece(Quaternion worldRotation) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) SetRotInPlace(worldRotation); VX = (VY = (VZ = 0f)); } public static void SetFromPiece(Quaternion worldRotation) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) Rot = Normalize(worldRotation); VX = (VY = (VZ = 0f)); } private static void AddSpin(int axis, float degrees) { switch (axis) { case 0: VX += degrees; break; case 1: VY += degrees; break; default: VZ += degrees; break; } } public static void DecaySpin(float dt) { if (Plugin.RingsReturnToNormal.Value) { float k = 1f - Mathf.Exp((0f - dt) / 0.1f); VX = Decay(VX, k); VY = Decay(VY, k); VZ = Decay(VZ, k); } } private static float Decay(float v, float k) { v = Mathf.DeltaAngle(0f, v); v *= 1f - k; if (!(Mathf.Abs(v) < 0.05f)) { return v; } return 0f; } public static void RingRotations(Quaternion frame, out Quaternion qx, out Quaternion qy, out Quaternion qz) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) Quaternion val = Quaternion.FromToRotation(Vector3.up, Vector3.right); Quaternion val2 = Quaternion.FromToRotation(Vector3.up, Vector3.forward); qx = frame * Quaternion.AngleAxis(VX + IntroX, Vector3.right) * val; qy = frame * Quaternion.AngleAxis(VY + IntroY, Vector3.up); qz = frame * Quaternion.AngleAxis(VZ + IntroZ, Vector3.forward) * val2; } public static Quaternion GhostRotation(float x, float y, float z) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) Quaternion result = Quaternion.Euler(x, y, z); Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null) { return result; } GameObject val = Patches.GhostRef.Invoke(localPlayer); if ((Object)(object)val == (Object)null) { return result; } Piece component = val.GetComponent<Piece>(); if ((Object)(object)component == (Object)null || !component.m_canRotate) { return result; } if (!Active || Patches.IsIgnored(val)) { return result; } return Rot; } } internal static class Patches { public static readonly FieldRef<Player, int> PlaceRotationRef = AccessTools.FieldRefAccess<Player, int>("m_placeRotation"); public static readonly FieldRef<Player, GameObject> GhostRef = AccessTools.FieldRefAccess<Player, GameObject>("m_placementGhost"); private static KeyboardShortcut[] _hotkeys; private static int _hotkeysFrame = -1; private static string _blockedRaw; private static HashSet<string> _blockedNames = new HashSet<string>(); public static bool ToggleRequested; private static float _toggleRequestedTime; private static bool _hideDeferred; private static bool _hideComboUsed; private static float _mainDownTime = -100f; private static float _lastToggleFire = -100f; private static bool _modifiersPrev; public static float LastToggleHeldTime = -100f; private static int _lockedAxis = 1; private static int _lastFrame = -1; private static float _lastHeldTime; private static bool _prevHeldRaw; private const float MissedReleaseTimeout = 0.5f; private static readonly string[] AxisNames = new string[3] { "X", "Y", "Z" }; public static bool IsIgnored(GameObject ghost) { if (Plugin.IgnoreTerrainOpPrefab.Value && ((Object)(object)ghost.GetComponentInChildren<TerrainOp>() != (Object)null || (Object)(object)ghost.GetComponentInChildren<TerrainModifier>() != (Object)null)) { return true; } string value = Plugin.IgnorePrefabNameList.Value; if (string.IsNullOrWhiteSpace(value)) { return false; } string text = ((Object)ghost).name; if (text.EndsWith("(Clone)")) { text = text.Substring(0, text.Length - 7); } string[] array = value.Split(','); for (int i = 0; i < array.Length; i++) { if (string.Equals(array[i].Trim(), text, StringComparison.OrdinalIgnoreCase)) { return true; } } return false; } public static bool UiBlocksInput() { if ((Object)(object)Chat.instance != (Object)null && Chat.instance.HasFocus()) { return true; } if (Console.IsVisible()) { return true; } if (Menu.IsVisible()) { return true; } if (TextInput.IsVisible()) { return true; } if (InventoryGui.IsVisible()) { return true; } if (Hud.IsPieceSelectionVisible()) { return true; } return false; } private static KeyCode Twin(KeyCode key) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected I4, but got Unknown return (KeyCode)((key - 303) switch { 1 => 303, 0 => 304, 3 => 305, 2 => 306, 5 => 307, 4 => 308, _ => 0, }); } public static bool KeyHeld(KeyCode key) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) if ((int)key == 0) { return false; } if (Input.GetKey(key)) { return true; } KeyCode val = Twin(key); if ((int)val != 0) { return Input.GetKey(val); } return false; } public static Vector3 PlaceOrigin(Player player) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) if (!FreeCam.Active) { return ((Character)player).GetEyePoint(); } return FreeCam.Position; } public static bool KeyReleasedNow(KeyCode key) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) if ((int)key == 0) { return false; } if (Input.GetKeyUp(key)) { return true; } KeyCode val = Twin(key); if ((int)val != 0) { return Input.GetKeyUp(val); } return false; } public static bool Pressed(KeyboardShortcut shortcut) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) KeyCode mainKey = ((KeyboardShortcut)(ref shortcut)).MainKey; if ((int)mainKey == 0) { return false; } if (OverriddenBySpecific(shortcut)) { return false; } if (Plugin.MoveEnabled.Value && OffsetState.IsMoveKey(mainKey)) { if (OffsetState.TapReleased(mainKey)) { return ModifiersHeld(shortcut); } return false; } return ((KeyboardShortcut)(ref shortcut)).IsDown(); } private static KeyboardShortcut[] HotkeyList() { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) if (_hotkeys != null && _hotkeysFrame == Time.frameCount) { return _hotkeys; } _hotkeysFrame = Time.frameCount; _hotkeys = (KeyboardShortcut[])(object)new KeyboardShortcut[15] { Plugin.RotationModeKey.Value, Plugin.ResetRotationKey.Value, Plugin.ResetAllRotationKey.Value, Plugin.ToggleAxesKey.Value, Plugin.CopyPieceRotation.Value, Plugin.FlipPieceKey.Value, Plugin.SelectTargetPieceKey.Value, Plugin.SnapDivisionIncrement.Value, Plugin.SnapDivisionDecrement.Value, Plugin.FreezeKey.Value, Plugin.FreeCamKey.Value, Plugin.MoveForwardKey.Value, Plugin.MoveSidewaysKey.Value, Plugin.MoveVerticalKey.Value, Plugin.ResetOffsetKey.Value }; return _hotkeys; } private static int ModifierCount(KeyboardShortcut shortcut) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) int num = 0; foreach (KeyCode modifier in ((KeyboardShortcut)(ref shortcut)).Modifiers) { _ = modifier; num++; } return num; } public static bool OverriddenBySpecific(KeyboardShortcut shortcut) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) KeyCode mainKey = ((KeyboardShortcut)(ref shortcut)).MainKey; if ((int)mainKey == 0) { return false; } int num = ModifierCount(shortcut); KeyboardShortcut[] array = HotkeyList(); for (int i = 0; i < array.Length; i++) { KeyboardShortcut shortcut2 = array[i]; if (((KeyboardShortcut)(ref shortcut2)).MainKey == mainKey && ModifierCount(shortcut2) > num && ModifiersHeld(shortcut2)) { return true; } } return false; } public static bool HeldPlain(KeyboardShortcut shortcut) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) if (Held(shortcut)) { return !OverriddenBySpecific(shortcut); } return false; } private static bool SharedHotkeyActive() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) KeyboardShortcut value = Plugin.FlipPieceKey.Value; if (!HotkeyKeyActive(((KeyboardShortcut)(ref value)).MainKey)) { value = Plugin.CopyPieceRotation.Value; if (!HotkeyKeyActive(((KeyboardShortcut)(ref value)).MainKey)) { value = Plugin.ResetOffsetKey.Value; return HotkeyKeyActive(((KeyboardShortcut)(ref value)).MainKey); } } return true; } private static bool HotkeyKeyActive(KeyCode main) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) if ((int)main != 0) { if (!KeyHeld(main)) { return KeyReleasedNow(main); } return true; } return false; } public static bool ShouldBlockGameButton(string name) { if (!RotState.Active) { return false; } string value = Plugin.BlockedGameButtons.Value; if (string.IsNullOrWhiteSpace(value)) { return false; } if ((object)value != _blockedRaw && value != _blockedRaw) { _blockedRaw = value; _blockedNames = new HashSet<string>(); string[] array = value.Split(','); foreach (string text in array) { if (text.Trim().Length > 0) { _blockedNames.Add(text.Trim()); } } } if (!_blockedNames.Contains(name)) { return false; } Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null || !((Character)localPlayer).InPlaceMode()) { return false; } if (!Plugin.MoveEnabled.Value || !OffsetState.MoveKeyActive()) { return SharedHotkeyActive(); } return true; } public static bool KeyPressedNow(KeyCode key) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) if ((int)key == 0) { return false; } if (Input.GetKeyDown(key)) { return true; } KeyCode val = Twin(key); if ((int)val != 0) { return Input.GetKeyDown(val); } return false; } public static bool ModifiersHeld(KeyboardShortcut shortcut) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) foreach (KeyCode modifier in ((KeyboardShortcut)(ref shortcut)).Modifiers) { if (!KeyHeld(modifier)) { return false; } } return true; } public static bool KeyDown(KeyboardShortcut shortcut) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) KeyCode mainKey = ((KeyboardShortcut)(ref shortcut)).MainKey; if ((int)mainKey == 0 || !KeyPressedNow(mainKey)) { return false; } foreach (KeyCode modifier in ((KeyboardShortcut)(ref shortcut)).Modifiers) { if (!KeyHeld(modifier)) { return false; } } return true; } public static void UpdateToggleState() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Invalid comparison between Unknown and I4 //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) KeyboardShortcut value = Plugin.RotationModeKey.Value; KeyCode mainKey = ((KeyboardShortcut)(ref value)).MainKey; float unscaledTime = Time.unscaledTime; bool flag = ModifiersHeld(value); bool flag2 = KeyHeld(mainKey); bool flag3 = (int)mainKey > 0 && flag2 && flag; if ((int)mainKey != 0 && KeyPressedNow(mainKey)) { _mainDownTime = unscaledTime; } bool flag4 = false; if ((int)mainKey != 0 && KeyPressedNow(mainKey) && flag) { flag4 = true; } else if (flag && !_modifiersPrev && flag2 && unscaledTime - _mainDownTime < 0.3f) { flag4 = true; } _modifiersPrev = flag; if (flag4 && unscaledTime - _lastToggleFire > 0.4f) { ToggleRequested = true; _toggleRequestedTime = unscaledTime; _lastToggleFire = unscaledTime; } if (ToggleRequested && unscaledTime - _toggleRequestedTime > 0.3f) { ToggleRequested = false; } if (flag3) { LastToggleHeldTime = unscaledTime; } if (!_hideDeferred) { return; } if (flag3) { _hideComboUsed = true; } if ((int)mainKey == 0 || !KeyHeld(mainKey)) { if (!_hideComboUsed) { PerformVanillaHide(); } _hideDeferred = false; _hideComboUsed = false; } } public static bool ShouldBlockHide() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) KeyboardShortcut value = Plugin.RotationModeKey.Value; KeyCode mainKey = ((KeyboardShortcut)(ref value)).MainKey; if ((int)mainKey == 0) { return false; } float unscaledTime = Time.unscaledTime; if (Held(value)) { LastToggleHeldTime = unscaledTime; _hideComboUsed = true; return true; } if (unscaledTime - LastToggleHeldTime < 0.25f) { return true; } bool flag = false; using (IEnumerator<KeyCode> enumerator = ((KeyboardShortcut)(ref value)).Modifiers.GetEnumerator()) { if (enumerator.MoveNext()) { _ = enumerator.Current; flag = true; } } if (flag && Input.GetKey(mainKey)) { _hideDeferred = true; _hideComboUsed = false; return true; } return false; } private static void PerformVanillaHide() { Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null) { return; } object? obj = AccessTools.Method(typeof(Humanoid), "GetRightItem", (Type[])null, (Type[])null).Invoke(localPlayer, null); object obj2 = AccessTools.Method(typeof(Humanoid), "GetLeftItem", (Type[])null, (Type[])null).Invoke(localPlayer, null); if (obj != null || obj2 != null) { if (!((Character)localPlayer).InAttack() && !((Character)localPlayer).InDodge()) { ((Humanoid)localPlayer).HideHandItems(false, true); } } else if ((!((Character)localPlayer).IsSwimming() || ((Character)localPlayer).IsOnGround()) && !((Character)localPlayer).InDodge()) { AccessTools.Method(typeof(Humanoid), "ShowHandItems", (Type[])null, (Type[])null).Invoke(localPlayer, new object[2] { false, true }); } } public static bool Held(KeyboardShortcut shortcut) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) KeyCode mainKey = ((KeyboardShortcut)(ref shortcut)).MainKey; if ((int)mainKey == 0 || !KeyHeld(mainKey)) { return false; } foreach (KeyCode modifier in ((KeyboardShortcut)(ref shortcut)).Modifiers) { if (!KeyHeld(modifier)) { return false; } } return true; } public static int ActiveAxis() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) if (_lastFrame == Time.frameCount) { return _lockedAxis; } _lastFrame = Time.frameCount; float unscaledTime = Time.unscaledTime; bool flag = Held(Plugin.XRotationKey.Value); bool flag2 = Held(Plugin.ZRotationKey.Value); if (_lockedAxis != 1) { KeyboardShortcut val = ((_lockedAxis == 0) ? Plugin.XRotationKey.Value : Plugin.ZRotationKey.Value); bool flag3 = ((_lockedAxis == 0) ? flag : flag2); if (flag3) { _lastHeldTime = unscaledTime; } if (Plugin.DebugLog.Value && flag3 != _prevHeldRaw) { Plugin.Log.LogInfo((object)("[axes] f=" + Time.frameCount + " key locked " + ((object)((KeyboardShortcut)(ref val)).MainKey/*cast due to .constrained prefix*/).ToString() + " held=" + flag3 + " keyUp=" + Input.GetKeyUp(((KeyboardShortcut)(ref val)).MainKey))); } _prevHeldRaw = flag3; if (!Input.GetKeyUp(((KeyboardShortcut)(ref val)).MainKey) && (flag3 || !(unscaledTime - _lastHeldTime > 0.5f))) { return _lockedAxis; } if (Plugin.DebugLog.Value) { Plugin.Log.LogInfo((object)("[axes] f=" + Time.frameCount + " axis " + _lockedAxis + " released")); } } int lockedAxis = _lockedAxis; _lockedAxis = ((!flag) ? ((!flag2) ? 1 : 2) : 0); if (_lockedAxis != 1) { _lastHeldTime = unscaledTime; _prevHeldRaw = true; } if (Plugin.DebugLog.Value && _lockedAxis != lockedAxis) { Plugin.Log.LogInfo((object)("[axes] f=" + Time.frameCount + " axis selected " + _lockedAxis)); } return _lockedAxis; } public static void Say(Player player, string msg) { if (!FloatingText.Show(msg)) { ((Character)player).Message((MessageType)1, msg, 0, (Sprite)null, false); } } public static void SetDivisions(Player player, int value) { value = Mathf.Clamp(value, 2, 256); if (value != Plugin.SnapDivisions.Value) { Plugin.SnapDivisions.Value = value; } } public static void ToggleRotationMode(Player player) { //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) if (!RotState.Active && Plugin.AdvancedRequiresWorkbench.Value && !FreeCam.HasStation(player)) { Say(player, Plugin.TextWorkbench.Value); return; } RotState.Active = !RotState.Active; if (RotState.Active) { GizmoVisual.PlayIntro(); } else { GizmoVisual.CancelIntro(); } if (RotState.Active) { RotState.SetFromPiece(Quaternion.Euler(0f, (float)PlaceRotationRef.Invoke(player) * 22.5f, 0f)); } else { float y = ((Quaternion)(ref RotState.Rot)).eulerAngles.y; PlaceRotationRef.Invoke(player) = Mathf.RoundToInt(y / 22.5f); } if (!RotState.Active) { FreezeState.Release(); } } public static void HandleHotkeys(Player player) { //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) if (ToggleRequested) { ToggleRequested = false; ToggleRotationMode(player); } if (RotState.Active) { if (Pressed(Plugin.ResetAllRotationKey.Value)) { RotState.ResetAll(); } else if (Pressed(Plugin.ResetRotationKey.Value)) { RotState.ResetAxis(ActiveAxis()); } if (Pressed(Plugin.ToggleAxesKey.Value)) { RotState.ToggleLocal(); } KeyboardShortcut value = Plugin.FlipPieceKey.Value; if ((int)((KeyboardShortcut)(ref value)).MainKey != 0 && KeyDown(value)) { RotState.Flip(); } if (Pressed(Plugin.CopyPieceRotation.Value)) { Piece hoveringPiece = player.GetHoveringPiece(); if ((Object)(object)hoveringPiece != (Object)null) { RotState.CopyFromPiece(((Component)hoveringPiece).transform.rotation); } } if (Pressed(Plugin.SnapDivisionIncrement.Value)) { SetDivisions(player, Plugin.SnapDivisions.Value * 2); } else if (Pressed(Plugin.SnapDivisionDecrement.Value)) { SetDivisions(player, Plugin.SnapDivisions.Value / 2); } OffsetState.Handle(player); if (Pressed(Plugin.FreezeKey.Value)) { FreezeState.Toggle(player); } } if (Pressed(Plugin.SelectTargetPieceKey.Value)) { MethodInfo methodInfo = AccessTools.Method(typeof(Player), "CopyPiece", (Type[])null, (Type[])null); if (methodInfo != null) { methodInfo.Invoke(player, null); } } } } [HarmonyPatch(typeof(ZInput), "GetButtonDown", new Type[] { typeof(string) })] internal static class BlockHideWeaponPatch { private static void Postfix(string name, ref bool __result) { if (__result && !(name != "Hide") && Patches.ShouldBlockHide()) { __result = false; } } } [HarmonyPatch(typeof(ZInput), "GetButtonDown", new Type[] { typeof(string) })] internal static class BlockGameButtonDownPatch { private static void Postfix(string name, ref bool __result) { if (__result && Patches.ShouldBlockGameButton(name)) { __result = false; } } } [HarmonyPatch(typeof(ZInput), "GetButton", new Type[] { typeof(string) })] internal static class BlockGameButtonHeldPatch { private static void Postfix(string name, ref bool __result) { if (__result && Patches.ShouldBlockGameButton(name)) { __result = false; } } } [HarmonyPatch(typeof(ZInput), "GetButtonUp", new Type[] { typeof(string) })] internal static class BlockGameButtonUpPatch { private static void Postfix(string name, ref bool __result) { if (__result && Patches.ShouldBlockGameButton(name)) { __result = false; } } } [HarmonyPatch(typeof(Player), "UpdatePlacement")] internal static class UpdatePlacementPatch { private static void Prefix(Player __instance, ref int __state) { RotState.SkipNextDiff = false; __state = Patches.PlaceRotationRef.Invoke(__instance); } private static void Postfix(Player __instance, bool takeInput, int __state) { if ((Object)(object)__instance != (Object)(object)Player.m_localPlayer) { return; } BuildPanel.Tick(__instance); FloatingText.Tick(__instance); FreeCam.HandleKey(__instance, takeInput); if (!((Character)__instance).InPlaceMode()) { GizmoVisual.Hide(); if (FreeCam.Active) { FreeCam.Stop(); } FreezeState.Release(); if (Plugin.ResetOffsetOnPieceChange.Value) { OffsetState.Reset(); } if (Plugin.DeactivateOnHammerUnequip.Value) { RotState.Active = Plugin.RotationModeStartsActive.Value; if (!RotState.Active) { FreezeState.Release(); } } return; } OffsetState.UpdateKeys(); int num = Patches.PlaceRotationRef.Invoke(__instance) - __state; if (RotState.Active && num != 0 && !RotState.SkipNextDiff && Math.Abs(num) <= 2) { int num2 = ((takeInput && !Patches.UiBlocksInput() && Plugin.MoveEnabled.Value) ? OffsetState.ActiveMoveAxis() : (-1)); if (num2 >= 0) { OffsetState.WheelStep(num2, num); } else { RotState.Rotate(Patches.ActiveAxis(), num); } } if (takeInput && !Patches.UiBlocksInput()) { Patches.HandleHotkeys(__instance); } } } [HarmonyPatch(typeof(Player), "CopyPiece")] internal static class CopyPiecePatch { private static void Postfix(Player __instance, bool __result) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) RotState.SkipNextDiff = true; if (__result) { Piece hoveringPiece = __instance.GetHoveringPiece(); if ((Object)(object)hoveringPiece != (Object)null) { RotState.SetFromPiece(((Component)hoveringPiece).transform.rotation); } } } } [HarmonyPatch(typeof(Player), "SetupPlacementGhost")] internal static class SetupGhostPatch { private static int _lastPieceId; private static void Postfix(Player __instance) { Piece val = (((Object)(object)__instance != (Object)null) ? __instance.GetSelectedPiece() : null); int num = (((Object)(object)val != (Object)null) ? ((Object)((Component)val).gameObject).GetInstanceID() : 0); bool flag = num != _lastPieceId; _lastPieceId = num; if (flag) { if (Plugin.ReleaseOnPieceChange.Value) { FreezeState.Release(); } if (Plugin.ResetOffsetOnPieceChange.Value) { OffsetState.Reset(); } } RotState.SkipNextDiff = true; } } [HarmonyPatch(typeof(Player), "UpdatePlacementGhost")] internal static class UpdatePlacementGhostPatch { private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions) { //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Expected O, but got Unknown //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Expected O, but got Unknown //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Expected O, but got Unknown List<CodeInstruction> list = new List<CodeInstruction>(instructions); MethodInfo objB = AccessTools.Method(typeof(Quaternion), "Euler", new Type[3] { typeof(float), typeof(float), typeof(float) }, (Type[])null); MethodInfo operand = AccessTools.Method(typeof(RotState), "GhostRotation", (Type[])null, (Type[])null); int num = 0; foreach (CodeInstruction item in list) { if (item.opcode == OpCodes.Call && object.Equals(item.operand, objB)) { item.operand = operand; num++; } } if (num != 1) { Plugin.Log.LogWarning((object)("UpdatePlacementGhost: expected 1 call to Quaternion.Euler and replaced " + num + ".")); } MethodInfo noBuild = AccessTools.Method(typeof(Location), "IsInsideNoBuildLocation", new Type[1] { typeof(Vector3) }, (Type[])null); MethodInfo methodInfo = AccessTools.Method(typeof(OffsetState), "Apply", (Type[])null, (Type[])null); FieldInfo fieldInfo = AccessTools.Field(typeof(Player), "m_placementGhost"); int num2 = list.FindIndex((CodeInstruction i) => i.opcode == OpCodes.Call && object.Equals(i.operand, noBuild)); if (num2 >= 2) { list.InsertRange(num2 - 2, (IEnumerable<CodeInstruction>)(object)new CodeInstruction[3] { new CodeInstruction(OpCodes.Call, (object)methodInfo), new CodeInstruction(OpCodes.Ldarg_0, (object)null), new CodeInstruction(OpCodes.Ldfld, (object)fieldInfo) }); } else { Plugin.Log.LogWarning((object)"UpdatePlacementGhost: IsInsideNoBuildLocation not found; the fine offset will not be applied."); } return list; } private static void Postfix(Player __instance) { if (!((Object)(object)__instance != (Object)(object)Player.m_localPlayer)) { GameObject val = Patches.GhostRef.Invoke(__instance); bool flag = Plugin.ShowMoveLine.Value && Plugin.MoveLinePreview.Value; if ((Object)(object)val == (Object)null || !val.activeInHierarchy || (!flag && (!Plugin.ShowGizmo.Value || !RotState.Active))) { GizmoVisual.Hide(); } else { GizmoVisual.Show(val); } } } } internal static class GizmoVisual { [CompilerGenerated] private static class <>O { public static CameraCallback <0>__OnPreCull; } private static GameObject _root; private static Transform[] _rings; private static Material[] _mats; private static int _ghostId; private static float _radius = 1.5f; private static Quaternion _frame = Quaternion.identity; private static GameObject _ghost; private static int _lastFocus = -1; private static bool _hooked; private static bool _introPending; private static float _introTime = float.MaxValue; private static float _introAlpha = 1f; private static float _introScale = 1f; private static GameObject[] _moveLines; private static Material _moveMat; private static Mesh _moveMesh; private static int _moveSignature; private static float _pivotBlend; private static Mesh _mesh; private static int _meshSignature; public static void PlayIntro() { _introPending = true; } public static void CancelIntro() { _introPending = false; EndIntro(); } private static void EndIntro() { _introTime = float.MaxValue; _introAlpha = 1f; _introScale = 1f; RotState.IntroX = (RotState.IntroY = (RotState.IntroZ = 0f)); } private static void UpdateIntro() { if (_introPending) { _introPending = false; if (Plugin.GizmoIntro.Value) { _introTime = 0f; } } if (_introTime != float.MaxValue) { _introTime += Time.deltaTime; float num = Mathf.Max(0.02f, Plugin.GizmoIntroSeconds.Value); float num2 = Mathf.Exp((0f - _introTime) / num); if (num2 < 0.003f) { EndIntro(); return; } float num3 = (RotState.IntroX = Plugin.GizmoIntroSpin.Value * num2); RotState.IntroY = 0f - num3; RotState.IntroZ = num3; _introScale = Mathf.Lerp(1f, Plugin.GizmoIntroScale.Value, num2); _introAlpha = 1f - num2; } } private static void OnPreCull(Camera cam) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_root != (Object)null && _root.activeSelf && (Object)(object)_ghost != (Object)null) { _root.transform.position = PivotPosition(_ghost); } } private static void UpdatePivotBlend() { float num = ((Plugin.GlobalPivotAtCursor.Value && !RotState.Local) ? 1f : 0f); if (Mathf.Abs(num - _pivotBlend) < 0.002f) { _pivotBlend = num; } else { _pivotBlend += (num - _pivotBlend) * (1f - Mathf.Exp((0f - Time.deltaTime) / 0.07f)); } } private static Vector3 PivotPosition(GameObject ghost) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) Vector3 val = OffsetState.CenterWorld(ghost); if (_pivotBlend <= 0.0001f) { return val; } return Vector3.Lerp(val, OffsetState.AimFor(ghost), _pivotBlend); } private static int MeshSignature() { return HashCode.Combine(Plugin.GizmoLineThickness.Value, Plugin.ArrowLengthDegrees.Value, Plugin.ArrowHeadSize.Value, Plugin.ArrowShaftThickness.Value, Plugin.DashLengthDegrees.Value, Plugin.DashThickness.Value, Plugin.ArrowHeadLength.Value); } private static void RefreshMesh() { int num = MeshSignature(); if (!((Object)(object)_mesh != (Object)null) || num != _meshSignature) { Mesh mesh = _mesh; _mesh = BuildArrowRing(Plugin.GizmoLineThickness.Value); _meshSignature = num; Transform[] rings = _rings; for (int i = 0; i < rings.Length; i++) { ((Component)rings[i]).GetComponent<MeshFilter>().sharedMesh = _mesh; } if ((Object)(object)mesh != (Object)null) { Object.Destroy((Object)(object)mesh); } } } public static void Hide() { if ((Object)(object)_root != (Object)null && _root.activeSelf) { _root.SetActive(false); } if (_introTime != float.MaxValue) { EndIntro(); } } public static void Show(GameObject ghost) { //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Expected O, but got Unknown //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Expected O, but got Unknown //IL_0285: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Unknown result type (might be due to invalid IL or missing references) //IL_02a6: Unknown result type (might be due to invalid IL or missing references) //IL_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02c7: Unknown result type (might be due to invalid IL or missing references) //IL_02d5: Unknown result type (might be due to invalid IL or missing references) //IL_02e3: Unknown result type (might be due to invalid IL or missing references) //IL_02f0: Unknown result type (might be due to invalid IL or missing references) //IL_030e: Unknown result type (might be due to invalid IL or missing references) //IL_032c: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_root == (Object)null) { Build(); } if ((Object)(object)_root == (Object)null) { return; } RefreshMesh(); int instanceID = ((Object)ghost).GetInstanceID(); if (instanceID != _ghostId) { _ghostId = instanceID; _radius = ComputeRadius(ghost); } _root.SetActive(true); UpdatePivotBlend(); _root.transform.position = PivotPosition(ghost); _ghost = ghost; if (!_hooked) { CameraCallback onPreCull = Camera.onPreCull; object obj = <>O.<0>__OnPreCull; if (obj == null) { CameraCallback val = OnPreCull; <>O.<0>__OnPreCull = val; obj = (object)val; } Camera.onPreCull = (CameraCallback)Delegate.Combine((Delegate?)(object)onPreCull, (Delegate?)obj); _hooked = true; } UpdateIntro(); _root.transform.localScale = Vector3.one * (_radius * Plugin.GizmoSizeMultiplier.Value * _introScale); if (_moveLines != null) { int num = ((Plugin.ShowMoveLine.Value && Plugin.MoveEnabled.Value && RotState.Active && !Patches.UiBlocksInput()) ? OffsetState.ActiveMoveAxis() : (-1)); bool flag = Plugin.ShowMoveLine.Value && Plugin.MoveLinePreview.Value; if (num >= 0 || flag) { ShowMoveLine(ghost, num); return; } HideMoveLines(); } if (!Plugin.ShowGizmo.Value || !RotState.Active) { Hide(); return; } int num2 = Patches.ActiveAxis(); int num3 = -1; if (num2 != 1) { num3 = num2; } else if (Time.time - RotState.LastRotateTime < ((RotState.LastAxis == 1) ? Plugin.WheelFocusHold.Value : Plugin.AxisFocusSeconds.Value)) { num3 = RotState.LastAxis; } int num4 = ((num2 != 1) ? num2 : (-1)); if (Plugin.DebugLog.Value && num3 != _lastFocus) { Plugin.Log.LogInfo((object)("[axes] f=" + Time.frameCount + " focus " + _lastFocus + " -> " + num3 + " held=" + num2)); } _lastFocus = num3; bool flag2 = Plugin.HideUnselectedAxes.Value && num3 != -1; for (int i = 0; i < 3; i++) { ((Component)_rings[i]).gameObject.SetActive(!flag2 || num3 == i); } if (num3 == -1) { RotState.DecaySpin(Time.deltaTime); } _frame = Quaternion.Slerp(_frame, RotState.AxesFrame, 1f - Mathf.Exp((0f - Time.deltaTime) / 0.06f)); RotState.RingRotations(_frame, out var qx, out var qy, out var qz); _rings[0].rotation = qx; _rings[1].rotation = qy; _rings[2].rotation = qz; Paint(0, Plugin.XGizmoColor.Value, Plugin.EmissionFactorX.Value, num4 == 0); Paint(1, Plugin.YGizmoColor.Value, Plugin.EmissionFactorY.Value, num4 == 1); Paint(2, Plugin.ZGizmoColor.Value, Plugin.EmissionFactorZ.Value, num4 == 2); } private static void Paint(int i, Color c, float emission, bool active) {