Skip to content

Commit 552d922

Browse files
authored
Add YR-specific TeamType properties
* Made RequiredAddOn optional
1 parent 2a97376 commit 552d922

7 files changed

Lines changed: 108 additions & 30 deletions

File tree

src/TSMapEditor/Config/Events.ini

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,16 @@ Name=No Event
3939
Description=This is a null event. There is no need to ever use this in a real trigger.
4040

4141
[EnteredBy]
42-
Name=Entered by
42+
Name=Entered By
4343
Description=Triggers when any infantry or vehicle of given house enters an attached building or celltag. You can use -1 to mean "any house".
4444
P2Type=HouseType
4545

4646
[SpiedUpon]
47-
Name=Spied upon
47+
Name=Spied Upon
4848
Description=Triggers when a spy has entered an attached building.
4949

5050
[ThievedBy]
51-
Name=Thieved by
51+
Name=Thieved By
5252
Description=Triggers when a thief steals money from the specified house.
5353
Available=no ; thieves don't work
5454
P2Type=HouseType
@@ -148,7 +148,7 @@ P1Type=-1
148148
P2Type=TeamType
149149
150150
[ZoneEntryBy]
151-
Name=Zone Entry by
151+
Name=Zone Entry By
152152
Description=Triggers when a unit of the specified house enters the same CellTag zone that this trigger is attached to.
153153
P2Type=HouseType
154154
@@ -238,7 +238,7 @@ Name=Quarter Health (Any Source)
238238
Description=Triggers when damaged to quarter health from any source.
239239

240240
[AttackedBy]
241-
Name=Attacked by
241+
Name=Attacked By
242242
Description=When attacked by some unit of specified house.
243243
P2Type=HouseType
244244

@@ -261,12 +261,12 @@ P2Type=Number
261261
Name=Destroyed by Anything
262262
Description=Triggers when destroyed or captured or infiltrated by anything what-so-ever.
263263

264-
[PickupCrate]
265-
Name=Pickup Crate
264+
[PickedUpCrate]
265+
Name=Picked Up Crate
266266
Description=When crate is picked up by an object attached to this trigger.
267267

268268
[PickedUpCrateAny]
269-
Name=Picked up Crate (Any)
269+
Name=Picked Up Crate (Any)
270270
Description=When crate is picked up by any unit.
271271

272272
[RandomDelay]

src/TSMapEditor/Config/UI/Windows/BasicSectionConfigWindow.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ Text=Free Radar
165165
$X=getX(chkOfficial)
166166
$Y=getBottom(chkFreeRadar) + VERTICAL_SPACING
167167
Text=Enhanced Mode
168+
$Enabled=1 - USE_COUNTRIES
168169

169170
; Apply button
170171

src/TSMapEditor/Config/UI/Windows/TeamTypesWindow.ini

Lines changed: 53 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,25 @@ $CC15=tbMax:EditorNumberTextBox
1919
$CC16=lblMax:XNALabel
2020
$CC17=tbTechLevel:EditorNumberTextBox
2121
$CC18=lblTechLevel:XNALabel
22-
$CC19=tbGroup:EditorNumberTextBox
23-
$CC20=lblGroup:XNALabel
24-
$CC21=tbWaypoint:EditorNumberTextBox
25-
$CC22=lblWaypoint:XNALabel
26-
$CC23=selTaskForce:EditorPopUpSelector
27-
$CC24=btnOpenTaskForce:EditorButton
28-
$CC25=lblTaskForce:XNALabel
29-
$CC26=selScript:EditorPopUpSelector
30-
$CC27=btnOpenScript:EditorButton
31-
$CC28=lblScript:XNALabel
32-
$CC29=selTag:EditorPopUpSelector
33-
$CC30=lblTag:XNALabel
22+
$CC19=ddMindControlDecision:XNADropDown
23+
$CC20=lblMindControlDecision:XNALabel
24+
$CC21=tbGroup:EditorNumberTextBox
25+
$CC22=lblGroup:XNALabel
26+
$CC23=tbWaypoint:EditorNumberTextBox
27+
$CC24=lblWaypoint:XNALabel
28+
$CC25=selTaskForce:EditorPopUpSelector
29+
$CC26=btnOpenTaskForce:EditorButton
30+
$CC27=lblTaskForce:XNALabel
31+
$CC28=selScript:EditorPopUpSelector
32+
$CC29=btnOpenScript:EditorButton
33+
$CC30=lblScript:XNALabel
34+
$CC31=selTag:EditorPopUpSelector
35+
$CC32=lblTag:XNALabel
36+
$CC33=tbTransportWaypoint:EditorNumberTextBox
37+
$CC34=lblTransportWaypoint:XNALabel
3438
; Assign width before initializing panelBooleans so the panel can check the width of the window
3539
$Width=getRight(selTag) + EMPTY_SPACE_SIDES
36-
$CC31=panelBooleans:EditorPanel
40+
$CC35=panelBooleans:EditorPanel
3741
HasCloseButton=true
3842

