From 4b73f5a997368c9c8ffc0a95728e7301ccf709e3 Mon Sep 17 00:00:00 2001 From: Nytra <14206961+Nytra@users.noreply.github.com> Date: Tue, 24 Dec 2024 11:04:07 +0000 Subject: [PATCH] Remove debug stuff --- .../FieldExtensions.cs | 16 ---------------- .../UI/Tooltips/TooltipConfig.cs | 7 ------- 2 files changed, 23 deletions(-) diff --git a/MonkeyLoader.Resonite.Integration/FieldExtensions.cs b/MonkeyLoader.Resonite.Integration/FieldExtensions.cs index ffafa21..67d88b8 100644 --- a/MonkeyLoader.Resonite.Integration/FieldExtensions.cs +++ b/MonkeyLoader.Resonite.Integration/FieldExtensions.cs @@ -123,8 +123,6 @@ public static Action SyncWithNullableConfigKeyHasValue(this IFie IDefiningConfigKey configKey, string? eventLabel = null, bool allowWriteBack = true) where T : struct { - configKey.FindNearestParent().Logger.Trace(() => $"Syncing with nullable config key HasValue: {configKey.Id}"); - field.Value = configKey.GetValue().HasValue; eventLabel ??= field.GetWriteBackEventLabel(); @@ -132,8 +130,6 @@ public static Action SyncWithNullableConfigKeyHasValue(this IFie void ParentDestroyedHandler(IDestroyable _) { - //configKey.FindNearestParent().Logger.Trace(() => $"Parent destroyed: {configKey.Id}"); - parent.Destroyed -= ParentDestroyedHandler; field.Changed -= FieldChangedHandler; @@ -142,8 +138,6 @@ void ParentDestroyedHandler(IDestroyable _) void FieldChangedHandler(IChangeable _) { - //configKey.FindNearestParent().Logger.Trace(() => $"Field changed: {configKey.Id} {field.Value} {configKey.GetValue().HasValue} {allowWriteBack}"); - T? newValue = field.Value ? default(T) : null; if (field.Value != configKey.GetValue().HasValue && (!allowWriteBack || !configKey.TrySetValue(newValue, eventLabel))) @@ -152,8 +146,6 @@ void FieldChangedHandler(IChangeable _) void ConfigKeyChangedHandler(object sender, ConfigKeyChangedEventArgs args) { - //configKey.FindNearestParent().Logger.Trace(() => $"Config key changed: {configKey.Id} {field.Value} {configKey.GetValue().HasValue}"); - if (field.Value != configKey.GetValue().HasValue) field.World.RunSynchronously(() => field.Value = configKey.GetValue().HasValue); } @@ -168,8 +160,6 @@ void ConfigKeyChangedHandler(object sender, ConfigKeyChangedEventArgs args) public static Action SyncWithEnumFlag(this IField field, IDefiningConfigKey configKey, long longValue, string? eventLabel = null, bool allowWriteBack = true) { - configKey.FindNearestParent().Logger.Trace(() => $"Syncing with enum flag: {configKey.Id} {longValue}"); - Type enumType = typeof(T); if (typeof(T).IsNullable()) { @@ -187,19 +177,13 @@ public static Action SyncWithEnumFlag(this IField field, void FieldChanged(IChangeable changeable) { - //configKey.FindNearestParent().Logger.Trace(() => $"Field changed: {configKey.Id} {field.Value} {configKey.GetValue() ?? default} {longValue}"); - configKey.TrySetValue(Enum.ToObject(enumType, field.Value ? Convert.ToInt64(configKey.GetValue() ?? default(T)) | longValue : Convert.ToInt64(configKey.GetValue() ?? default(T)) & ~longValue)); } void KeyChanged(object sender, IConfigKeyChangedEventArgs changedEvent) { - //configKey.FindNearestParent().Logger.Trace(() => $"Config key changed: {configKey.Id} {field.Value} {configKey.GetValue()} {longValue}"); - if (field.FilterWorldElement() is null) { - //configKey.FindNearestParent().Logger.Trace(() => $"Field was destroyed: {configKey.Id} {longValue}"); - configKey.Changed -= KeyChanged; return; } diff --git a/MonkeyLoader.Resonite.Integration/UI/Tooltips/TooltipConfig.cs b/MonkeyLoader.Resonite.Integration/UI/Tooltips/TooltipConfig.cs index b8dee13..55aae13 100644 --- a/MonkeyLoader.Resonite.Integration/UI/Tooltips/TooltipConfig.cs +++ b/MonkeyLoader.Resonite.Integration/UI/Tooltips/TooltipConfig.cs @@ -29,13 +29,6 @@ public sealed class TooltipConfig : SingletonConfigSection new ConfigKeyRange(.5f, 4) }; - private static readonly DefiningConfigKey _testKey0 = new("testKey0", "Test key0.", () => ShadowType.Hard); - private static readonly DefiningConfigKey _testKey = new("testKey", "Test key.", () => ShadowType.Soft); - private static readonly DefiningConfigKey _testKey3 = new("testKey3", "Test key3.", () => MappingTarget.NONE); - private static readonly DefiningConfigKey _testKey2 = new("testKey2", "Test key2.", () => null); - private static readonly DefiningConfigKey _testKey4 = new("testKey4", "Test key4.", () => null); - private static readonly DefiningConfigKey _testKey5 = new("testKey5", "Test key5.", () => null); - /// /// Gets the background color for tooltips. ///