From 9c63c0a1af32c2b69294725f0734a216e794ebde Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Tue, 16 Jun 2026 19:38:02 +0100 Subject: [PATCH] Delete dead PropertiesPanel reflection inspector --- Aetheria.State.Verify/Program.cs | 36 ++++++++++++-- Assets/Scripts/Gameplay/FieldDriver.cs | 24 ---------- Assets/Scripts/ServerShared/Attributes.cs | 26 ---------- .../Scripts/ServerShared/Attributes.cs.meta | 11 ----- .../ServerShared/Behaviors/AetherDrive.cs | 1 - .../ServerShared/Behaviors/StatModifier.cs | 2 - Assets/Scripts/ServerShared/Corporations.cs | 12 ----- .../Scripts/ServerShared/ExponentialCurve.cs | 6 --- .../Scripts/ServerShared/RuntimeGeometry.cs | 14 +++--- .../RuntimeProjection/Attributes.cs | 4 -- .../RuntimeProjection/Attributes.cs.meta | 11 ----- .../UI/Properties Panel/PropertiesPanel.cs | 48 ------------------- docs/aetheria-perfect-machine-map.md | 15 +++--- 13 files changed, 46 insertions(+), 164 deletions(-) delete mode 100644 Assets/Scripts/ServerShared/Attributes.cs delete mode 100644 Assets/Scripts/ServerShared/Attributes.cs.meta delete mode 100644 Assets/Scripts/ServerShared/RuntimeProjection/Attributes.cs delete mode 100644 Assets/Scripts/ServerShared/RuntimeProjection/Attributes.cs.meta diff --git a/Aetheria.State.Verify/Program.cs b/Aetheria.State.Verify/Program.cs index 9a7063d5a..bf658528a 100644 --- a/Aetheria.State.Verify/Program.cs +++ b/Aetheria.State.Verify/Program.cs @@ -488,7 +488,7 @@ Console.WriteLine("Renderer-local console authority: deleted; UI commands flow t Console.WriteLine("Renderer-local debug panels: obsolete uGUI field tester authority is deleted"); Console.WriteLine("Main-menu settings authority: gameplay and graphics settings return through typed player-settings commits"); Console.WriteLine("Main-menu Continue authority: Continue selects typed run state instead of a null button"); -Console.WriteLine("PropertiesPanel inspector authority: reflection inspection is read-only display"); +Console.WriteLine("PropertiesPanel inspector authority: dead generic reflection inspector path is deleted"); Console.WriteLine("Runtime simulation tuning authority: UI writes flow through gameplay checkpoint commits"); Console.WriteLine("Hull conductivity authority: inventory UI toggles flow through gameplay checkpoint commits"); Console.WriteLine("Inventory entity rename authority: UI rename flows through gameplay checkpoint commits"); @@ -910,15 +910,19 @@ 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", "AetherDrive.cs"), Path.Combine(root, "Assets", "Scripts", "ServerShared", "Behaviors", "StatModifier.cs"), - Path.Combine(root, "Assets", "Scripts", "ServerShared", "Behaviors", "VelocityLimit.cs") + Path.Combine(root, "Assets", "Scripts", "ServerShared", "Behaviors", "VelocityLimit.cs"), + Path.Combine(root, "Assets", "Scripts", "ServerShared", "ExponentialCurve.cs"), + Path.Combine(root, "Assets", "Scripts", "ServerShared", "RuntimeGeometry.cs"), + Path.Combine(root, "Assets", "Scripts", "UI", "Properties Panel", "PropertiesPanel.cs") }; var forbiddenSymbols = new[] { + "InspectableAttribute", "PreferredInspectorAttribute", "InspectableTextAttribute", "InspectablePrefabAttribute", @@ -934,7 +938,9 @@ static void RequireNoDeadInspectorMetadata(string root) "InspectableRangedFloatAttribute", "InspectableRangedIntAttribute", "OrderAttribute", + "EntityTypeRestrictionAttribute", "InspectorHeaderAttribute", + "[Inspectable", "[InspectableText", "[InspectablePrefab", "[InspectableTexture", @@ -949,6 +955,7 @@ static void RequireNoDeadInspectorMetadata(string root) "[InspectableRangedFloat", "[InspectableRangedInt", "[Order(", + "EntityTypeRestriction(", "[InspectorHeader(" }; @@ -963,9 +970,23 @@ static void RequireNoDeadInspectorMetadata(string root) if (hits.Length > 0) { throw new InvalidOperationException( - "Dead inspector-specialization metadata should stay deleted; the live read-only inspector only uses plain Inspectable markers: " + + "Dead inspector-specialization metadata should stay deleted; no generic Inspectable attribute path should remain in live runtime code: " + string.Join("; ", hits)); } + + var deletedFiles = new[] + { + Path.Combine(root, "Assets", "Scripts", "ServerShared", "RuntimeProjection", "Attributes.cs"), + Path.Combine(root, "Assets", "Scripts", "ServerShared", "Attributes.cs") + }; + + var stillPresent = deletedFiles.Where(File.Exists).Select(path => Path.GetRelativePath(root, path)).ToArray(); + if (stillPresent.Length > 0) + { + throw new InvalidOperationException( + "Dead inspector attribute definition files should be deleted once the generic reflection inspector path is gone: " + + string.Join(", ", stillPresent)); + } } static void RequireTypedOrbitTaskKeys(string root) @@ -2351,6 +2372,11 @@ static void RequirePropertiesPanelReadOnlyInspector(string root) var source = File.ReadAllText(propertiesPanelPath); var forbiddenSymbols = new[] { + "Inspect(object obj", + "Inspect(object obj, FieldInfo field", + "GetCustomAttribute", + "type.GetCustomAttribute()", + "field.GetValue(obj)", "readWrite", "field.SetValue", "f => field.SetValue", @@ -2365,7 +2391,7 @@ static void RequirePropertiesPanelReadOnlyInspector(string root) if (hits.Length > 0) { throw new InvalidOperationException( - "PropertiesPanel reflection inspection still has renderer-local write authority: " + + "PropertiesPanel should not keep the dead generic reflection inspector path or renderer-local write authority: " + string.Join(", ", hits)); } } diff --git a/Assets/Scripts/Gameplay/FieldDriver.cs b/Assets/Scripts/Gameplay/FieldDriver.cs index 5dceafd82..7bbf78ee7 100644 --- a/Assets/Scripts/Gameplay/FieldDriver.cs +++ b/Assets/Scripts/Gameplay/FieldDriver.cs @@ -12,59 +12,35 @@ public class FieldDriver : MonoBehaviour public float2 Push; public float FrontTwist; public float RearTwist; - [Inspectable] public float TestMagnitude; - [Inspectable] public float FlowSpeed; - [Inspectable] public float FlowSpeedThrottleExponent; - [Inspectable] public float WaveThrottleExponent; public int MaxHits; - [Inspectable] public ExponentialCurve MagnitudeTimeScaling; - [Inspectable] public float MeleeRange; - [Inspectable] public float MeleeRangeExponent; - [Inspectable] public float MeleeFlatness; - [Inspectable] public float MeleeShaping; - [Inspectable] public float MeleeDuration; - [Inspectable] public float MeleeAngle; - [Inspectable] public float MeleeAngleExponent; - [Inspectable] public float TendrilBaseRadius = 3; - [Inspectable] public float TendrilTipRadius = .1f; - [Inspectable] public float TendrilExtensionExponent = .75f; - [Inspectable] public float TendrilExtendBaseAnimationExponent = .5f; - [Inspectable] public float TendrilBaseDamping = 2; - [Inspectable] public float TendrilTipRadiusAnimationExponent = 2f; - [Inspectable] public float TendrilFadeExponent = 2; - // [Inspectable] // public float GrabScaleAnimationExponent = .5f; - [Inspectable] public float GrabExtendTime; - [Inspectable] public float GrabEnvelopTime; - [Inspectable] public float GrabPullTime; - [Inspectable] public RectTransform.Axis RefractionAxis = RectTransform.Axis.Horizontal; private Material _field; diff --git a/Assets/Scripts/ServerShared/Attributes.cs b/Assets/Scripts/ServerShared/Attributes.cs deleted file mode 100644 index f2d017a98..000000000 --- a/Assets/Scripts/ServerShared/Attributes.cs +++ /dev/null @@ -1,26 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ - -using System; - -[AttributeUsage(AttributeTargets.Class)] -public class EntityTypeRestrictionAttribute : Attribute -{ - public readonly HullType Type; - - public EntityTypeRestrictionAttribute(HullType type) - { - Type = type; - } -} - -// public class CategoryAttribute : Attribute -// { -// public readonly Type Type; -// -// public CategoryAttribute(Type type) -// { -// Type = type; -// } -// } \ No newline at end of file diff --git a/Assets/Scripts/ServerShared/Attributes.cs.meta b/Assets/Scripts/ServerShared/Attributes.cs.meta deleted file mode 100644 index 08f03ce0f..000000000 --- a/Assets/Scripts/ServerShared/Attributes.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: f68edb6415593e542b4ba42ff5bec0c0 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/ServerShared/Behaviors/AetherDrive.cs b/Assets/Scripts/ServerShared/Behaviors/AetherDrive.cs index 2fd63cae5..1b160e30a 100644 --- a/Assets/Scripts/ServerShared/Behaviors/AetherDrive.cs +++ b/Assets/Scripts/ServerShared/Behaviors/AetherDrive.cs @@ -5,7 +5,6 @@ using Unity.Mathematics; using static Unity.Mathematics.math; -[Inspectable, EntityTypeRestriction(HullType.Ship)] public class AetherDrive : Behavior { private readonly float3 _rotorDiameter; diff --git a/Assets/Scripts/ServerShared/Behaviors/StatModifier.cs b/Assets/Scripts/ServerShared/Behaviors/StatModifier.cs index caaad9e4c..7443c343f 100644 --- a/Assets/Scripts/ServerShared/Behaviors/StatModifier.cs +++ b/Assets/Scripts/ServerShared/Behaviors/StatModifier.cs @@ -143,11 +143,9 @@ public enum StatModifierType Multiplier } -[Inspectable] public class StatReference { public string Target; - [Inspectable] public string Stat; } diff --git a/Assets/Scripts/ServerShared/Corporations.cs b/Assets/Scripts/ServerShared/Corporations.cs index 0832804b9..43ed5d80d 100644 --- a/Assets/Scripts/ServerShared/Corporations.cs +++ b/Assets/Scripts/ServerShared/Corporations.cs @@ -7,46 +7,34 @@ using System.Collections; using System.Collections.Generic; using Unity.Mathematics; -[Inspectable] public class Faction : INamedEntry { public string FactionKey; - [Inspectable] public string Name; - [Inspectable] public string ShortName; - [Inspectable] public string Description; - [Inspectable] public string Logo; - // [Inspectable] // public bool PlayerHostile; - [Inspectable] public float3 PrimaryColor; - [Inspectable] public float3 SecondaryColor; public string GeonameFileKey; public string BossHullItemKey; - [Inspectable] public int InfluenceDistance = 4; public Dictionary AllegianceByKey = new Dictionary(); - [Inspectable] public uint OverworldMusic; - [Inspectable] public uint CombatMusic; - [Inspectable] public uint BossMusic; public string EntryName diff --git a/Assets/Scripts/ServerShared/ExponentialCurve.cs b/Assets/Scripts/ServerShared/ExponentialCurve.cs index a81b36490..027319dae 100644 --- a/Assets/Scripts/ServerShared/ExponentialCurve.cs +++ b/Assets/Scripts/ServerShared/ExponentialCurve.cs @@ -11,13 +11,10 @@ using static Unity.Mathematics.math; [Serializable] public class ExponentialCurve { - [Inspectable] public float Exponent; - [Inspectable] public float Multiplier; - [Inspectable] public float Constant; public float Evaluate(float value) => Multiplier * pow(value, Exponent) + Constant; @@ -26,13 +23,10 @@ public class ExponentialCurve [Serializable] public class ExponentialLerp { - [Inspectable] public float Exponent; - [Inspectable] public float Minimum; - [Inspectable] public float Maximum; public float Evaluate(float value) => Minimum + pow(saturate(value), Exponent) * (Maximum - Minimum); diff --git a/Assets/Scripts/ServerShared/RuntimeGeometry.cs b/Assets/Scripts/ServerShared/RuntimeGeometry.cs index 2f0eff1d3..0032dcf16 100644 --- a/Assets/Scripts/ServerShared/RuntimeGeometry.cs +++ b/Assets/Scripts/ServerShared/RuntimeGeometry.cs @@ -10,7 +10,6 @@ using static Unity.Mathematics.math; using float2 = Unity.Mathematics.float2; using int2 = Unity.Mathematics.int2; -[Inspectable] public class Shape { public bool[,] Cells; @@ -257,15 +256,14 @@ public class Shape } } -[Inspectable] public class HardpointData : ITintInspector { - [Inspectable] public HardpointType Type; - [Inspectable] public int2 Position; - [Inspectable] public Shape Shape = new Shape(); - [Inspectable] public string Transform; - [Inspectable] public ItemRotation Rotation; - [Inspectable] public float Armor; + public HardpointType Type; + public int2 Position; + public Shape Shape = new Shape(); + public string Transform; + public ItemRotation Rotation; + public float Armor; public override string ToString() { diff --git a/Assets/Scripts/ServerShared/RuntimeProjection/Attributes.cs b/Assets/Scripts/ServerShared/RuntimeProjection/Attributes.cs deleted file mode 100644 index f727ce7fd..000000000 --- a/Assets/Scripts/ServerShared/RuntimeProjection/Attributes.cs +++ /dev/null @@ -1,4 +0,0 @@ -using System; - -[AttributeUsage(AttributeTargets.All, Inherited = false)] -public class InspectableAttribute : Attribute { } diff --git a/Assets/Scripts/ServerShared/RuntimeProjection/Attributes.cs.meta b/Assets/Scripts/ServerShared/RuntimeProjection/Attributes.cs.meta deleted file mode 100644 index 45035dfca..000000000 --- a/Assets/Scripts/ServerShared/RuntimeProjection/Attributes.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: d078a6b39f8c440fabe8d43881207c5d -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/UI/Properties Panel/PropertiesPanel.cs b/Assets/Scripts/UI/Properties Panel/PropertiesPanel.cs index 7cd3c39cb..52787c37d 100644 --- a/Assets/Scripts/UI/Properties Panel/PropertiesPanel.cs +++ b/Assets/Scripts/UI/Properties Panel/PropertiesPanel.cs @@ -7,7 +7,6 @@ using System.Collections; using System.Collections.Generic; using System.Globalization; using System.Linq; -using System.Reflection; using GameCult.Aetheria.State.Unity; using TMPro; using UniRx; @@ -702,53 +701,6 @@ public class PropertiesPanel : MonoBehaviour RefreshValues(); } - public void Inspect(object obj, bool inspectablesOnly = false, bool topLevel = true) - { - var fields = obj.GetType().GetFields(); - foreach (var field in fields) - Inspect(obj, field, inspectablesOnly); - - // if(topLevel) - // foreach (var field in _propertyFields) - // field.transform.SetSiblingIndex(_propertyFields.IndexOf(field)); - - RefreshValues(); - } - - public void Inspect(object obj, FieldInfo field, bool inspectablesOnly = false) - { - var inspectable = field.GetCustomAttribute(); - if (inspectable == null && inspectablesOnly) return; - var type = field.FieldType; - - if (type == typeof(float)) - { - AddProperty(field.Name.SplitCamelCase(), () => ((float) field.GetValue(obj)).ToString("0.##")); - } - else if (type == typeof(int)) - { - AddProperty(field.Name.SplitCamelCase(), () => ((int) field.GetValue(obj)).ToString()); - } - else if (type.IsEnum) - { - AddProperty(field.Name.SplitCamelCase(), () => Enum.GetName(type, field.GetValue(obj)).SplitCamelCase()); - } - else if (type == typeof(string)) - { - AddProperty(field.Name.SplitCamelCase(), () => (string) field.GetValue(obj)); - } - else if (field.FieldType == typeof(bool)) AddProperty(field.Name.SplitCamelCase(), () => ((bool) field.GetValue(obj)).ToString()); - else if (type.GetCustomAttribute() != null) - { - // if(!_propertyFields.Any() || !_propertyFields.Last().gameObject.name.ToUpper().Contains("DIVIDER")) - // _propertyFields.Add(Divider.Instantiate()); - var list = AddList(field.Name); - list.Inspect(field.GetValue(obj), inspectablesOnly, false); - } - else - Debug.Log($"Field \"{field.Name}\" has unknown type {field.FieldType.Name}. No inspector was generated."); - } - public void RefreshValues() { RefreshPropertyValues?.Invoke(); diff --git a/docs/aetheria-perfect-machine-map.md b/docs/aetheria-perfect-machine-map.md index c19f9b77e..f9e318ddd 100644 --- a/docs/aetheria-perfect-machine-map.md +++ b/docs/aetheria-perfect-machine-map.md @@ -1732,10 +1732,13 @@ 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. + - Done: delete the dead inspector-specialization metadata. Unused + header/order/preferred-inspector attribute types and their stale + annotations are gone. + - Done: delete the generic `PropertiesPanel` reflection inspector fallback + and the last `Inspectable`/`EntityTypeRestriction` attribute cargo cult. + Live item inspection stays on the typed item/property paths; there is no + remaining runtime object walker generating UI from reflection metadata. ## Verification @@ -1886,8 +1889,8 @@ The typed state spine, direct behavior factories, and migration quarantine exist; the next cuts should remove remaining live predicates that still need legacy DTO vocabulary, keep package-level MessagePack/JSON at explicit boundaries, and replace runtime/operator UI truth with Eve surfaces. The old -`PropertiesPanel` reflection inspector is display-only; do not restore writable -inspection as a shortcut around typed command/state ownership. Runtime simulation +Do not restore the deleted generic `PropertiesPanel` reflection inspector as a +shortcut around typed command/state ownership. Runtime simulation tuning controls may remain temporarily on uGUI only when they delegate to gameplay-owned commit methods that queue typed checkpoint state; direct UI mutation of entity/item/behavior settings is obsolete authority. Hull