3943

@@ -92,11 +96,14 @@ Text=Name:
9296
$X=getX(tbName)
9397
$Width=getWidth(tbName)
9498
$Y=getBottom(tbName) + VERTICAL_SPACING
99+
Option0=Regular
100+
Option1=Veteran
101+
Option2=Elite
95102

96103
[lblVeteranLevel]
97104
$X=getX(lblName)
98105
$Y=getY(ddVeteranLevel) + 1
99-
Text=Veteran level:
106+
Text=Veteran Level:
100107

101108
[ddHouse]
102109
$X=getX(tbName)
@@ -136,7 +143,25 @@ $Y=getBottom(tbMax) + VERTICAL_SPACING
136143
[lblTechLevel]
137144
$X=getX(lblName)
138145
$Y=getY(tbTechLevel) + 1
139-
Text=Tech level:
146+
Text=Tech Level:
147+
148+
[ddMindControlDecision]
149+
$X=getX(tbName)
150+
$Width=getWidth(tbName)
151+
$Y=getBottom(tbTechLevel) + VERTICAL_SPACING
152+
$Enabled=USE_COUNTRIES
153+
Option0=None
154+
Option1=Add to Team
155+
Option2=Send to Grinder
156+
Option3=Send to Bio Reactor
157+
Option4=Go to Hunt
158+
Option5=Do Nothing
159+
160+
[lblMindControlDecision]
161+
$X=getX(lblName)
162+
$Y=getY(ddMindControlDecision) + 1
163+
Text=On Mind Control:
164+
$Enabled=USE_COUNTRIES
140165

141166
; *************
142167
; Second column
@@ -206,12 +231,24 @@ $X=getX(lblGroup)
206231
$Y=getY(lblMax)
207232
Text=Tag:
208233

234+
[tbTransportWaypoint]
235+
$X=getX(tbGroup)
236+
$Width=getWidth(tbGroup)
237+
$Y=getY(tbTechLevel)
238+
$Enabled=USE_COUNTRIES
239+
240+
[lblTransportWaypoint]
241+
$X=getX(lblGroup)
242+
$Y=getY(lblTechLevel)
243+
Text=Transport Wpt:
244+
$Enabled=USE_COUNTRIES
245+
209246
; **************
210247
; Check boxes get generated dynamically on the area of panelBooleans
211248
; **************
212249

213250
[panelBooleans]
214251
$X=getX(lblSelectedTeamType)
215-
$Y=getBottom(tbTechLevel) + VERTICAL_SPACING
252+
$Y=(getBottom(ddMindControlDecision) * USE_COUNTRIES) + (getBottom(tbTechLevel) * (1 - USE_COUNTRIES)) + VERTICAL_SPACING
216253
$Width=getWidth(TeamTypesWindow) - getX(panelBooleans) - EMPTY_SPACE_SIDES
217254
$Height=getHeight(TeamTypesWindow) - getY(panelBooleans) - EMPTY_SPACE_BOTTOM

src/TSMapEditor/Models/BasicSection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public class BasicSection : INIDefineable
2727
public int NewINIFormat { get; set; } = 4;
2828
public string NextScenario { get; set; }
2929
public string AltNextScenario { get; set; }
30-
public int RequiredAddOn { get; set; }
30+
public int? RequiredAddOn { get; set; }
3131
public bool SkipMapSelect { get; set; }
3232
public double CarryOverMoney { get; set; }
3333
public bool MultiplayerOnly { get; set; }

