Advertise shared surface commands over CultMesh

This commit is contained in:
Meta Vens 2026-06-21 13:00:42 +01:00
commit 02e51890ef
16 changed files with 91 additions and 49 deletions

View file

@ -10,6 +10,7 @@ var statePath = args.Length > 1
RequireGameplaySourcePurity(root);
RequirePackageSerializerBoundary(root);
RequireSharedEvePackagesImportedFromEveRepo(root);
RequireSharedRuntimeSurfaceCommandsUseCultMeshTransport(root);
RequireTypedPendingCommitKeys(root);
RequireTypedRuntimeFactionKeys(root);
RequireTypedGalaxyFactionRelationships(root);
@ -711,6 +712,42 @@ static void RequireSharedEvePackagesImportedFromEveRepo(string root)
}
}
static void RequireSharedRuntimeSurfaceCommandsUseCultMeshTransport(string root)
{
var runtimePath = Path.Combine(root, "Packages", "org.gamecult.aetheria.state", "Runtime");
if (!Directory.Exists(runtimePath))
{
throw new InvalidOperationException(
"Shared runtime surface command transport cannot be verified because the state runtime package is missing.");
}
var runtimeSources = Directory.EnumerateFiles(runtimePath, "*.cs", SearchOption.TopDirectoryOnly)
.ToDictionary(
path => Path.GetRelativePath(root, path),
File.ReadAllText,
StringComparer.Ordinal);
var combinedRuntime = string.Join("\n", runtimeSources.Values);
if (!combinedRuntime.Contains("public const string CultMeshTransport = \"cultmesh\"", StringComparison.Ordinal))
{
throw new InvalidOperationException(
"Shared runtime surface command templates do not expose a neutral CultMesh transport constant.");
}
var unityToolkitTransportHits = runtimeSources
.Where(pair => pair.Value.Contains("\"unity-uitoolkit\"", StringComparison.Ordinal))
.Select(pair => pair.Key)
.ToArray();
if (unityToolkitTransportHits.Length > 0)
{
throw new InvalidOperationException(
"Shared runtime surface command templates still advertise Unity UI Toolkit as the transport owner: " +
string.Join(", ", unityToolkitTransportHits));
}
Console.WriteLine("Shared runtime surface commands: command templates advertise CultMesh transport instead of Unity UI Toolkit");
}
static void RequirePackageSerializerBoundary(string root)
{
var packageRuntimeRoot = Path.Combine(root, "Packages", "org.gamecult.aetheria.state", "Runtime");

View file

@ -181,7 +181,7 @@ namespace GameCult.Aetheria.State.Verse
Array.Empty<AetheriaRuntimeSurfaceStyleToken>()),
commands: new[]
{
new AetheriaRuntimeSurfaceCommandTemplate(Close, "Close", "unity-uitoolkit")
new AetheriaRuntimeSurfaceCommandTemplate(Close, "Close", AetheriaRuntimeSurfaceCommandTemplate.CultMeshTransport)
});
}

View file

