Delete dead inspector metadata specializations

This commit is contained in:
Meta Vens 2026-06-16 19:24:01 +01:00
commit 1f12fe0f16
7 changed files with 77 additions and 76 deletions

View file

@ -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[]

View file

@ -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;

View file

@ -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;

View file

@ -5,7 +5,6 @@
using Unity.Mathematics;
using static Unity.Mathematics.math;
[Order(100)]
public class VelocityLimit : Behavior
{
public float Limit { get; private set; }

View file

@ -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<string, float> AllegianceByKey = new Dictionary<string, float>();
[InspectableSoundBank]
[Inspectable]
public uint OverworldMusic;
[InspectableSoundBank]
[Inspectable]
public uint CombatMusic;
[InspectableSoundBank]
[Inspectable]
public uint BossMusic;
public string EntryName

View file

@ -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;
}

View file

@ -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