src/TSMapEditor/Models/TeamType.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ public TeamType(string iniName)
2929
public int Max { get; set; }
3030
public int Priority { get; set; }
3131
public string Waypoint { get; set; }
32+
public string TransportWaypoint { get; set; }
33+
public int? MindControlDecision { get; set; }
3234
public int TechLevel { get; set; }
3335
public int VeteranLevel { get; set; }
3436

@@ -67,6 +69,12 @@ public string GetHintText()
6769
}
6870

6971
stringBuilder.Append("Waypoint: " + (string.IsNullOrWhiteSpace(Waypoint) ? Constants.NoneValue2 : Helpers.GetWaypointNumberFromAlphabeticalString(Waypoint)));
72+
73+
if (Constants.UseCountries)
74+
{
75+
stringBuilder.Append("TransportWaypoint: " + (string.IsNullOrWhiteSpace(TransportWaypoint) ? Constants.NoneValue2 : Helpers.GetWaypointNumberFromAlphabeticalString(TransportWaypoint)));
76+
}
77+
7078
stringBuilder.Append(Environment.NewLine + Environment.NewLine);
7179

7280
if (VeteranLevel > 1)

src/TSMapEditor/UI/Windows/BasicSectionConfigWindow.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,10 @@ private void BtnApply_LeftClick(object sender, System.EventArgs e)
117117
map.Basic.IceGrowthEnabled = chkGrowingIce.Checked;
118118
map.Basic.TiberiumDeathToVisceroid = chkTiberiumDeathToVisceroid.Checked;
119119
map.Basic.FreeRadar = chkFreeRadar.Checked;
120-
map.Basic.RequiredAddOn = chkRequiredAddOn.Checked ? 1 : 0;
120+
if (!Constants.UseCountries)
121+
{
122+
map.Basic.RequiredAddOn = chkRequiredAddOn.Checked ? 1 : 0;
123+
}
121124
}
122125
}
123126
}

