Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename EditorTilesetFilter to MapEditorData #15630

Merged
merged 1 commit into from
Sep 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ Also thanks to:
* Lawrence Wang
* Lesueur Benjamin (Valkirie)
* Maarten Meuris (Nyerguds)
* Manuel Geiger (Ectras)
* Mark Olson (markolson)
* Markus Hartung (hartmark)
* Matija Hustic (matija-hustic)
Expand Down
3 changes: 2 additions & 1 deletion OpenRA.Mods.Common/OpenRA.Mods.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@
<Compile Include="Traits\Demolishable.cs" />
<Compile Include="Traits\Demolition.cs" />
<Compile Include="Traits\DetectCloaked.cs" />
<Compile Include="Traits\EditorTilesetFilter.cs" />
<Compile Include="Traits\MapEditorData.cs" />
<Compile Include="Traits\EjectOnDeath.cs" />
<Compile Include="Traits\SpawnActorsOnSell.cs" />
<Compile Include="Traits\EngineerRepair.cs" />
Expand Down Expand Up @@ -866,6 +866,7 @@
<Compile Include="UpdateRules\UpdateRule.cs" />
<Compile Include="UpdateRules\UpdatePath.cs" />
<Compile Include="UpdateRules\UpdateUtils.cs" />
<Compile Include="UpdateRules\Rules\RenameEditorTilesetFilter.cs" />
<Compile Include="UpdateRules\Rules\20171014\LegacyBetaWarning.cs" />
<Compile Include="UpdateRules\Rules\20171014\RemoveMobileOnRails.cs" />
<Compile Include="UpdateRules\Rules\20171014\AircraftCanHoverGeneralization.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@

namespace OpenRA.Mods.Common.Traits
{
public class EditorTilesetFilterInfo : TraitInfo<EditorTilesetFilter>
public class MapEditorDataInfo : TraitInfo<MapEditorData>
{
public readonly HashSet<string> RequireTilesets = null;
public readonly HashSet<string> ExcludeTilesets = null;
public readonly string[] Categories;
}

public class EditorTilesetFilter { }
public class MapEditorData { }
}
35 changes: 35 additions & 0 deletions OpenRA.Mods.Common/UpdateRules/Rules/RenameEditorTilesetFilter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#region Copyright & License Information
/*
* Copyright 2007-2018 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version. For more
* information, see COPYING.
*/
#endregion

using System.Collections.Generic;

namespace OpenRA.Mods.Common.UpdateRules.Rules
{
public class RenameEditorTilesetFilter : UpdateRule
{
public override string Name { get { return "EditorTilesetFilter renamed to MapEditorData"; } }
public override string Description
{
get
{
return "The name EditorTilesetFilter was misleading and was renamed to MapEditorData.";
}
}

public override IEnumerable<string> UpdateActorNode(ModData modData, MiniYamlNode actorNode)
{
foreach (var data in actorNode.ChildrenMatching("EditorTilesetFilter"))
data.RenameKey("MapEditorData");

yield break;
}
}
}
1 change: 1 addition & 0 deletions OpenRA.Mods.Common/UpdateRules/UpdatePath.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ public class UpdatePath
new UpdatePath("playtest-20180729", new UpdateRule[]
{
// Bleed only changes here
new RenameEditorTilesetFilter()
})
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public ActorSelectorLogic(Widget widget, World world, WorldRenderer worldRendere
if (!a.HasTraitInfo<IRenderActorPreviewInfo>())
continue;

var editorData = a.TraitInfoOrDefault<EditorTilesetFilterInfo>();
var editorData = a.TraitInfoOrDefault<MapEditorDataInfo>();

// Actor must be included in at least one category
if (editorData == null || editorData.Categories == null)
Expand Down
Loading