private void Initialize() { Dictionary <String, String> dic; if (!TryLoadReplacements(out dic)) { return; } Log.Message($"[{TypeName}] Loading..."); foreach (KeyValuePair <String, Int32> pair in FF9BattleDB.SceneData) { Int32 index = pair.Value; if (index == 220 || index == 238) // Junk? { continue; } String path = EmbadedTextResources.GetCurrentPath("/Battle/" + index + ".mes"); String[] text = EmbadedSentenseLoader.LoadSentense(path); if (text != null) { for (Int32 i = 0; i < text.Length; i++) { String key = BattleFormatter.GetKey(text[i]); String value; if (dic.TryGetValue(key, out value)) { text[i] = value; } } } _cache[index] = text; } _initialized = true; }
protected override TxtEntry[] PrepareEntries() { Dictionary <String, String> dic = new Dictionary <String, String>(1024); foreach (KeyValuePair <String, Int32> pair in FF9BattleDB.SceneData) { Int32 index = pair.Value; if (index == 220 || index == 238) // Junk? { continue; } String path = EmbadedTextResources.GetCurrentPath("/Battle/" + index + ".mes"); String[] text = EmbadedSentenseLoader.LoadSentense(path); if (text == null) { continue; } foreach (String line in text) { if (String.IsNullOrEmpty(line)) { continue; } String key = BattleFormatter.GetKey(line); if (!dic.ContainsKey(key)) { dic.Add(key, BattleFormatter.GetValue(line)); } } } return(dic.Select(p => new TxtEntry { Prefix = p.Key, Value = p.Value }).ToArray()); }