Exemple #1
0
        void UpdateItemDropLabel()
        {
            uint unit_id  = (uint)this.B0.Value;
            uint class_id = (uint)this.B1.Value;

            if (unit_id > 0)
            {
                unit_id--;
            }
            uint unit_addr  = UnitForm.GetUnitAddr(unit_id);
            uint class_addr = ClassForm.GetClassAddr(class_id);

            bool isItemDrop =
                IsItemDropFlag(unit_addr) || IsItemDropFlag(class_addr);

            if (isItemDrop)
            {//アイテムドロップ
                X_ITEMDROP.Text      = R._("アイテムドロップ: ドロップする");
                X_ITEMDROP.ForeColor = OptionForm.Color_ControlComment_ForeColor();
            }
            else
            {
                X_ITEMDROP.Text      = R._("アイテムドロップ: ドロップしない");
                X_ITEMDROP.ForeColor = OptionForm.Color_Control_ForeColor();
            }
        }
        private void IndependenceButton_Click(object sender, EventArgs e)
        {
            if (this.AddressList.SelectedIndex < 0)
            {
                return;
            }
            uint   unitid   = (uint)U.atoh(this.AddressList.Text);
            uint   unitaddr = UnitForm.GetUnitAddr(unitid);
            string name     = U.ToHexString(unitid) + " " + UnitForm.GetUnitNameByAddr(unitaddr);

            uint setting = this.AssignLevelUpBaseAddress + (unitid * 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(unitid);
        }
Exemple #3
0
        public static int MakeUnitSkillButtons(uint uid, Button[] buttons, ToolTipEx tooltip)
        {
            uint unitAddr = UnitForm.GetUnitAddr(uid - 1);

            if (unitAddr == U.NOT_FOUND)
            {
                return(0);
            }
            uint b38 = Program.ROM.u8(unitAddr + 38); //自軍
            uint b39 = Program.ROM.u8(unitAddr + 39); //友軍
            uint b49 = Program.ROM.u8(unitAddr + 49); //敵軍

            if (b38 <= 0 && b39 <= 0 && b49 <= 0)
            {//なし
                return(0);
            }

            uint[] pointer = FindSkillFE8NVer2IconPointers();
            if (pointer == null)
            {
                return(0);
            }
            if (g_SkillBaseAddress == 0)
            {
                return(0);
            }

            InputFormRef InputFormRef    = Init(null);
            InputFormRef N1_InputFormRef = N1_Init(null);

            int skillCount           = 0;
            List <U.AddrResult> list = InputFormRef.MakeList();

            for (int i = 1; i < list.Count; i++)
            {
                if (b38 == i || b39 == i || b49 == i)
                {
                    uint   textid = Program.ROM.u16(list[i].addr + 0);
                    string name   = TextForm.Direct(textid);

                    if (b38 == i)
                    {
                        name += "\r\n" + R._("(自軍時のみ)");
                    }
                    if (b39 == i)
                    {
                        name += "\r\n" + R._("(敵軍時のみ)");
                    }
                    if (b49 == i)
                    {
                        name += "\r\n" + R._("(友軍時のみ)");
                    }

                    buttons[skillCount].BackgroundImage = DrawSkillIconLow((uint)i);
                    buttons[skillCount].Tag             = (uint)i;
                    tooltip.SetToolTip(buttons[skillCount], name);
                    skillCount++;
                    if (skillCount >= buttons.Length)
                    {
                        break;
                    }
                }
            }

            return(skillCount);
        }