Ejemplo n.º 1
0
        private void IndependenceButton_Click(object sender, EventArgs e)
        {
            if (this.AddressList.SelectedIndex < 0)
            {
                return;
            }
            uint   classid   = (uint)U.atoh(this.AddressList.Text);
            uint   classaddr = ClassForm.GetClassAddr(classid);
            string name      = U.ToHexString(classid) + " " + ClassForm.GetClassNameLow(classaddr);

            uint p       = InputFormRef.SelectToAddr(this.AddressList);
            uint setting = ClassForm.GetMoveCostPointerAddrLow(classaddr, (uint)this.FilterComboBox.SelectedIndex);

            if (setting == U.NOT_FOUND)
            {
                return;
            }

            Undo.UndoData undodata = Program.Undo.NewUndoData(this, "MoveCost Independence");
            PatchUtil.WriteIndependence(p, 68, setting, name, undodata);
            Program.Undo.Push(undodata);

            InputFormRef.ShowWriteNotifyAnimation(this, p);

            this.ReloadListButton.PerformClick();
            this.InputFormRef.JumpTo(classid);
        }
        private void IndependenceButton_Click(object sender, EventArgs e)
        {
            if (this.CLASS_LISTBOX.SelectedIndex < 0)
            {
                return;
            }
            uint   classid   = (uint)U.atoh(this.CLASS_LISTBOX.Text);
            uint   classaddr = ClassForm.GetClassAddr(classid);
            string name      = U.ToHexString(classid) + " " + ClassForm.GetClassNameLow(classaddr);

            uint pointer;
            uint currentP = ClassForm.GetBattleAnimeAddrWhereID(classid, out pointer);

            if (!U.isSafetyOffset(currentP))
            {
                return;
            }

            Undo.UndoData undodata = Program.Undo.NewUndoData(this, this.Name + " Independence");

            uint dataSize = (InputFormRef.DataCount + 1) * InputFormRef.BlockSize;

            PatchUtil.WriteIndependence(currentP, dataSize, pointer, name, undodata);
            Program.Undo.Push(undodata);

            InputFormRef.ShowWriteNotifyAnimation(this, currentP);

            U.ReSelectList(this.CLASS_LISTBOX);
        }
Ejemplo n.º 3
0
        static InputFormRef Init(MoveCostFE6Form self)
        {
            return(new InputFormRef(self
                                    , ""
                                    , Program.ROM.RomInfo.class_pointer()
                                    , Program.ROM.RomInfo.class_datasize()
                                    , (int i, uint addr) =>
            {    //読込最大値検索
                if (i == 0)
                {
                    return true;
                }
                uint no = Program.ROM.u8(addr + 4);
                return (no != 0);
            }
                                    , (int i, uint addr) =>
            {
                if (i == 0)
                {
                    return new U.AddrResult(0, "");
                }

                int filter = FilerFE6ToFE8(self.FilterComboBox.SelectedIndex);
                uint p = ClassForm.GetMoveCostAddrLow(addr, (uint)filter);
                if (p == 0)
                {
                    return new U.AddrResult();
                }
                string name = U.ToHexString(i) + " " + ClassForm.GetClassNameLow(addr);
                return new U.AddrResult(p, name);
            }
                                    ));
        }
Ejemplo n.º 4
0
        private void IndependenceButton_Click(object sender, EventArgs e)
        {
            if (this.ItemListBox.SelectedIndex < 0)
            {
                return;
            }

            uint   itemid   = (uint)U.atoh(this.ItemListBox.Text);
            uint   itemaddr = ItemForm.GetItemAddr(itemid);
            string name     = U.ToHexString(itemid) + " " + ClassForm.GetClassNameLow(itemaddr);

            uint pointer;
            uint currentP = ItemForm.GetEFFECTIVENESSPointerWhereID(itemid, out pointer);

            if (!U.isSafetyOffset(currentP))
            {
                return;
            }

            Undo.UndoData undodata = Program.Undo.NewUndoData(this, this.Name + " Independence");

            uint dataSize = (InputFormRef.DataCount + 1) * InputFormRef.BlockSize;

            PatchUtil.WriteIndependence(currentP, dataSize, pointer, name, undodata);
            Program.Undo.Push(undodata);

            InputFormRef.ShowWriteNotifyAnimation(this, currentP);

            ReselectItem(itemid);
        }
        private void IndependenceButton_Click(object sender, EventArgs e)
        {
            if (this.AddressList.SelectedIndex < 0)
            {
                return;
            }
            uint   classid   = (uint)U.atoh(this.AddressList.Text);
            uint   classaddr = ClassForm.GetClassAddr(classid);
            string name      = U.ToHexString(classid) + " " + ClassForm.GetClassNameLow(classaddr);

            uint setting = this.AssignLevelUpBaseAddress + (classid * 4);

            if (!U.isSafetyOffset(setting))
            {
                return;
            }

            uint p = Program.ROM.p32(setting);

            if (!U.isSafetyOffset(p))
            {
                return;
            }
            if (N1_InputFormRef.BaseAddress != p)
            {
                return;
            }
            if (N1_InputFormRef.DataCount == 0)
            {
                DialogResult dr = R.ShowNoYes("リストが0件です。\r\n空のリストを分離させても意味がないのですが、それでも分離独立させますか?");
                if (dr != DialogResult.Yes)
                {
                    return;
                }
            }

            Undo.UndoData undodata = Program.Undo.NewUndoData(this, this.Name + " Independence");

            uint dataSize = (N1_InputFormRef.DataCount + 1) * N1_InputFormRef.BlockSize;

            PatchUtil.WriteIndependence(p, dataSize, setting, name, undodata);
            Program.Undo.Push(undodata);

            InputFormRef.ShowWriteNotifyAnimation(this, p);

            this.ReloadListButton.PerformClick();
            this.InputFormRef.JumpTo(classid);
        }