Beispiel #1
0
        private void frmRoleInfo_Load(object sender, EventArgs e)
        {
            this.Icon = ComLib.GetIcon(Properties.Resources.Role);

            this.TopMost = GlobalSpecs.TopMost;

            _RoleInfo.FillData();

            LoadBigFace(RoleLib.GetFace(_RoleInfo.M08_人物肖像职业));

            LoadMiniFace(RoleLib.GetMiniFace(_RoleInfo.M08_人物肖像职业, _RoleInfo.M04_人物方向));

            SetFormValue();
        }
Beispiel #2
0
 private void FillFlowLayoutPanel(FlowLayoutPanel panel, List <Role> roleList)
 {
     for (int i = 0; i < roleList.Count; i++)
     {
         PictureBox facePic = new PictureBox();
         facePic.Image        = RoleLib.GetFace(roleList[i].M08_人物肖像职业);
         facePic.Location     = new Point(3, 3);
         facePic.Name         = "face";
         facePic.Size         = new Size(128, 100);
         facePic.Tag          = roleList[i];
         facePic.TabIndex     = 0;
         facePic.TabStop      = false;
         facePic.DoubleClick += FacePic_DoubleClick;
         panel.Controls.Add(facePic);
     }
 }
Beispiel #3
0
        private bool WriteAction(CheckBox pData, MemoryData pMemory)
        {
            bool WriteSuccess = false;

            if (pData.Checked != (RoleLib.GetState(pMemory) == RoleState.has))
            {
                int lState = pData.Checked ? GlobalConst.Acion_Moved : GlobalConst.Acion_nonMoved;
                WriteSuccess = Win32Lib.WriteMemory(pMemory.Address, lState, 1);
                if (WriteSuccess == false)
                {
                    MessageBox.Show("写入失败");
                    return(false);
                }
            }
            return(true);
        }
Beispiel #4
0
        private void SetItem(CheckBox stateChkBox, TextBox itemTextBox, MemoryData stateMemory, MemoryData itemMemory)
        {
            ItemEquip equip = RoleLib.GetEquip(stateMemory);

            stateChkBox.Checked = equip == ItemEquip.Equip;
            if (equip != ItemEquip.Non)
            {
                itemTextBox.Text = RoleLib.GetItem(itemMemory).Name;
                itemTextBox.Tag  = itemMemory.HexVal;
            }
            else
            {
                itemTextBox.Text = "";
                itemTextBox.Tag  = null;
            }
        }
Beispiel #5
0
 private void SaveOneItem(CheckBox pUsed, TextBox pItem, MemoryData pMemoryUsed, MemoryData pMemoryItem)
 {
     if (pItem.Text == "")
     {
         Win32Lib.WriteMemory(pMemoryUsed.Address, GlobalConst.Item_nonState, 1);
         Win32Lib.WriteMemory(pMemoryItem.Address, GlobalConst.Item_nonItem, 1);
     }
     else
     {
         ItemInfo item = RoleLib.GetItem(pItem.Text);
         Win32Lib.WriteMemory(pMemoryItem.Address, Convert.ToInt32(item.Code, 16), 1);
         if (pUsed.Checked)
         {
             Win32Lib.WriteMemory(pMemoryUsed.Address, GlobalConst.Item_Equiped, 1);
         }
         else
         {
             Win32Lib.WriteMemory(pMemoryUsed.Address, GlobalConst.Item_nonEquiped, 1);
         }
     }
 }
