Replace use of Contrast with Shadow for ingame chat and support power timers
This commit is contained in:
@@ -21,6 +21,7 @@ namespace OpenRA.Mods.Common.Widgets
|
||||
{
|
||||
public readonly int RemoveTime = 0;
|
||||
public readonly bool UseContrast = false;
|
||||
public readonly bool UseShadow = false;
|
||||
public readonly Color BackgroundColorDark = ChromeMetrics.Get<Color>("TextContrastColorDark");
|
||||
public readonly Color BackgroundColorLight = ChromeMetrics.Get<Color>("TextContrastColorLight");
|
||||
public string Notification = "";
|
||||
@@ -58,12 +59,24 @@ namespace OpenRA.Mods.Common.Widgets
|
||||
|
||||
if (owner != null)
|
||||
{
|
||||
font.DrawTextWithContrast(owner, chatpos,
|
||||
line.Color, BackgroundColorDark, BackgroundColorLight, UseContrast ? 1 : 0);
|
||||
if (UseContrast)
|
||||
font.DrawTextWithContrast(owner, chatpos,
|
||||
line.Color, BackgroundColorDark, BackgroundColorLight, 1);
|
||||
else if (UseShadow)
|
||||
font.DrawTextWithShadow(owner, chatpos,
|
||||
line.Color, BackgroundColorDark, BackgroundColorLight, 1);
|
||||
else
|
||||
font.DrawText(owner, chatpos, line.Color);
|
||||
}
|
||||
|
||||
font.DrawTextWithContrast(text, chatpos + new int2(inset, 0),
|
||||
Color.White, Color.Black, UseContrast ? 1 : 0);
|
||||
if (UseContrast)
|
||||
font.DrawTextWithContrast(text, chatpos + new int2(inset, 0),
|
||||
Color.White, Color.Black, 1);
|
||||
else if (UseShadow)
|
||||
font.DrawTextWithShadow(text, chatpos + new int2(inset, 0),
|
||||
Color.White, Color.Black, 1);
|
||||
else
|
||||
font.DrawText(text, chatpos + new int2(inset, 0), Color.White);
|
||||
}
|
||||
|
||||
Game.Renderer.DisableScissor();
|
||||
|
||||
Reference in New Issue
Block a user