Support PickAny templates in MultiBrushes

Allows PickAny templates to be used in MultiBrushes, which can be
painted with random selection. This avoids the need to define various
separate MultiBrushes for each tile combination.

Note that all combinations count as part of a single MultiBrush, which
may influence selection weighting.

This MultiBrush feature is not presently used in OpenRA's official
mods, but is useful for unofficial mods using more general PickAny
templates.
This commit is contained in:
Ashley Newson
2025-05-18 18:17:47 +01:00
committed by Gustas Kažukauskas
parent daf36769d6
commit 5c09d5d828
4 changed files with 84 additions and 29 deletions

View File

@@ -34,7 +34,7 @@ namespace OpenRA.Mods.Common.Lint
// Includes validation of actor types and template IDs.
var multiBrush = new MultiBrush(map, info);
foreach (var (_, tile) in multiBrush.Tiles)
foreach (var tile in multiBrush.PossibleTiles())
if (!templatedTerrainInfo.TryGetTerrainInfo(tile, out var _))
emitError($"Tileset {terrainInfoName} has invalid MultiBrush collection `{collectionName}`: tileset does not have tile {tile.Type},{tile.Index}");
}