public static string Get(string key, ref bool success) { if (string.IsNullOrEmpty(key)) { return(key); } int length = key.IndexOf("."); if (length < 0) { return(key); } string tableID = key.Substring(0, length); string key1 = key.Substring(length + 1); LocalizedText.TextTable textTable = LocalizedText.FindTable(tableID); if (textTable == null) { textTable = LocalizedText.InternalLoadTable(tableID, (LocalizedText.TextTable)null); if (textTable == null) { return(key); } } string text = textTable.FindText(key1); success = !string.IsNullOrEmpty(text) && !text.Equals(key1); return(text); }
public static void LoadTable(string tableID, bool forceReload = false) { LocalizedText.TextTable overwriteTable = LocalizedText.FindTable(tableID); if (overwriteTable == null || forceReload) { overwriteTable = LocalizedText.InternalLoadTable(tableID, overwriteTable); } overwriteTable.AutoUnload = false; }
public static void UnloadTable(string tableID) { LocalizedText.TextTable table = LocalizedText.FindTable(tableID); if (table == null) { return; } LocalizedText.mTables.Remove(table); }
public static string[] GetTextIDs(string tableID) { LocalizedText.TextTable table = LocalizedText.FindTable(tableID); if (table != null) { return(new List <string>((IEnumerable <string>)table.Items.Keys).ToArray()); } return(new string[0]); }
public static string SGGet(string language, string tableID, string textID) { if (string.IsNullOrEmpty(textID)) { return(textID); } if (string.IsNullOrEmpty(tableID)) { return(tableID); } string str = (LocalizedText.FindTable(tableID) ?? LocalizedText.InternalLoadTable(language, tableID, (LocalizedText.TextTable)null)).FindText(textID); if (string.IsNullOrEmpty(str) || str.Equals(textID)) { str = tableID + (object)'.' + textID; } return(str); }