mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Cache translated item name
This commit is contained in:
parent
e97ef7eb16
commit
fec5ae1c92
@ -20,6 +20,8 @@ namespace NewHorizons.Components.Props
|
|||||||
public bool ClearPickupConditionOnDrop;
|
public bool ClearPickupConditionOnDrop;
|
||||||
public string PickupFact;
|
public string PickupFact;
|
||||||
|
|
||||||
|
string _translatedName;
|
||||||
|
|
||||||
public ItemType ItemType
|
public ItemType ItemType
|
||||||
{
|
{
|
||||||
get => _type;
|
get => _type;
|
||||||
@ -28,7 +30,11 @@ namespace NewHorizons.Components.Props
|
|||||||
|
|
||||||
public override string GetDisplayName()
|
public override string GetDisplayName()
|
||||||
{
|
{
|
||||||
return TranslationHandler.GetTranslation(DisplayName, TranslationHandler.TextType.UI);
|
if (_translatedName == null)
|
||||||
|
{
|
||||||
|
_translatedName = TranslationHandler.GetTranslation(DisplayName, TranslationHandler.TextType.UI);
|
||||||
|
}
|
||||||
|
return _translatedName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool CheckIsDroppable()
|
public override bool CheckIsDroppable()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user