/// <summary> /// This method prepares the list variables and adds existing controls to them to help with localization and management. /// </summary> private void PrepareUI() { // NumericUpDownExts #region Add NumericUpDownExts to Dictionary updControls.Add(this.updB00, "Strength_BaseTypeE"); updControls.Add(this.updB01, "Speed_BaseTypeE"); updControls.Add(this.updB02, "Agility_BaseTypeE"); updControls.Add(this.updB03, "Endurance_BaseTypeE"); updControls.Add(this.updB04, "Health_BaseTypeE"); updControls.Add(this.updB05, "Charisma_BaseTypeE"); updControls.Add(this.updB06, "Intelligence_BaseTypeE"); updControls.Add(this.updB07, "Willpower_BaseTypeE"); updControls.Add(this.updB08, "Astral_BaseTypeE"); updControls.Add(this.updB09, "Perception_BaseTypeE"); updControls.Add(this.updB10, "Initiative_BaseTypeA"); updControls.Add(this.updB11, "Attack_BaseTypeA"); updControls.Add(this.updB12, "Defense_BaseTypeA"); updControls.Add(this.updB13, "Aim_BaseTypeA"); updControls.Add(this.updB14, "CMperLevel_BaseTypeB"); updControls.Add(this.updB15, "HP_BaseTypeC"); updControls.Add(this.updB16, "PR_BaseTypeC"); updControls.Add(this.updB17, "PRperLevel_BaseTypeB"); updControls.Add(this.updB18, "KP_BaseTypeB"); updControls.Add(this.updB19, "KPperLevel_BaseTypeB"); updControls.Add(this.updM00, "InitiativeCM_BaseTypeA"); updControls.Add(this.updM01, "AttackCM_BaseTypeA"); updControls.Add(this.updM02, "DefenseCM_BaseTypeA"); updControls.Add(this.updM03, "AimCM_BaseTypeA"); updControls.Add(this.updCharLevel, "CharLevel_BaseTypeC"); updControls.Add(this.updCharAge, "CharAge_BaseTypeD"); #endregion #region Setup NumericUpDownExt Properties foreach (var entry in updControls) { string updType = System.Text.RegularExpressions.Regex.Replace(entry.Value, @"^.*?(?=_)_", ""); NumericUpDownExt upd = entry.Key; switch (updType) { case "BaseTypeA": { upd.Maximum = 100; upd.Minimum = 0; upd.Value = 0; } break; case "BaseTypeB": { upd.Maximum = 20; upd.Minimum = 0; upd.Value = 0; } break; case "BaseTypeC": { upd.Maximum = 20; upd.Minimum = 1; upd.Value = 1; } break; case "BaseTypeD": { upd.Maximum = 30; upd.Minimum = 16; upd.Value = 18; } break; case "BaseTypeE": default: { upd.Maximum = 20; upd.Minimum = 3; upd.Value = 12; } break; } } #endregion // Labels #region Add Text Labels to Dictionary textLabels.Add("Strength", this.lblMAT00); textLabels.Add("Speed", this.lblMAT01); textLabels.Add("Agility", this.lblMAT02); textLabels.Add("Endurance", this.lblMAT03); textLabels.Add("Health", this.lblMAT04); textLabels.Add("Charisma", this.lblMAT05); textLabels.Add("Intelligence", this.lblMAT06); textLabels.Add("Willpower", this.lblMAT07); textLabels.Add("Astral", this.lblMAT08); textLabels.Add("Perception", this.lblMAT09); textLabels.Add("Initiative", this.lblMAT10); textLabels.Add("Attack", this.lblMAT11); textLabels.Add("Defense", this.lblMAT12); textLabels.Add("Aim", this.lblMAT13); textLabels.Add("CMperLevel", this.lblMAT14); textLabels.Add("HP", this.lblMAT15); textLabels.Add("PR", this.lblMAT16); textLabels.Add("PRperLevel", this.lblMAT17); textLabels.Add("KP", this.lblMAT18); textLabels.Add("KPperLevel", this.lblMAT19); textLabels.Add("Actual00", this.lblAT00); textLabels.Add("Actual01", this.lblAT01); textLabels.Add("Actual02", this.lblAT02); textLabels.Add("Actual03", this.lblAT03); textLabels.Add("Actual04", this.lblAT04); textLabels.Add("Actual05", this.lblAT05); textLabels.Add("Actual06", this.lblAT06); textLabels.Add("Actual07", this.lblAT07); textLabels.Add("Actual08", this.lblAT08); textLabels.Add("Actual09", this.lblAT09); textLabels.Add("Actual10", this.lblAT10); textLabels.Add("Actual11", this.lblAT11); textLabels.Add("Actual12", this.lblAT12); textLabels.Add("Actual13", this.lblAT13); textLabels.Add("Remaining", this.lblAT14); textLabels.Add("Actual14", this.lblAT15); textLabels.Add("Actual15", this.lblAT16); textLabels.Add("Actual16", this.lblAT17); textLabels.Add("Actual17", this.lblAT18); textLabels.Add("Actual18", this.lblAT19); textLabels.Add("Ccp00", this.lblCT00); textLabels.Add("Ccp01", this.lblCT01); textLabels.Add("Ccp02", this.lblCT02); textLabels.Add("Ccp03", this.lblCT03); textLabels.Add("Ccp04", this.lblCT04); textLabels.Add("Ccp05", this.lblCT05); textLabels.Add("Ccp06", this.lblCT06); textLabels.Add("Ccp07", this.lblCT07); textLabels.Add("Ccp08", this.lblCT08); textLabels.Add("Ccp09", this.lblCT09); textLabels.Add("Ccp10", this.lblCT10); textLabels.Add("Ccp11", this.lblCT11); textLabels.Add("Ccp12", this.lblCT12); textLabels.Add("Ccp13", this.lblCT13); textLabels.Add("Ccp14", this.lblCT14); textLabels.Add("Ccp15", this.lblCT15); textLabels.Add("Ccp16", this.lblCT16); textLabels.Add("Ccp17", this.lblCT17); textLabels.Add("Ccp18", this.lblCT18); textLabels.Add("Ccp19", this.lblCT19); textLabels.Add("AddedCM00", this.lblCMT00); textLabels.Add("AddedCM01", this.lblCMT01); textLabels.Add("AddedCM02", this.lblCMT02); textLabels.Add("AddedCM03", this.lblCMT03); textLabels.Add("SpentCcp00", this.lblMCT00); textLabels.Add("SpentCcp01", this.lblMCT01); textLabels.Add("SpentCcp02", this.lblMCT02); textLabels.Add("StatAverage", this.lblMST00); #endregion #region Add Value Labels to Dictionary valueLabels.Add("StrengthActual", this.lblAV00); valueLabels.Add("SpeedActual", this.lblAV01); valueLabels.Add("AgilityActual", this.lblAV02); valueLabels.Add("EnduranceActual", this.lblAV03); valueLabels.Add("HealthActual", this.lblAV04); valueLabels.Add("CharismaActual", this.lblAV05); valueLabels.Add("IntelligenceActual", this.lblAV06); valueLabels.Add("WillpowerActual", this.lblAV07); valueLabels.Add("AstralActual", this.lblAV08); valueLabels.Add("PerceptionActual", this.lblAV09); valueLabels.Add("InitiativeActual", this.lblAV10); valueLabels.Add("AttackActual", this.lblAV11); valueLabels.Add("DefenseActual", this.lblAV12); valueLabels.Add("AimActual", this.lblAV13); valueLabels.Add("CMperLevelActual", this.lblAV14); valueLabels.Add("HPActual", this.lblAV15); valueLabels.Add("PRActual", this.lblAV16); valueLabels.Add("PRperLevelActual", this.lblAV17); valueLabels.Add("KPActual", this.lblAV18); valueLabels.Add("KPperLevelActual", this.lblAV19); valueLabels.Add("StrengthCcp", this.lblCV00); valueLabels.Add("SpeedCcp", this.lblCV01); valueLabels.Add("AgilityCcp", this.lblCV02); valueLabels.Add("EnduranceCcp", this.lblCV03); valueLabels.Add("HealthCcp", this.lblCV04); valueLabels.Add("CharismaCcp", this.lblCV05); valueLabels.Add("IntelligenceCcp", this.lblCV06); valueLabels.Add("WillpowerCcp", this.lblCV07); valueLabels.Add("AstralCcp", this.lblCV08); valueLabels.Add("PerceptionCcp", this.lblCV09); valueLabels.Add("InitiativeCcp", this.lblCV10); valueLabels.Add("AttackCcp", this.lblCV11); valueLabels.Add("DefenseCcp", this.lblCV12); valueLabels.Add("AimCcp", this.lblCV13); valueLabels.Add("CMperLevelCcp", this.lblCV14); valueLabels.Add("HPCcp", this.lblCV15); valueLabels.Add("PRCcp", this.lblCV16); valueLabels.Add("PRperLevelCcp", this.lblCV17); valueLabels.Add("KPCcp", this.lblCV18); valueLabels.Add("KPperLevelCcp", this.lblCV19); valueLabels.Add("SpentCcp00", this.lblMCV00); valueLabels.Add("SpentCcp01", this.lblMCV01); valueLabels.Add("SpentCcp02", this.lblMCV02); valueLabels.Add("StatAverage", this.lblMSV00); valueLabels.Add("AMR", this.lblOV00); valueLabels.Add("MMR", this.lblOV01); valueLabels.Add("DamageBonus", this.lblOV02); valueLabels.Add("Mana", this.lblOV03); valueLabels.Add("ManaPerLevel", this.lblOV04); valueLabels.Add("Psy", this.lblOV05); valueLabels.Add("PsyPerLevel", this.lblOV06); #endregion // Event handlers #region Attach NumericUpDownExt event handlers this.updB00.ValueChanged += updB00_ValueChanged; this.updB01.ValueChanged += updB01_ValueChanged; this.updB02.ValueChanged += updB02_ValueChanged; this.updB03.ValueChanged += updB03_ValueChanged; this.updB04.ValueChanged += updB04_ValueChanged; this.updB05.ValueChanged += updB05_ValueChanged; this.updB06.ValueChanged += updB06_ValueChanged; this.updB07.ValueChanged += updB07_ValueChanged; this.updB08.ValueChanged += updB08_ValueChanged; this.updB09.ValueChanged += updB09_ValueChanged; this.updB10.ValueChanged += updB10_ValueChanged; this.updB11.ValueChanged += updB11_ValueChanged; this.updB12.ValueChanged += updB12_ValueChanged; this.updB13.ValueChanged += updB13_ValueChanged; this.updB14.ValueChanged += updB14_ValueChanged; this.updB15.ValueChanged += updB15_ValueChanged; this.updB16.ValueChanged += updB16_ValueChanged; this.updB17.ValueChanged += updB17_ValueChanged; this.updB18.ValueChanged += updB18_ValueChanged; this.updB19.ValueChanged += updB19_ValueChanged; this.updM00.ValueChanged += updM00_ValueChanged; this.updM01.ValueChanged += updM01_ValueChanged; this.updM02.ValueChanged += updM02_ValueChanged; this.updM03.ValueChanged += updM03_ValueChanged; this.updCharLevel.ValueChanged += updCharLevel_ValueChanged; #endregion #region Fire Event handlers to set every value to default updB00_ValueChanged(updB00, new EventArgs()); updB01_ValueChanged(updB01, new EventArgs()); updB02_ValueChanged(updB02, new EventArgs()); updB03_ValueChanged(updB03, new EventArgs()); updB04_ValueChanged(updB04, new EventArgs()); updB05_ValueChanged(updB05, new EventArgs()); updB06_ValueChanged(updB06, new EventArgs()); updB07_ValueChanged(updB07, new EventArgs()); updB08_ValueChanged(updB08, new EventArgs()); updB09_ValueChanged(updB09, new EventArgs()); updB10_ValueChanged(updB10, new EventArgs()); updB11_ValueChanged(updB11, new EventArgs()); updB12_ValueChanged(updB12, new EventArgs()); updB13_ValueChanged(updB13, new EventArgs()); updB14_ValueChanged(updB14, new EventArgs()); updB15_ValueChanged(updB15, new EventArgs()); updB16_ValueChanged(updB16, new EventArgs()); updB17_ValueChanged(updB17, new EventArgs()); updB18_ValueChanged(updB18, new EventArgs()); updB19_ValueChanged(updB19, new EventArgs()); updM00_ValueChanged(updM00, new EventArgs()); updM01_ValueChanged(updM01, new EventArgs()); updM02_ValueChanged(updM02, new EventArgs()); updM03_ValueChanged(updM03, new EventArgs()); updCharLevel_ValueChanged(updCharLevel, new EventArgs()); #endregion // SkillTree setup twSkillTree.Nodes.AddRange(xmlHandler.GetSkillTree()); twSkillTree.ExpandAll(); }
private void InitializeComponent() { this.tlpSelectSkill = new TableLayoutPanel(); this.lblSkillNameText = new Label(); this.lblSkillName = new Label(); this.lblLevel = new Label(); this.updLevel = new NumericUpDownExt(); this.chkUseCCP = new CheckBox(); this.lblReqList = new Label(); this.lbReqList = new ListBox(); this.lblSubType = new Label(); this.cbSubType = new ComboBox(); this.tlpButtons = new TableLayoutPanel(); this.btCancel = new Button(); this.btOk = new Button(); this.tlpSelectSkill.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.updLevel)).BeginInit(); this.tlpButtons.SuspendLayout(); this.SuspendLayout(); // // tlpSelectSkill // this.tlpSelectSkill.ColumnCount = 5; this.tlpSelectSkill.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 12F)); this.tlpSelectSkill.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 140F)); this.tlpSelectSkill.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F)); this.tlpSelectSkill.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 180F)); this.tlpSelectSkill.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 12F)); this.tlpSelectSkill.Controls.Add(this.lblSkillNameText, 1, 1); this.tlpSelectSkill.Controls.Add(this.lblSkillName, 1, 2); this.tlpSelectSkill.Controls.Add(this.lblLevel, 1, 3); this.tlpSelectSkill.Controls.Add(this.updLevel, 1, 4); this.tlpSelectSkill.Controls.Add(this.chkUseCCP, 1, 5); this.tlpSelectSkill.Controls.Add(this.lblReqList, 3, 1); this.tlpSelectSkill.Controls.Add(this.lbReqList, 3, 2); this.tlpSelectSkill.Controls.Add(this.lblSubType, 3, 5); this.tlpSelectSkill.Controls.Add(this.cbSubType, 3, 6); this.tlpSelectSkill.Controls.Add(this.tlpButtons, 1, 7); this.tlpSelectSkill.Dock = DockStyle.Fill; this.tlpSelectSkill.Location = new System.Drawing.Point(0, 0); this.tlpSelectSkill.Margin = new Padding(3, 4, 3, 4); this.tlpSelectSkill.Name = "tlpSelectSkill"; this.tlpSelectSkill.RowCount = 9; this.tlpSelectSkill.RowStyles.Add(new RowStyle(SizeType.Absolute, 16F)); this.tlpSelectSkill.RowStyles.Add(new RowStyle(SizeType.Absolute, 16F)); this.tlpSelectSkill.RowStyles.Add(new RowStyle(SizeType.Absolute, 48F)); this.tlpSelectSkill.RowStyles.Add(new RowStyle(SizeType.Absolute, 24F)); this.tlpSelectSkill.RowStyles.Add(new RowStyle(SizeType.Absolute, 100F)); this.tlpSelectSkill.RowStyles.Add(new RowStyle(SizeType.Absolute, 24F)); this.tlpSelectSkill.RowStyles.Add(new RowStyle(SizeType.Absolute, 48F)); this.tlpSelectSkill.RowStyles.Add(new RowStyle(SizeType.Percent, 100F)); this.tlpSelectSkill.RowStyles.Add(new RowStyle(SizeType.Absolute, 12F)); this.tlpSelectSkill.Size = new System.Drawing.Size(393, 322); this.tlpSelectSkill.TabIndex = 0; // // lblSkillNameText // this.lblSkillNameText.AutoSize = true; this.lblSkillNameText.Dock = DockStyle.Fill; this.lblSkillNameText.Location = new System.Drawing.Point(12, 16); this.lblSkillNameText.Margin = new Padding(0); this.lblSkillNameText.Name = "lblSkillNameText"; this.lblSkillNameText.Size = new System.Drawing.Size(140, 16); this.lblSkillNameText.TabIndex = 0; this.lblSkillNameText.Text = "Képzettség neve"; // // lblSkillName // this.lblSkillName.AutoSize = true; this.lblSkillName.BorderStyle = BorderStyle.Fixed3D; this.lblSkillName.Dock = DockStyle.Fill; this.lblSkillName.Location = new System.Drawing.Point(12, 32); this.lblSkillName.Margin = new Padding(0); this.lblSkillName.Name = "lblSkillName"; this.lblSkillName.Size = new System.Drawing.Size(140, 48); this.lblSkillName.TabIndex = 1; this.lblSkillName.Text = "<SkillName><SkillName>"; this.lblSkillName.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // lblLevel // this.lblLevel.AutoSize = true; this.lblLevel.Dock = DockStyle.Fill; this.lblLevel.Location = new System.Drawing.Point(12, 80); this.lblLevel.Margin = new Padding(0); this.lblLevel.Name = "lblLevel"; this.lblLevel.Size = new System.Drawing.Size(140, 24); this.lblLevel.TabIndex = 2; this.lblLevel.Text = "Fok / %"; this.lblLevel.TextAlign = System.Drawing.ContentAlignment.BottomLeft; // // updLevel // this.updLevel.Dock = DockStyle.Fill; this.updLevel.Font = new System.Drawing.Font("Harrington", 50.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.updLevel.Location = new System.Drawing.Point(12, 104); this.updLevel.Margin = new Padding(0); this.updLevel.Name = "updLevel"; this.updLevel.Size = new System.Drawing.Size(140, 86); this.updLevel.TabIndex = 3; this.updLevel.TextAlign = HorizontalAlignment.Center; this.updLevel.Value = new decimal(new int[] { 0, // TODO: Add min/max here based on SkillType 0, 0, 0 }); // // chkUseCCP // this.chkUseCCP.AutoSize = true; this.chkUseCCP.Dock = DockStyle.Fill; this.chkUseCCP.Location = new System.Drawing.Point(12, 204); this.chkUseCCP.Margin = new Padding(0); this.chkUseCCP.Name = "chkUseCCP"; this.chkUseCCP.Size = new System.Drawing.Size(140, 24); this.chkUseCCP.TabIndex = 4; this.chkUseCCP.Text = "KAP felhasználás"; this.chkUseCCP.UseVisualStyleBackColor = true; // // lblReqList // this.lblReqList.AutoSize = true; this.lblReqList.Dock = DockStyle.Fill; this.lblReqList.Location = new System.Drawing.Point(201, 16); this.lblReqList.Margin = new Padding(0); this.lblReqList.Name = "lblReqList"; this.lblReqList.Size = new System.Drawing.Size(180, 16); this.lblReqList.TabIndex = 7; this.lblReqList.Text = "Követelménylista"; // // lbReqList // this.lbReqList.Dock = DockStyle.Fill; this.lbReqList.FormattingEnabled = true; this.lbReqList.ItemHeight = 17; this.lbReqList.Location = new System.Drawing.Point(201, 32); this.lbReqList.Margin = new Padding(0); this.lbReqList.Name = "lbReqList"; this.tlpSelectSkill.SetRowSpan(this.lbReqList, 3); this.lbReqList.ScrollAlwaysVisible = true; this.lbReqList.Size = new System.Drawing.Size(180, 172); this.lbReqList.TabIndex = 8; // // lblSubType // this.lblSubType.AutoSize = true; this.lblSubType.Dock = DockStyle.Fill; this.lblSubType.Location = new System.Drawing.Point(201, 204); this.lblSubType.Margin = new Padding(0); this.lblSubType.Name = "lblSubType"; this.lblSubType.Size = new System.Drawing.Size(180, 24); this.lblSubType.TabIndex = 9; this.lblSubType.Text = "Altípus"; this.lblSubType.TextAlign = System.Drawing.ContentAlignment.BottomLeft; // // cbSubType // this.cbSubType.Dock = DockStyle.Fill; this.cbSubType.FormattingEnabled = true; this.cbSubType.Location = new System.Drawing.Point(201, 228); this.cbSubType.Margin = new Padding(0); this.cbSubType.Name = "cbSubType"; this.cbSubType.Size = new System.Drawing.Size(180, 25); this.cbSubType.TabIndex = 10; // // tlpButtons // this.tlpButtons.ColumnCount = 3; this.tlpSelectSkill.SetColumnSpan(this.tlpButtons, 3); this.tlpButtons.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 40F)); this.tlpButtons.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 20F)); this.tlpButtons.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 40F)); this.tlpButtons.Controls.Add(this.btOk, 2, 0); this.tlpButtons.Controls.Add(this.btCancel, 0, 0); this.tlpButtons.Dock = DockStyle.Fill; this.tlpButtons.Location = new System.Drawing.Point(15, 279); this.tlpButtons.Name = "tlpButtons"; this.tlpButtons.RowCount = 1; this.tlpButtons.RowStyles.Add(new RowStyle(SizeType.Percent, 100F)); this.tlpButtons.Size = new System.Drawing.Size(363, 28); this.tlpButtons.TabIndex = 11; // // btCancel // this.btCancel.Dock = DockStyle.Fill; this.btCancel.Location = new System.Drawing.Point(0, 0); this.btCancel.Margin = new Padding(0); this.btCancel.Name = "btCancel"; this.btCancel.Size = new System.Drawing.Size(145, 28); this.btCancel.TabIndex = 6; this.btCancel.Text = "Mégsem"; this.btCancel.UseVisualStyleBackColor = true; // // btOk // this.btOk.Dock = DockStyle.Fill; this.btOk.Location = new System.Drawing.Point(217, 0); this.btOk.Margin = new Padding(0); this.btOk.Name = "btOk"; this.btOk.Size = new System.Drawing.Size(146, 28); this.btOk.TabIndex = 7; this.btOk.Text = "OK"; this.btOk.UseVisualStyleBackColor = true; this.btOk.Enabled = false; // // frmSelectSkill // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); this.AutoScaleMode = AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(393, 322); this.Controls.Add(this.tlpSelectSkill); this.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.FormBorderStyle = FormBorderStyle.FixedSingle; this.Margin = new Padding(3, 4, 3, 4); this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "frmSelectSkill"; this.Text = "[ Képzettségszint ]"; this.tlpSelectSkill.ResumeLayout(false); this.tlpSelectSkill.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.updLevel)).EndInit(); this.tlpButtons.ResumeLayout(false); this.ResumeLayout(false); }