Remove Unity-local trade Eve component helpers
This commit is contained in:
parent
017f3e8932
commit
fb4b32e1d8
2 changed files with 6 additions and 51 deletions
|
|
@ -4552,6 +4552,8 @@ static void RequireTradeCargoSelectorUseEveSurface(string root)
|
|||
"host.AddComponent<UIDocument>",
|
||||
"ContextMenu.AddOption(\"Docking Bay\"",
|
||||
"ContextMenu.AddOption($\"{ship.Name} Bay {bay.index+1}\"",
|
||||
"private static EveSurfaceComponent",
|
||||
"new EveSurfaceComponent(",
|
||||
"string.Equals(request.Command, AetheriaRuntimeTradeCargoSelectorSurfaceBuilder.Close",
|
||||
"_cargoSelectionCommands.TryGetValue(request.Command",
|
||||
"GameManager.DockedEntity.Children",
|
||||
|
|
@ -4670,6 +4672,8 @@ static void RequireTradeFilterAndRowActionsUseEveSurface(string root)
|
|||
"ContextMenu.AddDropdown(",
|
||||
"ContextMenu.AddOption(",
|
||||
"ContextMenu.Show();",
|
||||
"private static EveSurfaceComponent",
|
||||
"new EveSurfaceComponent(",
|
||||
"string.Equals(request.Command, AetheriaRuntimeTradeInteractionSurfaceBuilder.CloseFilter",
|
||||
"string.Equals(request.Command, AetheriaRuntimeTradeInteractionSurfaceBuilder.CloseRowAction",
|
||||
"_filterSurfaceCommands.TryGetValue(request.Command",
|
||||
|
|
@ -4777,6 +4781,8 @@ static void RequireTradeItemDetailsUseEveSurface(string root)
|
|||
"host.AddComponent<UIDocument>",
|
||||
"public PropertiesPanel Properties;",
|
||||
"OnClick = () => Properties.Inspect(i.TypedItem)",
|
||||
"private static EveSurfaceComponent",
|
||||
"new EveSurfaceComponent(",
|
||||
"string.Equals(request.Command, AetheriaRuntimeTradeItemDetailsSurfaceBuilder.Close"
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using GameCult.Aetheria.EveRuntime;
|
||||
|
|
@ -1152,56 +1151,6 @@ public class TradeMenu : MonoBehaviour
|
|||
DateTime.UtcNow.ToString("O"));
|
||||
}
|
||||
|
||||
private static EveSurfaceComponent Card(
|
||||
string id,
|
||||
string title,
|
||||
params EveSurfaceComponent[] children)
|
||||
{
|
||||
return Node(id, "card", new[] { ("title", title) }, children);
|
||||
}
|
||||
|
||||
private static EveSurfaceComponent Metric(string id, string label, string value)
|
||||
{
|
||||
return Node(id, "metric", new[] { ("label", label), ("value", value) });
|
||||
}
|
||||
|
||||
private static EveSurfaceComponent Text(string id, string value)
|
||||
{
|
||||
return Node(id, "text", new[] { ("value", value) });
|
||||
}
|
||||
|
||||
private static EveSurfaceComponent Button(string id, string label, string command)
|
||||
{
|
||||
return Node(id, "control.button", new[] { ("label", label), ("command", command) });
|
||||
}
|
||||
|
||||
private static EveSurfaceComponent ButtonRow(
|
||||
string id,
|
||||
params EveSurfaceComponent[] children)
|
||||
{
|
||||
return Node(id, "row", Array.Empty<(string Key, string Value)>(), children);
|
||||
}
|
||||
|
||||
private static EveSurfaceComponent ButtonColumn(
|
||||
string id,
|
||||
params EveSurfaceComponent[] children)
|
||||
{
|
||||
return Node(id, "column", Array.Empty<(string Key, string Value)>(), children);
|
||||
}
|
||||
|
||||
private static EveSurfaceComponent Node(
|
||||
string id,
|
||||
string kind,
|
||||
IEnumerable<(string Key, string Value)> props,
|
||||
params EveSurfaceComponent[] children)
|
||||
{
|
||||
return new EveSurfaceComponent(
|
||||
id,
|
||||
kind,
|
||||
props.ToDictionary(prop => prop.Key, prop => prop.Value, StringComparer.Ordinal),
|
||||
children ?? Array.Empty<EveSurfaceComponent>());
|
||||
}
|
||||
|
||||
private int CountAvailablePlayerShips(string itemKey)
|
||||
{
|
||||
return GameManager.ObservedAvailableEntities()
|
||||
|
|
|
|||
Loading…
Reference in a new issue