From 1f12fe0f1606ca0094ad797bf82706acdc205de7 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Tue, 16 Jun 2026 19:24:01 +0100 Subject: [PATCH] Delete dead inspector metadata specializations --- Aetheria.State.Verify/Program.cs | 63 ++++++++++++++++++ Assets/Scripts/Gameplay/FieldDriver.cs | 6 +- .../ServerShared/Behaviors/StatModifier.cs | 1 - .../ServerShared/Behaviors/VelocityLimit.cs | 1 - Assets/Scripts/ServerShared/Corporations.cs | 14 ++-- .../RuntimeProjection/Attributes.cs | 64 ------------------- docs/aetheria-perfect-machine-map.md | 4 ++ 7 files changed, 77 insertions(+), 76 deletions(-) diff --git a/Aetheria.State.Verify/Program.cs b/Aetheria.State.Verify/Program.cs index 170ed2747..9a7063d5a 100644 --- a/Aetheria.State.Verify/Program.cs +++ b/Aetheria.State.Verify/Program.cs @@ -33,6 +33,7 @@ RequirePlayerSettingsEveSurface(root); RequireMainMenuContinueRunState(root); RequirePropertiesPanelReadOnlyInspector(root); RequireNoDeadRuntimeProjectionCaches(root); +RequireNoDeadInspectorMetadata(root); RequireRuntimeSimulationTuningCommits(root); RequireHullConductivityCommitAuthority(root); RequireInventoryEntityRenameCommitAuthority(root); @@ -905,6 +906,68 @@ static void RequireNoDeadRuntimeProjectionCaches(string root) } } +static void RequireNoDeadInspectorMetadata(string root) +{ + var checkedFiles = new[] + { + Path.Combine(root, "Assets", "Scripts", "ServerShared", "RuntimeProjection", "Attributes.cs"), + Path.Combine(root, "Assets", "Scripts", "Gameplay", "FieldDriver.cs"), + Path.Combine(root, "Assets", "Scripts", "ServerShared", "Corporations.cs"), + Path.Combine(root, "Assets", "Scripts", "ServerShared", "Behaviors", "StatModifier.cs"), + Path.Combine(root, "Assets", "Scripts", "ServerShared", "Behaviors", "VelocityLimit.cs") + }; + + var forbiddenSymbols = new[] + { + "PreferredInspectorAttribute", + "InspectableTextAttribute", + "InspectablePrefabAttribute", + "InspectableTextureAttribute", + "InspectableTextAssetAttribute", + "InspectableTemperatureAttribute", + "InspectableAnimationCurveAttribute", + "InspectableColorAttribute", + "InspectableSoundBankAttribute", + "InspectableAudioParameterAttribute", + "InspectableSchematicShapeAttribute", + "InspectableEnumValuesAttribute", + "InspectableRangedFloatAttribute", + "InspectableRangedIntAttribute", + "OrderAttribute", + "InspectorHeaderAttribute", + "[InspectableText", + "[InspectablePrefab", + "[InspectableTexture", + "[InspectableTextAsset", + "[InspectableTemperature", + "[InspectableAnimationCurve", + "[InspectableColor", + "[InspectableSoundBank", + "[InspectableAudioParameter", + "[InspectableSchematicShape", + "[InspectableEnumValues", + "[InspectableRangedFloat", + "[InspectableRangedInt", + "[Order(", + "[InspectorHeader(" + }; + + var hits = checkedFiles + .Where(File.Exists) + .SelectMany(path => File.ReadLines(path) + .Select((line, index) => new { Path = path, LineNumber = index + 1, Line = line })) + .Where(line => forbiddenSymbols.Any(symbol => line.Line.Contains(symbol, StringComparison.Ordinal))) + .Select(line => $"{Path.GetRelativePath(root, line.Path)}:{line.LineNumber}: {line.Line.Trim()}") + .ToArray(); + + if (hits.Length > 0) + { + throw new InvalidOperationException( + "Dead inspector-specialization metadata should stay deleted; the live read-only inspector only uses plain Inspectable markers: " + + string.Join("; ", hits)); + } +} + static void RequireTypedOrbitTaskKeys(string root) { var checkedFiles = new[] diff --git a/Assets/Scripts/Gameplay/FieldDriver.cs b/Assets/Scripts/Gameplay/FieldDriver.cs index bca30c68f..5dceafd82 100644 --- a/Assets/Scripts/Gameplay/FieldDriver.cs +++ b/Assets/Scripts/Gameplay/FieldDriver.cs @@ -25,7 +25,7 @@ public class FieldDriver : MonoBehaviour [Inspectable] public ExponentialCurve MagnitudeTimeScaling; - [Inspectable, InspectorHeader("Melee")] + [Inspectable] public float MeleeRange; [Inspectable] public float MeleeRangeExponent; @@ -40,7 +40,7 @@ public class FieldDriver : MonoBehaviour [Inspectable] public float MeleeAngleExponent; - [Inspectable, InspectorHeader("Tendril")] + [Inspectable] public float TendrilBaseRadius = 3; [Inspectable] public float TendrilTipRadius = .1f; @@ -57,7 +57,7 @@ public class FieldDriver : MonoBehaviour // [Inspectable] // public float GrabScaleAnimationExponent = .5f; - [Inspectable, InspectorHeader("Grab")] + [Inspectable] public float GrabExtendTime; [Inspectable] public float GrabEnvelopTime; diff --git a/Assets/Scripts/ServerShared/Behaviors/StatModifier.cs b/Assets/Scripts/ServerShared/Behaviors/StatModifier.cs index 91f2e2720..caaad9e4c 100644 --- a/Assets/Scripts/ServerShared/Behaviors/StatModifier.cs +++ b/Assets/Scripts/ServerShared/Behaviors/StatModifier.cs @@ -6,7 +6,6 @@ using System; using System.Linq; using GameCult.Aetheria.State.Unity; -[Order(-4)] public class StatModifier : Behavior, IInitializableBehavior, IDisposable, IAlwaysUpdatedBehavior { private readonly string _targetBehaviorKind; diff --git a/Assets/Scripts/ServerShared/Behaviors/VelocityLimit.cs b/Assets/Scripts/ServerShared/Behaviors/VelocityLimit.cs index a95e3ee51..58ef9b3d3 100644 --- a/Assets/Scripts/ServerShared/Behaviors/VelocityLimit.cs +++ b/Assets/Scripts/ServerShared/Behaviors/VelocityLimit.cs @@ -5,7 +5,6 @@ using Unity.Mathematics; using static Unity.Mathematics.math; -[Order(100)] public class VelocityLimit : Behavior { public float Limit { get; private set; } diff --git a/Assets/Scripts/ServerShared/Corporations.cs b/Assets/Scripts/ServerShared/Corporations.cs index 4094bfa4b..0832804b9 100644 --- a/Assets/Scripts/ServerShared/Corporations.cs +++ b/Assets/Scripts/ServerShared/Corporations.cs @@ -18,19 +18,19 @@ public class Faction : INamedEntry [Inspectable] public string ShortName; - [InspectableText] + [Inspectable] public string Description; - [InspectableTexture] + [Inspectable] public string Logo; // [Inspectable] // public bool PlayerHostile; - [InspectableColor] + [Inspectable] public float3 PrimaryColor; - [InspectableColor] + [Inspectable] public float3 SecondaryColor; public string GeonameFileKey; public string BossHullItemKey; @@ -40,13 +40,13 @@ public class Faction : INamedEntry public Dictionary AllegianceByKey = new Dictionary(); - [InspectableSoundBank] + [Inspectable] public uint OverworldMusic; - [InspectableSoundBank] + [Inspectable] public uint CombatMusic; - [InspectableSoundBank] + [Inspectable] public uint BossMusic; public string EntryName diff --git a/Assets/Scripts/ServerShared/RuntimeProjection/Attributes.cs b/Assets/Scripts/ServerShared/RuntimeProjection/Attributes.cs index 206a819d7..f727ce7fd 100644 --- a/Assets/Scripts/ServerShared/RuntimeProjection/Attributes.cs +++ b/Assets/Scripts/ServerShared/RuntimeProjection/Attributes.cs @@ -2,67 +2,3 @@ using System; [AttributeUsage(AttributeTargets.All, Inherited = false)] public class InspectableAttribute : Attribute { } - -[AttributeUsage(AttributeTargets.Field)] -public abstract class PreferredInspectorAttribute : InspectableAttribute { } - -public class InspectableTextAttribute : PreferredInspectorAttribute { } -public class InspectablePrefabAttribute : PreferredInspectorAttribute { } -public class InspectableTextureAttribute : PreferredInspectorAttribute { } -public class InspectableTextAssetAttribute : PreferredInspectorAttribute { } -public class InspectableTemperatureAttribute : PreferredInspectorAttribute { } -public class InspectableAnimationCurveAttribute : PreferredInspectorAttribute { } -public class InspectableColorAttribute : PreferredInspectorAttribute { } -public class InspectableSoundBankAttribute : PreferredInspectorAttribute { } -public class InspectableAudioParameterAttribute : PreferredInspectorAttribute { } -public class InspectableSchematicShapeAttribute : PreferredInspectorAttribute { } - -public class InspectableEnumValuesAttribute : PreferredInspectorAttribute -{ - public Type EnumType; - - public InspectableEnumValuesAttribute(Type enumType) - { - EnumType = enumType; - } -} - -public class InspectableRangedFloatAttribute : PreferredInspectorAttribute -{ - public readonly float Min, Max; - - public InspectableRangedFloatAttribute(float min, float max) - { - Min = min; - Max = max; - } -} - -public class InspectableRangedIntAttribute : PreferredInspectorAttribute -{ - public readonly int Min, Max; - - public InspectableRangedIntAttribute(int min, int max) - { - Min = min; - Max = max; - } -} - -public class OrderAttribute : Attribute -{ - public int Order; - - public OrderAttribute(int order) - { - Order = order; - } -} - -[AttributeUsage(AttributeTargets.Field, AllowMultiple = true, Inherited = true)] -public class InspectorHeaderAttribute : Attribute -{ - public readonly string header; - - public InspectorHeaderAttribute(string header) => this.header = header; -} diff --git a/docs/aetheria-perfect-machine-map.md b/docs/aetheria-perfect-machine-map.md index 20690a88a..c19f9b77e 100644 --- a/docs/aetheria-perfect-machine-map.md +++ b/docs/aetheria-perfect-machine-map.md @@ -1732,6 +1732,10 @@ First Aetheria surfaces to publish: now keeps only the live string-formatting helpers used by `TradeMenu` and `PropertiesPanel`; it no longer scans loaded assemblies or keeps static type-cache dictionaries for the old inspector/projection path. + - Done: delete the dead inspector-specialization metadata. The live + `PropertiesPanel` read-only inspector only checks plain `Inspectable` + markers now; unused header/order/preferred-inspector attribute types and + their stale annotations are gone. ## Verification