Skip to content

Commit 42f022e

Browse files
committed
Merge branch 'development-feature-dynamic_support' into development
2 parents 14fbd4b + d0986f8 commit 42f022e

21 files changed

+447
-190
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.idea/*
2+
.vscode/*
23

34
DUWS-R.iml
45
localDevDeploy.properties

source/INIT.sqf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,9 @@ for[{_x = 2},{_x <= 20},{_x = _x + 1}] do {
280280
};
281281
};
282282

283+
284+
_dynam = [player,"DynamicSupportMenu"] call BIS_fnc_addCommMenuItem;
285+
283286
//Loading player position and gear.
284287
//TODO: Add bought supports.
285288
/*

source/WARCOM/WARCOM_gps_marker.sqf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ WARCOM_marker_num = WARCOM_marker_num + 1;
2222
if (_units_alive<=0) exitWith { // IF ALL DEAD, EXIT.
2323
str(_markername) setMarkerColor "ColorRed";
2424
str(_markername) setMarkerType "waypoint";
25-
PAPABEAR sidechat format["To all units, this is HQ, Task force %1 just got wiped out. Stay alert",_TFname];
25+
[west, "PAPA_BEAR"] sidechat format["To all units, this is HQ, Task force %1 just got wiped out. Stay alert",_TFname];
2626
sleep 600;
2727
deleteMarker str(_markername);
2828
};

source/dialog/request_support.sqf

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ switch (_index2) do {
66
if (!support_supplydrop_available) then {
77
commandpointsblu1 = commandpointsblu1 - 5;
88
ctrlSetText [1000, format["%1",commandpointsblu1]];
9-
_supplydrop = [player,"ammo"] call BIS_fnc_addCommMenuItem;
109
lbSetColor [2103, index_support_supply, [0, 1, 0, 1]];
1110
playSound "boots";
1211
support_supplydrop_available = true;
@@ -22,7 +21,6 @@ switch (_index2) do {
2221
if (!support_arty_available) then {
2322
commandpointsblu1 = commandpointsblu1 - 20;
2423
ctrlSetText [1000, format["%1",commandpointsblu1]];
25-
_supplydrop = [player,"artillery"] call BIS_fnc_addCommMenuItem;
2624
lbSetColor [2103, index_support_arty, [0, 1, 0, 1]];
2725
playSound "boots";
2826
support_arty_available = true;
@@ -38,7 +36,6 @@ switch (_index2) do {
3836
if (!support_mortar_available) then {
3937
commandpointsblu1 = commandpointsblu1 - 10;
4038
ctrlSetText [1000, format["%1",commandpointsblu1]];
41-
_supplydrop = [player,"mortar"] call BIS_fnc_addCommMenuItem;
4239
lbSetColor [2103, index_support_mortar, [0, 1, 0, 1]];
4340
playSound "boots";
4441
support_mortar_available = true;
@@ -54,7 +51,6 @@ switch (_index2) do {
5451
if (!support_paradrop_available) then {
5552
commandpointsblu1 = commandpointsblu1 - 20;
5653
ctrlSetText [1000, format["%1",commandpointsblu1]];
57-
_supplydrop = [player,"paradrop"] call BIS_fnc_addCommMenuItem;
5854
lbSetColor [2103, index_support_paradrop, [0, 1, 0, 1]];
5955
playSound "boots";
6056
support_paradrop_available = true;
@@ -70,7 +66,6 @@ switch (_index2) do {
7066
if (!support_jdam_available) then {
7167
commandpointsblu1 = commandpointsblu1 - 15;
7268
ctrlSetText [1000, format["%1",commandpointsblu1]];
73-
_supplydrop = [player,"jdam"] call BIS_fnc_addCommMenuItem;
7469
lbSetColor [2103, index_support_jdam, [0, 1, 0, 1]];
7570
playSound "boots";
7671
support_jdam_available = true;
@@ -125,7 +120,6 @@ switch (_index2) do {
125120
if (!support_uav_recon_available) then {
126121
commandpointsblu1 = commandpointsblu1 - 10;
127122
ctrlSetText [1000, format["%1",commandpointsblu1]];
128-
_uav_recon = [player,"uav_recon"] call BIS_fnc_addCommMenuItem;
129123
lbSetColor [2103, index_support_uavrecon, [0, 1, 0, 1]];
130124
playSound "boots";
131125
support_uav_recon_available = true;
@@ -141,7 +135,6 @@ switch (_index2) do {
141135
if (!support_veh_refit_available) then {
142136
commandpointsblu1 = commandpointsblu1 - 3;
143137
ctrlSetText [1000, format["%1",commandpointsblu1]];
144-
_veh_refit = [player,"vehicle_refit"] call BIS_fnc_addCommMenuItem;
145138
lbSetColor [2103, index_support_refit, [0, 1, 0, 1]];
146139
playSound "loadgun";
147140
support_veh_refit_available = true;
@@ -157,7 +150,6 @@ switch (_index2) do {
157150
if (!support_helotaxi_available) then {
158151
commandpointsblu1 = commandpointsblu1 - 3;
159152
ctrlSetText [1000, format["%1",commandpointsblu1]];
160-
_veh_refit = [player,"helo_taxi"] call BIS_fnc_addCommMenuItem;
161153
lbSetColor [2103, index_support_helotaxi, [0, 1, 0, 1]];
162154
playSound "boots";
163155
support_helotaxi_available = true;
@@ -173,7 +165,6 @@ switch (_index2) do {
173165
if (!support_cluster_available) then {
174166
commandpointsblu1 = commandpointsblu1 - 25;
175167
ctrlSetText [1000, format["%1",commandpointsblu1]];
176-
_cluster = [player1,"cluster"] call BIS_fnc_addCommMenuItem;
177168
lbSetColor [2103, index_support_cluster, [0, 1, 0, 1]];
178169
playSound "boots";
179170
support_cluster_available = true;
@@ -210,7 +201,6 @@ switch (_index2) do {
210201
ctrlSetText [1000, format["%1",commandpointsblu1]];
211202
lbSetColor [2103, index_support_boattaxi, [0, 1, 0, 1]];
212203
support_boattaxi_available = true;
213-
_supplydrop = [player,"boat_taxi"] call BIS_fnc_addCommMenuItem;
214204
playSound "boots";
215205
} else {
216206
hint "This support is already available";

source/dialog/supports_init.hpp

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,19 @@ if (isNil "support_specialized_training_available") then {
1616

1717
if (isNil "support_armory_available") then {
1818
support_armory_available = false;
19-
};
19+
};
20+
21+
/*
22+
Support Timeout variables
23+
Variables that hold the next VALID time to use that supports (in seconds)
24+
Supports should set the next valid time as:
25+
support_exampleSupport_timeout = *now* + xyz seconds;
26+
*/
27+
28+
support_mortar_timeout = 0;
29+
support_jdam_timeout = 0;
30+
support_arty_timeout = 0;
31+
support_cluster_timeout = 0;
32+
support_uav_recon_timeout = 0;
33+
//support_helotaxi_timeout = 0; format may not be suitable
34+
//support_boattaxi_timeout = 0;

