Remove HSLColor.

This commit is contained in:
Paul Chote
2018-12-31 08:41:23 +00:00
parent ab4a7e3558
commit 3e404f6ac2
76 changed files with 256 additions and 416 deletions

View File

@@ -189,12 +189,12 @@ namespace OpenRA.Mods.Common.Scripting
}
[Desc("Display a text message to the player.")]
public void DisplayMessage(string text, string prefix = "Mission", HSLColor? color = null)
public void DisplayMessage(string text, string prefix = "Mission", Color? color = null)
{
if (string.IsNullOrEmpty(text))
return;
Color c = color.HasValue ? HSLColor.RGBFromHSL(color.Value.H / 255f, color.Value.S / 255f, color.Value.L / 255f) : Color.White;
var c = color.HasValue ? color.Value : Color.White;
Game.AddChatLine(c, prefix, text);
}
@@ -208,12 +208,12 @@ namespace OpenRA.Mods.Common.Scripting
}
[Desc("Display a text message at the specified location.")]
public void FloatingText(string text, WPos position, int duration = 30, HSLColor? color = null)
public void FloatingText(string text, WPos position, int duration = 30, Color? color = null)
{
if (string.IsNullOrEmpty(text) || !world.Map.Contains(world.Map.CellContaining(position)))
return;
Color c = color.HasValue ? HSLColor.RGBFromHSL(color.Value.H / 255f, color.Value.S / 255f, color.Value.L / 255f) : Color.White;
var c = color.HasValue ? color.Value : Color.White;
world.AddFrameEndTask(w => w.Add(new FloatingText(position, c, text, duration)));
}