private void InitializeCompanyFlowPanel(FlowLayoutPanel panel, IEnumerable<ICompanyInfo> companies) { foreach (ICompanyInfo company in companies) { Button button = new Button(); button.FlatStyle = FlatStyle.Flat; button.BackColor = Color.GhostWhite; button.Text = company.NickName; button.Width = 270; button.Height = 60; button.Font = new Font(button.Font.FontFamily, 20); button.Margin = new Padding(5); button.Click += new EventHandler((object e, EventArgs e1) => { SelectedCompany = company; SelectedCompanyButton = button; }); panel.Controls.Add(button); panel.MouseEnter += new EventHandler((object e, EventArgs e1) => { panel.Focus(); }); panel.FlowDirection = FlowDirection.LeftToRight; panel.AutoScroll = true; } }
private void UpdateControls() { // tosses the character information relevant to each character #region Condition Monitor ConditionMonitorUserControl uc = this.tabControl.TabPages[(int)DashBoardPages.CM].Controls[0] as ConditionMonitorUserControl; uc.MaxPhysical = this.CurrentNPC.PhysicalCM; uc.MaxStun = this.CurrentNPC.StunCM; uc.Physical = uc.MaxPhysical; uc.Stun = uc.MaxStun; #endregion #region Skill tab FlowLayoutPanel panel = new FlowLayoutPanel(); foreach (Skill skill in this.CurrentNPC.Skills) { if (skill.KnowledgeSkill) continue; // improvement for knowledge skills goes here // insert new skill control SmallSkillControl ucSkill = new SmallSkillControl(this); ucSkill.Skill = skill; ucSkill.DiceClick += DiceClick_Clicked; // add the skill to the collection of skills to show panel.Controls.Add(ucSkill); } panel.Dock = DockStyle.Fill; panel.AutoScroll = true; panel.MouseEnter += (object sender, EventArgs e) => { panel.Focus(); }; this.tabControl.TabPages[(int)DashBoardPages.Skills].Controls.Add(panel); #endregion #region Dice Roller DiceRollerControl dice = this.tabControl.TabPages[(int)DashBoardPages.Dice].Controls[0] as DiceRollerControl; //dice.NumberOfEdge = this.CurrentNPC.EDG; // todo figure out number of edge dice #endregion }
private void UpdateControls() { if (CurrentNPC == null) return; // tosses the character information relevant to each character #region Condition Monitor ConditionMonitorUserControl uc = this.tabControl.TabPages[(int) DashBoardPages.CM].Controls[0] as ConditionMonitorUserControl; uc.MaxPhysical = this.CurrentNPC.PhysicalCM; uc.MaxStun = this.CurrentNPC.StunCM; uc.Physical = CurrentNPC.PhysicalCMFilled; uc.Stun = CurrentNPC.StunCMFilled; uc.Modifier = CurrentNPC.DamageInitModifier; uc.MaxOverflow = CurrentNPC.CMOverflow; #endregion #region Skill tab this.tabControl.TabPages[(int) DashBoardPages.Skills].Controls.Clear(); FlowLayoutPanel panel = new FlowLayoutPanel(); foreach (ISkill skill in this.CurrentNPC.Skills.Where(s => s.Rating > 0)) { if (skill.KnowledgeSkill) continue; // improvement for knowledge skills goes here // insert new skill control SmallSkillControl ucSkill = new SmallSkillControl(this); ucSkill.Skill = skill; ucSkill.DiceClick += DiceClick_Clicked; // add the skill to the collection of skills to show panel.Controls.Add(ucSkill); } panel.Dock = DockStyle.Fill; panel.AutoScroll = true; panel.MouseEnter += (object sender, EventArgs e) => { panel.Focus(); }; this.tabControl.TabPages[(int) DashBoardPages.Skills].Controls.Add(panel); #endregion #region Dice Roller // todo figure out number of edge dice #endregion #region Spelltab this.tabControl.TabPages[(int)DashBoardPages.Spells].Controls.Clear(); FlowLayoutPanel spellPanel = new FlowLayoutPanel(); foreach (Spell spell in this.CurrentNPC.Spells.OrderBy(s=>s.Category)) { //get a new spellcontroll var ucSpell = GetSmallSpellControl(spell); LanguageManager.Instance.Load(GlobalOptions.Instance.Language,ucSpell); // add the skill to the collection of skills to show spellPanel.Controls.Add(ucSpell); } spellPanel.Dock = DockStyle.Fill; spellPanel.AutoScroll = true; spellPanel.MouseEnter += (object sender, EventArgs e) => { panel.Focus(); }; this.tabControl.TabPages[(int)DashBoardPages.Spells].Controls.Add(spellPanel); #endregion LanguageManager.Instance.Load(GlobalOptions.Instance.Language,this); }