Fix lobby faction tooltip rendering.

This commit is contained in:
Paul Chote
2023-10-29 14:20:27 +00:00
committed by Gustas
parent 500ee54f04
commit b28a3b6a5a
3 changed files with 8 additions and 7 deletions

View File

@@ -77,8 +77,11 @@ namespace OpenRA.Mods.Common.Widgets
{
ModRules = modData.DefaultRules;
var tooltipCache = new CachedTransform<string, string>(s => !string.IsNullOrEmpty(s) ? TranslationProvider.GetString(s) : "");
GetText = () => tooltipCache.Update(Text);
var textCache = new CachedTransform<string, string>(s => !string.IsNullOrEmpty(s) ? TranslationProvider.GetString(s) : "");
var tooltipTextCache = new CachedTransform<string, string>(s => !string.IsNullOrEmpty(s) ? TranslationProvider.GetString(s) : "");
var tooltipDescCache = new CachedTransform<string, string>(s => !string.IsNullOrEmpty(s) ? TranslationProvider.GetString(s) : "");
GetText = () => textCache.Update(Text);
GetColor = () => TextColor;
GetColorDisabled = () => TextColorDisabled;
GetContrastColorDark = () => ContrastColorDark;
@@ -86,9 +89,7 @@ namespace OpenRA.Mods.Common.Widgets
OnMouseUp = _ => OnClick();
OnKeyPress = _ => OnClick();
IsHighlighted = () => Highlighted;
var tooltipDescCache = new CachedTransform<string, string>(s => !string.IsNullOrEmpty(s) ? TranslationProvider.GetString(s) : "");
GetTooltipText = () => tooltipDescCache.Update(TooltipText);
var textCache = new CachedTransform<string, string>(s => !string.IsNullOrEmpty(s) ? TranslationProvider.GetString(s) : "");
GetTooltipText = () => tooltipTextCache.Update(TooltipText);
GetTooltipDesc = () => tooltipDescCache.Update(TooltipDesc);
tooltipContainer = Exts.Lazy(() =>
Ui.Root.Get<TooltipContainerWidget>(TooltipContainer));