fixed unity inventory and texts

This commit is contained in:
TAASONI3
2023-07-11 18:36:46 +02:00
parent d0d9a6847a
commit 18dfaf7602
12 changed files with 367 additions and 273 deletions

View File

@@ -19,16 +19,28 @@ public class TextHandler : MonoBehaviour
}
public static string getText(string key){
key = key.Replace("(","").Replace(")","");
bool hasLeftBracket = false;
bool hasRightBracket = false;
if(key.Contains("(")){
hasLeftBracket = true;
key = key.Replace("(","");
}
if(key.Contains(")")){
hasRightBracket = true;
key = key.Replace(")","");
}
if(key[0].Equals(Char.ToUpperInvariant(key[0]))){
key = Char.ToLowerInvariant(key[0]) + key.Substring(1);
}
if(key.Contains("\r\n")){
return key;
}
string text = LocalizationSettings.StringDatabase.GetLocalizedString("MyTexts",key);
if(hasLeftBracket){
text = "(" + text;
}
if(hasRightBracket){
text = text + ")";
}
return text;
}