Require map generators to specify valid tilesets.

This commit is contained in:
Paul Chote
2025-04-26 13:29:03 +01:00
committed by Gustas Kažukauskas
parent c41a1302b6
commit e5ffed2a4f
6 changed files with 18 additions and 2 deletions

View File

@@ -29,6 +29,9 @@ namespace OpenRA.Mods.Common.Widgets.Logic
var tools = world.Map.Rules.Actors[SystemActors.EditorWorld].TraitInfos<IEditorToolInfo>();
foreach (var tool in tools)
{
if (tool is IEditorMapGeneratorInfo gi && !gi.Tilesets.Contains(world.Map.Tileset))
continue;
var panel = Game.LoadWidget(world, tool.PanelWidget, widget, new WidgetArgs() { { "tool", tool } });
toolPanels.Add(panel);
toolLabels.Add(panel, FluentProvider.GetMessage(tool.Label));