@ -284,43 +284,43 @@ namespace GameCult.Aetheria.State.Verse
new AetheriaRuntimeSurfaceCommandTemplate(
AetheriaRuntimeClientTargetCommands.Refresh,
"Refresh",
"unity-uitoolkit"),
AetheriaRuntimeSurfaceCommandTemplate.CultMeshTransport),
new AetheriaRuntimeSurfaceCommandTemplate(
AetheriaRuntimeClientTargetCommands.CycleTargetKind,
"Cycle Transport",
"unity-uitoolkit"),
AetheriaRuntimeSurfaceCommandTemplate.CultMeshTransport),
new AetheriaRuntimeSurfaceCommandTemplate(
AetheriaRuntimeClientTargetCommands.SetTitle,
"Set Title",
"unity-uitoolkit"),
AetheriaRuntimeSurfaceCommandTemplate.CultMeshTransport),
new AetheriaRuntimeSurfaceCommandTemplate(
AetheriaRuntimeClientTargetCommands.SetVerseId,
"Set Verse Id",
"unity-uitoolkit"),
AetheriaRuntimeSurfaceCommandTemplate.CultMeshTransport),
new AetheriaRuntimeSurfaceCommandTemplate(
AetheriaRuntimeClientTargetCommands.SetCultMeshAddress,
"Set CultMesh Address",
"unity-uitoolkit"),
AetheriaRuntimeSurfaceCommandTemplate.CultMeshTransport),
new AetheriaRuntimeSurfaceCommandTemplate(
AetheriaRuntimeClientTargetCommands.SetStateFilePath,
"Set State File Path",
"unity-uitoolkit"),
AetheriaRuntimeSurfaceCommandTemplate.CultMeshTransport),
new AetheriaRuntimeSurfaceCommandTemplate(
AetheriaRuntimeClientTargetCommands.SetDiscoveryEndpoints,
"Set Discovery Endpoints",
"unity-uitoolkit"),
AetheriaRuntimeSurfaceCommandTemplate.CultMeshTransport),
new AetheriaRuntimeSurfaceCommandTemplate(
AetheriaRuntimeClientTargetCommands.DiscoverVerses,
"Discover Verses",
"unity-uitoolkit"),
AetheriaRuntimeSurfaceCommandTemplate.CultMeshTransport),
new AetheriaRuntimeSurfaceCommandTemplate(
AetheriaRuntimeClientTargetCommands.SelectDiscoveredVerse,
"Select Discovered Verse",
"unity-uitoolkit"),
AetheriaRuntimeSurfaceCommandTemplate.CultMeshTransport),
new AetheriaRuntimeSurfaceCommandTemplate(
AetheriaRuntimeClientTargetCommands.SyncReplica,
"Sync Replica",
"unity-uitoolkit"),
AetheriaRuntimeSurfaceCommandTemplate.CultMeshTransport),
new AetheriaRuntimeSurfaceCommandTemplate(
AetheriaRuntimeVerseHostCommands.CycleVisibility,
"Toggle Visibility",

View file

@ -33,7 +33,10 @@ namespace GameCult.Aetheria.State.Verse
public static IReadOnlyList<AetheriaRuntimeSurfaceCommandTemplate> ArgumentlessSurfaceCommands =>
ArgumentlessCommandKinds
.Select(kind => new AetheriaRuntimeSurfaceCommandTemplate(CommandName(kind), Label(kind), "cultmesh"))
.Select(kind => new AetheriaRuntimeSurfaceCommandTemplate(
CommandName(kind),
Label(kind),
AetheriaRuntimeSurfaceCommandTemplate.CultMeshTransport))
.ToArray();
public static string CommandName(AetheriaRuntimeDaemonCommandKinds kind)

View file

@ -259,12 +259,12 @@ namespace GameCult.Aetheria.State.Verse
Array.Empty<AetheriaRuntimeSurfaceStyleToken>()),
commands: new[]
{
new AetheriaRuntimeSurfaceCommandTemplate(Close, "Close", "unity-uitoolkit"),
new AetheriaRuntimeSurfaceCommandTemplate(ToggleOverrideShutdown, "Toggle Override Shutdown", "unity-uitoolkit"),
new AetheriaRuntimeSurfaceCommandTemplate(SetTargetTemperature, "Set Target Temperature", "unity-uitoolkit"),
new AetheriaRuntimeSurfaceCommandTemplate(ToggleWeaponGroup, "Toggle Weapon Group", "unity-uitoolkit"),
new AetheriaRuntimeSurfaceCommandTemplate(BindWeaponGroup, "Bind Weapon Group", "unity-uitoolkit"),
new AetheriaRuntimeSurfaceCommandTemplate(ClearActionBarBinding, "Clear Action Bar Binding", "unity-uitoolkit")
new AetheriaRuntimeSurfaceCommandTemplate(Close, "Close", AetheriaRuntimeSurfaceCommandTemplate.CultMeshTransport),
new AetheriaRuntimeSurfaceCommandTemplate(ToggleOverrideShutdown, "Toggle Override Shutdown", AetheriaRuntimeSurfaceCommandTemplate.CultMeshTransport),
new AetheriaRuntimeSurfaceCommandTemplate(SetTargetTemperature, "Set Target Temperature", AetheriaRuntimeSurfaceCommandTemplate.CultMeshTransport),
new AetheriaRuntimeSurfaceCommandTemplate(ToggleWeaponGroup, "Toggle Weapon Group", AetheriaRuntimeSurfaceCommandTemplate.CultMeshTransport),
new AetheriaRuntimeSurfaceCommandTemplate(BindWeaponGroup, "Bind Weapon Group", AetheriaRuntimeSurfaceCommandTemplate.CultMeshTransport),
new AetheriaRuntimeSurfaceCommandTemplate(ClearActionBarBinding, "Clear Action Bar Binding", AetheriaRuntimeSurfaceCommandTemplate.CultMeshTransport)
});
}

