Move Text handling to its own class
This commit is contained in:
@@ -77,7 +77,7 @@ namespace OpenRA.Mods.Common.Scripting
|
||||
if (value.TryGetClrValue(out int facing))
|
||||
{
|
||||
facingInit.Initialize(WAngle.FromFacing(facing));
|
||||
Game.Debug("Initializing Facing with integers is deprecated. Use Angle instead.");
|
||||
TextNotificationsManager.Debug("Initializing Facing with integers is deprecated. Use Angle instead.");
|
||||
return facingInit;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace OpenRA.Mods.Common.Scripting.Global
|
||||
|
||||
void Deprecated()
|
||||
{
|
||||
Game.Debug("The Facing table is deprecated. Use Angle instead.");
|
||||
TextNotificationsManager.Debug("The Facing table is deprecated. Use Angle instead.");
|
||||
}
|
||||
|
||||
public int North { get { Deprecated(); return 0; } }
|
||||
|
||||
@@ -194,7 +194,7 @@ namespace OpenRA.Mods.Common.Scripting
|
||||
return;
|
||||
|
||||
var c = color.HasValue ? color.Value : Color.White;
|
||||
Game.AddChatLine(prefix, c, text);
|
||||
TextNotificationsManager.AddChatLine(prefix, c, text);
|
||||
}
|
||||
|
||||
[Desc("Display a system message to the player. If 'prefix' is nil the default system prefix is used.")]
|
||||
@@ -204,9 +204,9 @@ namespace OpenRA.Mods.Common.Scripting
|
||||
return;
|
||||
|
||||
if (string.IsNullOrEmpty(prefix))
|
||||
Game.AddSystemLine(text);
|
||||
TextNotificationsManager.AddSystemLine(text);
|
||||
else
|
||||
Game.AddSystemLine(prefix, text);
|
||||
TextNotificationsManager.AddSystemLine(prefix, text);
|
||||
}
|
||||
|
||||
[Desc("Displays a debug message to the player, if \"Show Map Debug Messages\" is checked in the settings.")]
|
||||
@@ -215,7 +215,7 @@ namespace OpenRA.Mods.Common.Scripting
|
||||
if (string.IsNullOrEmpty(text) || !Game.Settings.Debug.LuaDebug)
|
||||
return;
|
||||
|
||||
Game.Debug(text);
|
||||
TextNotificationsManager.Debug(text);
|
||||
}
|
||||
|
||||
[Desc("Display a text message at the specified location.")]
|
||||
|
||||
@@ -36,14 +36,14 @@ namespace OpenRA.Mods.Common.Scripting
|
||||
[Desc("Activate the actor's Airstrike Power. DEPRECATED! Will be removed.")]
|
||||
public void SendAirstrike(WPos target, bool randomize = true, int facing = 0)
|
||||
{
|
||||
Game.Debug("SendAirstrike is deprecated. Use TargetAirstrike instead.");
|
||||
TextNotificationsManager.Debug("SendAirstrike is deprecated. Use TargetAirstrike instead.");
|
||||
ap.SendAirstrike(Self, target, randomize ? (WAngle?)null : WAngle.FromFacing(facing));
|
||||
}
|
||||
|
||||
[Desc("Activate the actor's Airstrike Power. DEPRECATED! Will be removed.")]
|
||||
public void SendAirstrikeFrom(CPos from, CPos to)
|
||||
{
|
||||
Game.Debug("SendAirstrikeFrom is deprecated. Use TargetAirstrike instead.");
|
||||
TextNotificationsManager.Debug("SendAirstrikeFrom is deprecated. Use TargetAirstrike instead.");
|
||||
var i = Self.World.Map.CenterOfCell(from);
|
||||
var j = Self.World.Map.CenterOfCell(to);
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace OpenRA.Mods.Common.Scripting
|
||||
[Desc("Activate the actor's Paratroopers Power. Returns the aircraft that will drop the reinforcements. DEPRECATED! Will be removed.")]
|
||||
public Actor[] ActivateParatroopers(WPos target, int facing = -1)
|
||||
{
|
||||
Game.Debug("SendParatroopersFrom is deprecated. Use TargetParatroopers instead.");
|
||||
TextNotificationsManager.Debug("SendParatroopersFrom is deprecated. Use TargetParatroopers instead.");
|
||||
var actors = pp.SendParatroopers(Self, target, facing == -1 ? (WAngle?)null : WAngle.FromFacing(facing));
|
||||
return actors.Aircraft;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user