From 3bd8177a5cfc845020b98fabf20b100bb348faf9 Mon Sep 17 00:00:00 2001 From: fffonion Date: Mon, 24 Mar 2014 21:59:13 +0800 Subject: [PATCH] friendly tips --- Program.cs | 8 +++ Properties/AssemblyInfo.cs | 2 +- frmConfig.Designer.cs | 121 +++++++++++++++++++++++++++++-------- frmConfig.cs | 69 +++++++++++++++------ 4 files changed, 154 insertions(+), 46 deletions(-) diff --git a/Program.cs b/Program.cs index c1cd206..41996b4 100644 --- a/Program.cs +++ b/Program.cs @@ -263,6 +263,14 @@ public static void showWnd(WndInfo[] wnds) } } + public static void showWndIfHided(WndInfo[] wnds) + { + foreach (WndInfo w in wnds) + { + if(!isVisible(w.hwnd)) + ShowWindowAsync(w.hwnd, SW_RESTORE); + } + } public static WndInfo refreshTitle(WndInfo wnd) { diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index 2eabdb1..b3c6699 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -33,4 +33,4 @@ // 方法是按如下所示使用“*”: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.68")] -[assembly: AssemblyFileVersion("1.4.9")] +[assembly: AssemblyFileVersion("1.5.0")] diff --git a/frmConfig.Designer.cs b/frmConfig.Designer.cs index 267c7db..f940135 100644 --- a/frmConfig.Designer.cs +++ b/frmConfig.Designer.cs @@ -153,7 +153,6 @@ private void InitializeComponent() this.label54 = new System.Windows.Forms.Label(); this.lblLineWarning = new System.Windows.Forms.Label(); this.groupBox8 = new System.Windows.Forms.GroupBox(); - this.textBox23 = new System.Windows.Forms.TextBox(); this.groupBox9 = new System.Windows.Forms.GroupBox(); this.label88 = new System.Windows.Forms.Label(); this.button72 = new System.Windows.Forms.Button(); @@ -349,6 +348,12 @@ private void InitializeComponent() this.dockMenu = new System.Windows.Forms.ContextMenuStrip(this.components); this.dockMenu_head = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); + this.cboDeckList = new System.Windows.Forms.ComboBox(); + this.label46 = new System.Windows.Forms.Label(); + this.linkLabel1 = new System.Windows.Forms.LinkLabel(); + this.lblInfiniteWarning = new System.Windows.Forms.Label(); + this.label92 = new System.Windows.Forms.Label(); + this.label91 = new System.Windows.Forms.Label(); this.grpSystem.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.numFairySleepFactor)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numDelay)).BeginInit(); @@ -507,6 +512,7 @@ private void InitializeComponent() // // grpSystem // + this.grpSystem.Controls.Add(this.label91); this.grpSystem.Controls.Add(this.txtReconnectGap); this.grpSystem.Controls.Add(this.cboReconnectGapIndicator); this.grpSystem.Controls.Add(this.chkAllowLongSleep); @@ -553,7 +559,7 @@ private void InitializeComponent() // txtReconnectGap // this.txtReconnectGap.Font = new System.Drawing.Font("微软雅黑", 9F); - this.txtReconnectGap.Location = new System.Drawing.Point(560, 129); + this.txtReconnectGap.Location = new System.Drawing.Point(612, 130); this.txtReconnectGap.Name = "txtReconnectGap"; this.txtReconnectGap.Size = new System.Drawing.Size(52, 27); this.txtReconnectGap.TabIndex = 1056; @@ -568,7 +574,7 @@ private void InitializeComponent() "立即重连", "在指定分钟后重连", "在指定时刻重连"}); - this.cboReconnectGapIndicator.Location = new System.Drawing.Point(400, 129); + this.cboReconnectGapIndicator.Location = new System.Drawing.Point(452, 130); this.cboReconnectGapIndicator.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.cboReconnectGapIndicator.Name = "cboReconnectGapIndicator"; this.cboReconnectGapIndicator.Size = new System.Drawing.Size(158, 28); @@ -585,6 +591,7 @@ private void InitializeComponent() this.chkAllowLongSleep.TabIndex = 1055; this.chkAllowLongSleep.Text = "允许长睡眠"; this.chkAllowLongSleep.UseVisualStyleBackColor = true; + this.chkAllowLongSleep.Visible = false; // // cbTask // @@ -959,6 +966,7 @@ private void InitializeComponent() this.numFairyTimes.Size = new System.Drawing.Size(69, 27); this.numFairyTimes.TabIndex = 1006; this.numFairyTimes.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.numFairyTimes.ValueChanged += new System.EventHandler(this.numFairyTimes_ValueChanged); // // label9 // @@ -1972,29 +1980,19 @@ private void InitializeComponent() // // groupBox8 // - this.groupBox8.Controls.Add(this.textBox23); + this.groupBox8.Controls.Add(this.linkLabel1); + this.groupBox8.Controls.Add(this.label46); + this.groupBox8.Controls.Add(this.cboDeckList); this.groupBox8.Font = new System.Drawing.Font("微软雅黑", 16.2F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.groupBox8.Location = new System.Drawing.Point(547, 212); this.groupBox8.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.groupBox8.Name = "groupBox8"; this.groupBox8.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2); - this.groupBox8.Size = new System.Drawing.Size(216, 109); + this.groupBox8.Size = new System.Drawing.Size(216, 114); this.groupBox8.TabIndex = 9; this.groupBox8.TabStop = false; this.groupBox8.Text = "那么选择卡组"; // - // textBox23 - // - this.textBox23.Font = new System.Drawing.Font("微软雅黑", 10.2F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.textBox23.Location = new System.Drawing.Point(19, 45); - this.textBox23.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); - this.textBox23.Multiline = true; - this.textBox23.Name = "textBox23"; - this.textBox23.ScrollBars = System.Windows.Forms.ScrollBars.Horizontal; - this.textBox23.Size = new System.Drawing.Size(181, 52); - this.textBox23.TabIndex = 9; - this.textBox23.WordWrap = false; - // // groupBox9 // this.groupBox9.Controls.Add(this.label88); @@ -2369,6 +2367,8 @@ private void InitializeComponent() // // button29 // + this.button29.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.button29.ForeColor = System.Drawing.Color.Crimson; this.button29.Location = new System.Drawing.Point(547, 492); this.button29.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.button29.Name = "button29"; @@ -2427,11 +2427,13 @@ private void InitializeComponent() // tabPage7 // this.tabPage7.BackColor = System.Drawing.SystemColors.Control; + this.tabPage7.Controls.Add(this.label92); + this.tabPage7.Controls.Add(this.lblInfiniteWarning); + this.tabPage7.Controls.Add(this.btnTaskerSave); this.tabPage7.Controls.Add(this.label41); this.tabPage7.Controls.Add(this.button39); this.tabPage7.Controls.Add(this.txtCondTasker); this.tabPage7.Controls.Add(this.lblTaskerCache); - this.tabPage7.Controls.Add(this.btnTaskerSave); this.tabPage7.Controls.Add(this.groupBox1); this.tabPage7.Controls.Add(this.grpTaskerThen); this.tabPage7.Controls.Add(this.grpTaskerIf); @@ -2489,7 +2491,8 @@ private void InitializeComponent() // // btnTaskerSave // - this.btnTaskerSave.Location = new System.Drawing.Point(633, 441); + this.btnTaskerSave.Font = new System.Drawing.Font("微软雅黑", 9F); + this.btnTaskerSave.Location = new System.Drawing.Point(578, 492); this.btnTaskerSave.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.btnTaskerSave.Name = "btnTaskerSave"; this.btnTaskerSave.Size = new System.Drawing.Size(91, 40); @@ -2507,7 +2510,7 @@ private void InitializeComponent() this.groupBox1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.groupBox1.Name = "groupBox1"; this.groupBox1.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2); - this.groupBox1.Size = new System.Drawing.Size(219, 118); + this.groupBox1.Size = new System.Drawing.Size(194, 63); this.groupBox1.TabIndex = 4; this.groupBox1.TabStop = false; this.groupBox1.Text = "否则"; @@ -2515,10 +2518,10 @@ private void InitializeComponent() // label23 // this.label23.AutoSize = true; - this.label23.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label23.Location = new System.Drawing.Point(43, 58); + this.label23.Font = new System.Drawing.Font("微软雅黑", 10F); + this.label23.Location = new System.Drawing.Point(71, 28); this.label23.Name = "label23"; - this.label23.Size = new System.Drawing.Size(92, 27); + this.label23.Size = new System.Drawing.Size(78, 23); this.label23.TabIndex = 1; this.label23.Text = "刷妖精战"; // @@ -3084,7 +3087,7 @@ private void InitializeComponent() // // btnTaskerReset // - this.btnTaskerReset.Location = new System.Drawing.Point(633, 495); + this.btnTaskerReset.Location = new System.Drawing.Point(675, 495); this.btnTaskerReset.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.btnTaskerReset.Name = "btnTaskerReset"; this.btnTaskerReset.Size = new System.Drawing.Size(91, 40); @@ -4358,6 +4361,69 @@ private void InitializeComponent() this.toolStripSeparator1.Name = "toolStripSeparator1"; this.toolStripSeparator1.Size = new System.Drawing.Size(195, 6); // + // cboDeckList + // + this.cboDeckList.Font = new System.Drawing.Font("微软雅黑", 12F); + this.cboDeckList.FormattingEnabled = true; + this.cboDeckList.Location = new System.Drawing.Point(8, 43); + this.cboDeckList.Name = "cboDeckList"; + this.cboDeckList.Size = new System.Drawing.Size(202, 35); + this.cboDeckList.TabIndex = 0; + // + // label46 + // + this.label46.Font = new System.Drawing.Font("微软雅黑", 7F); + this.label46.Location = new System.Drawing.Point(6, 80); + this.label46.Name = "label46"; + this.label46.Size = new System.Drawing.Size(151, 34); + this.label46.TabIndex = 1; + this.label46.Text = "可以在MAClient中\r\n使用rd或scc命令读取卡组"; + // + // linkLabel1 + // + this.linkLabel1.AutoSize = true; + this.linkLabel1.Font = new System.Drawing.Font("微软雅黑", 8F); + this.linkLabel1.Location = new System.Drawing.Point(171, 84); + this.linkLabel1.Name = "linkLabel1"; + this.linkLabel1.Size = new System.Drawing.Size(37, 20); + this.linkLabel1.TabIndex = 2; + this.linkLabel1.TabStop = true; + this.linkLabel1.Text = "教程"; + this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked); + // + // lblInfiniteWarning + // + this.lblInfiniteWarning.AutoSize = true; + this.lblInfiniteWarning.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.lblInfiniteWarning.ForeColor = System.Drawing.Color.Crimson; + this.lblInfiniteWarning.Location = new System.Drawing.Point(580, 435); + this.lblInfiniteWarning.Name = "lblInfiniteWarning"; + this.lblInfiniteWarning.Size = new System.Drawing.Size(189, 38); + this.lblInfiniteWarning.TabIndex = 11; + this.lblInfiniteWarning.Text = "注意:由于妖精战循环次数\r\n为无限,可能陷入死循环"; + this.lblInfiniteWarning.Visible = false; + // + // label92 + // + this.label92.AutoSize = true; + this.label92.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.label92.Font = new System.Drawing.Font("微软雅黑", 8F); + this.label92.Location = new System.Drawing.Point(382, 492); + this.label92.Name = "label92"; + this.label92.Size = new System.Drawing.Size(177, 40); + this.label92.TabIndex = 12; + this.label92.Text = "上一任务已完成后\r\n才会重新判断接下来的任务"; + // + // label91 + // + this.label91.AutoSize = true; + this.label91.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label91.Location = new System.Drawing.Point(396, 132); + this.label91.Name = "label91"; + this.label91.Size = new System.Drawing.Size(54, 20); + this.label91.TabIndex = 1057; + this.label91.Text = "掉线后"; + // // frmConfig // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F); @@ -4607,7 +4673,6 @@ private void InitializeComponent() private System.Windows.Forms.TextBox textBox20; private System.Windows.Forms.Label label36; private System.Windows.Forms.GroupBox groupBox8; - private System.Windows.Forms.TextBox textBox23; private System.Windows.Forms.GroupBox groupBox9; private System.Windows.Forms.Button button34; private System.Windows.Forms.TextBox textBox24; @@ -4777,6 +4842,12 @@ private void InitializeComponent() private System.Windows.Forms.TextBox txtReconnectGap; private System.Windows.Forms.ComboBox cboReconnectGapIndicator; private System.Windows.Forms.CheckBox chkAllowLongSleep; + private System.Windows.Forms.ComboBox cboDeckList; + private System.Windows.Forms.Label label46; + private System.Windows.Forms.LinkLabel linkLabel1; + private System.Windows.Forms.Label label92; + private System.Windows.Forms.Label lblInfiniteWarning; + private System.Windows.Forms.Label label91; } } diff --git a/frmConfig.cs b/frmConfig.cs index 1629166..ba2a916 100644 --- a/frmConfig.cs +++ b/frmConfig.cs @@ -109,6 +109,13 @@ private void refreshAll() { cbTask.SelectedIndex = 0; } + cboDeckList.Items.Clear(); + List lst2 = cf.EnumIniKey("carddeck"); + foreach (string ts in lst2) + { + cboDeckList.Items.Add(ts.Split('=')[0].Trim()); + + } numTaskTimes.Value = cf.ReadInt("system", "tasker_times"); numFactorTimes.Value = cf.ReadInt("system", "try_factor_times"); numFactorSleep.Value = cf.ReadInt("system", "factor_sleep"); @@ -152,7 +159,6 @@ private void refreshAll() txtFairySleep.Text = cf.Read("system", "fairy_battle_sleep"); numFairySleepFactor.Value = (decimal)cf.ReadFloat("system", "fairy_battle_sleep_factor"); txtGreetWords.Text = cf.Read("tactic", "greet_words"); - label23.Text = "刷妖精战" + numFactorTimes.Value + "次"; txtDisabledPlugins.Text = cf.Read("plugin", "disabled"); //button10.Text = "开始任务" + txtTaskName.Text; @@ -450,7 +456,6 @@ private void btnDefault_Click(object sender, EventArgs e) numFairySleepFactor.Value = 1; txtGreetWords.Text = "你好!"; - label23.Text = "刷妖精战" + numFactorTimes.Value + "次"; //button10.Text = "开始任务" + txtTaskName.Text; setToolTipText(); } @@ -867,9 +872,9 @@ private void button29_Click(object sender, EventArgs e) { if (lblCarddeckCache.Text != "") { - if (textBox23.Text == "") + if (cboDeckList.Text == "") { - textBox23.Focus(); + cboDeckList.Focus(); return; } if (textBox20.Text == "") @@ -877,13 +882,16 @@ private void button29_Click(object sender, EventArgs e) textBox20.Focus(); return; } + if (cboDeckList.Items.IndexOf(cboDeckList.Text) == -1 && + (MessageBox.Show("卡组名不存在,是否继续添加?\n你也可以稍后添加卡组" + cboDeckList.Text, "呵呵", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.No)) + return; if (txtCondCarddeck.Text == "") txtCondCarddeck.Text = "'" + textBox20.Text + "'"; txtCondCarddeck.Text = txtCondCarddeck.Text.Replace(" or '" + textBox20.Text + "'", " or ('" + textBox20.Text + "')"); txtCondCarddeck.Text = txtCondCarddeck.Text.Replace("'" + textBox20.Text + "'", - "(" + lblCarddeckCache.Text + ") and '" + textBox23.Text + "' or '" + textBox20.Text + "'"); + "(" + lblCarddeckCache.Text + ") and '" + cboDeckList.Text + "' or '" + textBox20.Text + "'"); lblCarddeckCache.Text = ""; button35.Enabled = true; @@ -940,6 +948,11 @@ private void button38_Click(object sender, EventArgs e) refreshAll(); refreshCond(); } + + private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) + { + System.Diagnostics.Process.Start("https://github.com/fffonion/MAClient/wiki/%E5%85%B3%E4%BA%8E%E6%8F%92%E4%BB%B6-carddeck_edit"); + } /// /// 清除 /// @@ -1382,8 +1395,8 @@ private void button60_Click_1(object sender, EventArgs e) private void frmConfig_FormClosing(object sender, FormClosingEventArgs e) { - button59.Text = "恢复"; - button59_Click(sender, e); + WndHdl.WndInfo[] res = WndHdl.findHwndbyTitleReg(@"\[[^\]]+\] AP\:"); + WndHdl.showWndIfHided(res); Process.GetCurrentProcess().Kill(); //System.Environment.Exit(0); } @@ -1393,44 +1406,46 @@ private void button60_Click_2(object sender, EventArgs e) { if (!groupBox11.Enabled)//左边group设为可用 { - textBox23.Text = "auto_set"; + cboDeckList.Text = "auto_set"; cboAim.SelectedIndex = cboAim.SelectedIndex == -1 ? 0 : cboAim.SelectedIndex; cboBCLimit.SelectedIndex = cboBCLimit.SelectedIndex == -1 ? 0 : cboBCLimit.SelectedIndex; cboLineCnt.SelectedIndex = cboLineCnt.SelectedIndex == -1 ? 0 : cboLineCnt.SelectedIndex; + button60.Font = new Font(button60.Font, FontStyle.Bold); button60.Text = "←←确认参数"; } else//确认 { - textBox23.Text = ""; + cboDeckList.Text = ""; switch (cboBCLimit.SelectedIndex) { case 1: - textBox23.Text += " bc:max"; + cboDeckList.Text += " bc:max"; break; case 2: - textBox23.Text += " bc:" + txtBCLimit.Text; + cboDeckList.Text += " bc:" + txtBCLimit.Text; break; } if (cboLineCnt.SelectedIndex != 0) - textBox23.Text += " line:" + (cboLineCnt.SelectedIndex + 1).ToString(); + cboDeckList.Text += " line:" + (cboLineCnt.SelectedIndex + 1).ToString(); switch (cboAim.SelectedIndex) { case 1: - textBox23.Text += " aim:MAX_CP"; + cboDeckList.Text += " aim:MAX_CP"; break; case 2: - textBox23.Text += " aim:DEFEAT"; + cboDeckList.Text += " aim:DEFEAT"; break; } if (!chkIsTest.Checked) - textBox23.Text += " notest"; + cboDeckList.Text += " notest"; if (!chkIsFast.Checked) - textBox23.Text += " nofast"; + cboDeckList.Text += " nofast"; if (txtCardEval.Text != "$.lv>=45") - textBox23.Text += " sel:" + txtCardEval.Text; + cboDeckList.Text += " sel:" + txtCardEval.Text; if (txtCardIncl.Text != "") - textBox23.Text += " incl:" + txtCardIncl.Text; - textBox23.Text = "auto_set(" + textBox23.Text.Trim() + ")"; + cboDeckList.Text += " incl:" + txtCardIncl.Text; + cboDeckList.Text = "auto_set(" + cboDeckList.Text.Trim() + ")"; + button60.Font = new Font(button60.Font, FontStyle.Regular); button60.Text = "使用自动配卡"; } groupBox11.Enabled = !groupBox11.Enabled; @@ -1875,7 +1890,7 @@ private void cboReservedName_SelectedIndexChanged(object sender, EventArgs e) { if (cboReservedName.SelectedIndex != 0) { - textBox23.Text = cboReservedName.SelectedIndex == 1 ? "no_change" : "abort"; + cboDeckList.Text = cboReservedName.SelectedIndex == 1 ? "no_change" : "abort"; } } @@ -1915,5 +1930,19 @@ private void cboReconnectGapIndicator_SelectedIndexChanged(object sender, EventA txtReconnectGap_TextChanged(sender, e); } + + private void numFairyTimes_ValueChanged(object sender, EventArgs e) + { + if (numFairyTimes.Value == 0) + { + label23.Text = "无限刷妖精战"; + lblInfiniteWarning.Visible = true; + } + else + { + label23.Text = "刷妖精战" + numFairyTimes.Value + "次"; + lblInfiniteWarning.Visible = false; + } + } } }