View file

@ -156,19 +156,19 @@ namespace GameCult.Aetheria.State.Verse
new AetheriaRuntimeSurfaceCommandTemplate(
AetheriaRuntimeInputSettingsCommands.Refresh,
"Refresh",
"unity-uitoolkit"),
AetheriaRuntimeSurfaceCommandTemplate.CultMeshTransport),
new AetheriaRuntimeSurfaceCommandTemplate(
AetheriaRuntimeInputSettingsCommands.BeginCapture,
"Capture Binding",
"unity-uitoolkit"),
AetheriaRuntimeSurfaceCommandTemplate.CultMeshTransport),
new AetheriaRuntimeSurfaceCommandTemplate(
AetheriaRuntimeInputSettingsCommands.CancelCapture,
"Cancel Capture",
"unity-uitoolkit"),
AetheriaRuntimeSurfaceCommandTemplate.CultMeshTransport),
new AetheriaRuntimeSurfaceCommandTemplate(
AetheriaRuntimeInputSettingsCommands.ToggleActionBar,
"Toggle Action-Bar Input",
"unity-uitoolkit")
AetheriaRuntimeSurfaceCommandTemplate.CultMeshTransport)
});
}

View file

@ -125,8 +125,8 @@ namespace GameCult.Aetheria.State.Verse
.Where(group => group?.Options != null)
.SelectMany(group => group.Options)
.Where(option => option?.IsCommand == true)
.Select(option => new AetheriaRuntimeSurfaceCommandTemplate(option.Command, option.Label, "unity-uitoolkit"))
.Append(new AetheriaRuntimeSurfaceCommandTemplate(Close, "Close", "unity-uitoolkit"))
.Select(option => new AetheriaRuntimeSurfaceCommandTemplate(option.Command, option.Label, AetheriaRuntimeSurfaceCommandTemplate.CultMeshTransport))
.Append(new AetheriaRuntimeSurfaceCommandTemplate(Close, "Close", AetheriaRuntimeSurfaceCommandTemplate.CultMeshTransport))
.ToArray();
return new AetheriaRuntimeSurfaceDocument(

View file

@ -350,7 +350,7 @@ namespace GameCult.Aetheria.State.Verse
private static AetheriaRuntimeSurfaceCommandTemplate Command(string command, string label)
{
return new AetheriaRuntimeSurfaceCommandTemplate(command, label, "unity-uitoolkit");
return new AetheriaRuntimeSurfaceCommandTemplate(command, label, AetheriaRuntimeSurfaceCommandTemplate.CultMeshTransport);
}
private static AetheriaRuntimeSurfaceComponent Card(

View file

@ -61,7 +61,7 @@ namespace GameCult.Aetheria.State.Verse
.Select(tab => new AetheriaRuntimeSurfaceCommandTemplate(
CommandFor(tab.Key),
LabelFor(tab),
"unity-uitoolkit"))
AetheriaRuntimeSurfaceCommandTemplate.CultMeshTransport))
.ToArray();
var buttons = state.VisibleTabs
.Select(tab => Button(

View file

@ -96,6 +96,8 @@ namespace GameCult.Aetheria.State.Verse
public sealed class AetheriaRuntimeSurfaceCommandTemplate
{
public const string CultMeshTransport = "cultmesh";
public AetheriaRuntimeSurfaceCommandTemplate(string command, string label, string transport)
{
Command = command ?? "";

View file

@ -67,10 +67,10 @@ namespace GameCult.Aetheria.State.Verse
Array.Empty<AetheriaRuntimeSurfaceStyleToken>()),
commands: new[]
{
new AetheriaRuntimeSurfaceCommandTemplate(DecrementShutdownThreshold, "Threshold -", "unity-uitoolkit"),
new AetheriaRuntimeSurfaceCommandTemplate(IncrementShutdownThreshold, "Threshold +", "unity-uitoolkit"),
new AetheriaRuntimeSurfaceCommandTemplate(ResetShutdownThreshold, "Default", "unity-uitoolkit"),
new AetheriaRuntimeSurfaceCommandTemplate(Close, "Close", "unity-uitoolkit")
new AetheriaRuntimeSurfaceCommandTemplate(DecrementShutdownThreshold, "Threshold -", AetheriaRuntimeSurfaceCommandTemplate.CultMeshTransport),
new AetheriaRuntimeSurfaceCommandTemplate(IncrementShutdownThreshold, "Threshold +", AetheriaRuntimeSurfaceCommandTemplate.CultMeshTransport),
new AetheriaRuntimeSurfaceCommandTemplate(ResetShutdownThreshold, "Default", AetheriaRuntimeSurfaceCommandTemplate.CultMeshTransport),
new AetheriaRuntimeSurfaceCommandTemplate(Close, "Close", AetheriaRuntimeSurfaceCommandTemplate.CultMeshTransport)
});
}

View file

@ -453,17 +453,17 @@ namespace GameCult.Aetheria.State.Verse
{
return new[]
{
new AetheriaRuntimeSurfaceCommandTemplate(AetheriaRuntimeStatRecipeCommands.Refresh, "Refresh", "cultmesh"),
new AetheriaRuntimeSurfaceCommandTemplate(AetheriaRuntimeStatRecipeCommands.SelectStat, "Select Stat", "cultmesh"),
new AetheriaRuntimeSurfaceCommandTemplate(AetheriaRuntimeStatRecipeCommands.AddStat, "Add Stat", "cultmesh"),
new AetheriaRuntimeSurfaceCommandTemplate(AetheriaRuntimeStatRecipeCommands.RemoveStat, "Remove Stat", "cultmesh"),
new AetheriaRuntimeSurfaceCommandTemplate(AetheriaRuntimeStatRecipeCommands.SetStatName, "Set Stat Name", "cultmesh"),
new AetheriaRuntimeSurfaceCommandTemplate(AetheriaRuntimeStatRecipeCommands.SetBaseValue, "Set Base Value", "cultmesh"),
new AetheriaRuntimeSurfaceCommandTemplate(AetheriaRuntimeStatRecipeCommands.ToggleCondition, "Toggle Condition", "cultmesh"),
new AetheriaRuntimeSurfaceCommandTemplate(AetheriaRuntimeStatRecipeCommands.CycleInfluenceOperation, "Cycle Operation", "cultmesh"),
new AetheriaRuntimeSurfaceCommandTemplate(AetheriaRuntimeStatRecipeCommands.SetInfluenceAmount, "Set Influence Amount", "cultmesh"),
new AetheriaRuntimeSurfaceCommandTemplate(AetheriaRuntimeStatRecipeCommands.SetInfluenceCurve, "Set Influence Curve", "cultmesh"),
new AetheriaRuntimeSurfaceCommandTemplate(AetheriaRuntimeStatRecipeCommands.SetPreviewCondition, "Set Preview Condition", "cultmesh")
new AetheriaRuntimeSurfaceCommandTemplate(AetheriaRuntimeStatRecipeCommands.Refresh, "Refresh", AetheriaRuntimeSurfaceCommandTemplate.CultMeshTransport),
new AetheriaRuntimeSurfaceCommandTemplate(AetheriaRuntimeStatRecipeCommands.SelectStat, "Select Stat", AetheriaRuntimeSurfaceCommandTemplate.CultMeshTransport),
new AetheriaRuntimeSurfaceCommandTemplate(AetheriaRuntimeStatRecipeCommands.AddStat, "Add Stat", AetheriaRuntimeSurfaceCommandTemplate.CultMeshTransport),
new AetheriaRuntimeSurfaceCommandTemplate(AetheriaRuntimeStatRecipeCommands.RemoveStat, "Remove Stat", AetheriaRuntimeSurfaceCommandTemplate.CultMeshTransport),
new AetheriaRuntimeSurfaceCommandTemplate(AetheriaRuntimeStatRecipeCommands.SetStatName, "Set Stat Name", AetheriaRuntimeSurfaceCommandTemplate.CultMeshTransport),
new AetheriaRuntimeSurfaceCommandTemplate(AetheriaRuntimeStatRecipeCommands.SetBaseValue, "Set Base Value", AetheriaRuntimeSurfaceCommandTemplate.CultMeshTransport),
new AetheriaRuntimeSurfaceCommandTemplate(AetheriaRuntimeStatRecipeCommands.ToggleCondition, "Toggle Condition", AetheriaRuntimeSurfaceCommandTemplate.CultMeshTransport),
new AetheriaRuntimeSurfaceCommandTemplate(AetheriaRuntimeStatRecipeCommands.CycleInfluenceOperation, "Cycle Operation", AetheriaRuntimeSurfaceCommandTemplate.CultMeshTransport),
new AetheriaRuntimeSurfaceCommandTemplate(AetheriaRuntimeStatRecipeCommands.SetInfluenceAmount, "Set Influence Amount", AetheriaRuntimeSurfaceCommandTemplate.CultMeshTransport),
new AetheriaRuntimeSurfaceCommandTemplate(AetheriaRuntimeStatRecipeCommands.SetInfluenceCurve, "Set Influence Curve", AetheriaRuntimeSurfaceCommandTemplate.CultMeshTransport),
new AetheriaRuntimeSurfaceCommandTemplate(AetheriaRuntimeStatRecipeCommands.SetPreviewCondition, "Set Preview Condition", AetheriaRuntimeSurfaceCommandTemplate.CultMeshTransport)
};
}

View file

@ -89,8 +89,8 @@ namespace GameCult.Aetheria.State.Verse
Button($"{SurfaceId}.close", "Close", Close)))),
Array.Empty<AetheriaRuntimeSurfaceStyleToken>()),
commands: targets
.Select(target => new AetheriaRuntimeSurfaceCommandTemplate(target.Command, target.Label, "unity-uitoolkit"))
.Append(new AetheriaRuntimeSurfaceCommandTemplate(Close, "Close", "unity-uitoolkit"))
.Select(target => new AetheriaRuntimeSurfaceCommandTemplate(target.Command, target.Label, AetheriaRuntimeSurfaceCommandTemplate.CultMeshTransport))
.Append(new AetheriaRuntimeSurfaceCommandTemplate(Close, "Close", AetheriaRuntimeSurfaceCommandTemplate.CultMeshTransport))
.ToArray());
}

