Extract strings from resource renderer.
This commit is contained in:
committed by
Gustas
parent
6c9e33b76c
commit
97c61e0068
@@ -39,6 +39,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
[FieldLoader.Require]
|
||||
[Desc("Resource name used by tooltips.")]
|
||||
[TranslationReference]
|
||||
public readonly string Name = null;
|
||||
|
||||
public ResourceTypeInfo(MiniYaml yaml)
|
||||
@@ -266,7 +267,14 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
protected virtual string GetRenderedResourceType(CPos cell) { return RenderContents[cell].Type; }
|
||||
|
||||
protected virtual string GetRenderedResourceTooltip(CPos cell) { return RenderContents[cell].Info?.Name; }
|
||||
protected virtual string GetRenderedResourceTooltip(CPos cell)
|
||||
{
|
||||
var info = RenderContents[cell].Info;
|
||||
if (info == null)
|
||||
return null;
|
||||
|
||||
return TranslationProvider.GetString(info.Name);
|
||||
}
|
||||
|
||||
IEnumerable<string> IResourceRenderer.ResourceTypes => Info.ResourceTypes.Keys;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user