This repository was archived by the owner on Aug 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPrBackColorSettings.cs
More file actions
275 lines (244 loc) · 10.5 KB
/
Copy pathPrBackColorSettings.cs
File metadata and controls
275 lines (244 loc) · 10.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
using System;
using System.Drawing;
using System.Windows.Forms;
using WowsTools.Properties;
namespace WowsTools
{
/// <summary>
/// 委托
/// </summary>
public delegate void SaveReloadPrBackColorSettingsEvent();
public partial class PrBackColorSettings : Form
{
/// <summary>
/// 事件
/// </summary>
public event SaveReloadPrBackColorSettingsEvent SaveReloadEvent;
public PrBackColorSettings()
{
InitializeComponent();
}
private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
/// <summary>
/// 存储所有值,并且退出生效
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void button3_Click(object sender, EventArgs e)
{
SaveDataInfo();
this.Close();
SaveReloadEvent();
}
private void PrBackColorSettings_Load(object sender, EventArgs e)
{
this.textBoxPrColor1.Text = Settings.Default.PrColor1;
this.textBoxPrColor2.Text = Settings.Default.PrColor2;
this.textBoxPrColor3.Text = Settings.Default.PrColor3;
this.textBoxPrColor4.Text = Settings.Default.PrColor4;
this.textBoxPrColor5.Text = Settings.Default.PrColor5;
this.textBoxPrColor6.Text = Settings.Default.PrColor6;
this.textBoxPrColor7.Text = Settings.Default.PrColor7;
this.textBoxPrColor8.Text = Settings.Default.PrColor8;
this.textBoxColorZero.Text = Settings.Default.PrColor0;
Colors(this.textBoxTestPr0, Settings.Default.PrColor0);
Colors(this.textBoxTestPr1, Settings.Default.PrColor1);
Colors(this.textBoxTestPr2, Settings.Default.PrColor2);
Colors(this.textBoxTestPr3, Settings.Default.PrColor3);
Colors(this.textBoxTestPr4, Settings.Default.PrColor4);
Colors(this.textBoxTestPr5, Settings.Default.PrColor5);
Colors(this.textBoxTestPr6, Settings.Default.PrColor6);
Colors(this.textBoxTestPr7, Settings.Default.PrColor7);
Colors(this.textBoxTestPr8, Settings.Default.PrColor8);
this.textBoxPrNa.Text = Settings.Default.PrColorNA;
this.textBoxMb1.Text = Settings.Default.DataGridViewTemplateForeColor0;
this.textBoxMb2.Text = Settings.Default.DataGridViewTemplateForeColor1;
Colors(this.textBoxTestNa, Settings.Default.PrColorNA);
Colors(this.textBoxTestMb1, Settings.Default.DataGridViewTemplateForeColor0);
Colors(this.textBoxTestMb2, Settings.Default.DataGridViewTemplateForeColor1);
//胜率
this.textBoxWinsValue1.Text = Settings.Default.WinsColorValue1.ToString();
this.textBoxWinsValue2.Text = Settings.Default.WinsColorValue2.ToString();
this.textBoxWinsValue3.Text = Settings.Default.WinsColorValue3.ToString();
this.textBoxWinsValue4.Text = Settings.Default.WinsColorValue4.ToString();
this.textBoxWinsColor1.Text = Settings.Default.WinsColor1;
this.textBoxWinsColor2.Text = Settings.Default.WinsColor2;
this.textBoxWinsColor3.Text = Settings.Default.WinsColor3;
this.textBoxWinsColor4.Text = Settings.Default.WinsColor4;
this.textBoxWinsColor5.Text = Settings.Default.WinsColor5;
Colors(this.textBoxTestWins1, Settings.Default.WinsColor1);
Colors(this.textBoxTestWins2, Settings.Default.WinsColor2);
Colors(this.textBoxTestWins3, Settings.Default.WinsColor3);
Colors(this.textBoxTestWins4, Settings.Default.WinsColor4);
Colors(this.textBoxTestWins5, Settings.Default.WinsColor5);
Color color = Color.Green;
if (Settings.Default.GamePrBackColorSelect == 0)
{
this.button1.BackColor = color;
}
else
{
this.button2.BackColor = color;
}
//值
this.textBoxPr1.Text = Settings.Default.PrValue1.ToString();
this.textBoxPr2.Text = Settings.Default.PrValue2.ToString();
this.textBoxPr3.Text = Settings.Default.PrValue3.ToString();
this.textBoxPr4.Text = Settings.Default.PrValue4.ToString();
this.textBoxPr5.Text = Settings.Default.PrValue5.ToString();
this.textBoxPr6.Text = Settings.Default.PrValue6.ToString();
this.textBoxPr7.Text = Settings.Default.PrValue7.ToString();
}
/// <summary>
/// pr
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void button1_Click(object sender, EventArgs e)
{
Settings.Default.GamePrBackColorSelect = 0;
Settings.Default.Save();
this.button1.BackColor = Color.Green;
this.button2.BackColor = Color.White;
}
/// <summary>
/// wins
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void button2_Click(object sender, EventArgs e)
{
Settings.Default.GamePrBackColorSelect = 1;
Settings.Default.Save();
this.button1.BackColor = Color.White;
this.button2.BackColor = Color.Green;
}
private static void Colors(TextBox textBox, string color)
{
try
{
textBox.BackColor = Color.FromArgb(Convert.ToInt32(color, 16));
}
catch (Exception e)
{
log.Error("渲染颜色发生错误 " + e);
}
}
private void SaveDataInfo()
{
Settings.Default.PrColor0 = this.textBoxColorZero.Text.Trim();
Settings.Default.PrColor1 = this.textBoxPrColor1.Text.Trim();
Settings.Default.PrColor2 = this.textBoxPrColor2.Text.Trim();
Settings.Default.PrColor3 = this.textBoxPrColor3.Text.Trim();
Settings.Default.PrColor4 = this.textBoxPrColor4.Text.Trim();
Settings.Default.PrColor5 = this.textBoxPrColor5.Text.Trim();
Settings.Default.PrColor6 = this.textBoxPrColor6.Text.Trim();
Settings.Default.PrColor7 = this.textBoxPrColor7.Text.Trim();
Settings.Default.PrColor8 = this.textBoxPrColor8.Text.Trim();
Settings.Default.PrColorNA = this.textBoxPrNa.Text.Trim();
Settings.Default.DataGridViewTemplateForeColor0 = this.textBoxMb1.Text.Trim();
Settings.Default.DataGridViewTemplateForeColor1 = this.textBoxMb2.Text.Trim();
//胜率
Settings.Default.WinsColorValue1 = double.Parse(this.textBoxWinsValue1.Text.Trim());
Settings.Default.WinsColorValue2 = double.Parse(this.textBoxWinsValue2.Text.Trim());
Settings.Default.WinsColorValue3 = double.Parse(this.textBoxWinsValue3.Text.Trim());
Settings.Default.WinsColorValue4 = double.Parse(this.textBoxWinsValue4.Text.Trim());
Settings.Default.WinsColor1 = this.textBoxWinsColor1.Text.Trim();
Settings.Default.WinsColor2 = this.textBoxWinsColor2.Text.Trim();
Settings.Default.WinsColor3 = this.textBoxWinsColor3.Text.Trim();
Settings.Default.WinsColor4 = this.textBoxWinsColor4.Text.Trim();
Settings.Default.WinsColor5 = this.textBoxWinsColor5.Text.Trim();
Settings.Default.Save();
}
/// <summary>
/// 加载效果
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void button4_Click(object sender, EventArgs e)
{
SaveDataInfo();
PrBackColorSettings_Load(null, null);
}
private void SelectColor(TextBox textBox)
{
ColorDialog dlg = new ColorDialog();
if (dlg.ShowDialog() == DialogResult.OK)
{
//获取所选择的颜色
Color color = dlg.Color;
//改变panel的背景色
int v = color.ToArgb();
textBox.Text = Convert.ToString(v, 16);
}
}
private void textBoxTestPr1_Click(object sender, EventArgs e)
{
SelectColor(this.textBoxPrColor1);
}
private void textBoxTestPr2_Click(object sender, EventArgs e)
{
SelectColor(this.textBoxPrColor2);
}
private void textBoxTestPr3_Click(object sender, EventArgs e)
{
SelectColor(this.textBoxPrColor3);
}
private void textBoxTestPr4_Click(object sender, EventArgs e)
{
SelectColor(this.textBoxPrColor4);
}
private void textBoxTestPr5_Click(object sender, EventArgs e)
{
SelectColor(this.textBoxPrColor5);
}
private void textBoxTestPr6_Click(object sender, EventArgs e)
{
SelectColor(this.textBoxPrColor6);
}
private void textBoxTestPr7_Click(object sender, EventArgs e)
{
SelectColor(this.textBoxPrColor7);
}
private void textBoxTestPr8_Click(object sender, EventArgs e)
{
SelectColor(this.textBoxPrColor8);
}
private void textBoxTestNa_Click(object sender, EventArgs e)
{
SelectColor(this.textBoxPrNa);
}
private void textBoxTestMb1_Click(object sender, EventArgs e)
{
SelectColor(this.textBoxMb1);
}
private void textBoxTestMb2_Click(object sender, EventArgs e)
{
SelectColor(this.textBoxMb2);
}
private void textBoxTestWins1_Click(object sender, EventArgs e)
{
SelectColor(this.textBoxWinsColor1);
}
private void textBoxTestWins2_Click(object sender, EventArgs e)
{
SelectColor(this.textBoxWinsColor2);
}
private void textBoxTestWins3_Click(object sender, EventArgs e)
{
SelectColor(this.textBoxWinsColor3);
}
private void textBoxTestWins4_Click(object sender, EventArgs e)
{
SelectColor(this.textBoxWinsColor4);
}
private void textBoxTestWins5_Click(object sender, EventArgs e)
{
SelectColor(this.textBoxWinsColor5);
}
private void textBoxTestPr0_Click(object sender, EventArgs e)
{
SelectColor(this.textBoxColorZero);
}
}
}