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
|
private ["_enable","_exited","_skip","_voteTime","_timer"];
MenuAction = -1;
_exited = false;
_timer = 3;
WFBE_ForceUpdate = true;
while {alive player && dialog} do {
//--- Build Units.
_enable = false;
if (barracksInRange || lightInRange || heavyInRange || aircraftInRange || hangarInRange || depotInRange) then {_enable = true};
ctrlEnable [11001,_enable];
ctrlEnable [11002,gearInRange];
_timer = _timer + 0.1;
sleep 0.1;
if (Side player != sideJoined) exitWith {closeDialog 0};
if (!dialog || _exited) exitWith {};
//--- Buy Units.
if (MenuAction == 1) then {
MenuAction = -1;
closeDialog 0;
createDialog "RscMenu_BuyUnits";
_exited = true;
};
//--- Buy Gear.
if (MenuAction == 2) then {
MenuAction = -1;
CloseDialog 0;
CreateDialog "RscAceGear";
_exited = true;
};
//--- Team Menu.
if (MenuAction == 3) then {
MenuAction = -1;
closeDialog 0;
createDialog "RscMenu_Team";
_exited = true;
};
//--- Voting Menu.
if (MenuAction == 4) then {
MenuAction = -1;
_skip = false;
_voteTime = WF_Logic getVariable Format["%1CommanderVoteTime",sideJoinedText];
if (_voteTime <= 0) then {_skip = true};
if (!_skip) then {
CloseDialog 0;
CreateDialog "RscMenu_Voting";
if !(_skip) exitWith {};
};
WFBE_RequestCommanderVote = ['SRVFNCREQUESTCOMMANDERVOTE',sideJoined];
publicVariable 'WFBE_RequestCommanderVote';
if (isHostedServer) then {['SRVFNCREQUESTCOMMANDERVOTE',sideJoined] Spawn HandleSPVF};
voted = true;
waitUntil {((WF_Logic getVariable Format ["%1CommanderVoteTime",sideJoinedText])>0) || !dialog || !alive player};
if (!alive player || !dialog) exitWith {_exited = true};
closeDialog 0;
createDialog "RscMenu_Voting";
_exited = true;
};
//--- Unflip Vehicle.
if (MenuAction == 10) then { //added-MrNiceGuy
MenuAction = -1;
_vehicle = vehicle player;
if (player != _vehicle) then {
if (getPos _vehicle select 2 > 3 && !surfaceIsWater (getPos _x)) then {
[_vehicle, getPos _vehicle, 15] Call PlaceSafe;
} else {
_vehicle setPos [getPos _vehicle select 0, getPos _vehicle select 1, 0.5];
_vehicle setVelocity [0,0,-0.5];
};
};
if (player == _vehicle) then {
_objects = player nearEntities[["Car","Motorcycle","Tank"],10];
if (count _objects > 0) then {
{
if (getPos _x select 2 > 3 && !surfaceIsWater (getPos _x)) then {
[_x, getPos _x, 15] Call PlaceSafe;
} else {
_x setPos [getPos _x select 0, getPos _x select 1, 0.5];
_x setVelocity [0,0,-0.5];
};
} forEach _objects;
};
};
};
//--- Headbug Fix.
if (MenuAction == 11) then { //added-MrNiceGuy
MenuAction = -1;
closeDialog 0;
titleCut["","BLACK FADED",0];
_pos = position player;
_vehi = "Lada1" createVehicle [0,0,0];
player moveInCargo _vehi;
deleteVehicle _vehi;
player setPos _pos;
titleCut["","BLACK IN",5];
};
//--- Display Parameters.
if (MenuAction == 12) exitWith { //added-MrNiceGuy
MenuAction = -1;
closeDialog 0;
createDialog "RscDisplay_Parameters";
};
//--- Uptime.
_uptime = Call GetTime; //added-MrNiceGuy
ctrlSetText [11015,Format[localize 'STR_WF_MAIN_Uptime',_uptime select 0,_uptime select 1,_uptime select 2, _uptime select 3]];
_enable = false; //added-MrNiceGuy
if (!isNull(commanderTeam)) then {if (commanderTeam == group player) then {_enable = true}};
ctrlEnable [11005,_enable]; //--- Team Orders
ctrlEnable [11008,_enable]; //--- Commander Menu
ctrlEnable [11006,commandInRange]; //--- Special Menu
ctrlEnable [11007,commandInRange]; //--- Upgrade Menu
//--- Command Menu.
if (MenuAction == 5) exitWith { //added-MrNiceGuy
MenuAction = -1;
closeDialog 0;
createDialog "RscMenu_Command";
};
//--- Tactical Menu.
if (MenuAction == 6) exitWith { //added-MrNiceGuy
MenuAction = -1;
closeDialog 0;
createDialog "RscMenu_Tactical";
};
//--- Upgrade Menu.
if (MenuAction == 7) exitWith { //added-MrNiceGuy
MenuAction = -1;
closeDialog 0;
createDialog "RscMenu_Upgrade";
};
//--- Economy Menu.
if (MenuAction == 8) exitWith { //added-MrNiceGuy
MenuAction = -1;
closeDialog 0;
createDialog "RscMenu_Economy";
};
//--- Service Menu.
if (MenuAction == 9) exitWith { //added-MrNiceGuy
MenuAction = -1;
closeDialog 0;
createDialog "RscMenu_Service";
};
};
|