示例#1
0
        private void LoadAgentToControls(Dhrakk.Game.DWAgent Agent)
        {
            CurrentAgent = Agent;

            //Handle the checkboxes down at the bottom.
            foreach (object FlowAgent in flowLayoutAgents.Controls)
            {
                if (FlowAgent is Dhrakk.Game.DWAgent.DWAgentCheckbox)
                {
                    if (!((Dhrakk.Game.DWAgent.DWAgentCheckbox)FlowAgent).ParentAgent.Equals(CurrentAgent))
                    {
                        ((Dhrakk.Game.DWAgent.DWAgentCheckbox)FlowAgent).Checked = false;
                    }
                }
            }

            Agent.AgentControl.Checked = true;

            //Start moving the data from the class to the controls.
            txtAgentName.Text = Agent.Name;

            BindingSource bsChars = new BindingSource();

            grdCharacteristics.DataSource = bsChars;
            foreach (Dhrakk.Game.DWAgent.DWAgentCharacteristic DWAC in Agent.Characteristics)
            {
                bsChars.Add(DWAC);
            }

            UpdateStatusBar();
        }
示例#2
0
        private void ClearControls()
        {
            CurrentAgent = new Dhrakk.Game.DWAgent("Cleaning up...");

            //Controls on the Agent Tab.
            txtAgentName.Text = "";
            lblRank.Text      = "";

            CurrentAgent = null;
        }
示例#3
0
        private void SetFormState(FormState FS)
        {
            switch (FS)
            {
            case FormState.Fresh:

                flowLayoutAgents.Controls.Clear();

                CurrentAgent = null;

                newAgentToolStripMenuItem.Enabled     = false;
                saveKillTeamToolStripMenuItem.Enabled = false;

                if (!tabControl.TabPages.Contains(tabWelcome))
                {
                    tabControl.TabPages.Insert(0, tabWelcome);
                }

                tabWelcome.Focus();

                CurrentFormState = FormState.Fresh;

                ClearControls();

                break;

            case FormState.Stale:
                UnloadWelcome();
                newAgentToolStripMenuItem.Enabled     = true;
                saveKillTeamToolStripMenuItem.Enabled = true;

                CurrentFormState = FormState.Stale;
                break;

            case FormState.Debug:

                CurrentFormState = FormState.Debug;
                break;
            }
        }
示例#4
0
 private void CreateNewAgent()
 {
     Dhrakk.Game.DWAgent newAgent = Dhrakk.Game.CurrentInstance.CreateNewAgent("New Agent");
     flowLayoutAgents.Controls.Add(newAgent.AgentControl);
     LoadAgentToControls(newAgent);
 }