Remove direct access to MapPreview.Rules.

This commit is contained in:
Paul Chote
2021-04-04 16:40:46 +01:00
committed by teinarss
parent 53e6d974f0
commit abee274f88
22 changed files with 57 additions and 54 deletions

View File

@@ -73,12 +73,12 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Display order for the game speed option in the lobby.")]
public readonly int GameSpeedDropdownDisplayOrder = 0;
IEnumerable<LobbyOption> ILobbyOptions.LobbyOptions(Ruleset rules)
IEnumerable<LobbyOption> ILobbyOptions.LobbyOptions(MapPreview map)
{
yield return new LobbyBooleanOption("shortgame", ShortGameCheckboxLabel, ShortGameCheckboxDescription,
ShortGameCheckboxVisible, ShortGameCheckboxDisplayOrder, ShortGameCheckboxEnabled, ShortGameCheckboxLocked);
var techLevels = rules.Actors[SystemActors.Player].TraitInfos<ProvidesTechPrerequisiteInfo>()
var techLevels = map.PlayerActorInfo.TraitInfos<ProvidesTechPrerequisiteInfo>()
.ToDictionary(t => t.Id, t => t.Name);
if (techLevels.Any())