Add localisation support to transient lines.
This commit is contained in:
committed by
Gustas
parent
43d1a20d8c
commit
1899eed839
@@ -32,18 +32,18 @@ namespace OpenRA
|
|||||||
SystemMessageLabel = "Battlefield Control";
|
SystemMessageLabel = "Battlefield Control";
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void AddTransientLine(string text, Player player)
|
public static void AddTransientLine(Player player, string text)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(text))
|
if (string.IsNullOrEmpty(text))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (player == null || player == player.World.LocalPlayer)
|
if (player == null || player == player.World.LocalPlayer)
|
||||||
AddTextNotification(TextNotificationPool.Transients, SystemClientId, SystemMessageLabel, text);
|
AddTextNotification(TextNotificationPool.Transients, SystemClientId, SystemMessageLabel, TranslationProvider.GetString(text));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void AddFeedbackLine(string text)
|
public static void AddFeedbackLine(string text, Dictionary<string, object> arguments = null)
|
||||||
{
|
{
|
||||||
AddTextNotification(TextNotificationPool.Feedback, SystemClientId, SystemMessageLabel, text);
|
AddTextNotification(TextNotificationPool.Feedback, SystemClientId, SystemMessageLabel, TranslationProvider.GetString(text, arguments));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void AddMissionLine(string prefix, string text, Color? prefixColor = null)
|
public static void AddMissionLine(string prefix, string text, Color? prefixColor = null)
|
||||||
@@ -51,19 +51,19 @@ namespace OpenRA
|
|||||||
AddTextNotification(TextNotificationPool.Mission, SystemClientId, prefix, text, prefixColor);
|
AddTextNotification(TextNotificationPool.Mission, SystemClientId, prefix, text, prefixColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void AddPlayerJoinedLine(string text)
|
public static void AddPlayerJoinedLine(string text, Dictionary<string, object> arguments = null)
|
||||||
{
|
{
|
||||||
AddTextNotification(TextNotificationPool.Join, SystemClientId, SystemMessageLabel, text);
|
AddTextNotification(TextNotificationPool.Join, SystemClientId, SystemMessageLabel, TranslationProvider.GetString(text, arguments));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void AddPlayerLeftLine(string text)
|
public static void AddPlayerLeftLine(string text, Dictionary<string, object> arguments = null)
|
||||||
{
|
{
|
||||||
AddTextNotification(TextNotificationPool.Leave, SystemClientId, SystemMessageLabel, text);
|
AddTextNotification(TextNotificationPool.Leave, SystemClientId, SystemMessageLabel, TranslationProvider.GetString(text, arguments));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void AddSystemLine(string text)
|
public static void AddSystemLine(string text, Dictionary<string, object> arguments = null)
|
||||||
{
|
{
|
||||||
AddSystemLine(SystemMessageLabel, text);
|
AddSystemLine(SystemMessageLabel, TranslationProvider.GetString(text, arguments));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void AddSystemLine(string prefix, string text)
|
public static void AddSystemLine(string prefix, string text)
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ namespace OpenRA.Mods.Cnc.Activities
|
|||||||
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech",
|
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech",
|
||||||
infiltrates.Info.Notification, self.Owner.Faction.InternalName);
|
infiltrates.Info.Notification, self.Owner.Faction.InternalName);
|
||||||
|
|
||||||
TextNotificationsManager.AddTransientLine(infiltrates.Info.TextNotification, self.Owner);
|
TextNotificationsManager.AddTransientLine(self.Owner, infiltrates.Info.TextNotification);
|
||||||
|
|
||||||
if (infiltrates.Info.EnterBehaviour == EnterBehaviour.Dispose)
|
if (infiltrates.Info.EnterBehaviour == EnterBehaviour.Dispose)
|
||||||
self.Dispose();
|
self.Dispose();
|
||||||
|
|||||||
@@ -88,8 +88,8 @@ namespace OpenRA.Mods.Cnc.Traits
|
|||||||
if (info.InfiltrationNotification != null)
|
if (info.InfiltrationNotification != null)
|
||||||
Game.Sound.PlayNotification(self.World.Map.Rules, infiltrator.Owner, "Speech", info.InfiltrationNotification, infiltrator.Owner.Faction.InternalName);
|
Game.Sound.PlayNotification(self.World.Map.Rules, infiltrator.Owner, "Speech", info.InfiltrationNotification, infiltrator.Owner.Faction.InternalName);
|
||||||
|
|
||||||
TextNotificationsManager.AddTransientLine(info.InfiltratedTextNotification, self.Owner);
|
TextNotificationsManager.AddTransientLine(self.Owner, info.InfiltratedTextNotification);
|
||||||
TextNotificationsManager.AddTransientLine(info.InfiltrationTextNotification, infiltrator.Owner);
|
TextNotificationsManager.AddTransientLine(infiltrator.Owner, info.InfiltrationTextNotification);
|
||||||
|
|
||||||
if (info.ShowTicks)
|
if (info.ShowTicks)
|
||||||
self.World.AddFrameEndTask(w => w.Add(new FloatingText(self.CenterPosition, infiltrator.Owner.Color, FloatingText.FormatCashTick(toGive), 30)));
|
self.World.AddFrameEndTask(w => w.Add(new FloatingText(self.CenterPosition, infiltrator.Owner.Color, FloatingText.FormatCashTick(toGive), 30)));
|
||||||
|
|||||||
@@ -62,8 +62,8 @@ namespace OpenRA.Mods.Cnc.Traits
|
|||||||
if (info.InfiltrationNotification != null)
|
if (info.InfiltrationNotification != null)
|
||||||
Game.Sound.PlayNotification(self.World.Map.Rules, infiltrator.Owner, "Speech", info.InfiltrationNotification, infiltrator.Owner.Faction.InternalName);
|
Game.Sound.PlayNotification(self.World.Map.Rules, infiltrator.Owner, "Speech", info.InfiltrationNotification, infiltrator.Owner.Faction.InternalName);
|
||||||
|
|
||||||
TextNotificationsManager.AddTransientLine(info.InfiltratedTextNotification, self.Owner);
|
TextNotificationsManager.AddTransientLine(self.Owner, info.InfiltratedTextNotification);
|
||||||
TextNotificationsManager.AddTransientLine(info.InfiltrationTextNotification, infiltrator.Owner);
|
TextNotificationsManager.AddTransientLine(infiltrator.Owner, info.InfiltrationTextNotification);
|
||||||
|
|
||||||
infiltrator.Owner.PlayerActor.TraitOrDefault<PlayerExperience>()?.GiveExperience(info.PlayerExperience);
|
infiltrator.Owner.PlayerActor.TraitOrDefault<PlayerExperience>()?.GiveExperience(info.PlayerExperience);
|
||||||
|
|
||||||
|
|||||||
@@ -65,8 +65,8 @@ namespace OpenRA.Mods.Cnc.Traits
|
|||||||
if (info.InfiltrationNotification != null)
|
if (info.InfiltrationNotification != null)
|
||||||
Game.Sound.PlayNotification(self.World.Map.Rules, infiltrator.Owner, "Speech", info.InfiltrationNotification, infiltrator.Owner.Faction.InternalName);
|
Game.Sound.PlayNotification(self.World.Map.Rules, infiltrator.Owner, "Speech", info.InfiltrationNotification, infiltrator.Owner.Faction.InternalName);
|
||||||
|
|
||||||
TextNotificationsManager.AddTransientLine(info.InfiltratedTextNotification, self.Owner);
|
TextNotificationsManager.AddTransientLine(self.Owner, info.InfiltratedTextNotification);
|
||||||
TextNotificationsManager.AddTransientLine(info.InfiltrationTextNotification, infiltrator.Owner);
|
TextNotificationsManager.AddTransientLine(infiltrator.Owner, info.InfiltrationTextNotification);
|
||||||
|
|
||||||
infiltrator.Owner.PlayerActor.TraitOrDefault<PlayerExperience>()?.GiveExperience(info.PlayerExperience);
|
infiltrator.Owner.PlayerActor.TraitOrDefault<PlayerExperience>()?.GiveExperience(info.PlayerExperience);
|
||||||
|
|
||||||
|
|||||||
@@ -64,8 +64,8 @@ namespace OpenRA.Mods.Cnc.Traits
|
|||||||
if (info.InfiltrationNotification != null)
|
if (info.InfiltrationNotification != null)
|
||||||
Game.Sound.PlayNotification(self.World.Map.Rules, infiltrator.Owner, "Speech", info.InfiltrationNotification, infiltrator.Owner.Faction.InternalName);
|
Game.Sound.PlayNotification(self.World.Map.Rules, infiltrator.Owner, "Speech", info.InfiltrationNotification, infiltrator.Owner.Faction.InternalName);
|
||||||
|
|
||||||
TextNotificationsManager.AddTransientLine(info.InfiltratedTextNotification, self.Owner);
|
TextNotificationsManager.AddTransientLine(self.Owner, info.InfiltratedTextNotification);
|
||||||
TextNotificationsManager.AddTransientLine(info.InfiltrationTextNotification, infiltrator.Owner);
|
TextNotificationsManager.AddTransientLine(infiltrator.Owner, info.InfiltrationTextNotification);
|
||||||
|
|
||||||
infiltrator.Owner.PlayerActor.TraitOrDefault<PlayerExperience>()?.GiveExperience(info.PlayerExperience);
|
infiltrator.Owner.PlayerActor.TraitOrDefault<PlayerExperience>()?.GiveExperience(info.PlayerExperience);
|
||||||
|
|
||||||
|
|||||||
@@ -61,8 +61,8 @@ namespace OpenRA.Mods.Cnc.Traits
|
|||||||
if (info.InfiltrationNotification != null)
|
if (info.InfiltrationNotification != null)
|
||||||
Game.Sound.PlayNotification(self.World.Map.Rules, infiltrator.Owner, "Speech", info.InfiltrationNotification, infiltrator.Owner.Faction.InternalName);
|
Game.Sound.PlayNotification(self.World.Map.Rules, infiltrator.Owner, "Speech", info.InfiltrationNotification, infiltrator.Owner.Faction.InternalName);
|
||||||
|
|
||||||
TextNotificationsManager.AddTransientLine(info.InfiltratedTextNotification, self.Owner);
|
TextNotificationsManager.AddTransientLine(self.Owner, info.InfiltratedTextNotification);
|
||||||
TextNotificationsManager.AddTransientLine(info.InfiltrationTextNotification, infiltrator.Owner);
|
TextNotificationsManager.AddTransientLine(infiltrator.Owner, info.InfiltrationTextNotification);
|
||||||
|
|
||||||
infiltrator.Owner.PlayerActor.TraitOrDefault<PlayerExperience>()?.GiveExperience(info.PlayerExperience);
|
infiltrator.Owner.PlayerActor.TraitOrDefault<PlayerExperience>()?.GiveExperience(info.PlayerExperience);
|
||||||
|
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ namespace OpenRA.Mods.Common.Activities
|
|||||||
enterHut?.Repair(self);
|
enterHut?.Repair(self);
|
||||||
|
|
||||||
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", speechNotification, self.Owner.Faction.InternalName);
|
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", speechNotification, self.Owner.Faction.InternalName);
|
||||||
TextNotificationsManager.AddTransientLine(textNotification, self.Owner);
|
TextNotificationsManager.AddTransientLine(self.Owner, textNotification);
|
||||||
|
|
||||||
if (enterBehaviour == EnterBehaviour.Dispose)
|
if (enterBehaviour == EnterBehaviour.Dispose)
|
||||||
self.Dispose();
|
self.Dispose();
|
||||||
|
|||||||
@@ -271,7 +271,7 @@ namespace OpenRA.Mods.Common.Activities
|
|||||||
host.Actor.Owner.PlayerActor.TraitOrDefault<PlayerExperience>()?.GiveExperience(repairsUnits.Info.PlayerExperience);
|
host.Actor.Owner.PlayerActor.TraitOrDefault<PlayerExperience>()?.GiveExperience(repairsUnits.Info.PlayerExperience);
|
||||||
|
|
||||||
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", repairsUnits.Info.FinishRepairingNotification, self.Owner.Faction.InternalName);
|
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", repairsUnits.Info.FinishRepairingNotification, self.Owner.Faction.InternalName);
|
||||||
TextNotificationsManager.AddTransientLine(repairsUnits.Info.FinishRepairingTextNotification, self.Owner);
|
TextNotificationsManager.AddTransientLine(self.Owner, repairsUnits.Info.FinishRepairingTextNotification);
|
||||||
|
|
||||||
activeResupplyTypes &= ~ResupplyType.Repair;
|
activeResupplyTypes &= ~ResupplyType.Repair;
|
||||||
return;
|
return;
|
||||||
@@ -289,7 +289,7 @@ namespace OpenRA.Mods.Common.Activities
|
|||||||
{
|
{
|
||||||
played = true;
|
played = true;
|
||||||
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", repairsUnits.Info.StartRepairingNotification, self.Owner.Faction.InternalName);
|
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", repairsUnits.Info.StartRepairingNotification, self.Owner.Faction.InternalName);
|
||||||
TextNotificationsManager.AddTransientLine(repairsUnits.Info.StartRepairingTextNotification, self.Owner);
|
TextNotificationsManager.AddTransientLine(self.Owner, repairsUnits.Info.StartRepairingTextNotification);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!playerResources.TakeCash(cost, true))
|
if (!playerResources.TakeCash(cost, true))
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ namespace OpenRA.Mods.Common.Activities
|
|||||||
self.World.AddFrameEndTask(w => w.Add(new FloatingText(self.CenterPosition, self.Owner.Color, FloatingText.FormatCashTick(refund), 30)));
|
self.World.AddFrameEndTask(w => w.Add(new FloatingText(self.CenterPosition, self.Owner.Color, FloatingText.FormatCashTick(refund), 30)));
|
||||||
|
|
||||||
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", sellableInfo.Notification, self.Owner.Faction.InternalName);
|
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", sellableInfo.Notification, self.Owner.Faction.InternalName);
|
||||||
TextNotificationsManager.AddTransientLine(sellableInfo.TextNotification, self.Owner);
|
TextNotificationsManager.AddTransientLine(self.Owner, sellableInfo.TextNotification);
|
||||||
|
|
||||||
self.Dispose();
|
self.Dispose();
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ namespace OpenRA.Mods.Common.Activities
|
|||||||
Game.Sound.PlayToPlayer(SoundType.World, self.Owner, s, self.CenterPosition);
|
Game.Sound.PlayToPlayer(SoundType.World, self.Owner, s, self.CenterPosition);
|
||||||
|
|
||||||
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", Notification, self.Owner.Faction.InternalName);
|
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", Notification, self.Owner.Faction.InternalName);
|
||||||
TextNotificationsManager.AddTransientLine(TextNotification, self.Owner);
|
TextNotificationsManager.AddTransientLine(self.Owner, TextNotification);
|
||||||
|
|
||||||
var init = new TypeDictionary
|
var init = new TypeDictionary
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -182,7 +182,7 @@ namespace OpenRA.Mods.Common.Orders
|
|||||||
if (!AcceptsPlug(topLeft, plugInfo))
|
if (!AcceptsPlug(topLeft, plugInfo))
|
||||||
{
|
{
|
||||||
Game.Sound.PlayNotification(world.Map.Rules, owner, "Speech", notification, owner.Faction.InternalName);
|
Game.Sound.PlayNotification(world.Map.Rules, owner, "Speech", notification, owner.Faction.InternalName);
|
||||||
TextNotificationsManager.AddTransientLine(placeBuildingInfo.CannotPlaceTextNotification, owner);
|
TextNotificationsManager.AddTransientLine(owner, placeBuildingInfo.CannotPlaceTextNotification);
|
||||||
|
|
||||||
yield break;
|
yield break;
|
||||||
}
|
}
|
||||||
@@ -196,7 +196,7 @@ namespace OpenRA.Mods.Common.Orders
|
|||||||
yield return order;
|
yield return order;
|
||||||
|
|
||||||
Game.Sound.PlayNotification(world.Map.Rules, owner, "Speech", notification, owner.Faction.InternalName);
|
Game.Sound.PlayNotification(world.Map.Rules, owner, "Speech", notification, owner.Faction.InternalName);
|
||||||
TextNotificationsManager.AddTransientLine(placeBuildingInfo.CannotPlaceTextNotification, owner);
|
TextNotificationsManager.AddTransientLine(owner, placeBuildingInfo.CannotPlaceTextNotification);
|
||||||
|
|
||||||
yield break;
|
yield break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
primaryToken = self.GrantCondition(Info.PrimaryCondition);
|
primaryToken = self.GrantCondition(Info.PrimaryCondition);
|
||||||
|
|
||||||
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", Info.SelectionNotification, self.Owner.Faction.InternalName);
|
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", Info.SelectionNotification, self.Owner.Faction.InternalName);
|
||||||
TextNotificationsManager.AddTransientLine(Info.SelectionTextNotification, self.Owner);
|
TextNotificationsManager.AddTransientLine(self.Owner, Info.SelectionTextNotification);
|
||||||
}
|
}
|
||||||
else if (primaryToken != Actor.InvalidConditionToken)
|
else if (primaryToken != Actor.InvalidConditionToken)
|
||||||
primaryToken = self.RevokeCondition(primaryToken);
|
primaryToken = self.RevokeCondition(primaryToken);
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
|
|
||||||
self.World.AddFrameEndTask(ww => DoProduction(self, producee, exit, productionType, inits));
|
self.World.AddFrameEndTask(ww => DoProduction(self, producee, exit, productionType, inits));
|
||||||
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", info.ReadyAudio, self.Owner.Faction.InternalName);
|
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", info.ReadyAudio, self.Owner.Faction.InternalName);
|
||||||
TextNotificationsManager.AddTransientLine(info.ReadyTextNotification, self.Owner);
|
TextNotificationsManager.AddTransientLine(self.Owner, info.ReadyTextNotification);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
actor.QueueActivity(new FlyOffMap(actor, Target.FromCell(w, endPos)));
|
actor.QueueActivity(new FlyOffMap(actor, Target.FromCell(w, endPos)));
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
if (order.OrderID == OrderID)
|
if (order.OrderID == OrderID)
|
||||||
{
|
{
|
||||||
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", Info.Notification, self.Owner.Faction.InternalName);
|
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", Info.Notification, self.Owner.Faction.InternalName);
|
||||||
TextNotificationsManager.AddTransientLine(Info.TextNotification, self.Owner);
|
TextNotificationsManager.AddTransientLine(self.Owner, Info.TextNotification);
|
||||||
|
|
||||||
return new Order(order.OrderID, self, target, queued)
|
return new Order(order.OrderID, self, target, queued)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
if (!Repairers.Any())
|
if (!Repairers.Any())
|
||||||
{
|
{
|
||||||
Game.Sound.PlayNotification(self.World.Map.Rules, player, "Speech", Info.RepairingStoppedNotification, player.Faction.InternalName);
|
Game.Sound.PlayNotification(self.World.Map.Rules, player, "Speech", Info.RepairingStoppedNotification, player.Faction.InternalName);
|
||||||
TextNotificationsManager.AddTransientLine(Info.RepairingStoppedTextNotification, self.Owner);
|
TextNotificationsManager.AddTransientLine(self.Owner, Info.RepairingStoppedTextNotification);
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -130,7 +130,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
Repairers.Add(player);
|
Repairers.Add(player);
|
||||||
|
|
||||||
Game.Sound.PlayNotification(self.World.Map.Rules, player, "Speech", Info.RepairingNotification, player.Faction.InternalName);
|
Game.Sound.PlayNotification(self.World.Map.Rules, player, "Speech", Info.RepairingNotification, player.Faction.InternalName);
|
||||||
TextNotificationsManager.AddTransientLine(Info.RepairingTextNotification, self.Owner);
|
TextNotificationsManager.AddTransientLine(self.Owner, Info.RepairingTextNotification);
|
||||||
|
|
||||||
UpdateCondition(self);
|
UpdateCondition(self);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
if (Info.EnabledSpeech != null)
|
if (Info.EnabledSpeech != null)
|
||||||
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", Info.EnabledSpeech, self.Owner.Faction.InternalName);
|
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", Info.EnabledSpeech, self.Owner.Faction.InternalName);
|
||||||
|
|
||||||
TextNotificationsManager.AddTransientLine(Info.EnabledTextNotification, self.Owner);
|
TextNotificationsManager.AddTransientLine(self.Owner, Info.EnabledTextNotification);
|
||||||
}
|
}
|
||||||
else if (!granted && conditionToken != Actor.InvalidConditionToken)
|
else if (!granted && conditionToken != Actor.InvalidConditionToken)
|
||||||
{
|
{
|
||||||
@@ -79,7 +79,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
if (Info.DisabledSpeech != null)
|
if (Info.DisabledSpeech != null)
|
||||||
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", Info.DisabledSpeech, self.Owner.Faction.InternalName);
|
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", Info.DisabledSpeech, self.Owner.Faction.InternalName);
|
||||||
|
|
||||||
TextNotificationsManager.AddTransientLine(Info.DisabledTextNotification, self.Owner);
|
TextNotificationsManager.AddTransientLine(self.Owner, Info.DisabledTextNotification);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
Game.Sound.PlayNotification(self.World.Map.Rules, collector.Owner, "Speech",
|
Game.Sound.PlayNotification(self.World.Map.Rules, collector.Owner, "Speech",
|
||||||
Info.Notification, collector.Owner.Faction.InternalName);
|
Info.Notification, collector.Owner.Faction.InternalName);
|
||||||
|
|
||||||
TextNotificationsManager.AddTransientLine(Info.TextNotification, collector.Owner);
|
TextNotificationsManager.AddTransientLine(collector.Owner, Info.TextNotification);
|
||||||
|
|
||||||
if (Info.Image != null && Info.Sequence != null)
|
if (Info.Image != null && Info.Sequence != null)
|
||||||
collector.World.AddFrameEndTask(w => w.Add(new SpriteEffect(collector, w, Info.Image, Info.Sequence, Info.Palette)));
|
collector.World.AddFrameEndTask(w => w.Add(new SpriteEffect(collector, w, Info.Image, Info.Sequence, Info.Palette)));
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
if (!silent)
|
if (!silent)
|
||||||
{
|
{
|
||||||
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Sounds", info.LevelUpNotification, self.Owner.Faction.InternalName);
|
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Sounds", info.LevelUpNotification, self.Owner.Faction.InternalName);
|
||||||
TextNotificationsManager.AddTransientLine(info.LevelUpTextNotification, self.Owner);
|
TextNotificationsManager.AddTransientLine(self.Owner, info.LevelUpTextNotification);
|
||||||
|
|
||||||
if (info.LevelUpImage != null && info.LevelUpSequence != null)
|
if (info.LevelUpImage != null && info.LevelUpSequence != null)
|
||||||
self.World.AddFrameEndTask(w => w.Add(new SpriteEffect(self, w, info.LevelUpImage, info.LevelUpSequence, info.LevelUpPalette)));
|
self.World.AddFrameEndTask(w => w.Add(new SpriteEffect(self, w, info.LevelUpImage, info.LevelUpSequence, info.LevelUpPalette)));
|
||||||
|
|||||||
@@ -89,12 +89,12 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
if (self.Owner == localPlayer)
|
if (self.Owner == localPlayer)
|
||||||
{
|
{
|
||||||
Game.Sound.PlayNotification(rules, self.Owner, "Speech", info.Notification, self.Owner.Faction.InternalName);
|
Game.Sound.PlayNotification(rules, self.Owner, "Speech", info.Notification, self.Owner.Faction.InternalName);
|
||||||
TextNotificationsManager.AddTransientLine(info.TextNotification, self.Owner);
|
TextNotificationsManager.AddTransientLine(self.Owner, info.TextNotification);
|
||||||
}
|
}
|
||||||
else if (localPlayer.IsAlliedWith(self.Owner) && localPlayer != e.Attacker.Owner)
|
else if (localPlayer.IsAlliedWith(self.Owner) && localPlayer != e.Attacker.Owner)
|
||||||
{
|
{
|
||||||
Game.Sound.PlayNotification(rules, localPlayer, "Speech", info.AllyNotification, localPlayer.Faction.InternalName);
|
Game.Sound.PlayNotification(rules, localPlayer, "Speech", info.AllyNotification, localPlayer.Faction.InternalName);
|
||||||
TextNotificationsManager.AddTransientLine(info.AllyTextNotification, localPlayer);
|
TextNotificationsManager.AddTransientLine(localPlayer, info.AllyTextNotification);
|
||||||
}
|
}
|
||||||
|
|
||||||
radarPings?.Add(() => self.Owner.IsAlliedWith(self.World.RenderPlayer), self.CenterPosition, info.RadarPingColor, info.RadarPingDuration);
|
radarPings?.Add(() => self.Owner.IsAlliedWith(self.World.RenderPlayer), self.CenterPosition, info.RadarPingColor, info.RadarPingDuration);
|
||||||
|
|||||||
@@ -32,6 +32,12 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
|
|
||||||
public class ConquestVictoryConditions : ITick, INotifyWinStateChanged, INotifyTimeLimit
|
public class ConquestVictoryConditions : ITick, INotifyWinStateChanged, INotifyTimeLimit
|
||||||
{
|
{
|
||||||
|
[TranslationReference("player")]
|
||||||
|
const string PlayerIsVictorious = "notification-player-is-victorious";
|
||||||
|
|
||||||
|
[TranslationReference("player")]
|
||||||
|
const string PlayerIsDefeated = "notification-player-is-defeated";
|
||||||
|
|
||||||
readonly ConquestVictoryConditionsInfo info;
|
readonly ConquestVictoryConditionsInfo info;
|
||||||
readonly MissionObjectives mo;
|
readonly MissionObjectives mo;
|
||||||
readonly bool shortGame;
|
readonly bool shortGame;
|
||||||
@@ -98,13 +104,13 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
if (info.SuppressNotifications)
|
if (info.SuppressNotifications)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
TextNotificationsManager.AddSystemLine(player.PlayerName + " is defeated.");
|
TextNotificationsManager.AddSystemLine(PlayerIsDefeated, Translation.Arguments("player", player.PlayerName));
|
||||||
Game.RunAfterDelay(info.NotificationDelay, () =>
|
Game.RunAfterDelay(info.NotificationDelay, () =>
|
||||||
{
|
{
|
||||||
if (Game.IsCurrentWorld(player.World) && player == player.World.LocalPlayer)
|
if (Game.IsCurrentWorld(player.World) && player == player.World.LocalPlayer)
|
||||||
{
|
{
|
||||||
Game.Sound.PlayNotification(player.World.Map.Rules, player, "Speech", mo.Info.LoseNotification, player.Faction.InternalName);
|
Game.Sound.PlayNotification(player.World.Map.Rules, player, "Speech", mo.Info.LoseNotification, player.Faction.InternalName);
|
||||||
TextNotificationsManager.AddTransientLine(mo.Info.LoseTextNotification, player);
|
TextNotificationsManager.AddTransientLine(player, mo.Info.LoseTextNotification);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -114,13 +120,13 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
if (info.SuppressNotifications)
|
if (info.SuppressNotifications)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
TextNotificationsManager.AddSystemLine(player.PlayerName + " is victorious.");
|
TextNotificationsManager.AddSystemLine(PlayerIsVictorious, Translation.Arguments("player", player.PlayerName));
|
||||||
Game.RunAfterDelay(info.NotificationDelay, () =>
|
Game.RunAfterDelay(info.NotificationDelay, () =>
|
||||||
{
|
{
|
||||||
if (Game.IsCurrentWorld(player.World) && player == player.World.LocalPlayer)
|
if (Game.IsCurrentWorld(player.World) && player == player.World.LocalPlayer)
|
||||||
{
|
{
|
||||||
Game.Sound.PlayNotification(player.World.Map.Rules, player, "Speech", mo.Info.WinNotification, player.Faction.InternalName);
|
Game.Sound.PlayNotification(player.World.Map.Rules, player, "Speech", mo.Info.WinNotification, player.Faction.InternalName);
|
||||||
TextNotificationsManager.AddTransientLine(mo.Info.WinTextNotification, player);
|
TextNotificationsManager.AddTransientLine(player, mo.Info.WinTextNotification);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
if (Game.RunTime > lastAttackTime + info.NotifyInterval)
|
if (Game.RunTime > lastAttackTime + info.NotifyInterval)
|
||||||
{
|
{
|
||||||
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", info.Notification, self.Owner.Faction.InternalName);
|
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", info.Notification, self.Owner.Faction.InternalName);
|
||||||
TextNotificationsManager.AddTransientLine(info.TextNotification, self.Owner);
|
TextNotificationsManager.AddTransientLine(self.Owner, info.TextNotification);
|
||||||
|
|
||||||
radarPings?.Add(() => self.Owner.IsAlliedWith(self.World.RenderPlayer), self.CenterPosition, info.RadarPingColor, info.RadarPingDuration);
|
radarPings?.Add(() => self.Owner.IsAlliedWith(self.World.RenderPlayer), self.CenterPosition, info.RadarPingColor, info.RadarPingDuration);
|
||||||
|
|
||||||
|
|||||||
@@ -230,7 +230,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
void PlayNotification(Actor self)
|
void PlayNotification(Actor self)
|
||||||
{
|
{
|
||||||
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", info.NewOptionsNotification, self.Owner.Faction.InternalName);
|
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", info.NewOptionsNotification, self.Owner.Faction.InternalName);
|
||||||
TextNotificationsManager.AddTransientLine(info.NewOptionsTextNotification, self.Owner);
|
TextNotificationsManager.AddTransientLine(self.Owner, info.NewOptionsTextNotification);
|
||||||
|
|
||||||
triggerNotification = false;
|
triggerNotification = false;
|
||||||
tick = 0;
|
tick = 0;
|
||||||
|
|||||||
@@ -187,7 +187,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
{
|
{
|
||||||
lastNotificationTime = Game.RunTime;
|
lastNotificationTime = Game.RunTime;
|
||||||
Game.Sound.PlayNotification(owner.World.Map.Rules, owner, "Speech", Info.InsufficientFundsNotification, owner.Faction.InternalName);
|
Game.Sound.PlayNotification(owner.World.Map.Rules, owner, "Speech", Info.InsufficientFundsNotification, owner.Faction.InternalName);
|
||||||
TextNotificationsManager.AddTransientLine(Info.InsufficientFundsTextNotification, owner);
|
TextNotificationsManager.AddTransientLine(owner, Info.InsufficientFundsTextNotification);
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -449,19 +449,19 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
if (isBuilding && !hasPlayedSound)
|
if (isBuilding && !hasPlayedSound)
|
||||||
{
|
{
|
||||||
hasPlayedSound = Game.Sound.PlayNotification(rules, self.Owner, "Speech", Info.ReadyAudio, self.Owner.Faction.InternalName);
|
hasPlayedSound = Game.Sound.PlayNotification(rules, self.Owner, "Speech", Info.ReadyAudio, self.Owner.Faction.InternalName);
|
||||||
TextNotificationsManager.AddTransientLine(Info.ReadyTextNotification, self.Owner);
|
TextNotificationsManager.AddTransientLine(self.Owner, Info.ReadyTextNotification);
|
||||||
}
|
}
|
||||||
else if (!isBuilding)
|
else if (!isBuilding)
|
||||||
{
|
{
|
||||||
if (BuildUnit(unit))
|
if (BuildUnit(unit))
|
||||||
{
|
{
|
||||||
Game.Sound.PlayNotification(rules, self.Owner, "Speech", Info.ReadyAudio, self.Owner.Faction.InternalName);
|
Game.Sound.PlayNotification(rules, self.Owner, "Speech", Info.ReadyAudio, self.Owner.Faction.InternalName);
|
||||||
TextNotificationsManager.AddTransientLine(Info.ReadyTextNotification, self.Owner);
|
TextNotificationsManager.AddTransientLine(self.Owner, Info.ReadyTextNotification);
|
||||||
}
|
}
|
||||||
else if (!hasPlayedSound && time > 0)
|
else if (!hasPlayedSound && time > 0)
|
||||||
{
|
{
|
||||||
hasPlayedSound = Game.Sound.PlayNotification(rules, self.Owner, "Speech", Info.BlockedAudio, self.Owner.Faction.InternalName);
|
hasPlayedSound = Game.Sound.PlayNotification(rules, self.Owner, "Speech", Info.BlockedAudio, self.Owner.Faction.InternalName);
|
||||||
TextNotificationsManager.AddTransientLine(Info.BlockedTextNotification, self.Owner);
|
TextNotificationsManager.AddTransientLine(self.Owner, Info.BlockedTextNotification);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})), !order.Queued);
|
})), !order.Queued);
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
if (resources.Resources > info.Threshold * resources.ResourceCapacity / 100)
|
if (resources.Resources > info.Threshold * resources.ResourceCapacity / 100)
|
||||||
{
|
{
|
||||||
Game.Sound.PlayNotification(self.World.Map.Rules, owner, "Speech", info.Notification, owner.Faction.InternalName);
|
Game.Sound.PlayNotification(self.World.Map.Rules, owner, "Speech", info.Notification, owner.Faction.InternalName);
|
||||||
TextNotificationsManager.AddTransientLine(info.TextNotification, owner);
|
TextNotificationsManager.AddTransientLine(owner, info.TextNotification);
|
||||||
}
|
}
|
||||||
|
|
||||||
lastSiloAdviceTime = Game.RunTime;
|
lastSiloAdviceTime = Game.RunTime;
|
||||||
|
|||||||
@@ -46,6 +46,12 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
|
|
||||||
public class StrategicVictoryConditions : ITick, ISync, INotifyWinStateChanged, INotifyTimeLimit
|
public class StrategicVictoryConditions : ITick, ISync, INotifyWinStateChanged, INotifyTimeLimit
|
||||||
{
|
{
|
||||||
|
[TranslationReference("player")]
|
||||||
|
const string PlayerIsVictorious = "notification-player-is-victorious";
|
||||||
|
|
||||||
|
[TranslationReference("player")]
|
||||||
|
const string PlayerIsDefeated = "notification-player-is-defeated";
|
||||||
|
|
||||||
readonly StrategicVictoryConditionsInfo info;
|
readonly StrategicVictoryConditionsInfo info;
|
||||||
|
|
||||||
[Sync]
|
[Sync]
|
||||||
@@ -136,13 +142,13 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
if (info.SuppressNotifications)
|
if (info.SuppressNotifications)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
TextNotificationsManager.AddSystemLine(player.PlayerName + " is defeated.");
|
TextNotificationsManager.AddSystemLine(PlayerIsDefeated, Translation.Arguments("player", player.PlayerName));
|
||||||
Game.RunAfterDelay(info.NotificationDelay, () =>
|
Game.RunAfterDelay(info.NotificationDelay, () =>
|
||||||
{
|
{
|
||||||
if (Game.IsCurrentWorld(player.World) && player == player.World.LocalPlayer)
|
if (Game.IsCurrentWorld(player.World) && player == player.World.LocalPlayer)
|
||||||
{
|
{
|
||||||
Game.Sound.PlayNotification(player.World.Map.Rules, player, "Speech", mo.Info.LoseNotification, player.Faction.InternalName);
|
Game.Sound.PlayNotification(player.World.Map.Rules, player, "Speech", mo.Info.LoseNotification, player.Faction.InternalName);
|
||||||
TextNotificationsManager.AddTransientLine(mo.Info.LoseTextNotification, player);
|
TextNotificationsManager.AddTransientLine(player, mo.Info.LoseTextNotification);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -152,13 +158,13 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
if (info.SuppressNotifications)
|
if (info.SuppressNotifications)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
TextNotificationsManager.AddSystemLine(player.PlayerName + " is victorious.");
|
TextNotificationsManager.AddSystemLine(PlayerIsVictorious, Translation.Arguments("player", player.PlayerName));
|
||||||
Game.RunAfterDelay(info.NotificationDelay, () =>
|
Game.RunAfterDelay(info.NotificationDelay, () =>
|
||||||
{
|
{
|
||||||
if (Game.IsCurrentWorld(player.World) && player == player.World.LocalPlayer)
|
if (Game.IsCurrentWorld(player.World) && player == player.World.LocalPlayer)
|
||||||
{
|
{
|
||||||
Game.Sound.PlayNotification(player.World.Map.Rules, player, "Speech", mo.Info.WinNotification, player.Faction.InternalName);
|
Game.Sound.PlayNotification(player.World.Map.Rules, player, "Speech", mo.Info.WinNotification, player.Faction.InternalName);
|
||||||
TextNotificationsManager.AddTransientLine(mo.Info.WinTextNotification, player);
|
TextNotificationsManager.AddTransientLine(player, mo.Info.WinTextNotification);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -167,7 +167,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
if (PlayLowPowerNotification && isLowPower && Game.RunTime > lastPowerAdviceTime + info.AdviceInterval)
|
if (PlayLowPowerNotification && isLowPower && Game.RunTime > lastPowerAdviceTime + info.AdviceInterval)
|
||||||
{
|
{
|
||||||
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", info.SpeechNotification, self.Owner.Faction.InternalName);
|
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", info.SpeechNotification, self.Owner.Faction.InternalName);
|
||||||
TextNotificationsManager.AddTransientLine(info.TextNotification, self.Owner);
|
TextNotificationsManager.AddTransientLine(self.Owner, info.TextNotification);
|
||||||
|
|
||||||
lastPowerAdviceTime = Game.RunTime;
|
lastPowerAdviceTime = Game.RunTime;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
self.World.AddFrameEndTask(ww => DoProduction(self, producee, exit?.Info, productionType, inits));
|
self.World.AddFrameEndTask(ww => DoProduction(self, producee, exit?.Info, productionType, inits));
|
||||||
Game.Sound.Play(SoundType.World, info.ChuteSound, self.CenterPosition);
|
Game.Sound.Play(SoundType.World, info.ChuteSound, self.CenterPosition);
|
||||||
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", info.ReadyAudio, self.Owner.Faction.InternalName);
|
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", info.ReadyAudio, self.Owner.Faction.InternalName);
|
||||||
TextNotificationsManager.AddTransientLine(info.ReadyTextNotification, self.Owner);
|
TextNotificationsManager.AddTransientLine(self.Owner, info.ReadyTextNotification);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
actor.QueueActivity(new Fly(actor, Target.FromCell(w, endPos)));
|
actor.QueueActivity(new Fly(actor, Target.FromCell(w, endPos)));
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ namespace OpenRA.Mods.Common.Traits.Sound
|
|||||||
var player = Info.NotifyAll ? localPlayer : self.Owner;
|
var player = Info.NotifyAll ? localPlayer : self.Owner;
|
||||||
|
|
||||||
Game.Sound.PlayNotification(self.World.Map.Rules, player, "Speech", Info.Notification, self.Owner.Faction.InternalName);
|
Game.Sound.PlayNotification(self.World.Map.Rules, player, "Speech", Info.Notification, self.Owner.Faction.InternalName);
|
||||||
TextNotificationsManager.AddTransientLine(Info.TextNotification, player);
|
TextNotificationsManager.AddTransientLine(player, Info.TextNotification);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ namespace OpenRA.Mods.Common.Traits.Sound
|
|||||||
Game.Sound.PlayNotification(self.World.Map.Rules, discoverer, "Speech", Info.Notification, discoverer.Faction.InternalName);
|
Game.Sound.PlayNotification(self.World.Map.Rules, discoverer, "Speech", Info.Notification, discoverer.Faction.InternalName);
|
||||||
|
|
||||||
if (discoverer != null)
|
if (discoverer != null)
|
||||||
TextNotificationsManager.AddTransientLine(Info.TextNotification, discoverer);
|
TextNotificationsManager.AddTransientLine(discoverer, Info.TextNotification);
|
||||||
|
|
||||||
// Radar notification
|
// Radar notification
|
||||||
if (Info.PingRadar)
|
if (Info.PingRadar)
|
||||||
|
|||||||
@@ -51,11 +51,11 @@ namespace OpenRA.Mods.Common.Traits.Sound
|
|||||||
{
|
{
|
||||||
var faction = info.NewOwnerVoice ? newOwner.Faction.InternalName : oldOwner.Faction.InternalName;
|
var faction = info.NewOwnerVoice ? newOwner.Faction.InternalName : oldOwner.Faction.InternalName;
|
||||||
Game.Sound.PlayNotification(self.World.Map.Rules, newOwner, "Speech", info.Notification, faction);
|
Game.Sound.PlayNotification(self.World.Map.Rules, newOwner, "Speech", info.Notification, faction);
|
||||||
TextNotificationsManager.AddTransientLine(info.TextNotification, newOwner);
|
TextNotificationsManager.AddTransientLine(newOwner, info.TextNotification);
|
||||||
|
|
||||||
var loseFaction = info.LoseNewOwnerVoice ? newOwner.Faction.InternalName : oldOwner.Faction.InternalName;
|
var loseFaction = info.LoseNewOwnerVoice ? newOwner.Faction.InternalName : oldOwner.Faction.InternalName;
|
||||||
Game.Sound.PlayNotification(self.World.Map.Rules, oldOwner, "Speech", info.LoseNotification, loseFaction);
|
Game.Sound.PlayNotification(self.World.Map.Rules, oldOwner, "Speech", info.LoseNotification, loseFaction);
|
||||||
TextNotificationsManager.AddTransientLine(info.LoseTextNotification, oldOwner);
|
TextNotificationsManager.AddTransientLine(oldOwner, info.LoseTextNotification);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech",
|
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech",
|
||||||
info.ReinforcementsArrivedSpeechNotification, self.Owner.Faction.InternalName);
|
info.ReinforcementsArrivedSpeechNotification, self.Owner.Faction.InternalName);
|
||||||
|
|
||||||
TextNotificationsManager.AddTransientLine(info.ReinforcementsArrivedTextNotification, self.Owner);
|
TextNotificationsManager.AddTransientLine(self.Owner, info.ReinforcementsArrivedTextNotification);
|
||||||
}
|
}
|
||||||
|
|
||||||
aircraftInRange[a] = true;
|
aircraftInRange[a] = true;
|
||||||
|
|||||||
@@ -99,12 +99,12 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
if (activated)
|
if (activated)
|
||||||
{
|
{
|
||||||
Game.Sound.PlayNotification(self.World.Map.Rules, manager.Self.Owner, "Speech", info.ReadyAudio, self.Owner.Faction.InternalName);
|
Game.Sound.PlayNotification(self.World.Map.Rules, manager.Self.Owner, "Speech", info.ReadyAudio, self.Owner.Faction.InternalName);
|
||||||
TextNotificationsManager.AddTransientLine(info.ReadyTextNotification, manager.Self.Owner);
|
TextNotificationsManager.AddTransientLine(manager.Self.Owner, info.ReadyTextNotification);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Game.Sound.PlayNotification(self.World.Map.Rules, manager.Self.Owner, "Speech", info.BlockedAudio, self.Owner.Faction.InternalName);
|
Game.Sound.PlayNotification(self.World.Map.Rules, manager.Self.Owner, "Speech", info.BlockedAudio, self.Owner.Faction.InternalName);
|
||||||
TextNotificationsManager.AddTransientLine(info.BlockedTextNotification, manager.Self.Owner);
|
TextNotificationsManager.AddTransientLine(manager.Self.Owner, info.BlockedTextNotification);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech",
|
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech",
|
||||||
Info.SelectTargetSpeechNotification, self.Owner.Faction.InternalName);
|
Info.SelectTargetSpeechNotification, self.Owner.Faction.InternalName);
|
||||||
|
|
||||||
TextNotificationsManager.AddTransientLine(Info.SelectTargetTextNotification, manager.Self.Owner);
|
TextNotificationsManager.AddTransientLine(manager.Self.Owner, Info.SelectTargetTextNotification);
|
||||||
|
|
||||||
self.World.OrderGenerator = new SelectSpawnActorPowerTarget(order, manager, this, MouseButton.Left);
|
self.World.OrderGenerator = new SelectSpawnActorPowerTarget(order, manager, this, MouseButton.Left);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -166,7 +166,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
{
|
{
|
||||||
Game.Sound.Play(SoundType.UI, Info.DetectedSound);
|
Game.Sound.Play(SoundType.UI, Info.DetectedSound);
|
||||||
Game.Sound.PlayNotification(self.World.Map.Rules, player, "Speech", info.DetectedSpeechNotification, player.Faction.InternalName);
|
Game.Sound.PlayNotification(self.World.Map.Rules, player, "Speech", info.DetectedSpeechNotification, player.Faction.InternalName);
|
||||||
TextNotificationsManager.AddTransientLine(info.DetectedTextNotification, player);
|
TextNotificationsManager.AddTransientLine(player, info.DetectedTextNotification);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -181,7 +181,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech",
|
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech",
|
||||||
Info.BeginChargeSpeechNotification, self.Owner.Faction.InternalName);
|
Info.BeginChargeSpeechNotification, self.Owner.Faction.InternalName);
|
||||||
|
|
||||||
TextNotificationsManager.AddTransientLine(Info.BeginChargeTextNotification, self.Owner);
|
TextNotificationsManager.AddTransientLine(self.Owner, Info.BeginChargeTextNotification);
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void Charged(Actor self, string key)
|
public virtual void Charged(Actor self, string key)
|
||||||
@@ -190,7 +190,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech",
|
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech",
|
||||||
Info.EndChargeSpeechNotification, self.Owner.Faction.InternalName);
|
Info.EndChargeSpeechNotification, self.Owner.Faction.InternalName);
|
||||||
|
|
||||||
TextNotificationsManager.AddTransientLine(Info.EndChargeTextNotification, self.Owner);
|
TextNotificationsManager.AddTransientLine(self.Owner, Info.EndChargeTextNotification);
|
||||||
|
|
||||||
foreach (var notify in self.TraitsImplementing<INotifySupportPower>())
|
foreach (var notify in self.TraitsImplementing<INotifySupportPower>())
|
||||||
notify.Charged(self);
|
notify.Charged(self);
|
||||||
@@ -228,7 +228,8 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
var speech = isAllied ? Info.LaunchSpeechNotification : Info.IncomingSpeechNotification;
|
var speech = isAllied ? Info.LaunchSpeechNotification : Info.IncomingSpeechNotification;
|
||||||
Game.Sound.PlayNotification(Self.World.Map.Rules, localPlayer, "Speech", speech, localPlayer.Faction.InternalName);
|
Game.Sound.PlayNotification(Self.World.Map.Rules, localPlayer, "Speech", speech, localPlayer.Faction.InternalName);
|
||||||
|
|
||||||
TextNotificationsManager.AddTransientLine(isAllied ? Info.LaunchTextNotification : Info.IncomingTextNotification, localPlayer);
|
var text = isAllied ? Info.LaunchTextNotification : Info.IncomingTextNotification;
|
||||||
|
TextNotificationsManager.AddTransientLine(localPlayer, text);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerable<CPos> CellsMatching(CPos location, char[] footprint, CVec dimensions)
|
public IEnumerable<CPos> CellsMatching(CPos location, char[] footprint, CVec dimensions)
|
||||||
|
|||||||
@@ -231,7 +231,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
Game.Sound.PlayNotification(power.Self.World.Map.Rules, power.Self.Owner, "Speech",
|
Game.Sound.PlayNotification(power.Self.World.Map.Rules, power.Self.Owner, "Speech",
|
||||||
Info.SelectTargetSpeechNotification, power.Self.Owner.Faction.InternalName);
|
Info.SelectTargetSpeechNotification, power.Self.Owner.Faction.InternalName);
|
||||||
|
|
||||||
TextNotificationsManager.AddTransientLine(Info.SelectTargetTextNotification, power.Self.Owner);
|
TextNotificationsManager.AddTransientLine(power.Self.Owner, Info.SelectTargetTextNotification);
|
||||||
|
|
||||||
power.SelectTarget(power.Self, Key, Manager);
|
power.SelectTarget(power.Self, Key, Manager);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
Game.Sound.PlayToPlayer(SoundType.World, self.Owner, s);
|
Game.Sound.PlayToPlayer(SoundType.World, self.Owner, s);
|
||||||
|
|
||||||
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", Info.NoTransformNotification, self.Owner.Faction.InternalName);
|
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", Info.NoTransformNotification, self.Owner.Faction.InternalName);
|
||||||
TextNotificationsManager.AddTransientLine(Info.NoTransformTextNotification, self.Owner);
|
TextNotificationsManager.AddTransientLine(self.Owner, Info.NoTransformTextNotification);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
if (!world.IsLoadingGameSave)
|
if (!world.IsLoadingGameSave)
|
||||||
{
|
{
|
||||||
Game.Sound.PlayNotification(world.Map.Rules, null, "Speech", info.Notification, world.RenderPlayer?.Faction.InternalName);
|
Game.Sound.PlayNotification(world.Map.Rules, null, "Speech", info.Notification, world.RenderPlayer?.Faction.InternalName);
|
||||||
TextNotificationsManager.AddTransientLine(info.TextNotification, null);
|
TextNotificationsManager.AddTransientLine(null, info.TextNotification);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -57,7 +57,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
if (!world.IsReplay)
|
if (!world.IsReplay)
|
||||||
{
|
{
|
||||||
Game.Sound.PlayNotification(world.Map.Rules, null, "Speech", info.LoadedNotification, world.RenderPlayer?.Faction.InternalName);
|
Game.Sound.PlayNotification(world.Map.Rules, null, "Speech", info.LoadedNotification, world.RenderPlayer?.Faction.InternalName);
|
||||||
TextNotificationsManager.AddTransientLine(info.LoadedTextNotification, null);
|
TextNotificationsManager.AddTransientLine(null, info.LoadedTextNotification);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -66,7 +66,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
if (!world.IsReplay)
|
if (!world.IsReplay)
|
||||||
{
|
{
|
||||||
Game.Sound.PlayNotification(world.Map.Rules, null, "Speech", info.SavedNotification, world.RenderPlayer?.Faction.InternalName);
|
Game.Sound.PlayNotification(world.Map.Rules, null, "Speech", info.SavedNotification, world.RenderPlayer?.Faction.InternalName);
|
||||||
TextNotificationsManager.AddTransientLine(info.SavedTextNotification, null);
|
TextNotificationsManager.AddTransientLine(null, info.SavedTextNotification);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -316,7 +316,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
if (actionManager != null)
|
if (actionManager != null)
|
||||||
actionManager.Modified = false;
|
actionManager.Modified = false;
|
||||||
|
|
||||||
TextNotificationsManager.AddTransientLine(TranslationProvider.GetString(SaveCurrentMap), world.LocalPlayer);
|
TextNotificationsManager.AddTransientLine(world.LocalPlayer, TranslationProvider.GetString(SaveCurrentMap));
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -217,7 +217,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
{
|
{
|
||||||
var faction = world.LocalPlayer?.Faction.InternalName;
|
var faction = world.LocalPlayer?.Faction.InternalName;
|
||||||
Game.Sound.PlayNotification(world.Map.Rules, null, "Speech", moi.LeaveNotification, faction);
|
Game.Sound.PlayNotification(world.Map.Rules, null, "Speech", moi.LeaveNotification, faction);
|
||||||
TextNotificationsManager.AddTransientLine(moi.LeaveTextNotification, null);
|
TextNotificationsManager.AddTransientLine(null, moi.LeaveTextNotification);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -324,7 +324,7 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
// Resume a paused item
|
// Resume a paused item
|
||||||
Game.Sound.PlayNotification(World.Map.Rules, World.LocalPlayer, "Sounds", ClickSound, null);
|
Game.Sound.PlayNotification(World.Map.Rules, World.LocalPlayer, "Sounds", ClickSound, null);
|
||||||
Game.Sound.PlayNotification(World.Map.Rules, World.LocalPlayer, "Speech", CurrentQueue.Info.QueuedAudio, World.LocalPlayer.Faction.InternalName);
|
Game.Sound.PlayNotification(World.Map.Rules, World.LocalPlayer, "Speech", CurrentQueue.Info.QueuedAudio, World.LocalPlayer.Faction.InternalName);
|
||||||
TextNotificationsManager.AddTransientLine(CurrentQueue.Info.QueuedTextNotification, World.LocalPlayer);
|
TextNotificationsManager.AddTransientLine(World.LocalPlayer, CurrentQueue.Info.QueuedTextNotification);
|
||||||
|
|
||||||
World.IssueOrder(Order.PauseProduction(CurrentQueue.Actor, icon.Name, false));
|
World.IssueOrder(Order.PauseProduction(CurrentQueue.Actor, icon.Name, false));
|
||||||
return true;
|
return true;
|
||||||
@@ -341,7 +341,7 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
if (!CurrentQueue.AllQueued().Any())
|
if (!CurrentQueue.AllQueued().Any())
|
||||||
{
|
{
|
||||||
Game.Sound.PlayNotification(World.Map.Rules, World.LocalPlayer, "Speech", notification, World.LocalPlayer.Faction.InternalName);
|
Game.Sound.PlayNotification(World.Map.Rules, World.LocalPlayer, "Speech", notification, World.LocalPlayer.Faction.InternalName);
|
||||||
TextNotificationsManager.AddTransientLine(textNotification, World.LocalPlayer);
|
TextNotificationsManager.AddTransientLine(World.LocalPlayer, textNotification);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (canQueue)
|
if (canQueue)
|
||||||
@@ -366,7 +366,7 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
{
|
{
|
||||||
// Instantly cancel items that haven't started, have finished, or if the queue doesn't support pausing
|
// Instantly cancel items that haven't started, have finished, or if the queue doesn't support pausing
|
||||||
Game.Sound.PlayNotification(World.Map.Rules, World.LocalPlayer, "Speech", CurrentQueue.Info.CancelledAudio, World.LocalPlayer.Faction.InternalName);
|
Game.Sound.PlayNotification(World.Map.Rules, World.LocalPlayer, "Speech", CurrentQueue.Info.CancelledAudio, World.LocalPlayer.Faction.InternalName);
|
||||||
TextNotificationsManager.AddTransientLine(CurrentQueue.Info.CancelledTextNotification, World.LocalPlayer);
|
TextNotificationsManager.AddTransientLine(World.LocalPlayer, CurrentQueue.Info.CancelledTextNotification);
|
||||||
|
|
||||||
World.IssueOrder(Order.CancelProduction(CurrentQueue.Actor, icon.Name, handleCount));
|
World.IssueOrder(Order.CancelProduction(CurrentQueue.Actor, icon.Name, handleCount));
|
||||||
}
|
}
|
||||||
@@ -374,7 +374,7 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
{
|
{
|
||||||
// Pause an existing item
|
// Pause an existing item
|
||||||
Game.Sound.PlayNotification(World.Map.Rules, World.LocalPlayer, "Speech", CurrentQueue.Info.OnHoldAudio, World.LocalPlayer.Faction.InternalName);
|
Game.Sound.PlayNotification(World.Map.Rules, World.LocalPlayer, "Speech", CurrentQueue.Info.OnHoldAudio, World.LocalPlayer.Faction.InternalName);
|
||||||
TextNotificationsManager.AddTransientLine(CurrentQueue.Info.OnHoldTextNotification, World.LocalPlayer);
|
TextNotificationsManager.AddTransientLine(World.LocalPlayer, CurrentQueue.Info.OnHoldTextNotification);
|
||||||
|
|
||||||
World.IssueOrder(Order.PauseProduction(CurrentQueue.Actor, icon.Name, true));
|
World.IssueOrder(Order.PauseProduction(CurrentQueue.Actor, icon.Name, true));
|
||||||
}
|
}
|
||||||
@@ -390,7 +390,7 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
// Directly cancel, skipping "on-hold"
|
// Directly cancel, skipping "on-hold"
|
||||||
Game.Sound.PlayNotification(World.Map.Rules, World.LocalPlayer, "Sounds", ClickSound, null);
|
Game.Sound.PlayNotification(World.Map.Rules, World.LocalPlayer, "Sounds", ClickSound, null);
|
||||||
Game.Sound.PlayNotification(World.Map.Rules, World.LocalPlayer, "Speech", CurrentQueue.Info.CancelledAudio, World.LocalPlayer.Faction.InternalName);
|
Game.Sound.PlayNotification(World.Map.Rules, World.LocalPlayer, "Speech", CurrentQueue.Info.CancelledAudio, World.LocalPlayer.Faction.InternalName);
|
||||||
TextNotificationsManager.AddTransientLine(CurrentQueue.Info.CancelledTextNotification, World.LocalPlayer);
|
TextNotificationsManager.AddTransientLine(World.LocalPlayer, CurrentQueue.Info.CancelledTextNotification);
|
||||||
|
|
||||||
World.IssueOrder(Order.CancelProduction(CurrentQueue.Actor, icon.Name, handleCount));
|
World.IssueOrder(Order.CancelProduction(CurrentQueue.Actor, icon.Name, handleCount));
|
||||||
|
|
||||||
|
|||||||
@@ -174,7 +174,7 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
Game.Sound.PlayNotification(spm.Self.World.Map.Rules, spm.Self.Owner, "Speech",
|
Game.Sound.PlayNotification(spm.Self.World.Map.Rules, spm.Self.Owner, "Speech",
|
||||||
clicked.Power.Info.InsufficientPowerSpeechNotification, spm.Self.Owner.Faction.InternalName);
|
clicked.Power.Info.InsufficientPowerSpeechNotification, spm.Self.Owner.Faction.InternalName);
|
||||||
|
|
||||||
TextNotificationsManager.AddTransientLine(clicked.Power.Info.InsufficientPowerTextNotification, spm.Self.Owner);
|
TextNotificationsManager.AddTransientLine(spm.Self.Owner, clicked.Power.Info.InsufficientPowerTextNotification);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
clicked.Power.Target();
|
clicked.Power.Target();
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ namespace OpenRA.Mods.D2k.Activities
|
|||||||
self.World.AddFrameEndTask(w => w.Add(new MapNotificationEffect(player, "Speech", swallow.Info.WormAttackNotification, 25, true, attackPosition, Color.Red)));
|
self.World.AddFrameEndTask(w => w.Add(new MapNotificationEffect(player, "Speech", swallow.Info.WormAttackNotification, 25, true, attackPosition, Color.Red)));
|
||||||
|
|
||||||
if (affectedPlayers.Contains(self.World.LocalPlayer))
|
if (affectedPlayers.Contains(self.World.LocalPlayer))
|
||||||
TextNotificationsManager.AddTransientLine(swallow.Info.WormAttackTextNotification, self.World.LocalPlayer);
|
TextNotificationsManager.AddTransientLine(self.World.LocalPlayer, swallow.Info.WormAttackTextNotification);
|
||||||
|
|
||||||
var barrel = armament.CheckFire(self, facing, target);
|
var barrel = armament.CheckFire(self, facing, target);
|
||||||
if (barrel == null)
|
if (barrel == null)
|
||||||
|
|||||||
Reference in New Issue
Block a user