Delete dead PropertiesPanel reflection inspector
This commit is contained in:
parent
1f12fe0f16
commit
9c63c0a1af
13 changed files with 46 additions and 164 deletions
|
|
@ -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<InspectableAttribute>",
|
||||
"type.GetCustomAttribute<InspectableAttribute>()",
|
||||
"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));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
// }
|
||||
// }
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: f68edb6415593e542b4ba42ff5bec0c0
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -5,7 +5,6 @@
|
|||
using Unity.Mathematics;
|
||||
using static Unity.Mathematics.math;
|
||||
|
||||
[Inspectable, EntityTypeRestriction(HullType.Ship)]
|
||||
public class AetherDrive : Behavior
|
||||
{
|
||||
private readonly float3 _rotorDiameter;
|
||||
|
|
|
|||
|
|
@ -143,11 +143,9 @@ public enum StatModifierType
|
|||
Multiplier
|
||||
}
|
||||
|
||||
[Inspectable]
|
||||
public class StatReference
|
||||
{
|
||||
public string Target;
|
||||
|
||||
[Inspectable]
|
||||
public string Stat;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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<string, float> AllegianceByKey = new Dictionary<string, float>();
|
||||
|
||||
[Inspectable]
|
||||
public uint OverworldMusic;
|
||||
|
||||
[Inspectable]
|
||||
public uint CombatMusic;
|
||||
|
||||
[Inspectable]
|
||||
public uint BossMusic;
|
||||
|
||||
public string EntryName
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +0,0 @@
|
|||
using System;
|
||||
|
||||
[AttributeUsage(AttributeTargets.All, Inherited = false)]
|
||||
public class InspectableAttribute : Attribute { }
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: d078a6b39f8c440fabe8d43881207c5d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -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<InspectableAttribute>();
|
||||
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<InspectableAttribute>() != null)
|
||||
{
|
||||
// if(!_propertyFields.Any() || !_propertyFields.Last().gameObject.name.ToUpper().Contains("DIVIDER"))
|
||||
// _propertyFields.Add(Divider.Instantiate<Prototype>());
|
||||
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();
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue