コード例 #1
0
        protected override Boolean LoadInternal()
        {
            Int32 fieldZoneId = FF9TextTool.FieldZoneId;

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

            return(true);
        }
コード例 #2
0
        protected override Boolean LoadExternal()
        {
            try
            {
                if (!_initialized)
                {
                    return(false);
                }

                Int32 fieldZoneId = FF9TextTool.FieldZoneId;

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

                if (result != null)
                {
                    // new
                    String fieldZoneName = GetZoneName(fieldZoneId);
                    IList <KeyValuePair <String, TextReplacement> > filedTags;
                    if (_fieldTags.TryGetValue(fieldZoneName, out filedTags))
                    {
                        for (Int32 i = 0; i < result.Length; i++)
                        {
                            result[i] = result[i].ReplaceAll(filedTags, _customTags);
                        }
                    }
                    else
                    {
                        for (Int32 i = 0; i < result.Length; i++)
                        {
                            result[i] = result[i].ReplaceAll(_customTags);
                        }
                    }

                    FF9TextTool.SetFieldText(result);
                    FF9TextTool.SetTableText(FF9TextTool.ExtractTableText(result));
                }

                return(true);
            }
            catch (Exception ex)
            {
                _initialized = true;
                Log.Error(ex, $"[{TypeName}] Failed to import resource.");
                return(false);
            }
        }