-
Notifications
You must be signed in to change notification settings - Fork 23
/
Methods.cs
1564 lines (1345 loc) · 85 KB
/
Methods.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 System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Threading;
namespace PoeTradeSearch
{
public partial class WinMain : Window
{
private void ResetControls()
{
tbLinksMin.Text = "";
tbSocketMin.Text = "";
tbLinksMax.Text = "";
tbSocketMax.Text = "";
tbLvMin.Text = "";
tbLvMax.Text = "";
tbQualityMin.Text = "";
tbQualityMax.Text = "";
tkDetail.Text = "";
lbDPS.Content = "옵션";
Synthesis.Content = "결합";
cbRarity.Items.Clear();
cbRarity.Items.Add("모두");
cbRarity.Items.Add(mParser.Rarity.Entries[0].Text[0]);
cbRarity.Items.Add(mParser.Rarity.Entries[1].Text[0]);
cbRarity.Items.Add(mParser.Rarity.Entries[2].Text[0]);
cbRarity.Items.Add(mParser.Rarity.Entries[3].Text[0]);
cbAiiCheck.IsChecked = false;
ckLv.IsChecked = false;
ckQuality.IsChecked = false;
ckSocket.IsChecked = false;
Synthesis.IsChecked = false;
cbAltQuality.Items.Clear();
cbInfluence1.SelectedIndex = 0;
cbInfluence2.SelectedIndex = 0;
cbInfluence1.BorderThickness = new Thickness(1);
cbInfluence2.BorderThickness = new Thickness(1);
cbCorrupt.SelectedIndex = 0;
cbCorrupt.BorderThickness = new Thickness(1);
cbCorrupt.FontWeight = FontWeights.Normal;
cbCorrupt.Foreground = cbInfluence1.Foreground;
cbOrbs.SelectionChanged -= CbOrbs_SelectionChanged;
cbSplinters.SelectionChanged -= CbOrbs_SelectionChanged;
cbOrbs.SelectedIndex = 0;
cbSplinters.SelectedIndex = 0;
cbOrbs.SelectionChanged += CbOrbs_SelectionChanged;
cbSplinters.SelectionChanged += CbOrbs_SelectionChanged;
cbOrbs.FontWeight = FontWeights.Normal;
cbSplinters.FontWeight = FontWeights.Normal;
ckLv.Content = mParser.Level.Text[0];
ckLv.FontWeight = FontWeights.Normal;
ckLv.Foreground = Synthesis.Foreground;
ckLv.BorderBrush = Synthesis.BorderBrush;
ckQuality.FontWeight = FontWeights.Normal;
ckQuality.Foreground = Synthesis.Foreground;
ckQuality.BorderBrush = Synthesis.BorderBrush;
lbSocketBackground.Visibility = Visibility.Hidden;
tabControl1.SelectedIndex = 0;
cbPriceListCount.SelectedIndex = (mConfig.Options.SearchListCount / 20) - 1;
tbPriceFilterMin.Text = mConfig.Options.SearchPriceMinimum > 0 ? mConfig.Options.SearchPriceMinimum.ToString() : "";
tkPriceCount.Text = "";
tkPriceInfo.Text = (string)tkPriceInfo.Tag;
cbPriceListTotal.Text = "0/0 검색";
for (int i = 0; i < 10; i++)
{
((ComboBox)FindName("cbOpt" + i)).Items.Clear();
// ((ComboBox)FindName("cbOpt" + i)).ItemsSource = new List<FilterEntrie>();
((ComboBox)FindName("cbOpt" + i)).DisplayMemberPath = "Name";
((ComboBox)FindName("cbOpt" + i)).SelectedValuePath = "Name";
((TextBox)FindName("tbOpt" + i)).Text = "";
((TextBox)FindName("tbOpt" + i)).Tag = null; // 특수 옵션에 사용
((TextBox)FindName("tbOpt" + i)).Background = SystemColors.WindowBrush;
((TextBox)FindName("tbOpt" + i + "_0")).Text = "";
((TextBox)FindName("tbOpt" + i + "_1")).Text = "";
((TextBox)FindName("tbOpt" + i + "_0")).IsEnabled = true;
((TextBox)FindName("tbOpt" + i + "_1")).IsEnabled = true;
((TextBox)FindName("tbOpt" + i + "_0")).Background = SystemColors.WindowBrush;
((TextBox)FindName("tbOpt" + i + "_0")).Foreground = ((TextBox)FindName("tbOpt" + i)).Foreground;
((CheckBox)FindName("tbOpt" + i + "_2")).BorderThickness = new Thickness(1);
((CheckBox)FindName("tbOpt" + i + "_2")).IsEnabled = true;
((CheckBox)FindName("tbOpt" + i + "_2")).IsChecked = false;
((CheckBox)FindName("tbOpt" + i + "_3")).IsChecked = false;
SetFilterObjectColor(i, SystemColors.ActiveBorderBrush);
SetFilterObjectVisibility(i, Visibility.Visible);
((CheckBox)FindName("tbOpt" + i + "_3")).Visibility = Visibility.Hidden;
}
}
private void SetFilterObjectColor(int index, System.Windows.Media.SolidColorBrush colorBrush)
{
((Control)FindName("tbOpt" + index)).BorderBrush = colorBrush;
((Control)FindName("tbOpt" + index + "_0")).BorderBrush = colorBrush;
((Control)FindName("tbOpt" + index + "_1")).BorderBrush = colorBrush;
((Control)FindName("tbOpt" + index + "_2")).BorderBrush = colorBrush;
((Control)FindName("tbOpt" + index + "_3")).BorderBrush = colorBrush;
}
private void SetFilterObjectVisibility(int index, Visibility visibility)
{
((ComboBox)FindName("cbOpt" + index)).Visibility = visibility;
((Control)FindName("tbOpt" + index + "_0")).Visibility = visibility;
((Control)FindName("tbOpt" + index + "_1")).Visibility = visibility;
((Control)FindName("tbOpt" + index + "_2")).Visibility = visibility;
((Control)FindName("tbOpt" + index + "_3")).Visibility = visibility;
}
private void setDPS(string physical, string elemental, string chaos, string quality, string perSecond, double phyDmgIncr, double speedIncr)
{
// DPS 계산 POE-TradeMacro 참고
double physicalDPS = DamageToDPS(physical);
double elementalDPS = DamageToDPS(elemental);
double chaosDPS = DamageToDPS(chaos);
double quality20Dps = quality == "" ? 0 : quality.ToDouble(0);
double attacksPerSecond = Regex.Replace(perSecond, "[^0-9.]", "").ToDouble(0);
if (speedIncr > 0)
{
double baseAttackSpeed = attacksPerSecond / (speedIncr / 100 + 1);
double modVal = baseAttackSpeed % 0.05;
baseAttackSpeed += modVal > 0.025 ? (0.05 - modVal) : -modVal;
attacksPerSecond = baseAttackSpeed * (speedIncr / 100 + 1);
}
physicalDPS = (physicalDPS / 2) * attacksPerSecond;
elementalDPS = (elementalDPS / 2) * attacksPerSecond;
chaosDPS = (chaosDPS / 2) * attacksPerSecond;
//20 퀄리티 보다 낮을땐 20 퀄리티 기준으로 계산
quality20Dps = quality20Dps < 20 ? physicalDPS * (phyDmgIncr + 120) / (phyDmgIncr + quality20Dps + 100) : 0;
physicalDPS = quality20Dps > 0 ? quality20Dps : physicalDPS;
lbDPS.Content = "DPS: P." + Math.Round(physicalDPS, 2).ToString() +
" + E." + Math.Round(elementalDPS, 2).ToString() +
" = T." + Math.Round(physicalDPS + elementalDPS + chaosDPS, 2).ToString();
}
private void Deduplicationfilter(List<Itemfilter> itemfilters)
{
for (int i = 0; i < itemfilters.Count; i++)
{
string txt = ((TextBox)FindName("tbOpt" + i)).Text;
if (((CheckBox)FindName("tbOpt" + i + "_2")).IsEnabled == false) continue;
for (int j = 0; j < itemfilters.Count; j++)
{
if (i == j) continue;
CheckBox tmpCcheckBox2 = (CheckBox)FindName("tbOpt" + j + "_2");
if (((TextBox)FindName("tbOpt" + j)).Text == txt)
{
tmpCcheckBox2.IsChecked = false;
tmpCcheckBox2.IsEnabled = false;
itemfilters[j].disabled = true;
}
}
}
}
private void ItemTextParser(string itemText, bool isWinShow = true)
{
int[] SocketParser(string socket)
{
int sckcnt = socket.Replace(" ", "-").Split('-').Length;
string[] scklinks = socket.Split(' ');
int lnkcnt = 0;
for (int s = 0; s < scklinks.Length; s++)
{
if (lnkcnt < scklinks[s].Length) lnkcnt = scklinks[s].Length;
}
return new int[] { sckcnt, lnkcnt < 3 ? 0 : lnkcnt - (int)Math.Ceiling((double)lnkcnt / 2) + 1 };
}
string[] ItemBaseParser(string[] opts)
{
string category = opts[0].Split(':')[1].Trim();
string rarity = opts[1].Split(':')[1].Trim();
string name = Regex.Replace(opts[2] ?? "", @"<<set:[A-Z]+>>", "");
bool b = opts.Length > 3 && opts[3] != "";
return new string[] { category, rarity, b ? name : "",
b ? Regex.Replace(opts[3] ?? "", @"<<set:[A-Z]+>>", "") : name
};
}
List<string> ItemOptionParser(string opts, string tier, ref int is_deep, ref bool is_multi_line)
{
List<string> options = new List<string>();
string[] tmp = opts.Split(new string[] { "\n" }, 0).Select(x => x.Trim()).ToArray();
is_deep = tmp[0][0] == '{' && tmp.Length > 1 ? 0 : -1;
if (tmp.Length == (is_deep == 0 ? 3 : 2))
{
is_multi_line = true;
options.Add(tmp[0 + (is_deep == 0 ? 1 : 0)] + "\n" + tmp[1 + (is_deep == 0 ? 1 : 0)]);
}
for (int ssi = 0; ssi < tmp.Length - (is_deep == 0 ? 1 : 0); ssi++)
{
options.Add(tmp[ssi + (is_deep == 0 ? 1 : 0)].RepEx(@"([0-9]+)\([0-9\.\+\-]*[0-9]+\)", "$1"));
}
is_deep = is_deep == 0 ? tmp[0].RepEx(@"^.+\s\(" + tier + @": ([0-9])\)\s—.+$", "$1").ToInt(0) : is_deep;
return options;
}
//TODO 위키 보기시 이름만 빼자
string map_influenced = "";
ParserData PS = mParser;
try
{
string[] asData = (itemText ?? "").Trim().Split(new string[] { "--------" }, StringSplitOptions.None);
if (asData.Length > 1 && (asData[0].IndexOf(PS.Category.Text[0] + ": ") == 0 || asData[0].IndexOf(PS.Category.Text[1] + ": ") == 0))
{
ResetControls();
byte z = (byte)(asData[0].IndexOf(PS.Category.Text[0] + ": ") == 0 ? 0 : 1); // language
string[] ibase_info = ItemBaseParser(asData[0].Trim().Split(new string[] { "\r\n" }, StringSplitOptions.None));
ParserDictItem category = Array.Find(PS.Category.Entries, x => x.Text[z] == ibase_info[0]); // category
string[] cate_ids = category != null ? category.Id.Split('.') : new string[] { "" };
ParserDictItem rarity = Array.Find(PS.Rarity.Entries, x => x.Text[z] == ibase_info[1]); // rarity
rarity = rarity == null ? new ParserDictItem() { Id = "", Text = new string[] { ibase_info[1], ibase_info[1] } } : rarity;
int k = 0;
double attackSpeedIncr = 0, PhysicalDamageIncr = 0;
List<Itemfilter> itemfilters = new List<Itemfilter>();
Dictionary<string, string> lItemOption = new Dictionary<string, string>()
{
{ PS.Quality.Text[z], "" }, { PS.Level.Text[z], "" }, { PS.ItemLevel.Text[z], "" }, { PS.TalismanTier.Text[z], "" }, { PS.MapTier.Text[z], "" },
{ PS.Sockets.Text[z], "" }, { PS.Heist.Text[z], "" }, { PS.MapUltimatum.Text[z], "" }, { PS.RewardUltimatum.Text[z], "" },
{ PS.Radius.Text[z], "" }, { PS.DeliriumReward.Text[z], "" }, { PS.MonsterGenus.Text[z], "" }, { PS.MonsterGroup.Text[z], "" },
{ PS.PhysicalDamage.Text[z], "" }, { PS.ElementalDamage.Text[z], "" }, { PS.ChaosDamage.Text[z], "" }, { PS.AttacksPerSecond.Text[z], "" },
{ PS.ShaperItem.Text[z], "" }, { PS.ElderItem.Text[z], "" }, { PS.CrusaderItem.Text[z], "" }, { PS.RedeemerItem.Text[z], "" },
{ PS.HunterItem.Text[z], "" }, { PS.WarlordItem.Text[z], "" }, { PS.SynthesisedItem.Text[z], "" },
{ PS.Corrupted.Text[z], "" }, { PS.Unidentified.Text[z], "" }, { PS.ProphecyItem.Text[z], "" }, { PS.Vaal.Text[z] + " " + ibase_info[3], "" }
};
// 시즌이 지날수록 땜질을 많이해 점점 복잡지는 소스 언제 정리하지?...
for (int i = 1; i < asData.Length; i++)
{
string[] asOpts = asData[i].Split(new string[] { "\r\n" }, 0).Select(x => x.Trim()).ToArray();
for (int j = 0; j < asOpts.Length; j++)
{
if (asOpts[j].Trim().IsEmpty()) continue;
int is_deep = -1;
bool is_multi_line = false;
List<string> options = ItemOptionParser(asOpts[j], PS.OptionTier.Text[z], ref is_deep, ref is_multi_line);
for (int o = 0; o < options.Count; o++)
{
string[] asSplit = options[o].Replace(@" \([\w\s]+\)", "").Split(':').Select(x => x.Trim()).ToArray();
if (lItemOption.ContainsKey(asSplit[0]))
{
if (lItemOption[asSplit[0]] == "") lItemOption[asSplit[0]] = asSplit.Length > 1 ? asSplit[1] : "_TRUE_";
}
else if (k < 10 && (!lItemOption[PS.ItemLevel.Text[z]].IsEmpty() || !lItemOption[PS.MapUltimatum.Text[z]].IsEmpty()))
{
string input = options[o].RepEx(@"\s(\([a-zA-Z]+\)|—\s.+)$", "");
string ft_type = options[o].Split(new string[] { "\n" }, 0)[0].RepEx(@"(.+)\s\(([a-zA-Z]+)\)$", "$2");
if (!RS.lFilterType.ContainsKey(ft_type)) ft_type = "_none_";
bool _resistance = false;
double min = 99999, max = 99999;
ParserDictItem special_option = null;
if (ft_type == "implicit" && cate_ids.Length == 1 && cate_ids[0] == "map")
{
string pats = "";
foreach (ParserDictItem item in PS.MapTier.Entries)
{
pats += item.Text[z] + "|";
}
Match match = Regex.Match(input.Trim(), "(.+) (" + pats + "_none_)(.*)");
if (match.Success)
{
map_influenced = match.Groups[2] + "";
input = match.Groups[1] + " #" + match.Groups[3];
}
continue;
}
else if (special_option == null)
{
if (ft_type == "implicit" && cate_ids.Length == 1 && cate_ids[0] == "logbook")
{
special_option = Array.Find(PS.Logbook.Entries, x => x.Text[z] == input);
if (special_option != null)
{
input = PS.Logbook.Text[z];
special_option.Key = "LOGBOOK";
}
}
else if (ft_type == "enchant" && asSplit.Length > 1 && cate_ids.Length == 2 && cate_ids[0] == "jewel")
{
string tmp2 = input.Split(':')?[1].Trim().RepEx(@"[0-9]+\%", "#%");
special_option = Array.Find(PS.Cluster.Entries, x => x.Text[z] == tmp2);
if (special_option != null)
{
input = asSplit[0] + ": #";
special_option.Key = "CLUSTER";
}
}
else if (ft_type == "_none_" && lItemOption[PS.Radius.Text[z]] != "")
{
special_option = Array.Find(PS.Radius.Entries, x => x.Text[z] == asSplit[0]);
if (special_option != null)
{
lItemOption[PS.Radius.Text[z]] = RS.lRadius.Entries[special_option.Id.ToInt() - 1].Text[z];
special_option.Key = "RADIUS";
}
}
}
input = Regex.Escape(Regex.Replace(input, @"[+-]?[0-9]+\.[0-9]+|[+-]?[0-9]+", "#"));
input = Regex.Replace(input, @"\\#", @"[+-]?([0-9]+\.[0-9]+|[0-9]+|\#)");
bool local_exists = false;
FilterDictItem filter = null;
foreach (FilterDict data_result in mFilter[z].Result)
{
Regex rgx = new Regex("^" + input + "$", RegexOptions.IgnoreCase);
FilterDictItem[] entries = Array.FindAll(data_result.Entries, x => rgx.IsMatch(x.Text));
// 2개 이상 같은 옵션이 있을때 장비 옵션 (특정) 만 추출
if (entries.Length > 1)
{
FilterDictItem[] entries_tmp = Array.FindAll(entries, x => x.Part == cate_ids[0]);
// 화살통 제외
if (entries_tmp.Length > 0 && (cate_ids.Length == 1 || cate_ids[1] != "quiver"))
{
local_exists = true;
entries = entries_tmp;
}
else
{
entries = Array.FindAll(entries, x => x.Part == null);
}
}
if (entries.Length > 0)
{
Array.Sort(entries, delegate (FilterDictItem entrie1, FilterDictItem entrie2)
{
return (entrie2.Part ?? "").CompareTo(entrie1.Part ?? "");
});
MatchCollection matches1 = Regex.Matches(options[o], @"[-]?([0-9]+\.[0-9]+|[0-9]+)");
foreach (FilterDictItem entrie in entries)
{
int idxMin = 0, idxMax = 0;
bool isMin = false, isMax = false;
bool isBreak = true;
MatchCollection matches2 = Regex.Matches(entrie.Text.Split('\n')[0], @"[-]?([0-9]+\.[0-9]+|[0-9]+|#)");
for (int t = 0; t < matches2.Count; t++)
{
if (matches2[t].Value == "#")
{
if (!isMin)
{
isMin = true;
idxMin = t;
}
else if (!isMax)
{
isMax = true;
idxMax = t;
}
}
else if (matches1[t].Value != matches2[t].Value)
{
isBreak = false;
break;
}
}
if (isBreak)
{
string[] id_split = entrie.Id.Split('.');
(FindName("cbOpt" + k) as ComboBox).Items.Add(new FilterEntrie(cate_ids[0], id_split[0], id_split[1], data_result.Label));
if (filter == null)
{
filter = entrie;
_resistance = id_split.Length == 2 && RS.lResistance.ContainsKey(id_split[1]);
min = isMin && matches1.Count > idxMin ? ((Match)matches1[idxMin]).Value.ToDouble(99999) : 99999;
max = isMax && idxMin < idxMax && matches1.Count > idxMax ? ((Match)matches1[idxMax]).Value.ToDouble(99999) : 99999;
}
break;
}
}
}
}
if (filter != null)
{
string[] split_id = filter.Id.Split('.');
Dictionary<string, SolidColorBrush> color = new Dictionary<string, SolidColorBrush>()
{
{ "implicit", Brushes.DarkRed }, { "crafted", Brushes.Blue }, { "enchant", Brushes.Blue }, { "scourge", Brushes.DarkOrange }
};
SetFilterObjectColor(k, color.ContainsKey(ft_type) ? color[ft_type] : SystemColors.ActiveBorderBrush);
(FindName("cbOpt" + k) as ComboBox).SelectedValue = RS.lFilterType["pseudo"];
if ((FindName("cbOpt" + k) as ComboBox).SelectedValue == null)
{
if (split_id.Length == 2 && RS.lPseudo.ContainsKey(split_id[1]))
(FindName("cbOpt" + k) as ComboBox).Items.Add(new FilterEntrie(cate_ids[0], "pseudo", split_id[1], RS.lFilterType["pseudo"]));
}
if ((FindName("cbOpt" + k) as ComboBox).Items.Count == 1)
{
(FindName("cbOpt" + k) as ComboBox).SelectedIndex = 0;
}
else
{
string tmp_type = !local_exists && mConfig.Options.AutoSelectPseudo ? "pseudo" : ft_type;
(FindName("cbOpt" + k) as ComboBox).SelectedValue = RS.lFilterType.ContainsKey(tmp_type) ? RS.lFilterType[tmp_type] : "_none_";
if ((FindName("cbOpt" + k) as ComboBox).SelectedValue == null)
{
foreach (string type in new string[] { ft_type, "explicit", "fractured" })
{
(FindName("cbOpt" + k) as ComboBox).SelectedValue = RS.lFilterType.ContainsKey(type) ? RS.lFilterType[type] : "_none_";
if ((FindName("cbOpt" + k) as ComboBox).SelectedValue != null) break;
}
}
}
// 평균
if (min != 99999 && max != 99999 && filter.Text.IndexOf("#" + (z == 0 ? "~" : " to ") + "#") > -1)
{
min += max;
min = Math.Truncate(min / 2 * 10) / 10;
max = 99999;
}
// 역방향 이면 위치 바꿈
ParserDictItem force_pos = Array.Find(PS.Position.Entries, x => x.Id.Equals(split_id[1]));
if (force_pos?.Key == "reverse" || force_pos?.Key == "right")
{
double tmp2 = min;
min = max;
max = tmp2;
}
itemfilters.Add(new Itemfilter
{
stat = split_id[1],
type = filter.Type,
text = filter.Text,
max = max,
min = min,
disabled = true
});
(FindName("tbOpt" + k) as TextBox).Text = (is_deep > 0 ? is_deep.ToString() + ") " : "") + filter.Text;
(FindName("tbOpt" + k + "_3") as CheckBox).Visibility = _resistance ? Visibility.Visible : Visibility.Hidden;
if ((FindName("tbOpt" + k + "_3") as CheckBox).Visibility == Visibility.Visible && mConfig.Options.AutoCheckTotalres)
(FindName("tbOpt" + k + "_3") as CheckBox).IsChecked = true;
if (special_option != null && (special_option.Key == "CLUSTER" || special_option.Key == "LOGBOOK"))
{
(FindName("tbOpt" + k) as TextBox).Text = special_option.Text[z];
(FindName("tbOpt" + k) as TextBox).Tag = special_option.Key;
(FindName("tbOpt" + k + "_0") as TextBox).IsEnabled = false;
(FindName("tbOpt" + k + "_1") as TextBox).IsEnabled = false;
(FindName("tbOpt" + k + "_2") as CheckBox).IsChecked = true;
itemfilters[itemfilters.Count - 1].min = min = special_option.Id.ToInt();
itemfilters[itemfilters.Count - 1].max = max = 99999;
if (itemfilters.Count > 0) // 군 주얼 패시브 갯수 자동 체크
{
(FindName("tbOpt0_2") as CheckBox).IsChecked = true;
itemfilters[0].disabled = false;
}
}
if (Array.Find(mParser.Disable.Entries, x => x.Id.Equals(split_id[1])) != null)
{
(FindName("tbOpt" + k + "_2") as CheckBox).IsChecked = false;
(FindName("tbOpt" + k + "_2") as CheckBox).IsEnabled = false;
}
else
{
if (ft_type != "implicit" && (is_deep < 1 || is_deep < 3) &&
(mChecked.Entries?.Find(x => x.Id.Equals(split_id[1]) && x.Key.IndexOf(cate_ids[0] + "/") > -1) != null))
{
(FindName("tbOpt" + k + "_2") as CheckBox).BorderThickness = new Thickness(2);
(FindName("tbOpt" + k + "_2") as CheckBox).IsChecked = true;
itemfilters[itemfilters.Count - 1].disabled = false;
}
}
(FindName("tbOpt" + k + "_0") as TextBox).Text = min == 99999 ? "" : min.ToString();
(FindName("tbOpt" + k + "_1") as TextBox).Text = max == 99999 ? "" : max.ToString();
attackSpeedIncr += filter.Text == PS.AttackSpeedIncr.Text[z] && min.WithIn(1, 999) ? min : 0;
PhysicalDamageIncr += filter.Text == PS.PhysicalDamageIncr.Text[z] && min.WithIn(1, 9999) ? min : 0;
string[] strs_tmp = (FindName("tbOpt" + k) as TextBox).Text.Split('\n');
if (strs_tmp.Length > 1)
{
(FindName("tbOpt" + k) as TextBox).Text = strs_tmp[0];
for (int ssi = 1; ssi < strs_tmp.Length; ssi++)
{
k++;
SetFilterObjectVisibility(k, Visibility.Hidden);
(FindName("tbOpt" + k) as TextBox).Text = strs_tmp[ssi];
(FindName("tbOpt" + k + "_2") as CheckBox).IsChecked = false;
((ComboBox)FindName("cbOpt" + k)).Items.Clear();
SetFilterObjectColor(k, color.ContainsKey(ft_type) ? color[ft_type] : SystemColors.ActiveBorderBrush);
}
}
if (ft_type == "_none_" && (FindName("cbOpt" + k) as ComboBox).SelectedIndex > -1 &&
(string)(FindName("cbOpt" + k) as ComboBox).SelectedValue != RS.lFilterType["explicit"] &&
(string)(FindName("cbOpt" + k) as ComboBox).SelectedValue != RS.lFilterType["pseudo"])
{
SetFilterObjectColor(k, Brushes.Pink);
}
k++;
if (o == 0 && is_multi_line) break; // break if multi lines
}
}
}
}
}
string item_rarity = rarity.Text[0];
string item_name = ibase_info[2];
string item_type = ibase_info[3];
int alt_quality = 0;
bool is_blight = false;
bool is_map = cate_ids[0] == "map"; // || lItemOption[PS.MapTier.Text[z]] != "";
bool is_map_fragment = cate_ids.Length > 1 && cate_ids.Join('.') == "map.fragment";
bool is_map_ultimatum = lItemOption[PS.MapUltimatum.Text[z]] != "";
bool is_prophecy = lItemOption[PS.ProphecyItem.Text[z]] == "_TRUE_";
bool is_currency = rarity.Id == "currency";
bool is_divination_card = rarity.Id == "card";
bool is_gem = rarity.Id == "gem";
bool is_Jewel = cate_ids[0] == "jewel";
bool is_vaal_gem = is_gem && lItemOption[PS.Vaal.Text[z] + " " + item_type] == "_TRUE_";
bool is_heist = lItemOption[PS.Heist.Text[z]] != "";
bool is_unIdentify = lItemOption[PS.Unidentified.Text[z]] == "_TRUE_";
bool is_detail = is_gem || is_map_fragment || (!is_map_ultimatum && is_currency) || is_divination_card || is_prophecy;
int item_idx = -1;
int cate_idx = category != null ? Array.FindIndex(mItems[z].Result, x => x.Id.Equals(category.Key)) : -1;
if (is_prophecy)
{
cate_ids = new string[] { "prophecy" };
item_rarity = Array.Find(PS.Category.Entries, x => x.Id == "prophecy").Text[z];
item_idx = Array.FindIndex(mItems[z].Result[cate_idx].Entries, x => x.Type == item_type);
}
if (is_map_fragment || is_map_ultimatum)
{
item_rarity = is_map_ultimatum ? "결전" : Array.Find(PS.Category.Entries, x => x.Id == "map.fragment").Text[z];
item_idx = Array.FindIndex(mItems[z].Result[cate_idx].Entries, x => x.Type == item_type);
}
else if (lItemOption[PS.MonsterGenus.Text[z]] != "" && lItemOption[PS.MonsterGroup.Text[z]] != "")
{
cate_ids = new string[] { "monster", "beast" };
cate_idx = Array.FindIndex(mItems[z].Result, x => x.Id.Equals("monsters"));
item_idx = Array.FindIndex(mItems[z].Result[cate_idx].Entries, x => x.Text == item_type);
item_rarity = Array.Find(PS.Category.Entries, x => x.Id == "monster.beast").Text[z];
item_type = z == 1 || item_idx == -1 ? item_type : mItems[1].Result[cate_idx].Entries[item_idx].Type;
item_idx = -1; // 야수는 영어로만 검색됨...
}
else if (cate_idx > -1)
{
FilterDict data = mItems[z].Result[cate_idx];
if ((is_unIdentify || rarity.Id == "normal") && item_type.Length > 4 && item_type.IndexOf(PS.Superior.Text[z] + " ") == 0)
{
item_type = item_type.Substring(z == 1 ? 9 : 3);
}
else if (rarity.Id == "magic")
{
item_type = item_type.Split(new string[] { z == 1 ? " of " : " - " }, StringSplitOptions.None)[0].Trim();
}
if (is_gem)
{
for (int i = 0; i < PS.Gems.Entries.Length; i++)
{
int pos = item_type.IndexOf(PS.Gems.Entries[i].Text[z] + " ");
if (pos == 0)
{
alt_quality = i + 1;
item_type = item_type.Substring(PS.Gems.Entries[i].Text[z].Length + 1);
}
}
if (is_vaal_gem && lItemOption[PS.Corrupted.Text[z]] == "_TRUE_")
{
FilterDictItem entries = Array.Find(data.Entries, x => x.Text.Equals(PS.Vaal.Text[z] + " " + item_type));
if (entries != null) item_type = entries.Type;
}
}
else if (is_map && item_type.Length > 5)
{
if (item_type.Length > 5)
{
if (item_type.IndexOf(PS.Blighted.Text[z] + " ") == 0)
{
is_blight = true;
item_type = item_type.Substring(PS.Blighted.Text[z].Length + 1);
}
if (item_type.IndexOf(PS.Shaped.Text[z] + " ") == 0)
item_type = item_type.Substring(PS.Shaped.Text[z].Length + 1);
}
// 환영 지도면 구분을 위해서 1번 옵션 자동 체크
if (!lItemOption[PS.DeliriumReward.Text[z]].IsEmpty() && itemfilters.Count > 0)
{
(FindName("tbOpt0_2") as CheckBox).IsChecked = true;
(FindName("tbOpt0_0") as TextBox).Text = "";
itemfilters[0].disabled = false;
itemfilters[0].min = 99999;
}
}
else if (lItemOption[PS.SynthesisedItem.Text[z]] == "_TRUE_")
{
string[] tmp = PS.SynthesisedItem.Text[z].Split(' ');
if (item_type.IndexOf(tmp[0] + " ") == 0)
item_type = item_type.Substring(tmp[0].Length + 1);
}
if (!is_unIdentify && rarity.Id == "magic")
{
string[] tmp = item_type.Split(' ');
if (data != null && tmp.Length > 1)
{
for (int i = 0; i < tmp.Length - 1; i++)
{
tmp[i] = "";
string tmp2 = tmp.Join(' ').Trim();
FilterDictItem entries = Array.Find(data.Entries, x => x.Type.Equals(tmp2));
if (entries != null)
{
item_type = entries.Type;
break;
}
}
}
}
item_idx = Array.FindIndex(mItems[z].Result[cate_idx].Entries, x => (x.Type == item_type && (rarity.Id != "unique" || x.Name == item_name)));
}
string item_quality = Regex.Replace(lItemOption[PS.Quality.Text[z]], "[^0-9]", "");
bool is_gear = cate_ids.Length > 1 && cate_ids[0].WithIn("weapon", "armour", "accessory");
if (is_detail || is_map_fragment)
{
try
{
int i = is_map_fragment ? 1 : (is_gem ? 3 : 2);
tkDetail.Text = asData.Length > (i + 1) ? asData[i] + asData[i + 1] : asData[asData.Length - 1];
tkDetail.Text = Regex.Replace(
tkDetail.Text.Replace(PS.UnstackItems.Text[z], ""),
"<(uniqueitem|prophecy|divination|gemitem|magicitem|rareitem|whiteitem|corrupted|default|normal|augmented|size:[0-9]+)>",
""
);
}
catch { }
}
else
{
// 장기는 중복 옵션 제거
if (cate_ids.Join('.') == "monster.sample")
{
Deduplicationfilter(itemfilters);
}
else if (!is_unIdentify && cate_ids[0] == "weapon")
{
setDPS(
lItemOption[PS.PhysicalDamage.Text[z]], lItemOption[PS.ElementalDamage.Text[z]], lItemOption[PS.ChaosDamage.Text[z]],
item_quality, lItemOption[PS.AttacksPerSecond.Text[z]], PhysicalDamageIncr, attackSpeedIncr
);
}
}
cbName.Items.Clear();
bool btmp = cate_idx == -1 || item_idx == -1;
for (int i = 0; i < 2; i++)
{
string name = btmp || rarity.Id != "unique" ? item_name : mItems[i].Result[cate_idx].Entries[item_idx].Name;
string type = btmp ? item_type : mItems[i].Result[cate_idx].Entries[item_idx].Type;
cbName.Items.Add(new ItemNames(name, type));
}
cbName.SelectedIndex = mConfig.Options.ServerType < 1 ? z : mConfig.Options.ServerType;
cbName.Tag = cate_ids; //카테고리
string[] bys = mConfig.Options.AutoSelectByType.ToLower().Split(',');
if (bys.Length > 0)
{
ckByCategory.IsChecked = Array.IndexOf(bys, cate_ids.Join('.')) > -1;
}
cbRarity.SelectedValue = item_rarity;
if (cbRarity.SelectedIndex == -1)
{
cbRarity.Items.Clear();
cbRarity.Items.Add(item_rarity);
cbRarity.SelectedIndex = 0;
}
else if ((string)cbRarity.SelectedValue == "normal")
{
cbRarity.SelectedIndex = 0;
}
bdExchange.IsEnabled = cate_ids[0] == "currency" && GetExchangeItem(z, item_type) != null;
bdExchange.Visibility = !is_gem && (is_detail || bdExchange.IsEnabled) ? Visibility.Visible : Visibility.Hidden;
if (bdExchange.Visibility == Visibility.Hidden)
{
tbLvMin.Text = Regex.Replace(lItemOption[is_gem ? PS.Level.Text[z] : PS.ItemLevel.Text[z]], "[^0-9]", "");
tbQualityMin.Text = item_quality;
string[] Influences = { PS.ShaperItem.Text[z], PS.ElderItem.Text[z], PS.CrusaderItem.Text[z], PS.RedeemerItem.Text[z], PS.HunterItem.Text[z], PS.WarlordItem.Text[z] };
for (int i = 0; i < Influences.Length; i++)
{
if (lItemOption[Influences[i]] == "_TRUE_")
cbInfluence1.SelectedIndex = i + 1;
}
for (int i = 0; i < Influences.Length; i++)
{
if (cbInfluence1.SelectedIndex != (i + 1) && lItemOption[Influences[i]] == "_TRUE_")
cbInfluence2.SelectedIndex = i + 1;
}
if (lItemOption[PS.Corrupted.Text[z]] == "_TRUE_")
{
cbCorrupt.BorderThickness = new Thickness(2);
cbCorrupt.FontWeight = FontWeights.Bold;
cbCorrupt.Foreground = System.Windows.Media.Brushes.DarkRed;
}
if (is_gem || is_Jewel || is_heist || is_map)
{
cbAltQuality.Items.Add(
is_heist ? "모든 강탈 가치" : (
is_gem ? "모든 젬" : (
is_map_ultimatum ? "모든 보상" : (is_Jewel ? "모든 반경" : "영향 없음")
)));
foreach (ParserDictItem item in (
is_heist ? PS.Heist : (is_gem ? PS.Gems : (
is_map_ultimatum ? PS.RewardUltimatum : (is_Jewel ? RS.lRadius : PS.MapTier)
))).Entries)
{
cbAltQuality.Items.Add(item.Text[z]);
}
if (is_gem)
{
ckLv.IsChecked = lItemOption[PS.Level.Text[z]].IndexOf(" (" + PS.Max.Text[z]) > 0;
ckQuality.IsChecked = item_quality.ToInt(0) > 19;
cbAltQuality.SelectedIndex = alt_quality;
}
else if (is_Jewel)
{
cbAltQuality.SelectedItem = lItemOption[PS.Radius.Text[z]];
if (cbAltQuality.SelectedIndex == -1)
{
cbAltQuality.Items.Clear();
cbAltQuality.Items.Add(lItemOption[PS.Radius.Text[z]] ?? "");
cbAltQuality.SelectedIndex = 0;
}
}
else if (is_heist)
{
string tmp = Regex.Replace(lItemOption[PS.Heist.Text[z]], @".+ \(([^\)]+)\)$", "$1");
cbAltQuality.SelectedValue = tmp;
if (cbAltQuality.SelectedIndex == -1)
{
cbAltQuality.SelectedIndex = 0;
}
ckLv.IsChecked = true;
}
else if (is_map || is_map_ultimatum)
{
Synthesis.Content = "역병";
if (is_map_ultimatum)
{
cbAltQuality.SelectedValue = lItemOption[PS.RewardUltimatum.Text[z]];
if (cbAltQuality.SelectedIndex == -1)
{
cbAltQuality.Items[cbAltQuality.Items.Count - 1] = lItemOption[PS.RewardUltimatum.Text[z]];
cbAltQuality.SelectedIndex = cbAltQuality.Items.Count - 1;
}
}
else
{
ckLv.IsChecked = true;
ckLv.Content = "등급";
tbLvMin.Text = tbLvMax.Text = lItemOption[PS.MapTier.Text[z]];
cbAltQuality.SelectedValue = map_influenced != "" ? map_influenced : "영향 없음";
}
}
}
else if (is_gear || cate_ids[0] == "flask")
{
if (tbQualityMin.Text.ToInt(0) > (cate_ids[0] == "accessory" ? 4 : 20))
{
ckQuality.FontWeight = FontWeights.Bold;
ckQuality.Foreground = System.Windows.Media.Brushes.DarkRed;
ckQuality.BorderBrush = System.Windows.Media.Brushes.DarkRed;
}
if (is_gear)
{
cbCorrupt.SelectedIndex = mConfig.Options.AutoSelectCorrupt == "no" ? 2 : (mConfig.Options.AutoSelectCorrupt == "yes" ? 1 : 0);
}
}
}
if (lItemOption[PS.Sockets.Text[z]] != "")
{
int[] socket = SocketParser(lItemOption[PS.Sockets.Text[z]]);
tbSocketMin.Text = socket[0].ToString();
tbLinksMin.Text = socket[1] > 0 ? socket[1].ToString() : "";
ckSocket.IsChecked = socket[1] > 4;
}
if (is_gear && ckLv.IsChecked == false && cbName.Items.Count == 2)
{
ItemNames names = (ItemNames)cbName.Items[0];
string tmp = names.Type.Escape() + @"\(([0-9]+)\)\/";
string tmp2 = (cbInfluence1.Text ?? "__NULL__") + "|" + (cbInfluence2.Text ?? "__NULL__");
CheckedDictItem baseitem = mChecked.bases?.Find(x => Regex.IsMatch(x.Id, "모두|" + tmp2) && Regex.IsMatch(x.Key, tmp));
if (baseitem != null)
{
MatchCollection mmm = Regex.Matches(baseitem.Key, tmp);
if (mmm.Count == 1 && mmm[0].Groups.Count == 2 && mmm[0].Groups[1].Value.ToInt(101) <= tbLvMin.Text.ToInt(0))
{
ckLv.FontWeight = FontWeights.Bold;
ckLv.Foreground = System.Windows.Media.Brushes.DarkRed;
ckLv.BorderBrush = System.Windows.Media.Brushes.DarkRed;
ckLv.IsChecked = true;
}
}
}
if (isWinShow || this.Visibility == Visibility.Visible)
{
Synthesis.IsChecked = (is_map && is_blight) || lItemOption[PS.SynthesisedItem.Text[z]] == "_TRUE_";
lbSocketBackground.Visibility = is_gear ? Visibility.Hidden : Visibility.Visible;
cbAltQuality.Visibility = is_gear ? Visibility.Hidden : Visibility.Visible;
bdDetail.Visibility = is_detail ? Visibility.Visible : Visibility.Hidden;
cbInfluence1.Visibility = cbAltQuality.Visibility == Visibility.Visible ? Visibility.Hidden : Visibility.Visible;
cbInfluence2.Visibility = cbAltQuality.Visibility == Visibility.Visible ? Visibility.Hidden : Visibility.Visible;
if (cbInfluence1.SelectedIndex > 0) cbInfluence1.BorderThickness = new Thickness(2);
if (cbInfluence2.SelectedIndex > 0) cbInfluence2.BorderThickness = new Thickness(2);
tkPriceInfo.Foreground = tkPriceCount.Foreground = SystemColors.WindowTextBrush;
mLockUpdatePrice = false;
if (mConfig.Options.SearchAutoDelay > 0 && mAutoSearchTimerCount < 1)
{
UpdatePriceThreadWorker(GetItemOptions(), null);
}
else
{
liPrice.Items.Clear();
}
if (mConfig.Options.AutoCheckUnique && rarity.Id == "unique")
cbAiiCheck.IsChecked = true;
this.Show();
}
}
}
catch (Exception ex)
{
//Console.WriteLine(ex.Message);
ForegroundMessage(String.Format("{0} 에러: {1}\r\n\r\n{2}\r\n\r\n", ex.Source, ex.Message, ex.StackTrace), "에러", MessageBoxButton.OK, MessageBoxImage.Error);
}
}
private ItemOption GetItemOptions()
{
ItemOption itemOption = new ItemOption();
itemOption.LangIndex = cbName.SelectedIndex;
itemOption.Inherits = (string[])cbName.Tag; //카테고리
itemOption.Name = (cbName.SelectedItem as ItemNames).Name;
itemOption.Type = (cbName.SelectedItem as ItemNames).Type;
itemOption.Influence1 = cbInfluence1.SelectedIndex;
itemOption.Influence2 = cbInfluence2.SelectedIndex;
// 영향은 첫번째 값이 우선 순위여야 함
if (itemOption.Influence1 == 0 && itemOption.Influence2 != 0)
{
itemOption.Influence1 = itemOption.Influence2;
itemOption.Influence2 = 0;
}
itemOption.Corrupt = cbCorrupt.SelectedIndex;
itemOption.Synthesis = Synthesis.IsChecked == true;
itemOption.ChkSocket = ckSocket.IsChecked == true;
itemOption.ChkQuality = ckQuality.IsChecked == true;
itemOption.ChkLv = ckLv.IsChecked == true;
itemOption.ByCategory = ckByCategory.IsChecked == true;
itemOption.SocketMin = tbSocketMin.Text.ToDouble(99999);
itemOption.SocketMax = tbSocketMax.Text.ToDouble(99999);
itemOption.LinkMin = tbLinksMin.Text.ToDouble(99999);
itemOption.LinkMax = tbLinksMax.Text.ToDouble(99999);
itemOption.QualityMin = tbQualityMin.Text.ToDouble(99999);
itemOption.QualityMax = tbQualityMax.Text.ToDouble(99999);
itemOption.LvMin = tbLvMin.Text.ToDouble(99999);
itemOption.LvMax = tbLvMax.Text.ToDouble(99999);
itemOption.AltQuality = cbAltQuality.SelectedIndex;
itemOption.RarityAt = cbRarity.Items.Count > 1 ? cbRarity.SelectedIndex : 0;
itemOption.PriceMin = tbPriceFilterMin.Text == "" ? 0 : tbPriceFilterMin.Text.ToDouble(99999);
bool is_ultimatum = (cbRarity.SelectedValue ?? "").Equals("결전");
itemOption.Flags = is_ultimatum ? "ULTIMATUM|" + cbAltQuality.SelectedValue : "";
itemOption.itemfilters.Clear();
if (!is_ultimatum && itemOption.AltQuality > 0 && itemOption.Inherits[0].WithIn("jewel", "map"))
{
Itemfilter itemfilter = new Itemfilter();
itemfilter.min = itemfilter.max = 99999;
itemfilter.disabled = false;
if (itemOption.Inherits[0] == "jewel")
{
itemfilter.type = "explicit";
itemfilter.stat = "stat_3642528642";
itemfilter.option = itemOption.AltQuality.ToString();
}
else
{
itemfilter.type = "implicit";
itemfilter.stat = "stat_1792283443";
itemfilter.option = itemOption.AltQuality.ToString();
}
FilterDict filterDict = Array.Find(mFilter[itemOption.LangIndex].Result, x => x.Label == RS.lFilterType[itemfilter.type]);
if (filterDict != null)
{
FilterDictItem filter = Array.Find(filterDict.Entries, x => x.Id == itemfilter.type + "." + itemfilter.stat);
itemfilter.text = filter?.Text ?? "";
itemOption.itemfilters.Add(itemfilter);