Rename Player.Country to Player.Faction
This commit is contained in:
@@ -113,12 +113,12 @@ namespace OpenRA
|
||||
Name = runtimePlayer.PlayerName,
|
||||
IsHuman = !runtimePlayer.IsBot,
|
||||
IsBot = runtimePlayer.IsBot,
|
||||
FactionName = runtimePlayer.Country.Name,
|
||||
FactionId = runtimePlayer.Country.InternalName,
|
||||
FactionName = runtimePlayer.Faction.Name,
|
||||
FactionId = runtimePlayer.Faction.InternalName,
|
||||
Color = runtimePlayer.Color,
|
||||
Team = client.Team,
|
||||
SpawnPoint = runtimePlayer.SpawnPoint,
|
||||
IsRandomFaction = runtimePlayer.Country.InternalName != client.Race,
|
||||
IsRandomFaction = runtimePlayer.Faction.InternalName != client.Race,
|
||||
IsRandomSpawnPoint = runtimePlayer.SpawnPoint != client.SpawnPoint
|
||||
};
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace OpenRA
|
||||
|
||||
public readonly string PlayerName;
|
||||
public readonly string InternalName;
|
||||
public readonly FactionInfo Country;
|
||||
public readonly FactionInfo Faction;
|
||||
public readonly bool NonCombatant = false;
|
||||
public readonly bool Playable = true;
|
||||
public readonly int ClientIndex;
|
||||
@@ -95,7 +95,7 @@ namespace OpenRA
|
||||
Color = client.Color;
|
||||
PlayerName = client.Name;
|
||||
botType = client.Bot;
|
||||
Country = ChooseCountry(world, client.Race, !pr.LockFaction);
|
||||
Faction = ChooseCountry(world, client.Race, !pr.LockFaction);
|
||||
DisplayCountry = ChooseDisplayCountry(world, client.Race);
|
||||
}
|
||||
else
|
||||
@@ -108,7 +108,7 @@ namespace OpenRA
|
||||
Playable = pr.Playable;
|
||||
Spectating = pr.Spectating;
|
||||
botType = pr.Bot;
|
||||
Country = ChooseCountry(world, pr.Faction, false);
|
||||
Faction = ChooseCountry(world, pr.Faction, false);
|
||||
DisplayCountry = ChooseDisplayCountry(world, pr.Faction);
|
||||
}
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace OpenRA.Traits
|
||||
{
|
||||
this.info = info;
|
||||
var self = init.Self;
|
||||
var race = init.Contains<RaceInit>() ? init.Get<RaceInit, string>() : self.Owner.Country.InternalName;
|
||||
var race = init.Contains<RaceInit>() ? init.Get<RaceInit, string>() : self.Owner.Faction.InternalName;
|
||||
|
||||
quantizedFacings = Exts.Lazy(() =>
|
||||
{
|
||||
|
||||
@@ -145,7 +145,7 @@ namespace OpenRA.Traits
|
||||
{
|
||||
if (Resources > 0.8 * ResourceCapacity)
|
||||
{
|
||||
Sound.PlayNotification(self.World.Map.Rules, owner, "Speech", "SilosNeeded", owner.Country.InternalName);
|
||||
Sound.PlayNotification(self.World.Map.Rules, owner, "Speech", "SilosNeeded", owner.Faction.InternalName);
|
||||
AlertSilo = true;
|
||||
}
|
||||
else
|
||||
@@ -187,14 +187,14 @@ namespace OpenRA.Traits
|
||||
public void PlayCashTickUp(Actor self)
|
||||
{
|
||||
if (Game.Settings.Sound.CashTicks)
|
||||
Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Sounds", "CashTickUp", self.Owner.Country.InternalName);
|
||||
Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Sounds", "CashTickUp", self.Owner.Faction.InternalName);
|
||||
}
|
||||
|
||||
public void PlayCashTickDown(Actor self)
|
||||
{
|
||||
if (Game.Settings.Sound.CashTicks && nextCashTickTime == 0)
|
||||
{
|
||||
Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Sounds", "CashTickDown", self.Owner.Country.InternalName);
|
||||
Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Sounds", "CashTickDown", self.Owner.Faction.InternalName);
|
||||
nextCashTickTime = 2;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace OpenRA
|
||||
if (string.IsNullOrEmpty(voiced.VoiceSet))
|
||||
return;
|
||||
|
||||
voiced.PlayVoice(self, phrase, self.Owner.Country.InternalName);
|
||||
voiced.PlayVoice(self, phrase, self.Owner.Faction.InternalName);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace OpenRA
|
||||
if (string.IsNullOrEmpty(voiced.VoiceSet))
|
||||
return;
|
||||
|
||||
voiced.PlayVoiceLocal(self, phrase, self.Owner.Country.InternalName, volume);
|
||||
voiced.PlayVoiceLocal(self, phrase, self.Owner.Faction.InternalName, volume);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ namespace OpenRA
|
||||
foreach (var v in orderSubject.TraitsImplementing<IOrderVoice>())
|
||||
{
|
||||
if (voice.PlayVoice(orderSubject, v.VoicePhraseForOrder(orderSubject, o),
|
||||
orderSubject.Owner.Country.InternalName))
|
||||
orderSubject.Owner.Faction.InternalName))
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace OpenRA.Widgets
|
||||
{
|
||||
public static Sprite GetChromeImage(World world, string name)
|
||||
{
|
||||
return ChromeProvider.GetImage("chrome-" + world.LocalPlayer.Country.InternalName, name);
|
||||
return ChromeProvider.GetImage("chrome-" + world.LocalPlayer.Faction.InternalName, name);
|
||||
}
|
||||
|
||||
public static void DrawRGBA(Sprite s, float2 pos)
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
cargo.Delivered(self);
|
||||
|
||||
self.World.AddFrameEndTask(ww => DoProduction(self, producee, exit, raceVariant));
|
||||
Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", info.ReadyAudio, self.Owner.Country.InternalName);
|
||||
Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", info.ReadyAudio, self.Owner.Faction.InternalName);
|
||||
}));
|
||||
|
||||
actor.QueueActivity(new Fly(actor, Target.FromCell(w, endPos)));
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace OpenRA.Mods.Common.Activities
|
||||
|
||||
if (health.DamageState == DamageState.Undamaged)
|
||||
{
|
||||
Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", repairsUnits.FinishRepairingNotification, self.Owner.Country.InternalName);
|
||||
Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", repairsUnits.FinishRepairingNotification, self.Owner.Faction.InternalName);
|
||||
return NextActivity;
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace OpenRA.Mods.Common.Activities
|
||||
if (!played)
|
||||
{
|
||||
played = true;
|
||||
Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", repairsUnits.StartRepairingNotification, self.Owner.Country.InternalName);
|
||||
Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", repairsUnits.StartRepairingNotification, self.Owner.Faction.InternalName);
|
||||
}
|
||||
|
||||
if (!self.Owner.PlayerActor.Trait<PlayerResources>().TakeCash(cost))
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace OpenRA.Mods.Common.Activities
|
||||
foreach (var s in Sounds)
|
||||
Sound.PlayToPlayer(self.Owner, s, self.CenterPosition);
|
||||
|
||||
Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", Notification, self.Owner.Country.InternalName);
|
||||
Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", Notification, self.Owner.Faction.InternalName);
|
||||
|
||||
var init = new TypeDictionary
|
||||
{
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace OpenRA.Mods.Common.Orders
|
||||
|
||||
var buildableInfo = info.Traits.Get<BuildableInfo>();
|
||||
var mostLikelyProducer = queue.MostLikelyProducer();
|
||||
race = buildableInfo.ForceRace ?? (mostLikelyProducer.Trait != null ? mostLikelyProducer.Trait.Race : producer.Owner.Country.InternalName);
|
||||
race = buildableInfo.ForceRace ?? (mostLikelyProducer.Trait != null ? mostLikelyProducer.Trait.Race : producer.Owner.Faction.InternalName);
|
||||
|
||||
buildOk = map.SequenceProvider.GetSequence("overlay", "build-valid-{0}".F(tileset)).GetSprite(0);
|
||||
buildBlocked = map.SequenceProvider.GetSequence("overlay", "build-invalid").GetSprite(0);
|
||||
@@ -86,7 +86,7 @@ namespace OpenRA.Mods.Common.Orders
|
||||
orderType = "PlacePlug";
|
||||
if (!AcceptsPlug(topLeft, plugInfo))
|
||||
{
|
||||
Sound.PlayNotification(world.Map.Rules, producer.Owner, "Speech", "BuildingCannotPlaceAudio", producer.Owner.Country.InternalName);
|
||||
Sound.PlayNotification(world.Map.Rules, producer.Owner, "Speech", "BuildingCannotPlaceAudio", producer.Owner.Faction.InternalName);
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
@@ -95,7 +95,7 @@ namespace OpenRA.Mods.Common.Orders
|
||||
if (!world.CanPlaceBuilding(building, buildingInfo, topLeft, null)
|
||||
|| !buildingInfo.IsCloseEnoughToBase(world, producer.Owner, building, topLeft))
|
||||
{
|
||||
Sound.PlayNotification(world.Map.Rules, producer.Owner, "Speech", "BuildingCannotPlaceAudio", producer.Owner.Country.InternalName);
|
||||
Sound.PlayNotification(world.Map.Rules, producer.Owner, "Speech", "BuildingCannotPlaceAudio", producer.Owner.Faction.InternalName);
|
||||
yield break;
|
||||
}
|
||||
|
||||
|
||||
@@ -38,13 +38,13 @@ namespace OpenRA.Mods.Common.Scripting
|
||||
[Desc("Play an announcer voice listed in notifications.yaml")]
|
||||
public void PlaySpeechNotification(Player player, string notification)
|
||||
{
|
||||
Sound.PlayNotification(world.Map.Rules, player, "Speech", notification, player != null ? player.Country.InternalName : null);
|
||||
Sound.PlayNotification(world.Map.Rules, player, "Speech", notification, player != null ? player.Faction.InternalName : null);
|
||||
}
|
||||
|
||||
[Desc("Play a sound listed in notifications.yaml")]
|
||||
public void PlaySoundNotification(Player player, string notification)
|
||||
{
|
||||
Sound.PlayNotification(world.Map.Rules, player, "Sounds", notification, player != null ? player.Country.InternalName : null);
|
||||
Sound.PlayNotification(world.Map.Rules, player, "Sounds", notification, player != null ? player.Faction.InternalName : null);
|
||||
}
|
||||
|
||||
[Desc("Play a sound file")]
|
||||
|
||||
@@ -80,7 +80,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
isPrimary = true;
|
||||
|
||||
Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", "PrimaryBuildingSelected", self.Owner.Country.InternalName);
|
||||
Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", "PrimaryBuildingSelected", self.Owner.Faction.InternalName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
if (!Repairers.Remove(player) && Repairers.Count < Info.RepairBonuses.Length)
|
||||
{
|
||||
Repairers.Add(player);
|
||||
Sound.PlayNotification(self.World.Map.Rules, player, "Speech", "Repairing", player.Country.InternalName);
|
||||
Sound.PlayNotification(self.World.Map.Rules, player, "Speech", "Repairing", player.Faction.InternalName);
|
||||
|
||||
self.World.AddFrameEndTask(w =>
|
||||
{
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
if (captor.World.LocalPlayer != captor.Owner)
|
||||
return;
|
||||
|
||||
var race = info.NewOwnerVoice ? newOwner.Country.InternalName : oldOwner.Country.InternalName;
|
||||
var race = info.NewOwnerVoice ? newOwner.Faction.InternalName : oldOwner.Faction.InternalName;
|
||||
Sound.PlayNotification(self.World.Map.Rules, captor.World.LocalPlayer, "Speech", info.Notification, race);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
public bool CanGiveTo(Actor collector)
|
||||
{
|
||||
if (info.ValidRaces.Any() && !info.ValidRaces.Contains(collector.Owner.Country.InternalName))
|
||||
if (info.ValidRaces.Any() && !info.ValidRaces.Contains(collector.Owner.Faction.InternalName))
|
||||
return false;
|
||||
|
||||
var targetable = collector.Info.Traits.GetOrDefault<ITargetableInfo>();
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
public bool CanGiveTo(Actor collector)
|
||||
{
|
||||
if (info.ValidRaces.Any() && !info.ValidRaces.Contains(collector.Owner.Country.InternalName))
|
||||
if (info.ValidRaces.Any() && !info.ValidRaces.Contains(collector.Owner.Faction.InternalName))
|
||||
return false;
|
||||
|
||||
foreach (string unit in info.Units)
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
this.info = info;
|
||||
var raceList = info.Races;
|
||||
correctRace = raceList.Length == 0 || raceList.Contains(self.Owner.Country.InternalName);
|
||||
correctRace = raceList.Length == 0 || raceList.Contains(self.Owner.Faction.InternalName);
|
||||
}
|
||||
|
||||
public void Selling(Actor self) { }
|
||||
|
||||
@@ -98,7 +98,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
if (!silent)
|
||||
{
|
||||
Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Sounds", "LevelUp", self.Owner.Country.InternalName);
|
||||
Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Sounds", "LevelUp", self.Owner.Faction.InternalName);
|
||||
self.World.AddFrameEndTask(w => w.Add(new CrateEffect(self, "levelup", info.LevelUpPalette)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
if (self.World.WorldTick - lastAttackTime > info.NotifyInterval * 25)
|
||||
{
|
||||
Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", info.Notification, self.Owner.Country.InternalName);
|
||||
Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", info.Notification, self.Owner.Faction.InternalName);
|
||||
|
||||
if (radarPings != null)
|
||||
radarPings.Add(() => self.Owner == self.World.LocalPlayer, self.CenterPosition, info.RadarPingColor, info.RadarPingDuration);
|
||||
|
||||
@@ -67,7 +67,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
Game.RunAfterDelay(info.NotificationDelay, () =>
|
||||
{
|
||||
if (Game.IsCurrentWorld(player.World))
|
||||
Sound.PlayNotification(player.World.Map.Rules, player, "Speech", "Lose", player.Country.InternalName);
|
||||
Sound.PlayNotification(player.World.Map.Rules, player, "Speech", "Lose", player.Faction.InternalName);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -77,7 +77,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
Game.Debug("{0} is victorious.", player.PlayerName);
|
||||
|
||||
if (player == player.World.LocalPlayer)
|
||||
Game.RunAfterDelay(info.NotificationDelay, () => Sound.PlayNotification(player.World.Map.Rules, player, "Speech", "Win", player.Country.InternalName));
|
||||
Game.RunAfterDelay(info.NotificationDelay, () => Sound.PlayNotification(player.World.Map.Rules, player, "Speech", "Win", player.Faction.InternalName));
|
||||
}
|
||||
|
||||
public void OnObjectiveAdded(Player player, int id) { }
|
||||
|
||||
@@ -57,7 +57,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
if (self.World.WorldTick - lastAttackTime > info.NotifyInterval * 25)
|
||||
{
|
||||
Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", info.Notification, self.Owner.Country.InternalName);
|
||||
Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", info.Notification, self.Owner.Faction.InternalName);
|
||||
|
||||
if (radarPings != null)
|
||||
radarPings.Add(() => self.Owner == self.World.LocalPlayer, self.CenterPosition, info.RadarPingColor, info.RadarPingDuration);
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
if (self.Owner.IsAlliedWith(self.World.RenderPlayer))
|
||||
Sound.PlayNotification(self.World.Map.Rules, null, info.NotificationType, info.Notification,
|
||||
self.World.RenderPlayer != null ? self.World.RenderPlayer.Country.InternalName : null);
|
||||
self.World.RenderPlayer != null ? self.World.RenderPlayer.Faction.InternalName : null);
|
||||
|
||||
if (radarPings != null)
|
||||
{
|
||||
|
||||
@@ -62,7 +62,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
return;
|
||||
|
||||
var producer = queue.MostLikelyProducer();
|
||||
var race = producer.Trait != null ? producer.Trait.Race : self.Owner.Country.InternalName;
|
||||
var race = producer.Trait != null ? producer.Trait.Race : self.Owner.Faction.InternalName;
|
||||
var buildingInfo = unit.Traits.Get<BuildingInfo>();
|
||||
|
||||
var buildableInfo = unit.Traits.GetOrDefault<BuildableInfo>();
|
||||
@@ -143,7 +143,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
if (GetNumBuildables(self.Owner) > prevItems)
|
||||
w.Add(new DelayedAction(info.NewOptionsNotificationDelay,
|
||||
() => Sound.PlayNotification(self.World.Map.Rules, order.Player, "Speech", info.NewOptionsNotification, order.Player.Country.InternalName)));
|
||||
() => Sound.PlayNotification(self.World.Map.Rules, order.Player, "Speech", info.NewOptionsNotification, order.Player.Faction.InternalName)));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -97,7 +97,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
playerPower = playerActor.Trait<PowerManager>();
|
||||
developerMode = playerActor.Trait<DeveloperMode>();
|
||||
|
||||
Race = init.Contains<RaceInit>() ? init.Get<RaceInit, string>() : self.Owner.Country.InternalName;
|
||||
Race = init.Contains<RaceInit>() ? init.Get<RaceInit, string>() : self.Owner.Faction.InternalName;
|
||||
Enabled = !info.Race.Any() || info.Race.Contains(Race);
|
||||
|
||||
CacheProduceables(playerActor);
|
||||
@@ -123,7 +123,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
if (!Info.Sticky)
|
||||
{
|
||||
Race = self.Owner.Country.InternalName;
|
||||
Race = self.Owner.Faction.InternalName;
|
||||
Enabled = !Info.Race.Any() || Info.Race.Contains(Race);
|
||||
}
|
||||
|
||||
@@ -277,13 +277,13 @@ namespace OpenRA.Mods.Common.Traits
|
||||
var isBuilding = unit.Traits.Contains<BuildingInfo>();
|
||||
|
||||
if (isBuilding && !hasPlayedSound)
|
||||
hasPlayedSound = Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", Info.ReadyAudio, self.Owner.Country.InternalName);
|
||||
hasPlayedSound = Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", Info.ReadyAudio, self.Owner.Faction.InternalName);
|
||||
else if (!isBuilding)
|
||||
{
|
||||
if (BuildUnit(order.TargetString))
|
||||
Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", Info.ReadyAudio, self.Owner.Country.InternalName);
|
||||
Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", Info.ReadyAudio, self.Owner.Faction.InternalName);
|
||||
else if (!hasPlayedSound && time > 0)
|
||||
hasPlayedSound = Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", Info.BlockedAudio, self.Owner.Country.InternalName);
|
||||
hasPlayedSound = Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", Info.BlockedAudio, self.Owner.Faction.InternalName);
|
||||
}
|
||||
})));
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
if (string.IsNullOrEmpty(prerequisite))
|
||||
prerequisite = init.Self.Info.Name;
|
||||
|
||||
var race = init.Contains<RaceInit>() ? init.Get<RaceInit, string>() : init.Self.Owner.Country.InternalName;
|
||||
var race = init.Contains<RaceInit>() ? init.Get<RaceInit, string>() : init.Self.Owner.Faction.InternalName;
|
||||
|
||||
Update(init.Self.Owner, race);
|
||||
}
|
||||
@@ -64,7 +64,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public void OnOwnerChanged(Actor self, Player oldOwner, Player newOwner)
|
||||
{
|
||||
if (info.ResetOnOwnerChange)
|
||||
Update(newOwner, newOwner.Country.InternalName);
|
||||
Update(newOwner, newOwner.Faction.InternalName);
|
||||
}
|
||||
|
||||
void Update(Player owner, string race)
|
||||
|
||||
@@ -112,7 +112,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
Game.RunAfterDelay(info.NotificationDelay, () =>
|
||||
{
|
||||
if (Game.IsCurrentWorld(player.World))
|
||||
Sound.PlayNotification(player.World.Map.Rules, player, "Speech", "Lose", player.Country.InternalName);
|
||||
Sound.PlayNotification(player.World.Map.Rules, player, "Speech", "Lose", player.Faction.InternalName);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -122,7 +122,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
Game.Debug("{0} is victorious.", player.PlayerName);
|
||||
|
||||
if (player == player.World.LocalPlayer)
|
||||
Game.RunAfterDelay(info.NotificationDelay, () => Sound.PlayNotification(player.World.Map.Rules, player, "Speech", "Win", player.Country.InternalName));
|
||||
Game.RunAfterDelay(info.NotificationDelay, () => Sound.PlayNotification(player.World.Map.Rules, player, "Speech", "Win", player.Faction.InternalName));
|
||||
}
|
||||
|
||||
public void OnObjectiveAdded(Player player, int id) { }
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
if (!IsTraitDisabled && order.OrderString == "PowerDown")
|
||||
{
|
||||
disabled = !disabled;
|
||||
Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Sounds", disabled ? "EnablePower" : "DisablePower", self.Owner.Country.InternalName);
|
||||
Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Sounds", disabled ? "EnablePower" : "DisablePower", self.Owner.Faction.InternalName);
|
||||
power.UpdateActor(self);
|
||||
|
||||
if (disabled)
|
||||
@@ -68,7 +68,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
if (!disabled || !Info.CancelWhenDisabled)
|
||||
return;
|
||||
disabled = false;
|
||||
Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Sounds", "EnablePower", self.Owner.Country.InternalName);
|
||||
Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Sounds", "EnablePower", self.Owner.Faction.InternalName);
|
||||
power.UpdateActor(self);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
if (--nextPowerAdviceTime <= 0)
|
||||
{
|
||||
if (lowPower)
|
||||
Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", info.SpeechNotification, self.Owner.Country.InternalName);
|
||||
Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", info.SpeechNotification, self.Owner.Faction.InternalName);
|
||||
nextPowerAdviceTime = info.AdviceInterval;
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
Info = info;
|
||||
rp = Exts.Lazy(() => init.Self.IsDead ? null : init.Self.TraitOrDefault<RallyPoint>());
|
||||
Race = init.Contains<RaceInit>() ? init.Get<RaceInit, string>() : init.Self.Owner.Country.InternalName;
|
||||
Race = init.Contains<RaceInit>() ? init.Get<RaceInit, string>() : init.Self.Owner.Faction.InternalName;
|
||||
}
|
||||
|
||||
public void DoProduction(Actor self, ActorInfo producee, ExitInfo exitinfo, string raceVariant)
|
||||
|
||||
@@ -145,7 +145,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public RenderSprites(ActorInitializer init, RenderSpritesInfo info)
|
||||
{
|
||||
this.info = info;
|
||||
race = init.Contains<RaceInit>() ? init.Get<RaceInit, string>() : init.Self.Owner.Country.InternalName;
|
||||
race = init.Contains<RaceInit>() ? init.Get<RaceInit, string>() : init.Self.Owner.Faction.InternalName;
|
||||
}
|
||||
|
||||
public string GetImage(Actor self)
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public void Killed(Actor self, AttackInfo e)
|
||||
{
|
||||
var player = info.NotifyAll ? self.World.LocalPlayer : self.Owner;
|
||||
Sound.PlayNotification(self.World.Map.Rules, player, "Speech", info.Notification, self.Owner.Country.InternalName);
|
||||
Sound.PlayNotification(self.World.Map.Rules, player, "Speech", info.Notification, self.Owner.Faction.InternalName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
// Audio notification
|
||||
if (discoverer != null && !string.IsNullOrEmpty(Info.Notification))
|
||||
Sound.PlayNotification(self.World.Map.Rules, discoverer, "Speech", Info.Notification, discoverer.Country.InternalName);
|
||||
Sound.PlayNotification(self.World.Map.Rules, discoverer, "Speech", Info.Notification, discoverer.Faction.InternalName);
|
||||
|
||||
// Radar notificaion
|
||||
if (Info.PingRadar && radarPings.Value != null)
|
||||
|
||||
@@ -62,7 +62,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
self = init.Self;
|
||||
this.info = info;
|
||||
buildingInfo = self.World.Map.Rules.Actors[info.IntoActor].Traits.GetOrDefault<BuildingInfo>();
|
||||
race = init.Contains<RaceInit>() ? init.Get<RaceInit, string>() : self.Owner.Country.InternalName;
|
||||
race = init.Contains<RaceInit>() ? init.Get<RaceInit, string>() : self.Owner.Faction.InternalName;
|
||||
}
|
||||
|
||||
public string VoicePhraseForOrder(Actor self, Order order)
|
||||
@@ -101,7 +101,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
foreach (var s in info.NoTransformSounds)
|
||||
Sound.PlayToPlayer(self.Owner, s);
|
||||
|
||||
Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", info.NoTransformNotification, self.Owner.Country.InternalName);
|
||||
Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", info.NoTransformNotification, self.Owner.Faction.InternalName);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -31,11 +31,11 @@ namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
var spawnClass = p.PlayerReference.StartingUnitsClass ?? w.LobbyInfo.GlobalSettings.StartingUnitsClass;
|
||||
var unitGroup = w.Map.Rules.Actors["world"].Traits.WithInterface<MPStartUnitsInfo>()
|
||||
.Where(g => g.Class == spawnClass && g.Races != null && g.Races.Contains(p.Country.InternalName))
|
||||
.Where(g => g.Class == spawnClass && g.Races != null && g.Races.Contains(p.Faction.InternalName))
|
||||
.RandomOrDefault(w.SharedRandom);
|
||||
|
||||
if (unitGroup == null)
|
||||
throw new InvalidOperationException("No starting units defined for country {0} with class {1}".F(p.Country.InternalName, spawnClass));
|
||||
throw new InvalidOperationException("No starting units defined for country {0} with class {1}".F(p.Faction.InternalName, spawnClass));
|
||||
|
||||
if (unitGroup.BaseActor != null)
|
||||
{
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
public void WorldLoaded(World world, WorldRenderer wr)
|
||||
{
|
||||
Sound.PlayNotification(world.Map.Rules, null, "Speech", info.Notification, world.RenderPlayer == null ? null : world.RenderPlayer.Country.InternalName);
|
||||
Sound.PlayNotification(world.Map.Rules, null, "Speech", info.Notification, world.RenderPlayer == null ? null : world.RenderPlayer.Faction.InternalName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,8 +19,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
public AddRaceSuffixLogic(Widget widget, World world)
|
||||
{
|
||||
string race;
|
||||
if (!ChromeMetrics.TryGet("RaceSuffix-" + world.LocalPlayer.Country.InternalName, out race))
|
||||
race = world.LocalPlayer.Country.InternalName;
|
||||
if (!ChromeMetrics.TryGet("RaceSuffix-" + world.LocalPlayer.Faction.InternalName, out race))
|
||||
race = world.LocalPlayer.Faction.InternalName;
|
||||
var suffix = "-" + race;
|
||||
|
||||
if (widget is ButtonWidget)
|
||||
|
||||
@@ -62,8 +62,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
flag.GetImageCollection = () => "flags";
|
||||
if (lp.Stances[pp] == Stance.Ally || lp.WinState != WinState.Undefined)
|
||||
{
|
||||
flag.GetImageName = () => pp.Country.InternalName;
|
||||
item.Get<LabelWidget>("FACTION").GetText = () => pp.Country.Name;
|
||||
flag.GetImageName = () => pp.Faction.InternalName;
|
||||
item.Get<LabelWidget>("FACTION").GetText = () => pp.Faction.Name;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
Action onQuit = () =>
|
||||
{
|
||||
if (world.Type == WorldType.Regular)
|
||||
Sound.PlayNotification(world.Map.Rules, null, "Speech", "Leave", world.LocalPlayer == null ? null : world.LocalPlayer.Country.InternalName);
|
||||
Sound.PlayNotification(world.Map.Rules, null, "Speech", "Leave", world.LocalPlayer == null ? null : world.LocalPlayer.Faction.InternalName);
|
||||
|
||||
resumeDisabled = true;
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ namespace OpenRA.Mods.Common.Widgets
|
||||
|
||||
if (world.Type == WorldType.Regular)
|
||||
Sound.PlayNotification(world.Map.Rules, null, "Speech", "Leave",
|
||||
world.LocalPlayer == null ? null : world.LocalPlayer.Country.InternalName);
|
||||
world.LocalPlayer == null ? null : world.LocalPlayer.Faction.InternalName);
|
||||
|
||||
var exitDelay = iop != null ? iop.ExitDelay : 0;
|
||||
if (mpe != null)
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
Player = p;
|
||||
Label = p.PlayerName;
|
||||
Color = p.Color.RGB;
|
||||
Race = p.Country.InternalName;
|
||||
Race = p.Faction.InternalName;
|
||||
IsSelected = () => p.World.RenderPlayer == p;
|
||||
OnClick = () => { p.World.RenderPlayer = p; logic.selected = this; p.World.Selection.Clear(); };
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
|
||||
if (showOwner)
|
||||
{
|
||||
flagRace = o.Country.InternalName;
|
||||
flagRace = o.Faction.InternalName;
|
||||
ownerName = o.PlayerName;
|
||||
ownerColor = o.Color.RGB;
|
||||
widget.Bounds.Height = doubleHeight;
|
||||
|
||||
@@ -458,7 +458,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
if (player.World.RenderPlayer != null && player.World.RenderPlayer.Stances[player] != Stance.Ally)
|
||||
flag.GetImageName = () => player.DisplayCountry.InternalName;
|
||||
else
|
||||
flag.GetImageName = () => player.Country.InternalName;
|
||||
flag.GetImageName = () => player.Faction.InternalName;
|
||||
|
||||
var playerName = template.Get<LabelWidget>("PLAYER");
|
||||
var client = player.World.LobbyInfo.ClientWithIndex(player.ClientIndex);
|
||||
|
||||
@@ -67,7 +67,7 @@ namespace OpenRA.Mods.Common.Widgets
|
||||
if (current == null)
|
||||
continue;
|
||||
|
||||
var race = queue.Trait.Actor.Owner.Country.InternalName;
|
||||
var race = queue.Trait.Actor.Owner.Faction.InternalName;
|
||||
var actor = queue.Trait.AllItems().FirstOrDefault(a => a.Name == current.Item);
|
||||
if (actor == null)
|
||||
continue;
|
||||
|
||||
@@ -226,7 +226,7 @@ namespace OpenRA.Mods.Common.Widgets
|
||||
{
|
||||
// Queue a new item
|
||||
Sound.Play(TabClick);
|
||||
Sound.PlayNotification(World.Map.Rules, World.LocalPlayer, "Speech", CurrentQueue.Info.QueuedAudio, World.LocalPlayer.Country.InternalName);
|
||||
Sound.PlayNotification(World.Map.Rules, World.LocalPlayer, "Speech", CurrentQueue.Info.QueuedAudio, World.LocalPlayer.Faction.InternalName);
|
||||
World.IssueOrder(Order.StartProduction(CurrentQueue.Actor, icon.Name,
|
||||
handleMultiple ? 5 : 1));
|
||||
return true;
|
||||
@@ -245,14 +245,14 @@ namespace OpenRA.Mods.Common.Widgets
|
||||
if (item.Paused || item.Done || item.TotalCost == item.RemainingCost)
|
||||
{
|
||||
// Instant cancel of things we have not started yet and things that are finished
|
||||
Sound.PlayNotification(World.Map.Rules, World.LocalPlayer, "Speech", CurrentQueue.Info.CancelledAudio, World.LocalPlayer.Country.InternalName);
|
||||
Sound.PlayNotification(World.Map.Rules, World.LocalPlayer, "Speech", CurrentQueue.Info.CancelledAudio, World.LocalPlayer.Faction.InternalName);
|
||||
World.IssueOrder(Order.CancelProduction(CurrentQueue.Actor, icon.Name,
|
||||
handleMultiple ? 5 : 1));
|
||||
}
|
||||
else
|
||||
{
|
||||
// Pause an existing item
|
||||
Sound.PlayNotification(World.Map.Rules, World.LocalPlayer, "Speech", CurrentQueue.Info.OnHoldAudio, World.LocalPlayer.Country.InternalName);
|
||||
Sound.PlayNotification(World.Map.Rules, World.LocalPlayer, "Speech", CurrentQueue.Info.OnHoldAudio, World.LocalPlayer.Faction.InternalName);
|
||||
World.IssueOrder(Order.PauseProduction(CurrentQueue.Actor, icon.Name, true));
|
||||
}
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@ namespace OpenRA.Mods.D2k.Activities
|
||||
|
||||
void NotifyPlayer(Player player, WPos location)
|
||||
{
|
||||
Sound.PlayNotification(player.World.Map.Rules, player, "Speech", swallow.Info.WormAttackNotification, player.Country.InternalName);
|
||||
Sound.PlayNotification(player.World.Map.Rules, player, "Speech", swallow.Info.WormAttackNotification, player.Faction.InternalName);
|
||||
|
||||
if (player == player.World.RenderPlayer)
|
||||
radarPings.Add(() => true, location, Color.Red, 50);
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace OpenRA.Mods.RA.Traits
|
||||
{
|
||||
this.info = info;
|
||||
production = init.Self.Trait<Production>();
|
||||
race = init.Contains<RaceInit>() ? init.Get<RaceInit, string>() : init.Self.Owner.Country.InternalName;
|
||||
race = init.Contains<RaceInit>() ? init.Get<RaceInit, string>() : init.Self.Owner.Faction.InternalName;
|
||||
}
|
||||
|
||||
public void UnitProducedByOther(Actor self, Actor producer, Actor produced)
|
||||
|
||||
@@ -168,7 +168,7 @@ namespace OpenRA.Mods.RA.Traits
|
||||
var oldEffectiveOwner = AsPlayer;
|
||||
|
||||
var renderSprites = actorInfo.Traits.GetOrDefault<RenderSpritesInfo>();
|
||||
AsSprite = renderSprites == null ? null : renderSprites.GetImage(actorInfo, self.World.Map.SequenceProvider, newOwner.Country.InternalName);
|
||||
AsSprite = renderSprites == null ? null : renderSprites.GetImage(actorInfo, self.World.Map.SequenceProvider, newOwner.Faction.InternalName);
|
||||
AsPlayer = newOwner;
|
||||
AsTooltipInfo = actorInfo.Traits.WithInterface<TooltipInfo>().FirstOrDefault();
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace OpenRA.Mods.RA.Traits
|
||||
{
|
||||
this.info = info;
|
||||
|
||||
race = init.Contains<RaceInit>() ? init.Get<RaceInit, string>() : init.Self.Owner.Country.InternalName;
|
||||
race = init.Contains<RaceInit>() ? init.Get<RaceInit, string>() : init.Self.Owner.Faction.InternalName;
|
||||
}
|
||||
|
||||
public void Killed(Actor self, AttackInfo e)
|
||||
|
||||
Reference in New Issue
Block a user