Allow tools to disable themselves
This commit is contained in:
committed by
Matthias Mailänder
parent
f8921226b8
commit
42181d77a5
@@ -26,10 +26,10 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
public MapToolsLogic(Widget widget, World world)
|
||||
{
|
||||
var toolDropdownWidget = widget.Get<DropDownButtonWidget>("TOOLS_DROPDOWN");
|
||||
var tools = world.Map.Rules.Actors[SystemActors.EditorWorld].TraitInfos<IEditorToolInfo>();
|
||||
var tools = world.WorldActor.TraitsImplementing<IEditorTool>();
|
||||
foreach (var tool in tools)
|
||||
{
|
||||
if (tool is IEditorMapGeneratorInfo gi && !gi.Tilesets.Contains(world.Map.Tileset))
|
||||
if (!tool.IsEnabled)
|
||||
continue;
|
||||
|
||||
var panel = Game.LoadWidget(world, tool.PanelWidget, widget, new WidgetArgs() { { "tool", tool } });
|
||||
|
||||
Reference in New Issue
Block a user