Ejemplo n.º 1
0
        private Dictionary<int, string> ReadOffsetText(Mother3Rom rom, int tableOffset, int textOffset, bool dialog)
        {
            Mother3Reader reader = new Mother3Reader(rom);

            reader.Position = tableOffset;
            int[] pointers = reader.ReadMiniOffsetTable(textOffset);

            Dictionary<int, string> text = new Dictionary<int, string>();

            for (int i = 0; i < pointers.Length; i++)
            {
                reader.Position = pointers[i];

                if (pointers[i] != 0)
                {
                    if (dialog)
                    {
                        text.Add(i, reader.ReadDialogString());
                    }
                    else
                    {
                        text.Add(i, reader.ReadCodedString());
                    }
                }
            }

            return text;
        }