예제 #1
0
        public bool AddCharWindow(CharWindow _charWindow)
        {
            if (this.InvokeRequired)
            {
                return((bool)this.Invoke((Func <CharWindow, bool>)AddCharWindow, _charWindow));
            }

            flowLayoutPanel1.Controls.Add(_charWindow);
            flowLayoutPanel1.SetFlowBreak(_charWindow, true);
            return(true);
        }
예제 #2
0
        public bool RemoveCharWindow(CharWindow _charWindow)
        {
            if (this.InvokeRequired)
            {
                return((bool)this.Invoke((Func <CharWindow, bool>)RemoveCharWindow, _charWindow));
            }

            if (flowLayoutPanel1.Controls.Contains(_charWindow))
            {
                flowLayoutPanel1.Controls.Remove(_charWindow);
            }
            return(true);
        }
예제 #3
0
파일: Character.cs 프로젝트: keksdude/test
        public Character(Client _parentClient)
        {
            this._parentClient = _parentClient;
            _processHandle     = OpenProcess(PROCESS_WM_READ + PROCESS_WM_WRITE, false, _parentClient.Process.Id);

            DataSet _dsName  = new DataSet(MemoryAddresses.MemoryDic["name"].Address, _processHandle, 1000, MemoryAddresses.MemoryDic["name"].Bytecount);
            DataSet _dsHp    = new DataSet(MemoryAddresses.MemoryDic["hp"].Address, _processHandle, 100, MemoryAddresses.MemoryDic["hp"].Bytecount);
            DataSet _dsMaxHp = new DataSet(MemoryAddresses.MemoryDic["maxhp"].Address, _processHandle, 100, MemoryAddresses.MemoryDic["maxhp"].Bytecount);
            DataSet _dsSp    = new DataSet(MemoryAddresses.MemoryDic["sp"].Address, _processHandle, 1000, MemoryAddresses.MemoryDic["sp"].Bytecount);
            DataSet _dsMaxSp = new DataSet(MemoryAddresses.MemoryDic["maxsp"].Address, _processHandle, 1000, MemoryAddresses.MemoryDic["maxsp"].Bytecount);
            DataSet _dsJob   = new DataSet(MemoryAddresses.MemoryDic["job"].Address, _processHandle, 1000, MemoryAddresses.MemoryDic["job"].Bytecount);
            DataSet _dsBLvl  = new DataSet(MemoryAddresses.MemoryDic["blvl"].Address, _processHandle, 1000, MemoryAddresses.MemoryDic["blvl"].Bytecount);
            DataSet _dsJLvl  = new DataSet(MemoryAddresses.MemoryDic["jlvl"].Address, _processHandle, 1000, MemoryAddresses.MemoryDic["jlvl"].Bytecount);
            DataSet _dsX     = new DataSet(MemoryAddresses.MemoryDic["x"].Address, _processHandle, 1000, MemoryAddresses.MemoryDic["x"].Bytecount);
            DataSet _dsY     = new DataSet(MemoryAddresses.MemoryDic["y"].Address, _processHandle, 1000, MemoryAddresses.MemoryDic["y"].Bytecount);


            _buffs   = new Buffs(_processHandle);
            _toolbar = new Toolbar(_processHandle);
            _exp     = new Exp(_processHandle);

            _dsName.Changed  += DsNameChange;
            _dsJob.Changed   += DsJob_Changed;
            _dsHp.Changed    += DsHp_Changed;
            _dsMaxHp.Changed += DsMaxHp_Changed;
            _dsSp.Changed    += DsSp_Changed;
            _dsMaxSp.Changed += DsMaxSp_Changed;

            _dsX.Changed    += DsX_Changed;
            _dsY.Changed    += DsY_Changed;
            _dsBLvl.Changed += DsBLvl_Changed;
            _dsJLvl.Changed += DsJlvl_Changed;

            _exp.ExpPerHourChanged += ExpPerHour_Changed;

            _charWindow = new CharWindow();
            _charWindow.buttonResetExp.Click += CharWindowResetExp_Click;
            _charWindow.buttonAddTask.Click  += CharWindowAddTask_Click;



            //Program.GUI.Shown += GUI_Shown;

            DsNameChange(_dsName);
            DsJob_Changed(_dsJob);
            DsHp_Changed(_dsHp);
            DsMaxHp_Changed(_dsMaxHp);
            DsSp_Changed(_dsSp);
            DsMaxSp_Changed(_dsMaxSp);
            DsBLvl_Changed(_dsBLvl);
            DsJlvl_Changed(_dsJLvl);

            _availableDBTasks = TaskDB.GetTaskListByJob(_job);
            List <TaskDBEntry> _toAddDBTasks  = new List <TaskDBEntry>();
            Profile            _loadedProfile = ProfileDB.GetProfile(this._name);

            if (_loadedProfile != null)
            {
                foreach (string _string in _loadedProfile.TaskDBNames)
                {
                    foreach (TaskDBEntry _dbtask in  _availableDBTasks)
                    {
                        if (_dbtask.Name == _string)
                        {
                            _toAddDBTasks.Add(_dbtask);
                        }
                    }
                }

                foreach (TaskDBEntry _dbtask in _toAddDBTasks)
                {
                    _availableDBTasks.Remove(_dbtask);
                    this.AddTask(_dbtask);
                }
            }


            _charWindow.comboBoxTasks.DataSource    = _availableDBTasks;
            _charWindow.comboBoxTasks.DisplayMember = "TaskName";

            Program.GUI.AddCharWindow(_charWindow);
        }