View file

@ -168,8 +168,8 @@ namespace GameCult.Aetheria.State.Verse
commands: state.Groups
.Where(group => group?.Options != null)
.SelectMany(group => group.Options)
.Select(option => new AetheriaRuntimeSurfaceCommandTemplate(option.Command, option.Label, "unity-uitoolkit"))
.Append(new AetheriaRuntimeSurfaceCommandTemplate(CloseFilter, "Close", "unity-uitoolkit"))
.Select(option => new AetheriaRuntimeSurfaceCommandTemplate(option.Command, option.Label, AetheriaRuntimeSurfaceCommandTemplate.CultMeshTransport))
.Append(new AetheriaRuntimeSurfaceCommandTemplate(CloseFilter, "Close", AetheriaRuntimeSurfaceCommandTemplate.CultMeshTransport))
.ToArray());
}
@ -211,8 +211,8 @@ namespace GameCult.Aetheria.State.Verse
Button($"{RowActionSurfaceId}.close", "Close", CloseRowAction)))),
Array.Empty<AetheriaRuntimeSurfaceStyleToken>()),
commands: state.Actions
.Select(action => new AetheriaRuntimeSurfaceCommandTemplate(action.Command, action.Label, "unity-uitoolkit"))
.Append(new AetheriaRuntimeSurfaceCommandTemplate(CloseRowAction, "Close", "unity-uitoolkit"))
.Select(action => new AetheriaRuntimeSurfaceCommandTemplate(action.Command, action.Label, AetheriaRuntimeSurfaceCommandTemplate.CultMeshTransport))
.Append(new AetheriaRuntimeSurfaceCommandTemplate(CloseRowAction, "Close", AetheriaRuntimeSurfaceCommandTemplate.CultMeshTransport))
.ToArray());
}

View file

@ -156,7 +156,7 @@ namespace GameCult.Aetheria.State.Verse
Array.Empty<AetheriaRuntimeSurfaceStyleToken>()),
commands: new[]
{
new AetheriaRuntimeSurfaceCommandTemplate(Close, "Close", "unity-uitoolkit")
new AetheriaRuntimeSurfaceCommandTemplate(Close, "Close", AetheriaRuntimeSurfaceCommandTemplate.CultMeshTransport)
});
}

View file

@ -137,7 +137,7 @@ namespace GameCult.Aetheria.State.Verse
Array.Empty<AetheriaRuntimeSurfaceStyleToken>()),
commands: new[]
{
new AetheriaRuntimeSurfaceCommandTemplate(Close, "Close", "unity-uitoolkit")
new AetheriaRuntimeSurfaceCommandTemplate(Close, "Close", AetheriaRuntimeSurfaceCommandTemplate.CultMeshTransport)
});
}