Пример #1
0
        private void SwitchListExpandsButton_Click(object sender, EventArgs e)
        {
            int  selected = this.FilterComboBox.SelectedIndex;
            uint newCount = ItemForm.DataCount();

            if (this.L_0_COMBO.Items.Count <= 0)
            {
                return;
            }
            uint defAddr = U.FindComboSelectHexFromValueWhereName(this.L_0_COMBO, "-");

            if (defAddr == U.NOT_FOUND)
            {//見つからない場合、先頭の要素を利用します
                defAddr = U.atoh(this.L_0_COMBO.Items[0].ToString());
            }

            Undo.UndoData undodata = Program.Undo.NewUndoData(this, "ItemUsage SwitchExpands" + selected);
            switch (selected)
            {
            case 0:     //0=アイテムを利用できるか判定する
            default:
                PatchUtil.Switch2Expands(Program.ROM.RomInfo.item_usability_array_pointer()
                                         , Program.ROM.RomInfo.item_usability_array_switch2_address()
                                         , newCount
                                         , defAddr
                                         , undodata);
                break;

            case 1:     //1=アイテムを利用した場合の効果を定義する
                PatchUtil.Switch2Expands(Program.ROM.RomInfo.item_effect_array_pointer()
                                         , Program.ROM.RomInfo.item_effect_array_switch2_address()
                                         , newCount
                                         , defAddr
                                         , undodata);
                break;

            case 2:     //2=CCアイテムを使った場合の処理を定義する
                PatchUtil.Switch2Expands(Program.ROM.RomInfo.item_promotion1_array_pointer()
                                         , Program.ROM.RomInfo.item_promotion1_array_switch2_address()
                                         , newCount
                                         , defAddr
                                         , undodata);
                break;

            case 3:     //3=CCアイテムかどうかを定義する(FE7のみ)
                PatchUtil.Switch2Expands(Program.ROM.RomInfo.item_promotion2_array_pointer()
                                         , Program.ROM.RomInfo.item_promotion2_array_switch2_address()
                                         , newCount
                                         , defAddr
                                         , undodata);
                break;

            case 4:     //4=アイテムのターゲット選択の方法を定義する(多分)
                PatchUtil.Switch2Expands(Program.ROM.RomInfo.item_staff1_array_pointer()
                                         , Program.ROM.RomInfo.item_staff1_array_switch2_address()
                                         , newCount
                                         , defAddr
                                         , undodata);
                break;

            case 5:     //5=杖の種類を定義する
                PatchUtil.Switch2Expands(Program.ROM.RomInfo.item_staff2_array_pointer()
                                         , Program.ROM.RomInfo.item_staff2_array_switch2_address()
                                         , newCount
                                         , defAddr
                                         , undodata);
                break;

            case 6:     //6=ドーピングアイテムを利用した時のメッセージを定義する
                PatchUtil.Switch2Expands(Program.ROM.RomInfo.item_statbooster1_array_pointer()
                                         , Program.ROM.RomInfo.item_statbooster1_array_switch2_address()
                                         , newCount
                                         , defAddr
                                         , undodata);
                break;

            case 7:     //7=ドーピングアイテムとCCアイテムかどうかを定義する
                PatchUtil.Switch2Expands(Program.ROM.RomInfo.item_statbooster2_array_pointer()
                                         , Program.ROM.RomInfo.item_statbooster2_array_switch2_address()
                                         , newCount
                                         , defAddr
                                         , undodata);
                break;

            case 8:     //8=エラーメッセージを定義する
                PatchUtil.Switch2Expands(Program.ROM.RomInfo.item_errormessage_array_pointer()
                                         , Program.ROM.RomInfo.item_errormessage_array_switch2_address()
                                         , newCount
                                         , defAddr
                                         , undodata);
                break;

            case 9:     //9=アイテム名の前置詞を定義する
                PatchUtil.Switch2Expands(Program.ROM.RomInfo.item_name_article_pointer()
                                         , Program.ROM.RomInfo.item_name_article_switch2_address()
                                         , newCount
                                         , defAddr
                                         , undodata);
                break;
            }

            Program.Undo.Push(undodata);

            ReInit(selected, this.InputFormRef);
        }