-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathForm1.cs
More file actions
6276 lines (5746 loc) · 377 KB
/
Form1.cs
File metadata and controls
6276 lines (5746 loc) · 377 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
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.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Xml;
using System.Runtime.Serialization;
using OTGEdit.XML;
using OTGEdit.Utils;
using System.Runtime.InteropServices;
namespace OTGEdit
{
public partial class Form1 : Form
{
string WorldSaveDir = "";
SaveFileDialog sfd;
OpenFileDialog ofd;
FolderBrowserDialog convertBO3fbd;
FolderBrowserDialog copyBO3fbd;
FolderBrowserDialog fbdDestinationWorldDir = new FolderBrowserDialog();
OpenFileDialog convertBO3ofd;
ColorDialog colorDlg = new ColorDialog() { AnyColor = true, SolidColorOnly = false };
List<ListBox> BiomeListInputs = new List<ListBox>();
Dictionary<object, OTGProperty> ResourceQueueInputs = new Dictionary<object, OTGProperty>();
bool IgnorePropertyInputChangedBiome = false;
bool IgnoreOverrideCheckChangedBiome = false;
List<BiomeConfig> BiomeConfigsDefaultValues = new List<BiomeConfig>();
DialogResult addingMultipleResourcesXToAll = DialogResult.Abort;
DialogResult addingMultipleResourcesXToAll2 = DialogResult.Abort;
DialogResult addingMultipleResourcesXToAll3 = DialogResult.Abort;
List<string> resourcesToAdd = new List<string>();
bool copyPasting = false;
#region Startup
public Form1()
{
System.Globalization.CultureInfo customCulture = (System.Globalization.CultureInfo)System.Threading.Thread.CurrentThread.CurrentCulture.Clone();
customCulture.NumberFormat.NumberDecimalSeparator = ".";
System.Threading.Thread.CurrentThread.CurrentCulture = customCulture;
InitializeComponent();
groupBoxWorldTab.Location = new Point(21,144);
groupBoxBiomesTab.Location = new Point(-5000, 144);
tabControl1.Selected += tabControl1_Selected;
// TODO: Pass these as method parameters instead of using static fields.
Session.Form1 = this;
Session.tabControl1 = tabControl1;
Session.panel2 = pnlWorldTabInputs;
Session.panel3 = pnlBiomesTabInputs;
Session.btSave = btSave;
Session.btLoad = btLoad;
Session.btGenerate = btGenerate;
Session.lbGroups = lbGroups;
Session.btCopyBO3s = btCopyBO3s;
Session.Init();
this.rtbHelpTabLink1.LinkClicked += richTextBox_LinkClicked;
this.rtbHelpTabLink2.LinkClicked += richTextBox_LinkClicked;
this.rtbHelpTabLink3.LinkClicked += richTextBox_LinkClicked;
this.rtbHelpTabLink4.LinkClicked += richTextBox_LinkClicked;
this.AllowDrop = true;
this.DragEnter += new DragEventHandler(Form1_DragEnter);
this.DragDrop += new DragEventHandler(Form1_DragDrop);
tbSearchWorldConfig.MouseWheel += tbSearchWorldConfig_MouseWheel;
tbSearchBiomeConfig.MouseWheel += tbSearchBiomeConfig_MouseWheel;
pnlBiomesTabInputs.MouseWheel += lbBiomesTab_MouseWheel;
lbGroups.MouseWheel += lbBiomesTab_MouseWheel;
lbGroup.MouseWheel += lbBiomesTab_MouseWheel;
lbBiomes.MouseWheel += lbBiomesTab_MouseWheel;
lbGroup.KeyDown += PopUpForm.listBox_KeyDown;
lbBiomes.KeyDown += PopUpForm.listBox_KeyDown;
this.Width = Session.ClosedWidth;
this.Height = Session.ClosedHeight;
btSave.Enabled = false;
btLoad.Enabled = false;
cbVersion.SelectedIndexChanged += new EventHandler(delegate(object s, EventArgs args)
{
cbWorld.Items.Clear();
DirectoryInfo versionDir3 = new DirectoryInfo(Path.GetDirectoryName(Application.ExecutablePath) + "\\VersionConfigs\\" + cbVersion.SelectedItem + "\\Worlds\\");
if (versionDir3.Exists)
{
foreach (DirectoryInfo dir2 in versionDir3.GetDirectories())
{
cbWorld.Items.Add(dir2.Name);
}
if (cbWorld.Items.Count > 0)
{
cbWorld.SelectedIndex = 0;
}
}
});
if (Session.VersionDir.Exists)
{
foreach (DirectoryInfo dir1 in Session.VersionDir.GetDirectories())
{
cbVersion.Items.Add(dir1.Name);
}
if(cbVersion.Items.Count > 0)
{
cbVersion.SelectedIndex = 0;
}
}
DirectoryInfo dir = new DirectoryInfo(Path.GetDirectoryName(Application.ExecutablePath) + "\\Saves\\");
if (!dir.Exists)
{
dir.Create();
dir.Refresh();
}
sfd = new SaveFileDialog() { DefaultExt = "xml", InitialDirectory = dir.FullName };
sfd.Title = "Select an OTGEdit save file";
ofd = new OpenFileDialog() { DefaultExt = "xml", InitialDirectory = dir.FullName };
ofd.Title = "Select a save location";
convertBO3fbd = new FolderBrowserDialog();
convertBO3fbd.Description = "Select output directory";
convertBO3ofd = new OpenFileDialog() { DefaultExt = "schematic" };
convertBO3ofd.Title = "Select schematic(s) to convert";
convertBO3ofd.Multiselect = true;
copyBO3fbd = new FolderBrowserDialog();
copyBO3fbd.Description = "Select a /GlobalObjects or /WorldObjects directory (create if needed).";
}
void tabControl1_Selected(object sender, TabControlEventArgs e)
{
if(tabControl1.SelectedIndex == 0)
{
groupBoxWorldTab.Location = new Point(21,144);
groupBoxBiomesTab.Location = new Point(-5000, 144);
}
if (tabControl1.SelectedIndex == 1)
{
groupBoxWorldTab.Location = new Point(-5000, 144);
groupBoxBiomesTab.Location = new Point(21, 144);
}
if (tabControl1.SelectedIndex == 2)
{
groupBoxWorldTab.Location = new Point(-5000, 144);
groupBoxBiomesTab.Location = new Point(-5000, 144);
}
}
void SelectSourceWorld_Click(object sender, EventArgs e)
{
Session.ShowProgessBox();
Session.BiomeNames.Clear();
BiomeListInputs.Clear();
Session.DestinationConfigsDir = "";
WorldSaveDir = "";
Session.SourceConfigsDir = "";
Session.ToolTip1.RemoveAll();
ResourceQueueInputs.Clear();
tlpWorldSettings1.Controls.Clear();
tlpWorldSettings1.RowStyles.Clear();
tlpBiomeSettings1.Controls.Clear();
tlpBiomeSettings1.RowStyles.Clear();
Session.WorldConfigDefaultValues = null;
Session.WorldConfig1 = null;
Session.WorldSettingsInputs.Clear();
Session.BiomeGroups.Clear();
BiomeConfigsDefaultValues.Clear();
Session.BiomeSettingsInputs.Clear();
lbGroups.Items.Clear();
lbGroup.Items.Clear();
lbBiomes.Items.Clear();
DirectoryInfo versionDir = new DirectoryInfo(Path.GetDirectoryName(Application.ExecutablePath) + "\\VersionConfigs\\");
if (cbVersion.Items.Count > 0 && cbVersion.SelectedItem != null && versionDir.Exists)
{
var serializer = new System.Xml.Serialization.XmlSerializer(typeof(VersionConfig));
using (var reader = new XmlTextReader(Path.GetDirectoryName(Application.ExecutablePath) + "\\VersionConfigs\\" + cbVersion.SelectedItem + "\\VersionConfig.xml"))
{
Session.VersionConfig = (VersionConfig)serializer.Deserialize(reader);
}
if (Session.VersionConfig != null)
{
Session.SettingsType = Session.VersionConfig.SettingsTypes.FirstOrDefault(a => a.Type == "Forge") ?? Session.VersionConfig.SettingsTypes.First();
Session.WorldConfig1 = new WorldConfig(Session.VersionConfig);
LoadUI();
} else {
PopUpForm.CustomMessageBox("Y u do dis? :(");
}
Session.SourceConfigsDir = Path.GetDirectoryName(Application.ExecutablePath) + "\\VersionConfigs\\" + cbVersion.SelectedItem + "\\Worlds\\" + cbWorld.SelectedItem + "\\";
if (!String.IsNullOrEmpty(Session.SourceConfigsDir) && System.IO.Directory.Exists(Session.SourceConfigsDir + "\\" + "WorldBiomes" + "\\"))
{
System.IO.DirectoryInfo defaultWorldDirectory = new System.IO.DirectoryInfo(Session.SourceConfigsDir + "\\" + "WorldBiomes" + "\\");
List<FileInfo> biomeFiles = DirectoryUtils.GetAllFilesInDirAndSubDirs(defaultWorldDirectory.FullName);
foreach (System.IO.FileInfo file in biomeFiles)
{
if (file.Name.EndsWith(".bc"))
{
Session.BiomeNames.Add(file.Name.Replace(".bc", ""));
}
}
foreach (ListBox listBox in BiomeListInputs)
{
listBox.Items.Clear();
foreach (string biomeName in Session.BiomeNames)
{
listBox.Items.Add(biomeName.Trim());
}
}
}
Session.WorldConfigDefaultValues = World.LoadWorldConfigFromFile(new FileInfo(Session.SourceConfigsDir + "WorldConfig.ini"), Session.VersionConfig, true);
if (Session.WorldConfigDefaultValues == null)
{
Session.HideProgessBox();
UnloadUI();
Session.Form1.ResumeLayout();
PopUpForm.CustomMessageBox("WorldConfig.ini could not be loaded. Please make sure that WorldConfig.ini is present in the VersionConfigs directory for the selected version.", "Incompatible WorldConfig.ini");
return;
} else {
LoadBiomesList();
if (cbWorld.SelectedItem != null && cbWorld.SelectedItem.Equals("Default"))
{
LoadDefaultGroups();
}
if (lbBiomes.Items.Count > 0)
{
lbBiomes.SelectedIndex = 0;
}
foreach (Button bSetDefaults in Session.WorldSettingsInputs.Select(a => a.Value.Item3))
{
Session.ToolTip1.SetToolTip(bSetDefaults, "Set to default");
bSetDefaults.Text = "<";
}
btSetToDefault.Text = "Set to defaults";
}
string currentWorldTemplateName = new DirectoryInfo(Session.SourceConfigsDir).Name;
if (lastUsedWorldName.ContainsKey(currentWorldTemplateName))
{
lastUsedWorldName[currentWorldTemplateName] = currentWorldTemplateName;
} else {
lastUsedWorldName.Add(currentWorldTemplateName, currentWorldTemplateName);
}
Session.Form1.AutoSize = false;
Session.Form1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowOnly;
if (Session.Form1.Width < Session.OpenedWidth)
{
Session.Form1.Width = Session.OpenedWidth;
}
if (Session.Form1.Height < Session.OpenedHeight)
{
Session.Form1.Height = Session.OpenedHeight;
}
btClickBackGround(null, null);
}
Session.HideProgessBox();
}
public void UnloadUI()
{
//tabControl1.Visible = false;
btGenerate.Visible = false;
btCopyBO3s.Visible = false;
btSave.Enabled = false;
btLoad.Enabled = false;
tlpBiomeSettings1.Visible = false;
AutoSize = false;
Width = Session.ClosedWidth;
Height = Session.ClosedHeight;
}
public void LoadUI()
{
Session.ToolTip1.RemoveAll();
Session.ToolTip1.SetToolTip(lblGroups,
"Create biome groups containing one or more biome(s) and configure settings for each group.\r\n" +
"If a biome is listed in multiple groups then the order of the groups determines the final value.\r\n" +
"For instance you can set a value in the first group and override it in the second.\r\n" +
"Settings that accept a list of biomes or resources as a value can even be merged\r\n" +
"so you can add gold ore in the first group and diamond ore in the second."
);
btGenerate.Hide();
btCopyBO3s.Hide();
btSave.Enabled = false;
btLoad.Enabled = false;
tlpBiomeSettings1.Hide();
string uniqueResourceQueueItems = "";
foreach (ResourceQueueItem resourceQueueItem in Session.VersionConfig.ResourceQueueOptions)
{
if (resourceQueueItem.IsUnique)
{
if (!resourceQueueItem.HasUniqueParameter)
{
uniqueResourceQueueItems += resourceQueueItem.Name + "\r\n";
}
else if (resourceQueueItem.UniqueParameterIndex == 0)
{
uniqueResourceQueueItems += resourceQueueItem.Name + "*,\r\n";
}
else if (resourceQueueItem.UniqueParameterIndex == 1)
{
uniqueResourceQueueItems += resourceQueueItem.Name + "X,*,\r\n";
}
}
}
Dictionary<String, List<OTGProperty>> settingsByGroup = new Dictionary<string,List<OTGProperty>>();
// Worlds
foreach (OTGProperty property in Session.VersionConfig.WorldConfigDict.Values)
{
if (settingsByGroup.ContainsKey(property.Group))
{
settingsByGroup[property.Group].Add(property);
} else {
settingsByGroup[property.Group] = new List<OTGProperty>() { property };
}
}
tlpWorldSettings1.SuspendLayout();
tlpWorldSettings1.Controls.Clear();
tlpWorldSettings1.RowStyles.Clear();
tlpBiomeSettings1.SuspendLayout();
tlpBiomeSettings1.Controls.Clear();
tlpBiomeSettings1.RowStyles.Clear();
string lastGroupTitle = null;
int row = 0;
foreach (KeyValuePair<String, List<OTGProperty>> settingsGroup in settingsByGroup)
{
if (!String.IsNullOrEmpty(settingsGroup.Key) && (lastGroupTitle == null || !lastGroupTitle.Equals(settingsGroup.Key)))
{
lastGroupTitle = settingsGroup.Key;
Label txPropertyLabel1 = new Label();
txPropertyLabel1.Text = settingsGroup.Key;
txPropertyLabel1.Font = new System.Drawing.Font(txPropertyLabel1.Font, FontStyle.Bold);
txPropertyLabel1.AutoSize = true;
txPropertyLabel1.Margin = new Padding(0, row == 0 ? 10 : 35, 0, 15);
txPropertyLabel1.Click += new System.EventHandler(this.btClickBackGround);
tlpWorldSettings1.Controls.Add(txPropertyLabel1, 0, row);
row++;
tlpWorldSettings1.RowStyles.Add(new RowStyle(SizeType.AutoSize));
}
foreach (OTGProperty property in settingsGroup.Value)
{
Label txPropertyLabel = new Label();
txPropertyLabel.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right;
txPropertyLabel.Text = property.LabelText != null && property.LabelText.Length > 0 ? property.LabelText : property.Name;
txPropertyLabel.AutoSize = true;
txPropertyLabel.TabStop = false;
txPropertyLabel.Margin = new Padding(0, 5, 0, 0);
txPropertyLabel.Click += new System.EventHandler(this.btClickBackGround);
tlpWorldSettings1.Controls.Add(txPropertyLabel, 0, row);
CheckBox cbOverride = new CheckBox();
cbOverride.Anchor = AnchorStyles.Left | AnchorStyles.Top;
cbOverride.TabStop = false;
cbOverride.AutoSize = true;
cbOverride.Padding = new Padding(cbOverride.Padding.Left, cbOverride.Padding.Top + 4, cbOverride.Padding.Right, cbOverride.Padding.Bottom);
Session.ToolTip1.SetToolTip(cbOverride, "Apply this value");
tlpWorldSettings1.Controls.Add(cbOverride, 1, row);
cbOverride.CheckedChanged += PropertyInputOverrideCheckChangedWorld;
Panel pnlBtnHolder = new Panel();
pnlBtnHolder.Anchor = AnchorStyles.Left | AnchorStyles.Top;
pnlBtnHolder.Width = 23;
pnlBtnHolder.Height = 23;
pnlBtnHolder.Margin = new System.Windows.Forms.Padding(0, 1, 0, 0);
Button bSetDefaults = new Button();
bSetDefaults.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(74)))), ((int)(((byte)(150)))), ((int)(((byte)(134)))));
bSetDefaults.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
bSetDefaults.ForeColor = System.Drawing.Color.White;
bSetDefaults.UseVisualStyleBackColor = false;
bSetDefaults.Anchor = AnchorStyles.Left | AnchorStyles.Top;
bSetDefaults.Text = "C";
bSetDefaults.Width = 23;
bSetDefaults.Height = 23;
bSetDefaults.Click += bSetDefaultsWorldProperty;
bSetDefaults.TabStop = false;
pnlBtnHolder.Controls.Add(bSetDefaults);
tlpWorldSettings1.Controls.Add(pnlBtnHolder, 3, row);
Button bOpenTextEditor = null;
if (property.PropertyType == "BigString")
{
pnlBtnHolder.Height = 60;
bOpenTextEditor = new Button();
bOpenTextEditor.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(74)))), ((int)(((byte)(150)))), ((int)(((byte)(134)))));
bOpenTextEditor.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
bOpenTextEditor.ForeColor = System.Drawing.Color.White;
bOpenTextEditor.UseVisualStyleBackColor = false;
bOpenTextEditor.Anchor = AnchorStyles.Left | AnchorStyles.Top;
bOpenTextEditor.Text = "E";
bOpenTextEditor.Width = 23;
bOpenTextEditor.Height = 23;
bOpenTextEditor.Top = 26;
bOpenTextEditor.Click += bOpenTextEditBoxWorldProperty;
bOpenTextEditor.TabStop = false;
pnlBtnHolder.Controls.Add(bOpenTextEditor);
}
switch (property.PropertyType)
{
case "ResourceQueue":
Panel pnl = new Panel();
pnl.Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top;
pnl.AutoSize = false;
pnl.Width = 160;
ListBox lbPropertyInput = new ListBox();
lbPropertyInput.Sorted = true;
lbPropertyInput.Width = pnl.Width;
lbPropertyInput.Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top;
lbPropertyInput.SelectionMode = SelectionMode.MultiExtended;
lbPropertyInput.KeyDown += lbPropertyInput_KeyDown_World;
lbPropertyInput.Height = 140;
lbPropertyInput.DoubleClick += btEditResourceQueueItemWorld_Click;
//lbPropertyInput.MouseWheel += lbWorldTabSetting_MouseWheel;
lbPropertyInput.MouseHover += lbPropertyInput_MouseHover;
ResourceQueueInputs.Add(lbPropertyInput, property);
pnl.Controls.Add(lbPropertyInput);
Panel pnl3 = new Panel();
pnl3.Top = 140;
pnl3.Width = 160;
pnl3.Height = 25;
pnl3.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
pnl3.Resize += new EventHandler(delegate(object s, EventArgs args)
{
int left = 0;
foreach (Control ctl in ((Panel)s).Controls)
{
ctl.Width = (((Panel)s).Width - 10) / 3;
ctl.Left = left;
left += ((((Panel)s).Width - 10) / 3) + 5;
}
});
Button btAddResourceQueueItem = new Button();
btAddResourceQueueItem.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(74)))), ((int)(((byte)(150)))), ((int)(((byte)(134)))));
btAddResourceQueueItem.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
btAddResourceQueueItem.ForeColor = System.Drawing.Color.White;
btAddResourceQueueItem.UseVisualStyleBackColor = false;
btAddResourceQueueItem.Width = 50;
btAddResourceQueueItem.Anchor = AnchorStyles.Top;
btAddResourceQueueItem.Text = "Add";
btAddResourceQueueItem.Click += btAddResourceQueueItemWorld_Click;
btAddResourceQueueItem.TabStop = false;
ResourceQueueInputs.Add(btAddResourceQueueItem, property);
pnl3.Controls.Add(btAddResourceQueueItem);
Button btEditResourceQueueItem = new Button();
btEditResourceQueueItem.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(74)))), ((int)(((byte)(150)))), ((int)(((byte)(134)))));
btEditResourceQueueItem.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
btEditResourceQueueItem.ForeColor = System.Drawing.Color.White;
btEditResourceQueueItem.UseVisualStyleBackColor = false;
btEditResourceQueueItem.Left = 55;
btEditResourceQueueItem.Width = 50;
btEditResourceQueueItem.Anchor = AnchorStyles.Top;
btEditResourceQueueItem.Text = "Edit";
btEditResourceQueueItem.Click += btEditResourceQueueItemWorld_Click;
btEditResourceQueueItem.TabStop = false;
ResourceQueueInputs.Add(btEditResourceQueueItem, property);
pnl3.Controls.Add(btEditResourceQueueItem);
Button btDeleteResourceQueueItem = new Button();
btDeleteResourceQueueItem.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(74)))), ((int)(((byte)(150)))), ((int)(((byte)(134)))));
btDeleteResourceQueueItem.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
btDeleteResourceQueueItem.ForeColor = System.Drawing.Color.White;
btDeleteResourceQueueItem.UseVisualStyleBackColor = false;
btDeleteResourceQueueItem.Left = 110;
btDeleteResourceQueueItem.Width = 50;
btDeleteResourceQueueItem.Anchor = AnchorStyles.Top;
btDeleteResourceQueueItem.Text = "Delete";
btDeleteResourceQueueItem.Click += btDeleteResourceQueueItemWorld_Click;
btDeleteResourceQueueItem.TabStop = false;
ResourceQueueInputs.Add(btDeleteResourceQueueItem, property);
pnl3.Controls.Add(btDeleteResourceQueueItem);
Panel pCheckBoxes = new Panel();
pCheckBoxes.Top = 172;
pCheckBoxes.Width = 160;
pCheckBoxes.Height = 70;
pCheckBoxes.Visible = false;
pCheckBoxes.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right;
CheckBox btIgnoreParentMerge = new CheckBox();
btIgnoreParentMerge.Anchor = AnchorStyles.Left | AnchorStyles.Top;
btIgnoreParentMerge.AutoSize = true;
btIgnoreParentMerge.Text = "Override parent values";
btIgnoreParentMerge.Name = "OverrideParent";
btIgnoreParentMerge.Enabled = false;
btIgnoreParentMerge.Visible = false;
btIgnoreParentMerge.CheckedChanged += btOverrideParentValuesWorld_CheckedChanged;
pCheckBoxes.Controls.Add(btIgnoreParentMerge);
Session.ToolTip1.SetToolTip(btIgnoreParentMerge, "Ignore any resources defined in a group listed higher in the Groups menu than the current group.\r\n\r\n If this is disabled then multiple groups can add resources to the same setting.\r\n For instance Group 1 can add gold ore and Group 2 can add diamond ore to ResourceQueue.\r\n\r\nIf this is enabled then only the current group will add its values.\r\nFor instance if this option is enabled in Group 2 then if Group 1 adds gold ore and Group 2 adds diamond ore only the diamond ore is added.");
RadioButton btMergeWithDefaults = new RadioButton();
btMergeWithDefaults.Top = 25;
btMergeWithDefaults.Anchor = AnchorStyles.Left | AnchorStyles.Top;
btMergeWithDefaults.AutoSize = true;
btMergeWithDefaults.Text = "Merge with defaults";
btMergeWithDefaults.Enabled = false;
btMergeWithDefaults.Visible = false;
btMergeWithDefaults.Name = "Merge";
btMergeWithDefaults.CheckedChanged += btOverrideAllWorld_CheckedChanged;
pCheckBoxes.Controls.Add(btMergeWithDefaults);
Session.ToolTip1.SetToolTip(btMergeWithDefaults, "Adds the selected resources to the default resources.\r\n\r\nSome resource and parameter combinations are configured as \"must be unique\" in the VersionConfig.xml and will always be \r\noverridden, for instance Ore(GOLD_ORE, which means the values configured in this list will replace \r\nany existing Ore(GOLD_ORE resources. Unique resources are:\r\n\r\n" + uniqueResourceQueueItems + "\r\n\r\nResource name and * must be unique.\r\n\r\nResources that have a block as a unique parameter (such as ORE(Block,...)) can be configured to\r\nbe unique only when used with specific blocks (like GOLD_ORE, IRON_ORE etc).\r\n\r\nUnique resources, parameters and lists of blocks can be configured in the VersionConfig.xml.\r\nFor Ore(), UnderWaterOre() and Vein() by default all ore blocks are unique (iron_ore, gold_ore, quartz_ore etc).\r\n\r\nUpdate: Unique resources can now be added multiple times, duplicates are allowed but only within a single list.\r\nWhen merging resource lists with other biome groups and default values the normal merging behaviours are\r\napplied and duplicates between lists are removed.");
RadioButton btOverrideAll = new RadioButton();
btOverrideAll.Top = 50;
btOverrideAll.Anchor = AnchorStyles.Left | AnchorStyles.Top;
btOverrideAll.AutoSize = true;
btOverrideAll.Text = "Override defaults";
btOverrideAll.Checked = true;
btOverrideAll.Enabled = false;
btOverrideAll.Visible = false;
btOverrideAll.Name = "Override";
btOverrideAll.CheckedChanged += btOverrideAllWorld_CheckedChanged;
pCheckBoxes.Controls.Add(btOverrideAll);
Session.ToolTip1.SetToolTip(btOverrideAll, "Removes all default resources and replaces them with selected resources.");
pCheckBoxes.AutoSize = true;
pCheckBoxes.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
pnl.Controls.Add(pnl3);
pnl.Controls.Add(pCheckBoxes);
pnl.AutoSize = true;
tlpWorldSettings1.Controls.Add(pnl, 2, row);
Session.WorldSettingsInputs.Add(property, new Tuple<Control, CheckBox, Button, Label, ListBox, Panel, Button>(lbPropertyInput, cbOverride, bSetDefaults, txPropertyLabel, null, pCheckBoxes, bOpenTextEditor));
break;
case "String":
if(property.AllowedValues != null && property.AllowedValues.Count > 0)
{
ComboBoxWithBorder txPropertyInput = new ComboBoxWithBorder();
txPropertyInput.FlatStyle = FlatStyle.Flat;
txPropertyInput.DropDownStyle = ComboBoxStyle.DropDownList;
txPropertyInput.Items.Add("");
foreach(string allowedValue in property.AllowedValues)
{
txPropertyInput.Items.Add(allowedValue);
}
txPropertyInput.Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top;
txPropertyInput.SelectedIndexChanged += PropertyInputChangedWorld;
txPropertyInput.LostFocus += PropertyInputLostFocusWorld;
txPropertyInput.MouseHover += lbPropertyInput_MouseHover;
txPropertyInput.MouseWheel += lbWorldTabSetting_MouseWheel;
tlpWorldSettings1.Controls.Add(txPropertyInput, 2, row);
Session.WorldSettingsInputs.Add(property, new Tuple<Control, CheckBox, Button, Label, ListBox, Panel, Button>(txPropertyInput, cbOverride, bSetDefaults, txPropertyLabel, null, null, bOpenTextEditor));
} else {
TextBoxWithBorder txPropertyInput = new TextBoxWithBorder();
txPropertyInput.Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top;
txPropertyInput.TextChanged += PropertyInputChangedWorld;
txPropertyInput.LostFocus += PropertyInputLostFocusWorld;
txPropertyInput.MouseHover += lbPropertyInput_MouseHover;
tlpWorldSettings1.Controls.Add(txPropertyInput, 2, row);
Session.WorldSettingsInputs.Add(property, new Tuple<Control, CheckBox, Button, Label, ListBox, Panel, Button>(txPropertyInput, cbOverride, bSetDefaults, txPropertyLabel, null, null, bOpenTextEditor));
}
break;
case "BigString":
RichTextBox txPropertyInput2 = new RichTextBox();
txPropertyInput2.Multiline = true;
txPropertyInput2.BorderStyle = BorderStyle.None;
txPropertyInput2.Height = 58;
txPropertyInput2.Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top;
txPropertyInput2.TextChanged += PropertyInputChangedWorld;
txPropertyInput2.LostFocus += PropertyInputLostFocusWorld;
txPropertyInput2.MouseHover += lbPropertyInput_MouseHover;
txPropertyInput2.MouseWheel += lbWorldTabSetting_MouseWheel;
txPropertyInput2.KeyDown += lbPropertyInput_KeyDown_World;
txPropertyInput2.Left = 1;
txPropertyInput2.Top = 1;
Panel txtBoxBorder = new Panel();
txtBoxBorder.Width = txPropertyInput2.Width + 2;
txtBoxBorder.Height = txPropertyInput2.Height + 2;
txtBoxBorder.BackColor = Color.DarkGray;
txtBoxBorder.Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top;
txtBoxBorder.Controls.Add(txPropertyInput2);
tlpWorldSettings1.Controls.Add(txtBoxBorder, 2, row);
Session.WorldSettingsInputs.Add(property, new Tuple<Control, CheckBox, Button, Label, ListBox, Panel, Button>(txPropertyInput2, cbOverride, bSetDefaults, txPropertyLabel, null, null, bOpenTextEditor));
break;
case "Float":
case "Int":
NumericUpDownExt txPropertyInput3 = new NumericUpDownExt(property.PropertyType == "Float");
txPropertyInput3.Minimum = Convert.ToInt32(Math.Ceiling(property.MinValue));
txPropertyInput3.Maximum = Convert.ToInt32(Math.Floor(property.MaxValue));
txPropertyInput3.Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top;
txPropertyInput3.TextChanged += PropertyInputChangedWorld;
txPropertyInput3.LostFocus += PropertyInputLostFocusWorld;
// This is needed to make the table cell/column/row resize correctly
// This doesn't actually seem to affect the textbox's height/width.
// TODO: Is this still needed, using a hack on window resize now?
txPropertyInput3.AutoSize = false;
txPropertyInput3.Width = 0;
txPropertyInput3.Height = 0;
tlpWorldSettings1.Controls.Add(txPropertyInput3, 2, row);
Session.WorldSettingsInputs.Add(property, new Tuple<Control, CheckBox, Button, Label, ListBox, Panel, Button>(txPropertyInput3, cbOverride, bSetDefaults, txPropertyLabel, null, null, bOpenTextEditor));
break;
case "Color":
Panel colorPickerPanel = new Panel();
colorPickerPanel.Anchor = AnchorStyles.Left | AnchorStyles.Top;
colorPickerPanel.AutoSize = false;
colorPickerPanel.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
colorPickerPanel.Width = 0;
colorPickerPanel.Height = 0;
ListBox lbPropertyInput2 = new ListBox();
lbPropertyInput2.Anchor = AnchorStyles.Left | AnchorStyles.Top;
lbPropertyInput2.IntegralHeight = false;
lbPropertyInput2.Width = 20;
lbPropertyInput2.Height = 20;
lbPropertyInput2.BackColor = Color.White;
lbPropertyInput2.Margin = new Padding(3, 0, 0, 0);
lbPropertyInput2.TabStop = false;
lbPropertyInput2.Click += PropertyInputColorChangedWorld;
colorPickerPanel.Controls.Add(lbPropertyInput2);
TextBoxWithBorder txPropertyInput4 = new TextBoxWithBorder();
txPropertyInput4.Anchor = AnchorStyles.Left | AnchorStyles.Top;
txPropertyInput4.TextChanged += PropertyInputColorChangedWorld;
txPropertyInput4.LostFocus += PropertyInputLostFocusWorld;
txPropertyInput4.Left = 26;
colorPickerPanel.Controls.Add(txPropertyInput4);
colorPickerPanel.AutoSize = true;
tlpWorldSettings1.Controls.Add(colorPickerPanel, 2, row);
Session.WorldSettingsInputs.Add(property, new Tuple<Control, CheckBox, Button, Label, ListBox, Panel, Button>(txPropertyInput4, cbOverride, bSetDefaults, txPropertyLabel, lbPropertyInput2, null, bOpenTextEditor));
break;
case "BiomesList":
Panel pnl4 = new Panel();
pnl4.Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top;
pnl4.AutoSize = false;
pnl4.Width = 160;
ListBox lbPropertyInput3 = new ListBox();
lbPropertyInput3.KeyDown += lbPropertyInput_KeyDown_World;
lbPropertyInput3.Sorted = true;
lbPropertyInput3.Width = pnl4.Width;
lbPropertyInput3.Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top;
lbPropertyInput3.SelectionMode = SelectionMode.MultiExtended;
lbPropertyInput3.SelectedIndexChanged += lbPropertyInputWorld_SelectedIndexChanged;
lbPropertyInput3.Height = 140;
//lbPropertyInput3.MouseWheel += lbWorldTabSetting_MouseWheel;
lbPropertyInput3.MouseHover += lbPropertyInput_MouseHover;
lbPropertyInput3.SelectedIndexChanged += lbPropertyInput3_SelectedIndexChanged;
pnl4.Controls.Add(lbPropertyInput3);
Panel pCheckBoxes2 = new Panel();
pCheckBoxes2.Top = 144;
pCheckBoxes2.Width = 160;
pCheckBoxes2.Height = 70;
pCheckBoxes2.Visible = false;
pCheckBoxes2.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right;
CheckBox btIgnoreParentMerge2 = new CheckBox();
btIgnoreParentMerge2.Anchor = AnchorStyles.Left | AnchorStyles.Top;
btIgnoreParentMerge2.AutoSize = true;
btIgnoreParentMerge2.Text = "Override parent values";
btIgnoreParentMerge2.Name = "OverrideParent";
btIgnoreParentMerge2.Enabled = false;
btIgnoreParentMerge2.Visible = false;
btIgnoreParentMerge2.CheckedChanged += btOverrideParentValuesWorld_CheckedChanged;
pCheckBoxes2.Controls.Add(btIgnoreParentMerge2);
Session.ToolTip1.SetToolTip(btIgnoreParentMerge2, "Ignore any biomes defined in a group listed higher in the Groups menu than the current group.\r\n\r\n If this is disabled then multiple groups can add biomes to the same setting.\r\n For instance Group 1 can add biome A and Group 2 can add biome B.\r\n\r\nIf this is enabled then only the current group will add its biomes.\r\nFor instance if this option is enabled in Group 2 then if Group 1 adds biome A and Group 2 adds biome B only biome B is added.");
RadioButton btMergeWithDefaults2 = new RadioButton();
btMergeWithDefaults2.Top = 25;
btMergeWithDefaults2.Anchor = AnchorStyles.Left | AnchorStyles.Top;
btMergeWithDefaults2.AutoSize = true;
btMergeWithDefaults2.Text = "Merge with defaults";
btMergeWithDefaults2.Enabled = false;
btMergeWithDefaults2.Visible = false;
btMergeWithDefaults2.Name = "Merge";
btMergeWithDefaults2.CheckedChanged += btOverrideAllWorld_CheckedChanged;
pCheckBoxes2.Controls.Add(btMergeWithDefaults2);
Session.ToolTip1.SetToolTip(btMergeWithDefaults2, "Adds the selected biomes to the default biomes.");
RadioButton btOverrideAll2 = new RadioButton();
btOverrideAll2.Top = 50;
btOverrideAll2.Anchor = AnchorStyles.Left | AnchorStyles.Top;
btOverrideAll2.AutoSize = true;
btOverrideAll2.Text = "Override defaults";
btOverrideAll2.Checked = true;
btOverrideAll2.Enabled = false;
btOverrideAll2.Visible = false;
btOverrideAll2.Name = "Override";
btOverrideAll2.CheckedChanged += btOverrideAllWorld_CheckedChanged;
pCheckBoxes2.Controls.Add(btOverrideAll2);
Session.ToolTip1.SetToolTip(btOverrideAll2, "Removes all default biomes and replaces them with selected biomes.");
pCheckBoxes2.AutoSize = true;
pCheckBoxes2.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
pnl4.Controls.Add(pCheckBoxes2);
pnl4.AutoSize = true;
tlpWorldSettings1.Controls.Add(pnl4, 2, row);
Session.WorldSettingsInputs.Add(property, new Tuple<Control, CheckBox, Button, Label, ListBox, Panel, Button>(lbPropertyInput3, cbOverride, bSetDefaults, txPropertyLabel, null, pCheckBoxes2, bOpenTextEditor));
BiomeListInputs.Add(lbPropertyInput3);
break;
case "BiomesListSingle":
Panel pnl5 = new Panel();
pnl5.Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top;
pnl5.AutoSize = false;
pnl5.Width = 160;
ListBox lbPropertyInput4 = new ListBox();
lbPropertyInput4.KeyDown += lbPropertyInput_KeyDown_World;
lbPropertyInput4.Sorted = true;
lbPropertyInput4.Width = pnl5.Width;
lbPropertyInput4.Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top;
lbPropertyInput4.SelectionMode = SelectionMode.One;
lbPropertyInput4.SelectedIndexChanged += lbPropertyInputWorld_SelectedIndexChanged;
lbPropertyInput4.Height = 140;
//lbPropertyInput4.MouseWheel += lbWorldTabSetting_MouseWheel;
lbPropertyInput4.MouseHover += lbPropertyInput_MouseHover;
lbPropertyInput4.SelectedIndexChanged += lbPropertyInput3_SelectedIndexChanged;
pnl5.Controls.Add(lbPropertyInput4);
pnl5.AutoSize = true;
tlpWorldSettings1.Controls.Add(pnl5, 2, row);
Session.WorldSettingsInputs.Add(property, new Tuple<Control, CheckBox, Button, Label, ListBox, Panel, Button>(lbPropertyInput4, cbOverride, bSetDefaults, txPropertyLabel, null, null, bOpenTextEditor));
BiomeListInputs.Add(lbPropertyInput4);
break;
case "Bool":
Button btnTrueFalse = new Button();
btnTrueFalse.BackColor = Color.White;
btnTrueFalse.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
btnTrueFalse.ForeColor = Color.DarkGray;
btnTrueFalse.UseVisualStyleBackColor = false;
btnTrueFalse.Text = "";
btnTrueFalse.Anchor = AnchorStyles.Left | AnchorStyles.Top;
btnTrueFalse.Click += btnTrueFalseWorld_Click;
tlpWorldSettings1.Controls.Add(btnTrueFalse, 2, row);
Session.WorldSettingsInputs.Add(property, new Tuple<Control, CheckBox, Button, Label, ListBox, Panel, Button>(btnTrueFalse, cbOverride, bSetDefaults, txPropertyLabel, null, null, bOpenTextEditor));
break;
}
Session.ToolTip1.SetToolTip(bSetDefaults, "Clear");
row++;
}
}
// Biomes
settingsByGroup = new Dictionary<string, List<OTGProperty>>();
foreach (OTGProperty property in Session.VersionConfig.BiomeConfigDict.Values)
{
if (settingsByGroup.ContainsKey(property.Group))
{
settingsByGroup[property.Group].Add(property);
} else {
settingsByGroup[property.Group] = new List<OTGProperty>() { property };
}
}
lastGroupTitle = null;
row = 0;
foreach (KeyValuePair<String, List<OTGProperty>> settingsGroup in settingsByGroup)
{
if (!String.IsNullOrEmpty(settingsGroup.Key) && (lastGroupTitle == null || !lastGroupTitle.Equals(settingsGroup.Key)))
{
lastGroupTitle = settingsGroup.Key;
Label txPropertyLabel1 = new Label();
txPropertyLabel1.Text = settingsGroup.Key;
txPropertyLabel1.Font = new System.Drawing.Font(txPropertyLabel1.Font, FontStyle.Bold);
txPropertyLabel1.AutoSize = true;
txPropertyLabel1.Margin = new Padding(0, row == 0 ? 10 : 35, 0, 15);
txPropertyLabel1.Click += new System.EventHandler(this.btClickBackGround);
tlpBiomeSettings1.Controls.Add(txPropertyLabel1, 0, row);
row++;
tlpBiomeSettings1.RowStyles.Add(new RowStyle(SizeType.AutoSize));
}
foreach (OTGProperty property in settingsGroup.Value)
{
Label txPropertyLabel = new Label();
txPropertyLabel.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right;
txPropertyLabel.Text = property.LabelText != null && property.LabelText.Length > 0 ? property.LabelText : property.Name;
txPropertyLabel.AutoSize = true;
txPropertyLabel.TabStop = false;
txPropertyLabel.Margin = new Padding(0, 5, 0, 0);
txPropertyLabel.Click += new System.EventHandler(this.btClickBackGround);
tlpBiomeSettings1.Controls.Add(txPropertyLabel, 0, row);
CheckBox cbOverride = new CheckBox();
cbOverride.Anchor = AnchorStyles.Left | AnchorStyles.Top;
cbOverride.TabStop = false;
cbOverride.AutoSize = true;
cbOverride.Padding = new Padding(cbOverride.Padding.Left, cbOverride.Padding.Top + 4, cbOverride.Padding.Right, cbOverride.Padding.Bottom);
Session.ToolTip1.SetToolTip(cbOverride, "Apply this value");
tlpBiomeSettings1.Controls.Add(cbOverride, 1, row);
cbOverride.CheckedChanged += PropertyInputOverrideCheckChangedBiome;
Panel pnlBtnHolder = new Panel();
pnlBtnHolder.Anchor = AnchorStyles.Left | AnchorStyles.Top;
pnlBtnHolder.Width = 23;
pnlBtnHolder.Height = 23;
pnlBtnHolder.Margin = new System.Windows.Forms.Padding(0, 1, 0, 0);
Button bSetDefaults = new Button();
bSetDefaults.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(74)))), ((int)(((byte)(150)))), ((int)(((byte)(134)))));
bSetDefaults.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
bSetDefaults.ForeColor = System.Drawing.Color.White;
bSetDefaults.UseVisualStyleBackColor = false;
bSetDefaults.Anchor = AnchorStyles.Left | AnchorStyles.Top;
bSetDefaults.Text = "C";
bSetDefaults.Width = 23;
bSetDefaults.Height = 23;
bSetDefaults.Click += bSetDefaultsBiomeProperty;
bSetDefaults.TabStop = false;
pnlBtnHolder.Controls.Add(bSetDefaults);
tlpBiomeSettings1.Controls.Add(pnlBtnHolder, 3, row);
Button bOpenTextEditor = null;
if (property.PropertyType == "BigString")
{
pnlBtnHolder.Height = 60;
bOpenTextEditor = new Button();
bOpenTextEditor.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(74)))), ((int)(((byte)(150)))), ((int)(((byte)(134)))));
bOpenTextEditor.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
bOpenTextEditor.ForeColor = System.Drawing.Color.White;
bOpenTextEditor.UseVisualStyleBackColor = false;
bOpenTextEditor.Anchor = AnchorStyles.Left | AnchorStyles.Top;
bOpenTextEditor.Text = "E";
bOpenTextEditor.Width = 23;
bOpenTextEditor.Height = 23;
bOpenTextEditor.Top = 26;
bOpenTextEditor.Click += bOpenTextEditBoxBiomeProperty;
bOpenTextEditor.TabStop = false;
pnlBtnHolder.Controls.Add(bOpenTextEditor);
}
switch (property.PropertyType)
{
case "ResourceQueue":
Panel pnl = new Panel();
pnl.Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top;
pnl.AutoSize = false;
pnl.Width = 160;
ListBox lbPropertyInput = new ListBox();
lbPropertyInput.Sorted = true;
lbPropertyInput.Width = pnl.Width;
lbPropertyInput.Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top;
lbPropertyInput.SelectionMode = SelectionMode.MultiExtended;
lbPropertyInput.KeyDown += lbPropertyInput_KeyDown;
lbPropertyInput.Height = 140;
lbPropertyInput.DoubleClick += btEditResourceQueueItem_Click;
//lbPropertyInput.MouseWheel += lbBiomesTabSetting_MouseWheel;
lbPropertyInput.MouseHover += lbPropertyInput_MouseHover;
ResourceQueueInputs.Add(lbPropertyInput, property);
pnl.Controls.Add(lbPropertyInput);
Panel pnl3 = new Panel();
pnl3.Top = 140;
pnl3.Width = 160;
pnl3.Height = 25;
pnl3.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
pnl3.Resize += new EventHandler(delegate(object s, EventArgs args)
{
int left = 0;
foreach (Control ctl in ((Panel)s).Controls)
{
ctl.Width = (((Panel)s).Width - 10) / 3;
ctl.Left = left;
left += ((((Panel)s).Width - 10) / 3) + 5;
}
});
Button btAddResourceQueueItem = new Button();
btAddResourceQueueItem.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(74)))), ((int)(((byte)(150)))), ((int)(((byte)(134)))));
btAddResourceQueueItem.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
btAddResourceQueueItem.ForeColor = System.Drawing.Color.White;
btAddResourceQueueItem.UseVisualStyleBackColor = false;
btAddResourceQueueItem.Width = 50;
btAddResourceQueueItem.Anchor = AnchorStyles.Top;
btAddResourceQueueItem.Text = "Add";
btAddResourceQueueItem.Click += btAddResourceQueueItem_Click;
btAddResourceQueueItem.TabStop = false;
ResourceQueueInputs.Add(btAddResourceQueueItem, property);
pnl3.Controls.Add(btAddResourceQueueItem);
Button btEditResourceQueueItem = new Button();
btEditResourceQueueItem.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(74)))), ((int)(((byte)(150)))), ((int)(((byte)(134)))));
btEditResourceQueueItem.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
btEditResourceQueueItem.ForeColor = System.Drawing.Color.White;
btEditResourceQueueItem.UseVisualStyleBackColor = false;
btEditResourceQueueItem.Left = 55;
btEditResourceQueueItem.Width = 50;
btEditResourceQueueItem.Anchor = AnchorStyles.Top;
btEditResourceQueueItem.Text = "Edit";
btEditResourceQueueItem.Click += btEditResourceQueueItem_Click;
btEditResourceQueueItem.TabStop = false;
ResourceQueueInputs.Add(btEditResourceQueueItem, property);
pnl3.Controls.Add(btEditResourceQueueItem);
Button btDeleteResourceQueueItem = new Button();
btDeleteResourceQueueItem.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(74)))), ((int)(((byte)(150)))), ((int)(((byte)(134)))));
btDeleteResourceQueueItem.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
btDeleteResourceQueueItem.ForeColor = System.Drawing.Color.White;
btDeleteResourceQueueItem.UseVisualStyleBackColor = false;
btDeleteResourceQueueItem.Left = 110;
btDeleteResourceQueueItem.Width = 50;
btDeleteResourceQueueItem.Anchor = AnchorStyles.Top;
btDeleteResourceQueueItem.Text = "Delete";
btDeleteResourceQueueItem.Click += btDeleteResourceQueueItem_Click;
btDeleteResourceQueueItem.TabStop = false;
ResourceQueueInputs.Add(btDeleteResourceQueueItem, property);
pnl3.Controls.Add(btDeleteResourceQueueItem);
Panel pCheckBoxes = new Panel();
pCheckBoxes.Top = 172;
pCheckBoxes.Width = 160;
pCheckBoxes.Height = 70;
pCheckBoxes.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right;
CheckBox btIgnoreParentMerge = new CheckBox();
btIgnoreParentMerge.Anchor = AnchorStyles.Left | AnchorStyles.Top;
btIgnoreParentMerge.AutoSize = true;
btIgnoreParentMerge.Text = "Override parent values";
btIgnoreParentMerge.Name = "OverrideParent";
btIgnoreParentMerge.CheckedChanged += btOverrideParentValuesBiome_CheckedChanged;
pCheckBoxes.Controls.Add(btIgnoreParentMerge);