source/duws_revive/respawnClicked.sqf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ if(!staminaEnabled) then {
1010
player enableStamina false;
1111
};
1212

13+
_dynam = [player,"DynamicSupportMenu"] call BIS_fnc_addCommMenuItem;
14+
1315
closedialog 0;

source/dynamic_menu.sqf

Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
/*
2+
Author: UltraNoobian (Brenden Cai)
3+
4+
Description:
5+
Dynamically generate and update the Support menus, then display the root menu.
6+
7+
Parameter(s):
8+
None.
9+
10+
Usage:
11+
[] call "dynamic_menu.sqf";
12+
13+
Returns:
14+
- Nil -
15+
*/
16+
menuItemFormatter = {
17+
format [
18+
"[""%1"", [%2], """", -5, [[""expression"", ""%3""]], ""1"", ""%4""]",
19+
_this select 0,
20+
_this select 1,
21+
_this select 2,
22+
_this select 3
23+
];
24+
};
25+
26+
_itemsCount = 0;
27+
_offensiveItems = [];
28+
_logisticsItems = [];
29+
_transportItems = [];
30+
31+
// Critical note: If you use escape quotes as part of your params to menuItemFormatter,
32+
// You must double-escape those quotes
33+
// eg. "Hello ""mate""" -> "Hello """"mate"""""
34+
// eg. 'Hello "mate"' -> "Hello ""mate""'
35+
36+
37+
//Offensive Submenu checks
38+
if(support_mortar_available) then {
39+
_text = ["Mortar (2 CP)", 2, '_null = [8, 50, 5, 3, 2, 2, ""grenade""] execVM ""support\mapclickarty.sqf""', 1] call menuItemFormatter;
40+
_offensiveItems pushBack _text;
41+
} else {
42+
_text = ["Mortar (N/A)", 2, "", 0] call menuItemFormatter;
43+
_offensiveItems pushBack _text;
44+
};
45+
46+
if(support_arty_available) then {
47+
_text = ["Artillery Strike (4 CP)", 3, '_null = [6, 100, 8, 3, 1, 4, ""R_80mm_HE""] execVM ""support\mapclickarty.sqf""', 1] call menuItemFormatter;
48+
_offensiveItems pushBack _text;
49+
} else {
50+
_text = ["Artillery Strike (N/A)", 3, "", 0] call menuItemFormatter;
51+
_offensiveItems pushBack _text;
52+
};
53+
54+
if(support_cluster_available) then {
55+
_text = ["Cluster Bomb (6 CP)", 4, '_null = [1, 250, 1, 90, 1, 6, ""grenade""] execVM ""support\cluster\mapclickcluster.sqf""', 1] call menuItemFormatter;
56+
_offensiveItems pushBack _text;
57+
} else {
58+
_text = ["Cluster Bomb (N/A)", 4, "", 0] call menuItemFormatter;
59+
_offensiveItems pushBack _text;
60+
};
61+
62+
if(support_jdam_available) then {
63+
_text = ["JDAM Strike (1 CP)", 5, '_null = [1, 2, 1, 1, 3, 1, ""Bo_Mk82""] execVM ""support\mapclickarty.sqf""', 1] call menuItemFormatter;
64+
_offensiveItems pushBack _text;
65+
} else {
66+
_text = ["JDAM (N/A)", 5, "", 0] call menuItemFormatter;
67+
_offensiveItems pushBack _text;
68+
};
69+
70+
// Compilaton and Call for Offensive SubMenu
71+
_finalString = "offensive_SubMenu = [[""Offensive Supports"",true],";
72+
_offensiveItemsClassString = _offensiveItems joinString ",";
73+
_finalString = _finalString + _offensiveItemsClassString;
74+
_finalString = _finalString + "];";
75+
76+
_myCode = compile _finalString;
77+
call _myCode;
78+
79+
80+
//Logistics Submenu Checks
81+
if(support_supplydrop_available) then {
82+
_text = ["Supply Drop (2 CP)", 2, '_null = [player] execVM ""support\ammobox.sqf""', 1] call menuItemFormatter;
83+
_logisticsItems pushBack _text;
84+
} else {
85+
_text = ["Supply Drop ((N/A)", 2, '', 0] call menuItemFormatter;
86+
_logisticsItems pushBack _text;
87+
};
88+
89+
if(support_paradrop_available) then {
90+
_text = ["Airborne troops (25 CP)", 3, '_null = [player] execVM ""support\paradrop.sqf""', 1] call menuItemFormatter;
91+
_logisticsItems pushBack _text;
92+
} else {
93+
_text = ["Airborne troops (N/A)", 3, '', 0] call menuItemFormatter;
94+
_logisticsItems pushBack _text;
95+
};
96+
97+
if(support_uav_recon_available) then {
98+
_text = ["UAV Recon (3 CP)", 4, '_null = [player] execVM ""support\mapclickuav.sqf""', 1] call menuItemFormatter;
99+
_logisticsItems pushBack _text;
100+
} else {
101+
_text = ["UAV Recon (N/A)", 4, '', 0] call menuItemFormatter;
102+
_logisticsItems pushBack _text;
103+
};
104+
105+
if(support_veh_refit_available) then {
106+
_text = ["Vehicle Refit (2 CP)", 5, '_null = [player] execVM ""support\veh_refit.sqf""', 1] call menuItemFormatter;
107+
_logisticsItems pushBack _text;
108+
} else {
109+
_text = ["Vehicle Refit (N/A)", 5, '', 0] call menuItemFormatter;
110+
_logisticsItems pushBack _text;
111+
};
112+
113+
114+
// Compilaton and Call for Logistics SubMenu
115+
_finalString = "logistic_SubMenu = [[""Logistical Supports"",true],";
116+
_logisticsItemsClassString = _logisticsItems joinString ",";
117+
_finalString = _finalString + _logisticsItemsClassString;
118+
_finalString = _finalString + "];";
119+
120+
_myCode = compile _finalString;
121+
call _myCode;
122+
123+
//Transport Submenu check
124+
if(support_helotaxi_available) then {
125+
_text = ["Helicopter taxi(1 CP)", 2, '_nill = [getpos player,50] execVM ""support\taxi\helotaxi.sqf""', 1] call menuItemFormatter;
126+
_transportItems pushBack _text;
127+
} else {
128+
_text = ["Helicopter taxi(N/A)", 2, '', 0] call menuItemFormatter;
129+
_transportItems pushBack _text;
130+
};
131+
132+
if(support_boattaxi_available) then {
133+
_text = ["Boat taxi (1 CP)", 3, '_null = [getpos player,10] execVM ""support\taxi\boattaxi.sqf""', 1] call menuItemFormatter;
134+
_transportItems pushBack _text;
135+
} else {
136+
_text = ["Boat taxi (N/A)", 3, '', 0] call menuItemFormatter;
137+
_transportItems pushBack _text;
138+
};
139+
140+
141+
// Compilaton and Call for Transport SubMenu
142+
_finalString = "transport_SubMenu = [[""Transport Supports"",true],";
143+
_transportItemsClassString = _transportItems joinString ",";
144+
_finalString = _finalString + _transportItemsClassString;
145+
_finalString = _finalString + "];";
146+
147+
_myCode = compile _finalString;
148+
call _myCode;
149+
150+
151+
//Construct and show Support Menu root
152+
supportMenu =
153+
[
154+
["Support Menu",false],
155+
["Offensive", [2], "#USER:offensive_SubMenu", -5, [["expression", ""]], "1", "1"],
156+
["Logistics", [3], "#USER:logistic_SubMenu", -5, [["expression", ""]], "1", "1"],
157+
["Transport", [4], "#USER:transport_SubMenu", -5, [["expression", ""]], "1", "1"]
158+
];
159+
160+
showCommandingMenu "#USER:supportMenu";

source/initHQ/BluHQinit.sqf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ _trg5 setTriggerStatements["this", format["[""%1"",thislist] execvm 'enterlocati
2828
_trgWarning=createTrigger["EmptyDetector",_hqblu];
2929
_trgWarning setTriggerArea[300,300,0,false];
3030
_trgWarning setTriggerActivation["EAST","PRESENT",true];
31-
_trgWarning setTriggerStatements["this","PAPABEAR sidechat 'This is HQ, there are enemies near our main base!'", ""];
31+
_trgWarning setTriggerStatements["this","[west, ""PAPA_BEAR""] sidechat 'This is HQ, there are enemies near our main base!'", ""];
3232

3333
// CREATE THE OFFICER
3434
_group = createGroup west;

source/missions/stratmap.sqf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ _allFound = false;
44
_counter = 0;
55

66
if (isnil ("Mission_timeout_request")) then {Mission_timeout_request = true;};
7-
if (!Mission_timeout_request) exitWith {PAPABEAR=[West,"HQ"]; PAPABEAR SideChat "We don't have any other missions for you right now.";};
7+
if (!Mission_timeout_request) exitWith {[west, "PAPA_BEAR"] SideChat "We don't have any other missions for you right now.";};
88
if (!((vehiclevarname player) in game_master)) exitWith {hint "Only the host can request side missions for now"};
99

1010
startLoadingScreen ["Loading zones..."];

source/serverinit.sqf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ can_get_mission = true;publicVariable "can_get_mission";
8686
failsafe_zones_not_found = false;publicVariable "failsafe_zones_not_found";
8787
createcenter sideLogic;
8888
LogicGroup = createGroup SideLogic;publicVariable "LogicGroup";
89-
PAPABEAR=[West,"HQ"];publicVariable "PAPABEAR";
9089
locator_hq_actived = false;publicVariable "locator_hq_actived";
9190
op_zones_index = 0;publicVariable "op_zones_index";
9291
clientisSync = false;publicVariable "clientisSync";

0 commit comments

Comments
 (0)