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(); }
private void ClearControls() { CurrentAgent = new Dhrakk.Game.DWAgent("Cleaning up..."); //Controls on the Agent Tab. txtAgentName.Text = ""; lblRank.Text = ""; CurrentAgent = null; }
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; } }
private void CreateNewAgent() { Dhrakk.Game.DWAgent newAgent = Dhrakk.Game.CurrentInstance.CreateNewAgent("New Agent"); flowLayoutAgents.Controls.Add(newAgent.AgentControl); LoadAgentToControls(newAgent); }