Ejemplo n.º 1
0
        protected override Boolean LoadExternal()
        {
            try
            {
                if (!_initialized)
                {
                    return(false);
                }

                Int32 battleZoneId = FF9TextToolAccessor.GetBattleZoneId();

                String[] result;
                if (!_cache.TryGetValue(battleZoneId, out result))
                {
                    return(false);
                }

                if (result != null)
                {
                    FF9TextToolAccessor.SetBattleText(result);
                }

                return(true);
            }
            catch (Exception ex)
            {
                Log.Error(ex, $"[{TypeName}] Failed to import resource.");
                return(false);
            }
        }
Ejemplo n.º 2
0
        protected override Boolean LoadExternal()
        {
            try
            {
                String importDirectory = ImportDirectory;
                if (!Directory.Exists(importDirectory))
                {
                    Log.Warning($"[{TypeName}] Import was skipped bacause a directory does not exist: [{importDirectory}].");
                    return(false);
                }

                Log.Message($"[{TypeName}] Importing from [{importDirectory}]...");

                Dictionary <Int32, String> locationNames = FF9TextToolAccessor.GetLocationName();
                foreach (String filePath in Directory.GetFiles(importDirectory, "Names of *", SearchOption.TopDirectoryOnly))
                {
                    TxtEntry[] entries = TxtReader.ReadStrings(filePath);
                    LocationNameFormatter.Fill(filePath, entries, locationNames);
                }

                Log.Message($"[{TypeName}] Importing completed successfully.");
                return(true);
            }
            catch (Exception ex)
            {
                Log.Error(ex, $"[{TypeName}] Failed to import resource from.");
                return(false);
            }
        }
Ejemplo n.º 3
0
        protected override Boolean LoadExternal()
        {
            try
            {
                if (!_initialized)
                {
                    return(false);
                }

                Int32 fieldZoneId = FF9TextToolAccessor.GetFieldZoneId();

                String[] result;
                if (!_cache.TryGetValue(fieldZoneId, out result))
                {
                    Log.Warning($"[{TypeName}] Failed to find zone by ID: {fieldZoneId}].");
                    return(true);
                }

                if (result != null)
                {
                    FF9TextToolAccessor.SetFieldText(result);
                    FF9TextToolAccessor.SetTableText(FF9TextToolInterceptor.ExtractTableText(result));
                }

                return(true);
            }
            catch (Exception ex)
            {
                _initialized = true;
                Log.Error(ex, $"[{TypeName}] Failed to import resource.");
                return(false);
            }
        }
Ejemplo n.º 4
0
        protected override void ProcessEntries(TxtEntry[] entreis)
        {
            String[] abilityNames, strings;
            AbilityFormatter.Parse(entreis, out abilityNames, out strings);

            FF9TextToolAccessor.SetSupportAbilityName(abilityNames);
            FF9TextToolAccessor.SetSupportAbilityHelpDesc(strings);
        }
Ejemplo n.º 5
0
        protected override void ProcessEntries(TxtEntry[] entreis)
        {
            String[] commandNames, commandHelps;
            AbilityFormatter.Parse(entreis, out commandNames, out commandHelps);

            FF9TextToolAccessor.SetCommandName(commandNames);
            FF9TextToolAccessor.SetCommandHelpDesc(commandHelps);
        }
Ejemplo n.º 6
0
        protected override void ProcessEntries(TxtEntry[] entreis)
        {
            String[] skillNames, skillHelps;
            AbilityFormatter.Parse(entreis, out skillNames, out skillHelps);

            FF9TextToolAccessor.SetActionAbilityName(skillNames);
            FF9TextToolAccessor.SetActionAbilityHelpDesc(skillHelps);
        }
Ejemplo n.º 7
0
        protected override Boolean LoadInternal()
        {
            String[] abilityNames = EmbadedSentenseLoader.LoadSentense(EmbadedTextResources.AbilityNames);
            String[] abilityHelps = EmbadedSentenseLoader.LoadSentense(EmbadedTextResources.AbilityHelps);

            FF9TextToolAccessor.SetSupportAbilityName(abilityNames);
            FF9TextToolAccessor.SetSupportAbilityHelpDesc(abilityHelps);
            return(true);
        }
Ejemplo n.º 8
0
        protected override Boolean LoadInternal()
        {
            String[] commandNames = EmbadedSentenseLoader.LoadSentense(EmbadedTextResources.CommandNames);
            String[] commandHelps = EmbadedSentenseLoader.LoadSentense(EmbadedTextResources.CommandHelps);

            FF9TextToolAccessor.SetCommandName(commandNames);
            FF9TextToolAccessor.SetCommandHelpDesc(commandHelps);
            return(true);
        }
Ejemplo n.º 9
0
        protected override Boolean LoadInternal()
        {
            String[] skillNames = EmbadedSentenseLoader.LoadSentense(EmbadedTextResources.SkillNames);
            String[] skillHelps = EmbadedSentenseLoader.LoadSentense(EmbadedTextResources.SkillHelps);

            FF9TextToolAccessor.SetActionAbilityName(skillNames);
            FF9TextToolAccessor.SetActionAbilityHelpDesc(skillHelps);
            return(true);
        }
Ejemplo n.º 10
0
        protected override void ProcessEntries(TxtEntry[] entreis)
        {
            String[] itemNames, itemHelps, itemDescs;
            KeyItemFormatter.Parse(entreis, out itemNames, out itemHelps, out itemDescs);

            FF9TextToolAccessor.SetImportantItemName(itemNames);
            FF9TextToolAccessor.SetImportantItemHelpDesc(itemHelps);
            FF9TextToolAccessor.SetImportantSkinDesc(itemDescs);
        }