Beispiel #6
0
        private void SetFormValue()
        {
            #region title Info
            txtX.Text    = _RoleInfo.M01_X.Value;
            txtY.Text    = _RoleInfo.M02_Y.Value;
            labJob.Text  = RoleLib.GetJob(_RoleInfo.M33_职业).Name;
            labRace.Text = RoleLib.GetRace(_RoleInfo.M32_人种).Name;
            RoleNameInfo roleName = RoleLib.GetRoleName(_RoleInfo.M08_人物肖像职业);
            labName.Text    = roleName == null? _RoleInfo.M08_人物肖像职业.HexVal: roleName.Name;
            labRoleJob.Text = roleName == null ? _RoleInfo.M08_人物肖像职业.Value : roleName.Job;
            switch (RoleLib.GetCamp(_RoleInfo.M07_人物阵营))
            {
            case RoleCamp.Enemy:
                labCamp.Text = "(敌人)";
                break;

            case RoleCamp.NPC:
                labCamp.Text = "(NPC)";
                break;

            case RoleCamp.Ally:
                labCamp.Text = "(己方)";
                break;

            default:
                break;
            }

            //txtM03.Text = _RoleInfo.M03_人物图形.Value;
            //txtM04.Text = _RoleInfo.M04_人物方向.Value;
            //txtM07.Text = _RoleInfo.M07_人物阵营.Value;
            //txtM08.Text = _RoleInfo.M08_人物肖像职业.Value;
            //txtM09.Text = _RoleInfo.M09_人物名字.Value;
            #endregion

            #region basic info
            SetOneTxtItem(txtNowHP, _RoleInfo.M47_HP);
            SetOneTxtItem(txtMaxHP, _RoleInfo.M48_MaxHP);
            SetOneTxtItem(txtNowMP, _RoleInfo.M49_MP);
            SetOneTxtItem(txtMaxMP, _RoleInfo.M50_MaxMp);
            SetOneTxtItem(txtLV, _RoleInfo.M34_等级);
            SetOneTxtItem(txtMV, _RoleInfo.M44_移动);
            SetOneTxtItem(txtEx, _RoleInfo.M45_经验);
            SetOneTxtItem(txtBaseAP, _RoleInfo.M42_基本AP);
            SetOneTxtItem(txtBaseDP, _RoleInfo.M43_基本DP);
            SetOneTxtItem(txtDx, _RoleInfo.M46_DX);
            SetOneTxtItem(txtEv, _RoleInfo.M54_EV);
            SetOneTxtItem(txtAP, _RoleInfo.M51_AP);
            SetOneTxtItem(txtHit, _RoleInfo.M53_HIT);
            SetOneTxtItem(txtDP, _RoleInfo.M52_DP);

            txtPoison.Text    = _RoleInfo.M38_中毒.IntVal == 0 ? "" : _RoleInfo.M38_中毒.Value;
            txtParalysis.Text = _RoleInfo.M39_麻痹.IntVal == 0 ? "" : _RoleInfo.M39_麻痹.Value;
            txtCurse.Text     = _RoleInfo.M40_禁咒.IntVal == 0 ? "" : _RoleInfo.M40_禁咒.Value;
            chkAction.Checked = ComLib.GetAction(int.Parse(_RoleInfo.M06_是否可动.Value));
            #endregion

            #region Items
            SetItem(chkItem1, txtItem1, _RoleInfo.M11_物品1状态, _RoleInfo.M12_物品1);
            SetItem(chkItem2, txtItem2, _RoleInfo.M13_物品2状态, _RoleInfo.M14_物品2);
            SetItem(chkItem3, txtItem3, _RoleInfo.M15_物品3状态, _RoleInfo.M16_物品3);
            SetItem(chkItem4, txtItem4, _RoleInfo.M17_物品4状态, _RoleInfo.M18_物品4);
            SetItem(chkItem5, txtItem5, _RoleInfo.M19_物品5状态, _RoleInfo.M20_物品5);
            SetItem(chkItem6, txtItem6, _RoleInfo.M21_物品6状态, _RoleInfo.M22_物品6);
            SetItem(chkItem7, txtItem7, _RoleInfo.M23_物品7状态, _RoleInfo.M24_物品7);
            SetItem(chkItem8, txtItem8, _RoleInfo.M25_物品8状态, _RoleInfo.M26_物品8);
            #endregion

            #region Magic
            List <string> tMagicList;
            int[]         pMagicCode = { _RoleInfo.M27_法术1.IntVal,
                                         _RoleInfo.M28_法术2.IntVal,
                                         _RoleInfo.M29_法术3.IntVal,
                                         _RoleInfo.M30_法术4.IntVal,
                                         _RoleInfo.M31_法术5.IntVal };
            tMagicList = MagicLib.GetMagicName(pMagicCode);
            listBoxMagic.DataSource = tMagicList.Select(item => new { Name = item }).ToList();
            #endregion
        }