diff --git a/.vs/Elite Power Management Simulator/v16/.suo b/.vs/Elite Power Management Simulator/v16/.suo index ca852ca..ddb34ac 100644 Binary files a/.vs/Elite Power Management Simulator/v16/.suo and b/.vs/Elite Power Management Simulator/v16/.suo differ diff --git a/Elite Power Management Simulator/Form1.Designer.cs b/Elite Power Management Simulator/Form1.Designer.cs index f2c730b..9b90de3 100644 --- a/Elite Power Management Simulator/Form1.Designer.cs +++ b/Elite Power Management Simulator/Form1.Designer.cs @@ -46,9 +46,23 @@ this.lst_log = new System.Windows.Forms.ListBox(); this.txt_mba = new System.Windows.Forms.TextBox(); this.gbox_macroBuilder = new System.Windows.Forms.GroupBox(); + this.lbl_mbaChangeWarning = new System.Windows.Forms.Label(); + this.gbox_custom = new System.Windows.Forms.GroupBox(); + this.lbl_custRst = new System.Windows.Forms.Label(); + this.lbl_custWep = new System.Windows.Forms.Label(); + this.lbl_custEng = new System.Windows.Forms.Label(); + this.lbl_custSys = new System.Windows.Forms.Label(); + this.txt_custRst = new System.Windows.Forms.TextBox(); + this.txt_custWep = new System.Windows.Forms.TextBox(); + this.txt_custEng = new System.Windows.Forms.TextBox(); + this.txt_custSys = new System.Windows.Forms.TextBox(); + this.rad_custom = new System.Windows.Forms.RadioButton(); + this.rad_ahk = new System.Windows.Forms.RadioButton(); + this.rad_ch = new System.Windows.Forms.RadioButton(); this.gbox_pipmgmt.SuspendLayout(); this.gbox_log.SuspendLayout(); this.gbox_macroBuilder.SuspendLayout(); + this.gbox_custom.SuspendLayout(); this.SuspendLayout(); // // prog_eng @@ -208,28 +222,165 @@ this.lst_log.Name = "lst_log"; this.lst_log.Size = new System.Drawing.Size(376, 184); this.lst_log.TabIndex = 0; - this.lst_log.Visible = false; // // txt_mba // - this.txt_mba.Location = new System.Drawing.Point(5, 20); + this.txt_mba.Location = new System.Drawing.Point(5, 90); this.txt_mba.Name = "txt_mba"; this.txt_mba.Size = new System.Drawing.Size(768, 20); this.txt_mba.TabIndex = 14; - this.txt_mba.Text = "{down}"; - this.txt_mba.Visible = false; + this.txt_mba.Text = "KBDOWN "; // // gbox_macroBuilder // + this.gbox_macroBuilder.Controls.Add(this.lbl_mbaChangeWarning); + this.gbox_macroBuilder.Controls.Add(this.gbox_custom); + this.gbox_macroBuilder.Controls.Add(this.rad_custom); + this.gbox_macroBuilder.Controls.Add(this.rad_ahk); + this.gbox_macroBuilder.Controls.Add(this.rad_ch); this.gbox_macroBuilder.Controls.Add(this.txt_mba); this.gbox_macroBuilder.Location = new System.Drawing.Point(3, 205); this.gbox_macroBuilder.Name = "gbox_macroBuilder"; - this.gbox_macroBuilder.Size = new System.Drawing.Size(778, 50); + this.gbox_macroBuilder.Size = new System.Drawing.Size(778, 116); this.gbox_macroBuilder.TabIndex = 14; this.gbox_macroBuilder.TabStop = false; this.gbox_macroBuilder.Text = "Macro Build Assist"; this.gbox_macroBuilder.Visible = false; // + // lbl_mbaChangeWarning + // + this.lbl_mbaChangeWarning.AutoSize = true; + this.lbl_mbaChangeWarning.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lbl_mbaChangeWarning.ForeColor = System.Drawing.Color.Firebrick; + this.lbl_mbaChangeWarning.Location = new System.Drawing.Point(153, 22); + this.lbl_mbaChangeWarning.Name = "lbl_mbaChangeWarning"; + this.lbl_mbaChangeWarning.Size = new System.Drawing.Size(176, 39); + this.lbl_mbaChangeWarning.TabIndex = 28; + this.lbl_mbaChangeWarning.Text = "! WARNING !\r\nA pip reset must be performed\r\nto clear the macro builder!"; + this.lbl_mbaChangeWarning.TextAlign = System.Drawing.ContentAlignment.TopCenter; + this.lbl_mbaChangeWarning.Visible = false; + // + // gbox_custom + // + this.gbox_custom.Controls.Add(this.lbl_custRst); + this.gbox_custom.Controls.Add(this.lbl_custWep); + this.gbox_custom.Controls.Add(this.lbl_custEng); + this.gbox_custom.Controls.Add(this.lbl_custSys); + this.gbox_custom.Controls.Add(this.txt_custRst); + this.gbox_custom.Controls.Add(this.txt_custWep); + this.gbox_custom.Controls.Add(this.txt_custEng); + this.gbox_custom.Controls.Add(this.txt_custSys); + this.gbox_custom.Location = new System.Drawing.Point(393, 7); + this.gbox_custom.Name = "gbox_custom"; + this.gbox_custom.Size = new System.Drawing.Size(381, 80); + this.gbox_custom.TabIndex = 27; + this.gbox_custom.TabStop = false; + this.gbox_custom.Text = "Custom Macro Buttons"; + this.gbox_custom.Visible = false; + // + // lbl_custRst + // + this.lbl_custRst.AutoSize = true; + this.lbl_custRst.Location = new System.Drawing.Point(231, 58); + this.lbl_custRst.Name = "lbl_custRst"; + this.lbl_custRst.Size = new System.Drawing.Size(41, 13); + this.lbl_custRst.TabIndex = 7; + this.lbl_custRst.Text = "[ RST ]"; + // + // lbl_custWep + // + this.lbl_custWep.AutoSize = true; + this.lbl_custWep.Location = new System.Drawing.Point(345, 36); + this.lbl_custWep.Name = "lbl_custWep"; + this.lbl_custWep.Size = new System.Drawing.Size(32, 13); + this.lbl_custWep.TabIndex = 6; + this.lbl_custWep.Text = "WEP"; + // + // lbl_custEng + // + this.lbl_custEng.AutoSize = true; + this.lbl_custEng.Location = new System.Drawing.Point(231, 14); + this.lbl_custEng.Name = "lbl_custEng"; + this.lbl_custEng.Size = new System.Drawing.Size(30, 13); + this.lbl_custEng.TabIndex = 5; + this.lbl_custEng.Text = "ENG"; + // + // lbl_custSys + // + this.lbl_custSys.AutoSize = true; + this.lbl_custSys.Location = new System.Drawing.Point(117, 36); + this.lbl_custSys.Name = "lbl_custSys"; + this.lbl_custSys.Size = new System.Drawing.Size(28, 13); + this.lbl_custSys.TabIndex = 4; + this.lbl_custSys.Text = "SYS"; + // + // txt_custRst + // + this.txt_custRst.Location = new System.Drawing.Point(125, 54); + this.txt_custRst.Name = "txt_custRst"; + this.txt_custRst.Size = new System.Drawing.Size(100, 20); + this.txt_custRst.TabIndex = 3; + this.txt_custRst.TextChanged += new System.EventHandler(this.txt_custRst_TextChanged); + // + // txt_custWep + // + this.txt_custWep.Location = new System.Drawing.Point(239, 33); + this.txt_custWep.Name = "txt_custWep"; + this.txt_custWep.Size = new System.Drawing.Size(100, 20); + this.txt_custWep.TabIndex = 2; + this.txt_custWep.TextChanged += new System.EventHandler(this.txt_custWep_TextChanged); + // + // txt_custEng + // + this.txt_custEng.Location = new System.Drawing.Point(125, 11); + this.txt_custEng.Name = "txt_custEng"; + this.txt_custEng.Size = new System.Drawing.Size(100, 20); + this.txt_custEng.TabIndex = 1; + this.txt_custEng.TextChanged += new System.EventHandler(this.txt_custEng_TextChanged); + // + // txt_custSys + // + this.txt_custSys.Location = new System.Drawing.Point(11, 33); + this.txt_custSys.Name = "txt_custSys"; + this.txt_custSys.Size = new System.Drawing.Size(100, 20); + this.txt_custSys.TabIndex = 0; + this.txt_custSys.TextChanged += new System.EventHandler(this.txt_custSys_TextChanged); + // + // rad_custom + // + this.rad_custom.AutoSize = true; + this.rad_custom.Location = new System.Drawing.Point(7, 66); + this.rad_custom.Name = "rad_custom"; + this.rad_custom.Size = new System.Drawing.Size(60, 17); + this.rad_custom.TabIndex = 17; + this.rad_custom.Text = "Custom"; + this.rad_custom.UseVisualStyleBackColor = true; + this.rad_custom.CheckedChanged += new System.EventHandler(this.rad_mba_CheckedChanged); + // + // rad_ahk + // + this.rad_ahk.AutoSize = true; + this.rad_ahk.Location = new System.Drawing.Point(7, 43); + this.rad_ahk.Name = "rad_ahk"; + this.rad_ahk.Size = new System.Drawing.Size(82, 17); + this.rad_ahk.TabIndex = 16; + this.rad_ahk.Text = "AutoHotKey"; + this.rad_ahk.UseVisualStyleBackColor = true; + this.rad_ahk.CheckedChanged += new System.EventHandler(this.rad_mba_CheckedChanged); + // + // rad_ch + // + this.rad_ch.AutoSize = true; + this.rad_ch.Checked = true; + this.rad_ch.Location = new System.Drawing.Point(7, 20); + this.rad_ch.Name = "rad_ch"; + this.rad_ch.Size = new System.Drawing.Size(85, 17); + this.rad_ch.TabIndex = 15; + this.rad_ch.TabStop = true; + this.rad_ch.Text = "CH Products"; + this.rad_ch.UseVisualStyleBackColor = true; + this.rad_ch.CheckedChanged += new System.EventHandler(this.rad_mba_CheckedChanged); + // // form_main // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -250,6 +401,7 @@ this.Controls.Add(this.gbox_pipmgmt); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.MaximizeBox = false; this.Name = "form_main"; this.Text = "Elite Power Management Simulator"; this.gbox_pipmgmt.ResumeLayout(false); @@ -257,6 +409,8 @@ this.gbox_log.ResumeLayout(false); this.gbox_macroBuilder.ResumeLayout(false); this.gbox_macroBuilder.PerformLayout(); + this.gbox_custom.ResumeLayout(false); + this.gbox_custom.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); @@ -281,6 +435,19 @@ private System.Windows.Forms.ListBox lst_log; private System.Windows.Forms.TextBox txt_mba; private System.Windows.Forms.GroupBox gbox_macroBuilder; + private System.Windows.Forms.RadioButton rad_custom; + private System.Windows.Forms.RadioButton rad_ahk; + private System.Windows.Forms.RadioButton rad_ch; + private System.Windows.Forms.GroupBox gbox_custom; + private System.Windows.Forms.Label lbl_custRst; + private System.Windows.Forms.Label lbl_custWep; + private System.Windows.Forms.Label lbl_custEng; + private System.Windows.Forms.Label lbl_custSys; + private System.Windows.Forms.TextBox txt_custRst; + private System.Windows.Forms.TextBox txt_custWep; + private System.Windows.Forms.TextBox txt_custEng; + private System.Windows.Forms.TextBox txt_custSys; + private System.Windows.Forms.Label lbl_mbaChangeWarning; } } diff --git a/Elite Power Management Simulator/Form1.cs b/Elite Power Management Simulator/Form1.cs index a343675..1d76f7c 100644 --- a/Elite Power Management Simulator/Form1.cs +++ b/Elite Power Management Simulator/Form1.cs @@ -24,12 +24,14 @@ namespace Elite_Power_Management_Simulator public static Int16 sys = 4; public static Int16 wep = 4; - public static string key_rst = "{down}"; - public static string key_sys = "{left}"; - public static string key_eng = "{up}"; - public static string key_wep = "{right}"; + public static string key_rst = "KBDOWN "; + public static string key_sys = "KBLEFT "; + public static string key_eng = "KBUP "; + public static string key_wep = "KBRIGHT "; public static string rst_text = "[ RST ]\t\t[ 2 / 2 / 2 ]"; + + public static int log_count = 0; } public static class calc @@ -55,15 +57,18 @@ namespace Elite_Power_Management_Simulator string eng = Convert.ToString(Convert.ToDecimal(global.eng)/2); string sys = Convert.ToString(Convert.ToDecimal(global.sys)/2); string wep = Convert.ToString(Convert.ToDecimal(global.wep)/2); + global.log_count += 1; //Increment log count before declaring log entry number 'lc' + string lc = Convert.ToString(global.log_count); - lst_log.Items.Add(q + "\t\t" + "[ " + sys + " / " + eng + " / " + wep + " ]"); + lst_log.Items.Add(q + "\t\t" + "[ " + sys + " / " + eng + " / " + wep + " ]\t\t" + lc); txt_mba.Text = txt_mba.Text + log_btn; } public void reset_history() { lst_log.Items.Clear(); lst_log.Items.Add(global.rst_text); - txt_mba.Text = "{down}"; + txt_mba.Text = global.key_rst; + lbl_mbaChangeWarning.Hide(); } //Power Distribution Functions @@ -72,6 +77,7 @@ namespace Elite_Power_Management_Simulator global.eng = 4; global.sys = 4; global.wep = 4; + global.log_count = 0; reset_history(); update(); } @@ -121,13 +127,6 @@ namespace Elite_Power_Management_Simulator global.wep -= 1; fin = true; } - /*else - { - if (!fin) - { - MessageBox.Show("Internal math error!"); - } - }*/ } else { @@ -137,18 +136,10 @@ namespace Elite_Power_Management_Simulator global.sys -= 1; fin = true; } - /*else - { - if (!fin) - { - MessageBox.Show("Internal math error!"); - } - }*/ } } - + track_history(log_iname, global.key_eng); } - track_history(log_iname, global.key_eng); update(); } public void pwr_sys() @@ -208,9 +199,8 @@ namespace Elite_Power_Management_Simulator } } } - + track_history(log_iname, global.key_sys); } - track_history(log_iname, global.key_sys); update(); } public void pwr_wep() @@ -270,9 +260,8 @@ namespace Elite_Power_Management_Simulator } } } - + track_history(log_iname, global.key_wep); } - track_history(log_iname, global.key_wep); update(); } @@ -313,20 +302,75 @@ namespace Elite_Power_Management_Simulator { this.Width = 408; this.Height = 248; - lst_log.Hide(); - txt_mba.Hide(); gbox_log.Hide(); gbox_macroBuilder.Hide(); } else { this.Width = 800; - this.Height = 296; - lst_log.Show(); - txt_mba.Show(); + this.Height = 363; gbox_log.Show(); gbox_macroBuilder.Show(); } } + + private void txt_custSys_TextChanged(object sender, EventArgs e) + { + global.key_sys = txt_custSys.Text; + lbl_mbaChangeWarning.Show(); + } + + private void txt_custEng_TextChanged(object sender, EventArgs e) + { + global.key_eng = txt_custEng.Text; + lbl_mbaChangeWarning.Show(); + } + + private void txt_custWep_TextChanged(object sender, EventArgs e) + { + global.key_wep = txt_custWep.Text; + lbl_mbaChangeWarning.Show(); + } + + private void txt_custRst_TextChanged(object sender, EventArgs e) + { + global.key_rst = txt_custRst.Text; + lbl_mbaChangeWarning.Show(); + } + + private void rad_mba_CheckedChanged(object sender, EventArgs e) + { + if (rad_ch.Checked) + { + global.key_rst = "KBDOWN "; + global.key_sys = "KBLEFT "; + global.key_eng = "KBUP "; + global.key_wep = "KBRIGHT "; + + lbl_mbaChangeWarning.Show(); + gbox_custom.Hide(); + } + if (rad_ahk.Checked) + { + global.key_rst = "{down}"; + global.key_sys = "{left}"; + global.key_eng = "{up}"; + global.key_wep = "{right}"; + + lbl_mbaChangeWarning.Show(); + gbox_custom.Hide(); + } + if (rad_custom.Checked) + { + global.key_rst = txt_custRst.Text; + global.key_sys = txt_custSys.Text; + global.key_eng = txt_custEng.Text; + global.key_wep = txt_custWep.Text; + + lbl_mbaChangeWarning.Show(); + gbox_custom.Show(); + } + Application.DoEvents(); + } } } diff --git a/Elite Power Management Simulator/obj/Debug/Elite Power Management Simulator.csproj.GenerateResource.cache b/Elite Power Management Simulator/obj/Debug/Elite Power Management Simulator.csproj.GenerateResource.cache index d2524b9..b116ff8 100644 Binary files a/Elite Power Management Simulator/obj/Debug/Elite Power Management Simulator.csproj.GenerateResource.cache and b/Elite Power Management Simulator/obj/Debug/Elite Power Management Simulator.csproj.GenerateResource.cache differ diff --git a/Elite Power Management Simulator/obj/Debug/Elite Power Management Simulator.csprojAssemblyReference.cache b/Elite Power Management Simulator/obj/Debug/Elite Power Management Simulator.csprojAssemblyReference.cache index ac0702c..738fe88 100644 Binary files a/Elite Power Management Simulator/obj/Debug/Elite Power Management Simulator.csprojAssemblyReference.cache and b/Elite Power Management Simulator/obj/Debug/Elite Power Management Simulator.csprojAssemblyReference.cache differ diff --git a/Elite Power Management Simulator/obj/Debug/elite_power_sim.exe b/Elite Power Management Simulator/obj/Debug/elite_power_sim.exe index daa66aa..0365aa3 100644 Binary files a/Elite Power Management Simulator/obj/Debug/elite_power_sim.exe and b/Elite Power Management Simulator/obj/Debug/elite_power_sim.exe differ diff --git a/Elite Power Management Simulator/obj/Debug/elite_power_sim.pdb b/Elite Power Management Simulator/obj/Debug/elite_power_sim.pdb index 97083a4..d0c4c9d 100644 Binary files a/Elite Power Management Simulator/obj/Debug/elite_power_sim.pdb and b/Elite Power Management Simulator/obj/Debug/elite_power_sim.pdb differ