Ejemplo n.º 11
0
        protected override void ProcessEntries(TxtEntry[] entreis)
        {
            String[] itemNames, itemHelps, itemBattle;
            ItemFormatter.Parse(entreis, out itemNames, out itemHelps, out itemBattle);

            FF9TextToolAccessor.SetItemName(itemNames);
            FF9TextToolAccessor.SetItemHelpDesc(itemHelps);
            FF9TextToolAccessor.SetItemBattleDesc(itemBattle);
        }
Ejemplo n.º 12
0
        protected override Boolean LoadInternal()
        {
            String[] itemNames  = EmbadedSentenseLoader.LoadSentense(EmbadedTextResources.ItemNames);
            String[] itemHelps  = EmbadedSentenseLoader.LoadSentense(EmbadedTextResources.ItemHelps);
            String[] itemBattle = EmbadedSentenseLoader.LoadSentense(EmbadedTextResources.ItemBattle);

            FF9TextToolAccessor.SetItemName(itemNames);
            FF9TextToolAccessor.SetItemHelpDesc(itemHelps);
            FF9TextToolAccessor.SetItemBattleDesc(itemBattle);
            return(true);
        }
Ejemplo n.º 13
0
        protected override Boolean LoadInternal()
        {
            String[] itemNames = EmbadedSentenseLoader.LoadSentense(EmbadedTextResources.KeyItemNames);
            String[] itemHelps = EmbadedSentenseLoader.LoadSentense(EmbadedTextResources.KeyItemHelps);
            String[] itemDescs = EmbadedSentenseLoader.LoadSentense(EmbadedTextResources.KeyItemDescriptions);

            FF9TextToolAccessor.SetImportantItemName(itemNames);
            FF9TextToolAccessor.SetImportantItemHelpDesc(itemHelps);
            FF9TextToolAccessor.SetImportantSkinDesc(itemDescs);
            return(true);
        }
Ejemplo n.º 14
0
        protected override Boolean LoadInternal()
        {
            Int32  battleZoneId = FF9TextToolAccessor.GetBattleZoneId();
            String path         = EmbadedTextResources.GetCurrentPath("/Battle/" + battleZoneId + ".mes");

            String[] text = EmbadedSentenseLoader.LoadSentense(path);
            if (text != null)
            {
                FF9TextToolAccessor.SetBattleText(text);
            }
            return(true);
        }
Ejemplo n.º 15
0
        protected override Boolean LoadInternal()
        {
            Int32 fieldZoneId = FF9TextToolAccessor.GetFieldZoneId();

            String[] text;
            if (ReadEmbadedText(fieldZoneId, out text))
            {
                FF9TextToolAccessor.SetFieldText(text);
                FF9TextToolAccessor.SetTableText(FF9TextToolInterceptor.ExtractTableText(text));
            }

            return(true);
        }
Ejemplo n.º 16
0
        protected override Boolean LoadInternal()
        {
            String text = EmbadedSentenseLoader.LoadText(EmbadedTextResources.LocationNames);

            Dictionary <Int32, String> locationNames = FF9TextToolAccessor.GetLocationName();

            String[] array = text.Split('\r');
            for (Int32 i = 0; i < array.Length; i++)
            {
                String str = array[i];
                str = str.Replace("\n", String.Empty);
                if (!String.IsNullOrEmpty(str))
                {
                    String key   = str.Split(':')[0];
                    String value = str.Split(':')[1];
                    locationNames[Int32.Parse(key)] = FF9TextTool.RemoveOpCode(value);
                }
            }
            return(true);
        }
Ejemplo n.º 17
0
        private static IEnumerable InitializeBattleTextInternal()
        {
            Int32 battleZoneId = FF9TextToolAccessor.GetBattleZoneId();

            if (battleZoneId == -1)
            {
                PersistenSingleton <UIManager> .Instance.SetEventEnable(true);

                yield return(0);

                yield break;
            }

            FF9TextTool.IsLoading = true;

            foreach (var state in BattleImporter.LoadAsync())
            {
                yield return(state);
            }

            FF9TextTool.IsLoading = false;
            PersistenSingleton <UIManager> .Instance.SetEventEnable(true);
        }
Ejemplo n.º 18
0
        private static IEnumerable InitializeFieldTextInternal()
        {
            PersistenSingleton <UIManager> .Instance.SetEventEnable(false);

            Int32 fieldZoneId = FF9TextToolAccessor.GetFieldZoneId();

            if (fieldZoneId == -1)
            {
                PersistenSingleton <UIManager> .Instance.SetEventEnable(true);

                yield return(0);

                yield break;
            }

            FF9TextTool.IsLoading = true;

            foreach (var state in FieldImporter.LoadAsync())
            {
                yield return(state);
            }

            //TextLoader loader = new TextLoader("/Field/" + GetFieldTextFileName(fieldZoneId) + ".mes");
            //while (loader.Loading)
            //    yield return 0;

            //if (loader.Text != null)
            //{
            //    String source = TextOpCodeModifier.Modify(loader.Text);
            //    String[] text = ExtractSentense(source);
            //    FF9TextToolAccessor.SetFieldText(text);
            //    FF9TextToolAccessor.SetTableText(ExtractTableText(text));
            //}

            FF9TextTool.IsLoading = false;
            PersistenSingleton <UIManager> .Instance.SetEventEnable(true);
        }