-
Notifications
You must be signed in to change notification settings - Fork 1
/
Form1.cs
1104 lines (1036 loc) · 44.7 KB
/
Form1.cs
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
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
using ReaLTaiizor.Forms;
using ReaLTaiizor.Colors;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;
using Ftp2Res;
using System.Text.RegularExpressions;
using ResSC;
using BnkCvt;
using ClipCreator;
using Res2Ext;
using SpriteToLibrary;
using ClipTransformer;
using ReaLTaiizor.Controls;
using static EBToolBox.Form1;
using CCWin.Win32.Const;
namespace EBToolBox
{
public partial class Form1 : MaterialForm
{
//用以外部类修改
public static Form1 form1;
///readonly MaterialSkin.MaterialSkinManager materialSkinManager;
readonly ReaLTaiizor.Manager.MaterialSkinManager materialSkinManager;
public Form1()
{
InitializeComponent();
form1 = this;
materialSkinManager = ReaLTaiizor.Manager.MaterialSkinManager.Instance;
materialSkinManager.EnforceBackcolorOnAllComponents = true;
///materialSkinManager.AddFormToManage(this);
materialSkinManager.Theme = ReaLTaiizor.Manager.MaterialSkinManager.Themes.LIGHT;
materialSkinManager.ColorScheme = new ReaLTaiizor.Colors.MaterialColorScheme(ReaLTaiizor.Colors.MaterialPrimary.Indigo500, ReaLTaiizor.Colors.MaterialPrimary.Indigo700, ReaLTaiizor.Colors.MaterialPrimary.Indigo100, ReaLTaiizor.Colors.MaterialAccent.Pink200, ReaLTaiizor.Util.MaterialTextShade.WHITE);
}
private void Form1_Load(object sender, EventArgs e)
{
//将当前窗体实例复制给全局常量Form
form1 = this;
//这个是允许其他线程控制本窗体控件
System.Windows.Forms.Control.CheckForIllegalCrossThreadCalls = false;
}
private void materialButton3_MouseHover(object sender, EventArgs e)
{
colorDialog1.ShowDialog();
Color c = colorDialog1.Color;
materialSkinManager.ColorScheme = new ReaLTaiizor.Colors.MaterialColorScheme(c, materialSkinManager.ColorScheme.DarkPrimaryColor, materialSkinManager.ColorScheme.LightPrimaryColor, materialSkinManager.ColorScheme.AccentColor, ReaLTaiizor.Util.MaterialTextShade.WHITE);
Invalidate();
materialSkinManager.AddFormToManage(this);
}
private void materialButton1_Click(object sender, EventArgs e)
{
materialSkinManager.Theme = materialSkinManager.Theme == ReaLTaiizor.Manager.MaterialSkinManager.Themes.DARK ? ReaLTaiizor.Manager.MaterialSkinManager.Themes.LIGHT : ReaLTaiizor.Manager.MaterialSkinManager.Themes.DARK;
materialSkinManager.AddFormToManage(this);
}
private int colorSchemeIndex;
//切换颜色按钮点击
private void materialButton2_Click(object sender, EventArgs e)
{
colorSchemeIndex++;
if (colorSchemeIndex > 2)
colorSchemeIndex = 0;
updateColor();
materialSkinManager.AddFormToManage(this);
}
private void updateColor()
{
//These are just example color schemes
switch (colorSchemeIndex)
{
case 0:
materialSkinManager.ColorScheme = new ReaLTaiizor.Colors.MaterialColorScheme(
ReaLTaiizor.Colors.MaterialPrimary.Indigo500,
ReaLTaiizor.Colors.MaterialPrimary.Indigo700,
ReaLTaiizor.Colors.MaterialPrimary.Indigo100,
ReaLTaiizor.Colors.MaterialAccent.Pink200,
ReaLTaiizor.Util.MaterialTextShade.WHITE);
break;
case 1:
materialSkinManager.ColorScheme = new ReaLTaiizor.Colors.MaterialColorScheme(
ReaLTaiizor.Colors.MaterialPrimary.Green600,
ReaLTaiizor.Colors.MaterialPrimary.Green700,
ReaLTaiizor.Colors.MaterialPrimary.Green200,
ReaLTaiizor.Colors.MaterialAccent.Red100,
ReaLTaiizor.Util.MaterialTextShade.WHITE);
break;
case 2:
materialSkinManager.ColorScheme = new ReaLTaiizor.Colors.MaterialColorScheme(
ReaLTaiizor.Colors.MaterialPrimary.BlueGrey800,
ReaLTaiizor.Colors.MaterialPrimary.BlueGrey900,
ReaLTaiizor.Colors.MaterialPrimary.BlueGrey500,
ReaLTaiizor.Colors.MaterialAccent.LightBlue200,
ReaLTaiizor.Util.MaterialTextShade.WHITE);
break;
}
Invalidate();
materialSkinManager.AddFormToManage(this);
}
private void materialButton4_MouseHover(object sender, EventArgs e)
{
colorDialog2.ShowDialog();
Color c = colorDialog2.Color;
materialSkinManager.ColorScheme = new ReaLTaiizor.Colors.MaterialColorScheme(materialSkinManager.ColorScheme.PrimaryColor, c, materialSkinManager.ColorScheme.LightPrimaryColor, materialSkinManager.ColorScheme.AccentColor, ReaLTaiizor.Util.MaterialTextShade.WHITE);
Invalidate();
materialSkinManager.AddFormToManage(this);
}
private void materialButton5_MouseHover(object sender, EventArgs e)
{
colorDialog3.ShowDialog();
Color c = colorDialog3.Color;
materialSkinManager.ColorScheme = new ReaLTaiizor.Colors.MaterialColorScheme(materialSkinManager.ColorScheme.PrimaryColor, materialSkinManager.ColorScheme.DarkPrimaryColor, c, materialSkinManager.ColorScheme.AccentColor, ReaLTaiizor.Util.MaterialTextShade.WHITE);
Invalidate();
materialSkinManager.AddFormToManage(this);
}
private void materialButton6_MouseHover(object sender, EventArgs e)
{
colorDialog4.ShowDialog();
Color c = colorDialog4.Color;
materialSkinManager.ColorScheme = new ReaLTaiizor.Colors.MaterialColorScheme(materialSkinManager.ColorScheme.PrimaryColor, materialSkinManager.ColorScheme.DarkPrimaryColor, materialSkinManager.ColorScheme.LightPrimaryColor, c, ReaLTaiizor.Util.MaterialTextShade.WHITE);
Invalidate();
materialSkinManager.AddFormToManage(this);
}
//Ftp2Res第一个文字框读取
private void textBox1_DragEnter(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.FileDrop))
e.Effect = DragDropEffects.All; //重要代码:表明是所有类型的数据,比如文件路径
else
e.Effect = DragDropEffects.None;
}
//Ftp2Res第一个文字框显示
private void textBox1_DragDrop(object sender, DragEventArgs e)
{
string path = ((System.Array)e.Data.GetData(DataFormats.FileDrop)).GetValue(0).ToString(); //获得路径
if (File.Exists(path))
{
textBox1.Text = path;
}
else if (Directory.Exists(path))
{
MessageBox.Show("检测路径输入为文件夹,请正确输入文件路径");
}
else
{
MessageBox.Show("路径输入有误!请检查!");
}
//文件及文件夹检测模板///if (File.Exists(textBox1.Text))
//文件及文件夹检测模板///{
//文件及文件夹检测模板/// MessageBox.Show("检测路径输入为文件,请正确输入文件夹路径");
//文件及文件夹检测模板///}
//文件及文件夹检测模板///else if (Directory.Exists(textBox1.Text))
//文件及文件夹检测模板///{
//文件及文件夹检测模板/// MessageBox.Show("检测路径输入为文件夹,请正确输入文件路径");
//文件及文件夹检测模板///}
//文件及文件夹检测模板///else
//文件及文件夹检测模板///{
//文件及文件夹检测模板/// MessageBox.Show("路径输入有误!请检查!");
//文件及文件夹检测模板///}
}
//Ftp2Res第一个文字框文件读取按钮
private void materialButton7_Click(object sender, EventArgs e)
{
//判断是否点击的“打开”按钮
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
textBox1.Text = openFileDialog1.FileName;
}
}
//BnkCvt第一个文字框读取
private void textBox2_DragEnter(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.FileDrop))
e.Effect = DragDropEffects.All; //重要代码:表明是所有类型的数据,比如文件路径
else
e.Effect = DragDropEffects.None;
}
//BnkCvt第一个文字框显示
private void textBox2_DragDrop(object sender, DragEventArgs e)
{
string path = ((System.Array)e.Data.GetData(DataFormats.FileDrop)).GetValue(0).ToString(); //获得路径
if (File.Exists(path))
{
MessageBox.Show("检测路径输入为文件,请正确输入文件夹路径");
}
else if (Directory.Exists(path))
{
textBox2.Text = path;
}
else
{
MessageBox.Show("路径输入有误!请检查!");
}
}
//BnkCvt第一个文字框文件读取按钮
private void materialButton8_Click(object sender, EventArgs e)
{
if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
{
textBox2.Text = folderBrowserDialog1.SelectedPath;
}
}
private int RSCIndex;
//ResSC切换模式按钮
private void materialSwitch1_CheckStateChanged(object sender, EventArgs e)
{
if (RSCIndex > 1)
RSCIndex = 0;
switch (RSCIndex)
{
case 0:
materialTabControl2.SelectedTab = materialTabControl2.TabPages[1];
break;
case 1:
materialTabControl2.SelectedTab = materialTabControl2.TabPages[0];
break;
}
RSCIndex++;
}
//ResSC第一个文字框读取
private void textBox3_DragEnter(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.FileDrop))
e.Effect = DragDropEffects.All; //重要代码:表明是所有类型的数据,比如文件路径
else
e.Effect = DragDropEffects.None;
}
//ResSC第一个文字框显示
private void textBox3_DragDrop(object sender, DragEventArgs e)
{
string path = ((System.Array)e.Data.GetData(DataFormats.FileDrop)).GetValue(0).ToString(); //获得路径
if (File.Exists(path))
{
textBox3.Text = path;
}
else if (Directory.Exists(path))
{
MessageBox.Show("检测路径输入为文件夹,请正确输入文件路径");
}
else
{
MessageBox.Show("路径输入有误!请检查!");
}
}
//ResSC第一个文字框文件读取按钮
private void materialButton9_Click(object sender, EventArgs e)
{
//判断是否点击的“打开”按钮
if (openFileDialog2.ShowDialog() == DialogResult.OK)
{
textBox3.Text = openFileDialog2.FileName;
}
}
//ResSC第二个文字框读取
private void textBox4_DragEnter(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.FileDrop))
e.Effect = DragDropEffects.All; //重要代码:表明是所有类型的数据,比如文件路径
else
e.Effect = DragDropEffects.None;
}
//ResSC第二个文字框显示
private void textBox4_DragDrop(object sender, DragEventArgs e)
{
string path = ((System.Array)e.Data.GetData(DataFormats.FileDrop)).GetValue(0).ToString(); //获得路径
if (File.Exists(path))
{
MessageBox.Show("检测路径输入为文件,请正确输入文件夹路径");
}
else if (Directory.Exists(path))
{
textBox4.Text = path;
}
else
{
MessageBox.Show("路径输入有误!请检查!");
}
}
//BnkCvt第二个文字框文件读取按钮
private void materialButton10_Click(object sender, EventArgs e)
{
if (folderBrowserDialog2.ShowDialog() == DialogResult.OK)
{
textBox4.Text = folderBrowserDialog2.SelectedPath;
}
}
private int LSCIndex;
//levelSC切换模式按钮
private void materialSwitch2_CheckStateChanged(object sender, EventArgs e)
{
if (LSCIndex > 1)
LSCIndex = 0;
switch (LSCIndex)
{
case 0:
materialTabControl4.SelectedTab = materialTabControl4.TabPages[1];
break;
case 1:
materialTabControl4.SelectedTab = materialTabControl4.TabPages[0];
break;
}
LSCIndex++;
}
//LevelSC第一个文字框读取
private void textBox5_DragEnter(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.FileDrop))
e.Effect = DragDropEffects.All; //重要代码:表明是所有类型的数据,比如文件路径
else
e.Effect = DragDropEffects.None;
}
//LevelSC第一个文字框显示
private void textBox5_DragDrop(object sender, DragEventArgs e)
{
string path = ((System.Array)e.Data.GetData(DataFormats.FileDrop)).GetValue(0).ToString(); //获得路径
if (File.Exists(path))
{
textBox5.Text = path;
}
else if (Directory.Exists(path))
{
MessageBox.Show("检测路径输入为文件夹,请正确输入文件路径");
}
else
{
MessageBox.Show("路径输入有误!请检查!");
}
}
//LevelSC第一个文字框文件读取按钮
private void materialButton11_Click(object sender, EventArgs e)
{
//判断是否点击的“打开”按钮
if (openFileDialog3.ShowDialog() == DialogResult.OK)
{
textBox5.Text = openFileDialog3.FileName;
}
}
//LevelSC第二个文字框读取
private void textBox6_DragEnter(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.FileDrop))
e.Effect = DragDropEffects.All; //重要代码:表明是所有类型的数据,比如文件路径
else
e.Effect = DragDropEffects.None;
}
//LevelSC第二个文字框显示
private void textBox6_DragDrop(object sender, DragEventArgs e)
{
string path = ((System.Array)e.Data.GetData(DataFormats.FileDrop)).GetValue(0).ToString(); //获得路径
if (File.Exists(path))
{
MessageBox.Show("检测路径输入为文件,请正确输入文件夹路径");
}
else if (Directory.Exists(path))
{
textBox6.Text = path;
}
else
{
MessageBox.Show("路径输入有误!请检查!");
}
}
//LevelSC第二个文字框文件读取按钮
private void materialButton12_Click(object sender, EventArgs e)
{
if (folderBrowserDialog3.ShowDialog() == DialogResult.OK)
{
textBox6.Text = folderBrowserDialog3.SelectedPath;
}
}
//ClipCreator第一个文字框读取
private void textBox7_DragEnter(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.FileDrop))
e.Effect = DragDropEffects.All; //重要代码:表明是所有类型的数据,比如文件路径
else
e.Effect = DragDropEffects.None;
}
//ClipCreator第一个文字框显示
private void textBox7_DragDrop(object sender, DragEventArgs e)
{
string path = ((System.Array)e.Data.GetData(DataFormats.FileDrop)).GetValue(0).ToString(); //获得路径
if (File.Exists(path))
{
MessageBox.Show("检测路径输入为文件,请正确输入文件夹路径");
}
else if (Directory.Exists(path))
{
textBox7.Text = path;
}
else
{
MessageBox.Show("路径输入有误!请检查!");
}
}
//ClipCreator第一个文字框文件读取按钮
private void materialButton13_Click(object sender, EventArgs e)
{
if (folderBrowserDialog4.ShowDialog() == DialogResult.OK)
{
textBox7.Text = folderBrowserDialog4.SelectedPath;
}
}
//ClipTransformer第一个文字框读取
private void textBox8_DragEnter(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.FileDrop))
e.Effect = DragDropEffects.All; //重要代码:表明是所有类型的数据,比如文件路径
else
e.Effect = DragDropEffects.None;
}
//ClipTransformer第一个文字框显示
private void textBox8_DragDrop(object sender, DragEventArgs e)
{
string path = ((System.Array)e.Data.GetData(DataFormats.FileDrop)).GetValue(0).ToString(); //获得路径
if (File.Exists(path))
{
MessageBox.Show("检测路径输入为文件,请正确输入文件夹路径");
}
else if (Directory.Exists(path))
{
textBox8.Text = path;
}
else
{
MessageBox.Show("路径输入有误!请检查!");
}
}
//ClipTransformer第一个文字框文件读取按钮
private void materialButton14_Click(object sender, EventArgs e)
{
if (folderBrowserDialog5.ShowDialog() == DialogResult.OK)
{
textBox8.Text = folderBrowserDialog5.SelectedPath;
}
}
//DictionaryCreator第一个文字框读取
private void textBox9_DragEnter(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.FileDrop))
e.Effect = DragDropEffects.All; //重要代码:表明是所有类型的数据,比如文件路径
else
e.Effect = DragDropEffects.None;
}
//DictionaryCreator第一个文字框显示
private void textBox9_DragDrop(object sender, DragEventArgs e)
{
string path = ((System.Array)e.Data.GetData(DataFormats.FileDrop)).GetValue(0).ToString(); //获得路径
if (File.Exists(path))
{
MessageBox.Show("检测路径输入为文件,请正确输入文件夹路径");
}
else if (Directory.Exists(path))
{
textBox9.Text = path;
}
else
{
MessageBox.Show("路径输入有误!请检查!");
}
}
//DictionaryCreator第一个文字框文件读取按钮
private void materialButton15_Click(object sender, EventArgs e)
{
if (folderBrowserDialog6.ShowDialog() == DialogResult.OK)
{
textBox9.Text = folderBrowserDialog6.SelectedPath;
}
}
//Res2Ext第一个文字框读取
private void textBox10_DragEnter(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.FileDrop))
e.Effect = DragDropEffects.All; //重要代码:表明是所有类型的数据,比如文件路径
else
e.Effect = DragDropEffects.None;
}
//Res2Ext第一个文字框显示
private void textBox10_DragDrop(object sender, DragEventArgs e)
{
string path = ((System.Array)e.Data.GetData(DataFormats.FileDrop)).GetValue(0).ToString(); //获得路径
if (File.Exists(path))
{
MessageBox.Show("检测路径输入为文件,请正确输入文件夹路径");
}
else if (Directory.Exists(path))
{
textBox10.Text = path;
}
else
{
MessageBox.Show("路径输入有误!请检查!");
}
}
//Res2Ext第一个文字框文件读取按钮
private void materialButton16_Click(object sender, EventArgs e)
{
if (folderBrowserDialog7.ShowDialog() == DialogResult.OK)
{
textBox10.Text = folderBrowserDialog7.SelectedPath;
}
}
//SpriteToLibrary第一个文字框读取
private void textBox11_DragEnter(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.FileDrop))
e.Effect = DragDropEffects.All; //重要代码:表明是所有类型的数据,比如文件路径
else
e.Effect = DragDropEffects.None;
}
//SpriteToLibrary第一个文字框显示
private void textBox11_DragDrop(object sender, DragEventArgs e)
{
string path = ((System.Array)e.Data.GetData(DataFormats.FileDrop)).GetValue(0).ToString(); //获得路径
if (File.Exists(path))
{
MessageBox.Show("检测路径输入为文件,请正确输入文件夹路径");
}
else if (Directory.Exists(path))
{
textBox11.Text = path;
}
else
{
MessageBox.Show("路径输入有误!请检查!");
}
}
//SpriteToLibrary第一个文字框文件读取按钮
private void materialButton17_Click(object sender, EventArgs e)
{
if (folderBrowserDialog8.ShowDialog() == DialogResult.OK)
{
textBox11.Text = folderBrowserDialog8.SelectedPath;
}
}
//SpriteToLibrary第二个文字框读取
private void textBox12_DragEnter(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.FileDrop))
e.Effect = DragDropEffects.All; //重要代码:表明是所有类型的数据,比如文件路径
else
e.Effect = DragDropEffects.None;
}
//SpriteToLibrary第二个文字框显示
private void textBox12_DragDrop(object sender, DragEventArgs e)
{
string path = ((System.Array)e.Data.GetData(DataFormats.FileDrop)).GetValue(0).ToString(); //获得路径
if (File.Exists(path))
{
MessageBox.Show("检测路径输入为文件,请正确输入文件夹路径");
}
else if (Directory.Exists(path))
{
textBox12.Text = path;
}
else
{
MessageBox.Show("路径输入有误!请检查!");
}
}
//SpriteToLibrary第二个文字框文件读取按钮
private void materialButton18_Click(object sender, EventArgs e)
{
if (folderBrowserDialog9.ShowDialog() == DialogResult.OK)
{
textBox12.Text = folderBrowserDialog9.SelectedPath;
}
}
//Res2Ext第二个文字框读取
private void textBox13_DragEnter(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.FileDrop))
e.Effect = DragDropEffects.All; //重要代码:表明是所有类型的数据,比如文件路径
else
e.Effect = DragDropEffects.None;
}
//Res2Ext第二个文字框显示
private void textBox13_DragDrop(object sender, DragEventArgs e)
{
string path = ((System.Array)e.Data.GetData(DataFormats.FileDrop)).GetValue(0).ToString(); //获得路径
if (File.Exists(path)|| Directory.Exists(path))
{
textBox13.Text = path;
}
//更新而弃用///else if (Directory.Exists(path))
//更新而弃用///{
//更新而弃用/// MessageBox.Show("检测路径输入为文件夹,请正确输入文件路径");
//更新而弃用///}
else
{
MessageBox.Show("路径输入有误!请检查!");
}
}
//Res2Ext第二个文字框文件读取按钮
private void materialButton19_Click(object sender, EventArgs e)
{
//判断是否点击的“打开”按钮
//更新而弃用///if (openFileDialog4.ShowDialog() == DialogResult.OK)
if (folderBrowserDialog10.ShowDialog() == DialogResult.OK)
{
textBox13.Text = folderBrowserDialog10.SelectedPath;
}
}
//Ftp2Res的运行按钮
private void spaceButton1_Click(object sender, EventArgs e)
{
Task.Run(() =>
{
materialButton20.Enabled = false;
Ftp2Res.Ftp2Res ftp2Res = new Ftp2Res.Ftp2Res();
string filepath = null, SLOT = null;
if (File.Exists(textBox1.Text))
{
filepath = textBox1.Text;
}
else if (Directory.Exists(textBox1.Text))
{
MessageBox.Show("检测路径输入为文件夹,请正确输入文件路径");
}
else
{
MessageBox.Show("路径输入有误!请检查!");
}
if (Regex.IsMatch(textBox14.Text, @"^\d+$")) // 判断字符串是否为数字 的正则表达式)
{
SLOT = textBox14.Text;
}
else
{
MessageBox.Show("Slot输入不为阿拉伯数字!请检查!");
}
if (File.Exists(textBox1.Text) && Regex.IsMatch(textBox14.Text, @"^\d+$"))
{
ftp2Res.FtpToRes(filepath, SLOT);
}
else { }
materialButton20.Enabled = true;
});
}
//ResSC的第一个运行按钮
private void spaceButton2_Click(object sender, EventArgs e)
{
Task.Run(() =>
{
materialButton21.Enabled = false;
ResSC.ResSpliter resSpliter = new ResSC.ResSpliter();
if (File.Exists(textBox3.Text))
{
resSpliter.ResSplit(textBox3.Text);
}
else if (Directory.Exists(textBox3.Text))
{
MessageBox.Show("检测路径输入为文件夹,请正确输入文件路径");
}
else
{
MessageBox.Show("路径输入有误!请检查!");
}
materialButton21.Enabled = true;
});
}
//ResSC的第二个运行按钮
private void spaceButton3_Click(object sender, EventArgs e)
{
Task.Run(() =>
{
materialButton22.Enabled = false;
ResSC.ResCrafter resCrafter = new ResSC.ResCrafter();
if (File.Exists(textBox4.Text))
{
MessageBox.Show("检测路径输入为文件,请正确输入文件夹路径");
}
else if (Directory.Exists(textBox4.Text))
{
resCrafter.ResCraft(textBox4.Text);
}
else
{
MessageBox.Show("路径输入有误!请检查!");
}
materialButton22.Enabled = true;
});
}
//BnkCvt的运行按钮
private void materialButton23_Click(object sender, EventArgs e)
{
Task.Run(() =>
{
materialButton23.Enabled = false;
BnkCvt.BnkConvertor bnkConvertor = new BnkCvt.BnkConvertor();
if (File.Exists(textBox2.Text))
{
MessageBox.Show("检测路径输入为文件,请正确输入文件夹路径");
}
else if (Directory.Exists(textBox2.Text))
{
bnkConvertor.BnkCvt(textBox2.Text);
}
else
{
MessageBox.Show("路径输入有误!请检查!");
}
materialButton23.Enabled = true;
});
}
//SpriteToLibrary的运行按钮
private void materialButton24_Click(object sender, EventArgs e)
{
Task.Run(() =>
{
materialButton24.Enabled = false;
//创建xr实例
SpriteToLibrary.XflReader xr = new SpriteToLibrary.XflReader();
string dictionarypath1 = null, dictionarypath2 = null;
if (File.Exists(textBox11.Text))
{
MessageBox.Show("检测XFL总文件夹路径输入为文件,请正确输入文件夹路径");
}
else if (Directory.Exists(textBox11.Text))
{
dictionarypath1 = textBox11.Text;
}
else
{
MessageBox.Show("XFL总文件夹路径输入有误!请检查!");
}
if (File.Exists(textBox12.Text))
{
MessageBox.Show("检测位图总文件夹路径输入为文件,请正确输入文件夹路径");
}
else if (Directory.Exists(textBox12.Text) || textBox12.Text == null || textBox12.Text == "")
{
dictionarypath2 = textBox12.Text;
}
else
{
MessageBox.Show("位图总文件夹路径输入有误!请检查!");
}
if (Directory.Exists(textBox11.Text) && (Directory.Exists(textBox12.Text) || textBox12.Text == null || textBox12.Text == ""))
{
if (textBox12.Text == null || textBox12.Text == "")
{
dictionarypath2 = dictionarypath1;
}
else { }
//寻找总文件夹中所有Anim.xfl文件
xr.XflRead(dictionarypath1, dictionarypath2);
MessageBox.Show("SpriteToLibrary Done");
}
else { }
materialButton24.Enabled = true;
});
}
//ClipCreator的运行按钮
private void materialButton25_Click(object sender, EventArgs e)
{
Task.Run(() =>
{
materialButton25.Enabled = false;
//创建cc实例
ClipCreator.ClipCreator cc = new ClipCreator.ClipCreator();
//创建sr实例
ClipCreator.SpriteReplacer sr = new ClipCreator.SpriteReplacer();
//创建ddo实例
ClipCreator.DOMDocumentOverwriter ddo = new ClipCreator.DOMDocumentOverwriter();
if (File.Exists(textBox7.Text))
{
MessageBox.Show("检测路径输入为文件,请正确输入文件夹路径");
}
else if (Directory.Exists(textBox7.Text))
{
textBox15.AppendText("必要预检测执行中......\r\n");
cc.rs.ReplaceScan(textBox7.Text + "\\LIBRARY");
textBox15.AppendText("必要预检测执行完成\r\n");
if (checkedListBox1.GetItemChecked(5))
{
cc.ClipCreate(textBox7.Text);
ddo.DOMDocumentOverwrite(textBox7.Text + "\\DOMDocument.xml", textBox7.Text + "\\LIBRARY");
}
else
{
if (checkedListBox1.GetItemChecked(0))
{
cc.icr.ImageClipRead(textBox7.Text + "\\LIBRARY");
//对引用被删除i元件的a元件进行删除20240307添加
cc.acr.AnimateClipRead(textBox7.Text + "\\LIBRARY", cc.icr.delirecord);
cc.icc.ImageClipCreate(textBox7.Text + "\\LIBRARY", cc.icr.irecord, cc.rs.rsrecord);
}
if (checkedListBox1.GetItemChecked(2))
{
sr.SpriteReplace(textBox7.Text + "\\LIBRARY");
}
if (checkedListBox1.GetItemChecked(3))
{
cc.mlls.MultiLoadedLayerSplite(textBox7.Text + "\\LIBRARY", cc.rs.mllsrecord);
}
if (checkedListBox1.GetItemChecked(1))
{
cc.acr.AnimateClipRead(textBox7.Text + "\\LIBRARY");
cc.acc.AnimateClipCreate(textBox7.Text + "\\LIBRARY", cc.acr.arecord, cc.acr.inum, cc.acr.airecord);
}
if (checkedListBox1.GetItemChecked(4))
{
ddo.DOMDocumentOverwrite(textBox7.Text + "\\DOMDocument.xml", textBox7.Text + "\\LIBRARY");
}
else { }
}
MessageBox.Show("ClipCreator Done");
}
else
{
MessageBox.Show("路径输入有误!请检查!");
}
materialButton25.Enabled = true;
});
}
//ClipTransformer的运行按钮
private void materialButton26_Click(object sender, EventArgs e)
{
Task.Run(() =>
{
materialButton26.Enabled = false;
//创建ct实例
ClipTransformer.ClipTransformer ct = new ClipTransformer.ClipTransformer();
if (File.Exists(textBox8.Text))
{
MessageBox.Show("检测路径输入为文件,请正确输入文件夹路径");
}
else if (Directory.Exists(textBox8.Text))
{
ct.ClipTransform(textBox8.Text);
MessageBox.Show("ClipTransformer Done");
}
else
{
MessageBox.Show("路径输入有误!请检查!");
}
materialButton26.Enabled = true;
});
}
//Res2Ext的运行按钮
private void materialButton27_Click(object sender, EventArgs e)
{
Task.Run(() =>
{
materialButton27.Enabled = false;
//创建mdf实例
Res2Ext.MediaDataFormater mdf = new Res2Ext.MediaDataFormater();
//创建ddo实例
Res2Ext.DOMDocumentOverwriter ddo = new Res2Ext.DOMDocumentOverwriter();
//创建mco实例
Res2Ext.MainClipOverwriter mco = new Res2Ext.MainClipOverwriter();
//创建oco实例
Res2Ext.OtherClipOverwriter oco = new Res2Ext.OtherClipOverwriter();
//创建ce实例
Res2Ext.ClipEncryptor ce = new Res2Ext.ClipEncryptor();
//创建ecc实例20240317添加
Res2Ext.EncryptClipCreator ecc = new EncryptClipCreator();
string filepath = null, dictionarypath = null;
if (File.Exists(textBox10.Text))
{
MessageBox.Show("检测XFL文件夹路径输入为文件,请正确输入文件夹路径");
}
else if (Directory.Exists(textBox10.Text))
{
dictionarypath = textBox10.Text;
}
else
{
MessageBox.Show("XFL文件夹路径输入有误!请检查!");
}
if (File.Exists(textBox13.Text)|| Directory.Exists(textBox13.Text))
{
filepath = textBox13.Text;
}
//新功能更新而废弃///else if (Directory.Exists(textBox13.Text))
//新功能更新而废弃///{
//新功能更新而废弃/// MessageBox.Show("检测资源片段文件路径输入为文件夹,请正确输入文件路径");
//新功能更新而废弃///}
else
{
MessageBox.Show("资源片段文件(夹)路径输入有误!请检查!");
}
if (Directory.Exists(textBox10.Text) && (File.Exists(textBox13.Text)|| Directory.Exists(textBox13.Text)))
{
//加密元件创制20240317添加
ecc.EncryptClipCreate(dictionarypath + "\\LIBRARY", dictionarypath + "\\DOMDocument.xml");
mdf.MediaDataFormat(filepath, dictionarypath + "\\LIBRARY");
ddo.DOMDocumentOverwrite(dictionarypath + "\\DOMDocument.xml");
mco.MainClipOverwrite(dictionarypath + "\\LIBRARY\\main.xml");
oco.OtherClipOverwrite(dictionarypath + "\\LIBRARY");
//加密元件插入20240319添加
ce.SpecialClipEncrypt(filepath, dictionarypath + "\\LIBRARY", ecc.ic.icname);
ce.SpecialClipEncrypt(filepath, dictionarypath + "\\LIBRARY", ecc.ac.acname);
ce.ClipEncrypt(filepath, dictionarypath + "\\LIBRARY", dictionarypath + "\\DOMDocument.xml");
MessageBox.Show("Res2Ext Done");
}
else { }
materialButton27.Enabled = true;
});
}
//LevelSC的第一个运行按钮
private void materialButton28_Click(object sender, EventArgs e)
{
Task.Run(() =>
{
materialButton28.Enabled = false;
LevelSC.LevelSpliter levelSpliter = new LevelSC.LevelSpliter();
if (File.Exists(textBox5.Text))
{
levelSpliter.LevelSplit(textBox5.Text);
}
else if (Directory.Exists(textBox5.Text))
{
MessageBox.Show("检测路径输入为文件夹,请正确输入文件路径");
}
else
{
MessageBox.Show("路径输入有误!请检查!");
}
materialButton28.Enabled = true;
});
}
//LevelSC的第二个运行按钮
private void materialButton29_Click(object sender, EventArgs e)
{
Task.Run(() =>
{
materialButton29.Enabled = false;
LevelSC.LevelCrafter levelCrafter = new LevelSC.LevelCrafter();
if (File.Exists(textBox6.Text))
{