Editor: ActorEditLogic: support for dynamic generation of items in dropdown

This commit is contained in:
michaeldgg2
2023-12-24 22:54:19 +01:00
committed by Gustas
parent 507cdf1256
commit 073ce4a718
4 changed files with 18 additions and 13 deletions

View File

@@ -59,8 +59,8 @@ namespace OpenRA.Mods.Common.Traits
// Make sure the no-plug option is always available
EditorOptions[""] = EmptyOption;
yield return new EditorActorDropdown("Plug", EditorDisplayOrder, EditorOptions,
actor =>
yield return new EditorActorDropdown("Plug", EditorDisplayOrder, _ => EditorOptions,
(actor, _) =>
{
var init = actor.GetInitOrDefault<PlugInit>(this);
return init?.Value ?? "";