Beispiel #1
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);
            }
        }
Beispiel #2
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);
        }
        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);
        }