src/TSMapEditor/UI/Windows/TeamTypesWindow.cs

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ public TeamTypesWindow(WindowManager windowManager, Map map) : base(windowManage
4646
private EditorNumberTextBox tbPriority;
4747
private EditorNumberTextBox tbMax;
4848
private EditorNumberTextBox tbTechLevel;
49+
private XNADropDown ddMindControlDecision;
50+
private EditorNumberTextBox tbTransportWaypoint;
4951
private EditorNumberTextBox tbGroup;
5052
private EditorNumberTextBox tbWaypoint;
5153
private EditorPopUpSelector selTaskForce;
@@ -71,6 +73,8 @@ public override void Initialize()
7173
tbPriority = FindChild<EditorNumberTextBox>(nameof(tbPriority));
7274
tbMax = FindChild<EditorNumberTextBox>(nameof(tbMax));
7375
tbTechLevel = FindChild<EditorNumberTextBox>(nameof(tbTechLevel));
76+
ddMindControlDecision = FindChild<XNADropDown>(nameof(ddMindControlDecision));
77+
tbTransportWaypoint = FindChild<EditorNumberTextBox>(nameof(tbTransportWaypoint));
7478
tbGroup = FindChild<EditorNumberTextBox>(nameof(tbGroup));
7579
tbWaypoint = FindChild<EditorNumberTextBox>(nameof(tbWaypoint));
7680
selTaskForce = FindChild<EditorPopUpSelector>(nameof(selTaskForce));
@@ -80,10 +84,6 @@ public override void Initialize()
8084
var panelBooleans = FindChild<EditorPanel>("panelBooleans");
8185
AddBooleanProperties(panelBooleans);
8286

83-
ddVeteranLevel.AddItem("Regular");
84-
ddVeteranLevel.AddItem("Veteran");
85-
ddVeteranLevel.AddItem("Elite");
86-
8787
lbTeamTypes.SelectedIndexChanged += LbTeamTypes_SelectedIndexChanged;
8888

8989
FindChild<EditorButton>("btnNewTeamType").LeftClick += BtnNewTeamType_LeftClick;
@@ -288,8 +288,10 @@ private void EditTeamType(TeamType teamType)
288288
tbPriority.TextChanged -= TbPriority_TextChanged;
289289
tbMax.TextChanged -= TbMax_TextChanged;
290290
tbTechLevel.TextChanged -= TbTechLevel_TextChanged;
291+
ddMindControlDecision.SelectedIndexChanged -= DdMindControlDecision_SelectedIndexChanged;
291292
tbGroup.TextChanged -= TbGroup_TextChanged;
292293
tbWaypoint.TextChanged -= TbWaypoint_TextChanged;
294+
tbTransportWaypoint.TextChanged -= TbTransportWaypoint_TextChanged;
293295
checkBoxes.ForEach(chk => chk.CheckedChanged -= FlagCheckBox_CheckedChanged);
294296

295297
editedTeamType = teamType;
@@ -302,8 +304,11 @@ private void EditTeamType(TeamType teamType)
302304
tbPriority.Text = string.Empty;
303305
tbMax.Text = string.Empty;
304306
tbTechLevel.Text = string.Empty;
307+
ddMindControlDecision.SelectedIndex = -1;
308+
305309
tbGroup.Text = string.Empty;
306310
tbWaypoint.Text = string.Empty;
311+
tbTransportWaypoint.Text = string.Empty;
307312

308313
selTaskForce.Text = string.Empty;
309314
selTaskForce.Tag = null;
@@ -328,6 +333,12 @@ private void EditTeamType(TeamType teamType)
328333
tbGroup.Value = editedTeamType.Group;
329334
tbWaypoint.Value = Helpers.GetWaypointNumberFromAlphabeticalString(editedTeamType.Waypoint);
330335

336+
if (Constants.UseCountries)
337+
{
338+
ddMindControlDecision.SelectedIndex = editedTeamType.MindControlDecision ?? -1;
339+
tbTransportWaypoint.Value = Helpers.GetWaypointNumberFromAlphabeticalString(editedTeamType.TransportWaypoint);
340+
}
341+
331342
if (editedTeamType.TaskForce != null)
332343
selTaskForce.Text = editedTeamType.TaskForce.Name + " (" + editedTeamType.TaskForce.ININame + ")";
333344
else
@@ -351,8 +362,10 @@ private void EditTeamType(TeamType teamType)
351362
tbPriority.TextChanged += TbPriority_TextChanged;
352363
tbMax.TextChanged += TbMax_TextChanged;
353364
tbTechLevel.TextChanged += TbTechLevel_TextChanged;
365+
ddMindControlDecision.SelectedIndexChanged += DdMindControlDecision_SelectedIndexChanged;
354366
tbGroup.TextChanged += TbGroup_TextChanged;
355367
tbWaypoint.TextChanged += TbWaypoint_TextChanged;
368+
tbTransportWaypoint.TextChanged += TbTransportWaypoint_TextChanged;
356369
checkBoxes.ForEach(chk => chk.CheckedChanged += FlagCheckBox_CheckedChanged);
357370
}
358371

@@ -370,6 +383,14 @@ private void TbWaypoint_TextChanged(object sender, EventArgs e)
370383
editedTeamType.Waypoint = Helpers.WaypointNumberToAlphabeticalString(tbWaypoint.Value);
371384
}
372385

386+
private void TbTransportWaypoint_TextChanged(object sender, EventArgs e)
387+
{
388+
if (Constants.UseCountries)
389+
{
390+
editedTeamType.TransportWaypoint = Helpers.WaypointNumberToAlphabeticalString(tbTransportWaypoint.Value);
391+
}
392+
}
393+
373394
private void TbGroup_TextChanged(object sender, EventArgs e)
374395
{
375396
editedTeamType.Group = tbGroup.Value;
@@ -401,6 +422,14 @@ private void DdVeteranLevel_SelectedIndexChanged(object sender, EventArgs e)
401422
editedTeamType.VeteranLevel = ddVeteranLevel.SelectedIndex + 1;
402423
}
403424

425+
private void DdMindControlDecision_SelectedIndexChanged(object sender, EventArgs e)
426+
{
427+
if (Constants.UseCountries)
428+
{
429+
editedTeamType.MindControlDecision = ddMindControlDecision.SelectedIndex;
430+
}
431+
}
432+
404433
private void TbName_TextChanged(object sender, EventArgs e)
405434
{
406435
editedTeamType.Name = tbName.Text;

0 commit comments

Comments
 (0)