示例#1
0
文件: Build.cs 项目: pkmnfrk/mm-rando
        private void WriteLinkAppearance()
        {
            if (cLink.SelectedIndex == 0)
            {
                WriteTunicColour();
            }
            else if (cLink.SelectedIndex < 4)
            {
                int          i   = cLink.SelectedIndex;
                BinaryReader b   = new BinaryReader(File.Open(ObjsDir + "link-" + i.ToString(), FileMode.Open));
                byte[]       obj = new byte[b.BaseStream.Length];
                b.Read(obj, 0, obj.Length);
                b.Close();
                if (i < 3)
                {
                    WriteTunicColour(obj, i);
                }
                ;
                ROMFuncs.ApplyHack(ModsDir + "fix-link-" + i.ToString());
                ROMFuncs.InsertObj(obj, 0x11);
                if (i == 3)
                {
                    b   = new BinaryReader(File.Open(ObjsDir + "kafei", FileMode.Open));
                    obj = new byte[b.BaseStream.Length];
                    b.Read(obj, 0, obj.Length);
                    b.Close();
                    WriteTunicColour(obj, i);
                    ROMFuncs.InsertObj(obj, 0x1C);
                    ROMFuncs.ApplyHack(ModsDir + "fix-kafei");
                }
                ;
            }
            ;
            List <int[]> Others = ROMFuncs.GetAddresses(AddrsDir + "tunic-forms");

            ROMFuncs.UpdateFormTunics(Others, bTunic.BackColor);
        }
示例#2
0
        private void WriteLinkAppearance()
        {
            if (Settings.Character == Character.LinkMM)
            {
                WriteTunicColour();
            }
            else if (Settings.Character == Character.LinkOOT ||
                     Settings.Character == Character.AdultLink ||
                     Settings.Character == Character.Kafei)
            {
                int          characterIndex = (int)Settings.Character;
                BinaryReader b   = new BinaryReader(File.Open(ObjsDirectory + "link-" + characterIndex.ToString(), FileMode.Open));
                byte[]       obj = new byte[b.BaseStream.Length];
                b.Read(obj, 0, obj.Length);
                b.Close();
                if (characterIndex < 3)
                {
                    WriteTunicColour(obj, characterIndex);
                }

                ROMFuncs.ApplyHack(ModsDirectory + "fix-link-" + characterIndex.ToString());
                ROMFuncs.InsertObj(obj, 0x11);
                if (characterIndex == 3)
                {
                    b   = new BinaryReader(File.Open(ObjsDirectory + "kafei", FileMode.Open));
                    obj = new byte[b.BaseStream.Length];
                    b.Read(obj, 0, obj.Length);
                    b.Close();
                    WriteTunicColour(obj, characterIndex);
                    ROMFuncs.InsertObj(obj, 0x1C);
                    ROMFuncs.ApplyHack(ModsDirectory + "fix-kafei");
                }
            }
            List <int[]> Others = ROMFuncs.GetAddresses(AddrsDirectory + "tunic-forms");

            ROMFuncs.UpdateFormTunics(Others, Settings.TunicColor);
        }