@bf6mods/sdk 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +20445 -15595
- package/dist/index.js +333 -604
- package/dist/index.js.map +1 -1
- package/dist/std/chunk-Bp6m_JJh.js +13 -0
- package/dist/std/index.d.ts +26 -33
- package/dist/std/index.js +207 -391
- package/dist/std/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,691 +1,420 @@
|
|
|
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
|
-
}
|
|
1
|
+
//#region src/config/mutators/index.ts
|
|
2
|
+
/**
|
|
3
|
+
* Determines the Man-Down behavior when a soldier is downed.
|
|
4
|
+
*/
|
|
5
|
+
let ManDownExperienceType = /* @__PURE__ */ function(ManDownExperienceType$1) {
|
|
6
|
+
ManDownExperienceType$1[ManDownExperienceType$1["Crawl"] = 0] = "Crawl";
|
|
7
|
+
ManDownExperienceType$1[ManDownExperienceType$1["Downed"] = 1] = "Downed";
|
|
8
|
+
ManDownExperienceType$1[ManDownExperienceType$1["InstantDeath"] = 2] = "InstantDeath";
|
|
9
|
+
return ManDownExperienceType$1;
|
|
10
|
+
}({});
|
|
11
|
+
/**
|
|
12
|
+
* Controls which type of AI to spawn. PvP AI will automatically spawn and can be replaced by human players. PvE AI is a fixed number that cannot be replaced, for Solo or Co-op experiences.
|
|
13
|
+
*/
|
|
14
|
+
let AiSpawnType = /* @__PURE__ */ function(AiSpawnType$1) {
|
|
15
|
+
AiSpawnType$1[AiSpawnType$1["NoBots"] = 0] = "NoBots";
|
|
16
|
+
AiSpawnType$1[AiSpawnType$1["Backfill"] = 2] = "Backfill";
|
|
17
|
+
AiSpawnType$1[AiSpawnType$1["Static"] = 1] = "Static";
|
|
18
|
+
return AiSpawnType$1;
|
|
19
|
+
}({});
|
|
20
|
+
/**
|
|
21
|
+
* Controls the rules for Squad Spawning, for squad members and squad leaders.
|
|
22
|
+
*/
|
|
23
|
+
let SquadSpawnType = /* @__PURE__ */ function(SquadSpawnType$1) {
|
|
24
|
+
SquadSpawnType$1[SquadSpawnType$1["All"] = 0] = "All";
|
|
25
|
+
SquadSpawnType$1[SquadSpawnType$1["SquadmatesOnLeader_LeaderNone"] = 1] = "SquadmatesOnLeader_LeaderNone";
|
|
26
|
+
SquadSpawnType$1[SquadSpawnType$1["SquadmatesOnLeader_LeaderAll"] = 2] = "SquadmatesOnLeader_LeaderAll";
|
|
27
|
+
SquadSpawnType$1[SquadSpawnType$1["Disabled"] = 2] = "Disabled";
|
|
28
|
+
SquadSpawnType$1[SquadSpawnType$1["Undocumneted"] = 3] = "Undocumneted";
|
|
29
|
+
return SquadSpawnType$1;
|
|
30
|
+
}({});
|
|
31
|
+
/**
|
|
32
|
+
* Controls what type of scoreboard layout to use.
|
|
33
|
+
*/
|
|
34
|
+
let ScoreboardType = /* @__PURE__ */ function(ScoreboardType$1) {
|
|
35
|
+
ScoreboardType$1[ScoreboardType$1["NotSet"] = 0] = "NotSet";
|
|
36
|
+
ScoreboardType$1[ScoreboardType$1["DefaultFAA"] = 1] = "DefaultFAA";
|
|
37
|
+
ScoreboardType$1[ScoreboardType$1["Off"] = 2] = "Off";
|
|
38
|
+
ScoreboardType$1[ScoreboardType$1["CustomTwoTeams"] = 3] = "CustomTwoTeams";
|
|
39
|
+
ScoreboardType$1[ScoreboardType$1["CustomFFA"] = 4] = "CustomFFA";
|
|
40
|
+
return ScoreboardType$1;
|
|
41
|
+
}({});
|
|
42
|
+
/**
|
|
43
|
+
* Determines the behavior of the Ping command.
|
|
44
|
+
*/
|
|
45
|
+
let PingBehavior = /* @__PURE__ */ function(PingBehavior$1) {
|
|
46
|
+
PingBehavior$1[PingBehavior$1["PingTargets"] = 0] = "PingTargets";
|
|
47
|
+
PingBehavior$1[PingBehavior$1["Disabled"] = 1] = "Disabled";
|
|
48
|
+
return PingBehavior$1;
|
|
49
|
+
}({});
|
|
50
|
+
let ModBuilderGameMode = /* @__PURE__ */ function(ModBuilderGameMode$1) {
|
|
51
|
+
ModBuilderGameMode$1[ModBuilderGameMode$1["Custom"] = 2] = "Custom";
|
|
52
|
+
return ModBuilderGameMode$1;
|
|
53
|
+
}({});
|
|
54
|
+
/**
|
|
55
|
+
* Sets the faction for each team.
|
|
56
|
+
*/
|
|
57
|
+
let FactionID = /* @__PURE__ */ function(FactionID$1) {
|
|
58
|
+
FactionID$1[FactionID$1["Pax"] = -1865993703] = "Pax";
|
|
59
|
+
FactionID$1[FactionID$1["MapDefault"] = 0] = "MapDefault";
|
|
60
|
+
FactionID$1[FactionID$1["NATO"] = 607944106] = "NATO";
|
|
61
|
+
return FactionID$1;
|
|
62
|
+
}({});
|
|
50
63
|
|
|
51
|
-
|
|
64
|
+
//#endregion
|
|
65
|
+
//#region src/config/index.ts
|
|
66
|
+
let AttachmentType = /* @__PURE__ */ function(AttachmentType$1) {
|
|
67
|
+
AttachmentType$1[AttachmentType$1["SpatialData"] = 1] = "SpatialData";
|
|
68
|
+
AttachmentType$1[AttachmentType$1["TypeScript"] = 2] = "TypeScript";
|
|
69
|
+
AttachmentType$1[AttachmentType$1["Strings"] = 4] = "Strings";
|
|
70
|
+
return AttachmentType$1;
|
|
71
|
+
}({});
|
|
72
|
+
|
|
73
|
+
//#endregion
|
|
74
|
+
//#region src/modlib/index.ts
|
|
52
75
|
function Concat(s1, s2) {
|
|
53
|
-
|
|
76
|
+
return s1 + s2;
|
|
54
77
|
}
|
|
55
78
|
function And(...rest) {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
if (!cond) return false;
|
|
59
|
-
}
|
|
60
|
-
return true;
|
|
79
|
+
for (let i = 0; i < rest.length; i++) if (!rest[i]) return false;
|
|
80
|
+
return true;
|
|
61
81
|
}
|
|
62
82
|
function AndFn(...rest) {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
83
|
+
for (let i = 0; i < rest.length; i++) {
|
|
84
|
+
const condFn = rest[i];
|
|
85
|
+
if (!condFn()) return false;
|
|
86
|
+
}
|
|
87
|
+
return true;
|
|
68
88
|
}
|
|
69
89
|
function getPlayerId(player) {
|
|
70
|
-
|
|
90
|
+
return mod.GetObjId(player);
|
|
71
91
|
}
|
|
72
92
|
function getTeamId(team) {
|
|
73
|
-
|
|
93
|
+
return mod.GetObjId(team);
|
|
74
94
|
}
|
|
75
95
|
function ConvertArray(array) {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
96
|
+
let v = [];
|
|
97
|
+
let n = mod.CountOf(array);
|
|
98
|
+
for (let i = 0; i < n; i++) {
|
|
99
|
+
let currentElement = mod.ValueInArray(array, i);
|
|
100
|
+
v.push(currentElement);
|
|
101
|
+
}
|
|
102
|
+
return v;
|
|
83
103
|
}
|
|
84
104
|
function FilteredArray(array, cond) {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
105
|
+
const arr = ConvertArray(array);
|
|
106
|
+
let v = mod.EmptyArray();
|
|
107
|
+
let n = arr.length;
|
|
108
|
+
for (let i = 0; i < n; i++) {
|
|
109
|
+
let currentElement = arr[i];
|
|
110
|
+
if (cond(currentElement)) mod.AppendToArray(v, currentElement);
|
|
111
|
+
}
|
|
112
|
+
return v;
|
|
93
113
|
}
|
|
94
114
|
function IndexOfFirstTrue(array, cond, arg = null) {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
115
|
+
const arr = ConvertArray(array);
|
|
116
|
+
let n = arr.length;
|
|
117
|
+
for (let i = 0; i < n; i++) {
|
|
118
|
+
let currentArrayElement = arr[i];
|
|
119
|
+
if (cond(currentArrayElement, arg)) return i;
|
|
120
|
+
}
|
|
121
|
+
return -1;
|
|
102
122
|
}
|
|
103
123
|
function IfThenElse(condition, ifTrue, ifFalse) {
|
|
104
|
-
|
|
105
|
-
|
|
124
|
+
if (condition) return ifTrue();
|
|
125
|
+
else return ifFalse();
|
|
106
126
|
}
|
|
107
127
|
function IsTrueForAll(array, condition, arg = null) {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
128
|
+
const arr = ConvertArray(array);
|
|
129
|
+
let n = arr.length;
|
|
130
|
+
for (let i = 0; i < n; i++) {
|
|
131
|
+
let currentArrayElement = arr[i];
|
|
132
|
+
if (!condition(currentArrayElement, arg)) return false;
|
|
133
|
+
}
|
|
134
|
+
return true;
|
|
115
135
|
}
|
|
116
136
|
function IsTrueForAny(array, condition, arg = null) {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
137
|
+
const arr = ConvertArray(array);
|
|
138
|
+
let n = arr.length;
|
|
139
|
+
for (let i = 0; i < n; i++) {
|
|
140
|
+
let currentArrayElement = arr[i];
|
|
141
|
+
if (condition(currentArrayElement, arg)) return true;
|
|
142
|
+
}
|
|
143
|
+
return false;
|
|
124
144
|
}
|
|
125
145
|
function SortedArray(array, compare) {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
146
|
+
let v1 = array.slice();
|
|
147
|
+
v1.sort(compare);
|
|
148
|
+
let v2 = [];
|
|
149
|
+
for (let e of v1) v2.push(e);
|
|
150
|
+
return v2;
|
|
131
151
|
}
|
|
132
152
|
function Equals(a, b) {
|
|
133
|
-
|
|
134
|
-
|
|
153
|
+
if (a == null || b == null) debugger;
|
|
154
|
+
return mod.Equals(a, b);
|
|
135
155
|
}
|
|
136
156
|
async function WaitUntil(delay, cond) {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
157
|
+
let deltaCount = 10;
|
|
158
|
+
let deltaWait = delay / deltaCount;
|
|
159
|
+
for (let t = 0; t < deltaCount; t++) {
|
|
160
|
+
if (!cond()) break;
|
|
161
|
+
await mod.Wait(deltaWait);
|
|
162
|
+
}
|
|
143
163
|
}
|
|
144
164
|
var ConditionState = class {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
165
|
+
constructor() {
|
|
166
|
+
this.lastState = false;
|
|
167
|
+
}
|
|
168
|
+
update(newState) {
|
|
169
|
+
if (!newState) {
|
|
170
|
+
this.lastState = false;
|
|
171
|
+
return false;
|
|
172
|
+
}
|
|
173
|
+
if (this.lastState) return false;
|
|
174
|
+
this.lastState = true;
|
|
175
|
+
return true;
|
|
176
|
+
}
|
|
157
177
|
};
|
|
158
178
|
var Conditions = class {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
return this.conditionStates[n];
|
|
167
|
-
}
|
|
179
|
+
constructor() {
|
|
180
|
+
this.conditionStates = [];
|
|
181
|
+
}
|
|
182
|
+
getConditionState(n) {
|
|
183
|
+
while (n >= this.conditionStates.length) this.conditionStates.push(new ConditionState());
|
|
184
|
+
return this.conditionStates[n];
|
|
185
|
+
}
|
|
168
186
|
};
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
187
|
+
let playerConditions = [];
|
|
188
|
+
let teamConditions = [];
|
|
189
|
+
let capturePointConditions = [];
|
|
190
|
+
let mcomConditions = [];
|
|
191
|
+
let vehicleConditions = [];
|
|
192
|
+
let globalConditions = new Conditions();
|
|
175
193
|
function getObjectCondition(id, objectConditions, n) {
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
}
|
|
179
|
-
let conditions = objectConditions[id];
|
|
180
|
-
return conditions.getConditionState(n);
|
|
194
|
+
while (id >= objectConditions.length) objectConditions.push(new Conditions());
|
|
195
|
+
return objectConditions[id].getConditionState(n);
|
|
181
196
|
}
|
|
182
197
|
function getPlayerCondition(obj, n) {
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
}
|
|
187
|
-
let conditions = playerConditions[id];
|
|
188
|
-
return conditions.getConditionState(n);
|
|
198
|
+
let id = getPlayerId(obj);
|
|
199
|
+
while (id >= playerConditions.length) playerConditions.push(new Conditions());
|
|
200
|
+
return playerConditions[id].getConditionState(n);
|
|
189
201
|
}
|
|
190
202
|
function getTeamCondition(team, n) {
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
}
|
|
195
|
-
let conditions = teamConditions[id];
|
|
196
|
-
return conditions.getConditionState(n);
|
|
203
|
+
let id = getTeamId(team);
|
|
204
|
+
while (id >= teamConditions.length) teamConditions.push(new Conditions());
|
|
205
|
+
return teamConditions[id].getConditionState(n);
|
|
197
206
|
}
|
|
198
207
|
function getCapturePointCondition(obj, n) {
|
|
199
|
-
|
|
200
|
-
return getObjectCondition(id, capturePointConditions, n);
|
|
208
|
+
return getObjectCondition(mod.GetObjId(obj), capturePointConditions, n);
|
|
201
209
|
}
|
|
202
210
|
function getMCOMCondition(obj, n) {
|
|
203
|
-
|
|
204
|
-
return getObjectCondition(id, mcomConditions, n);
|
|
211
|
+
return getObjectCondition(mod.GetObjId(obj), mcomConditions, n);
|
|
205
212
|
}
|
|
206
213
|
function getVehicleCondition(obj, n) {
|
|
207
|
-
|
|
208
|
-
return getObjectCondition(id, vehicleConditions, n);
|
|
214
|
+
return getObjectCondition(mod.GetObjId(obj), vehicleConditions, n);
|
|
209
215
|
}
|
|
210
216
|
function getGlobalCondition(n) {
|
|
211
|
-
|
|
217
|
+
return globalConditions.getConditionState(n);
|
|
212
218
|
}
|
|
213
219
|
function getPlayersInTeam(team) {
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
}
|
|
223
|
-
return teamMembers;
|
|
220
|
+
const allPlayers = mod.AllPlayers();
|
|
221
|
+
const n = mod.CountOf(allPlayers);
|
|
222
|
+
let teamMembers = [];
|
|
223
|
+
for (let i = 0; i < n; i++) {
|
|
224
|
+
let player = mod.ValueInArray(allPlayers, i);
|
|
225
|
+
if (mod.GetTeam(player) == team) teamMembers.push(player);
|
|
226
|
+
}
|
|
227
|
+
return teamMembers;
|
|
224
228
|
}
|
|
225
229
|
function __asModVector(param) {
|
|
226
|
-
|
|
227
|
-
|
|
230
|
+
if (Array.isArray(param)) return mod.CreateVector(param[0], param[1], param.length == 2 ? 0 : param[2]);
|
|
231
|
+
else return param;
|
|
228
232
|
}
|
|
229
233
|
function __asModMessage(param) {
|
|
230
|
-
|
|
231
|
-
|
|
234
|
+
if (typeof param === "string") return mod.Message(param);
|
|
235
|
+
return param;
|
|
232
236
|
}
|
|
233
237
|
function __fillInDefaultArgs(params) {
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
238
|
+
if (!params.hasOwnProperty("name")) params.name = "";
|
|
239
|
+
if (!params.hasOwnProperty("position")) params.position = mod.CreateVector(0, 0, 0);
|
|
240
|
+
if (!params.hasOwnProperty("size")) params.size = mod.CreateVector(100, 100, 0);
|
|
241
|
+
if (!params.hasOwnProperty("anchor")) params.anchor = mod.UIAnchor.TopLeft;
|
|
242
|
+
if (!params.hasOwnProperty("parent")) params.parent = mod.GetUIRoot();
|
|
243
|
+
if (!params.hasOwnProperty("visible")) params.visible = true;
|
|
244
|
+
if (!params.hasOwnProperty("padding")) params.padding = params.type == "Container" ? 0 : 8;
|
|
245
|
+
if (!params.hasOwnProperty("bgColor")) params.bgColor = mod.CreateVector(.25, .25, .25);
|
|
246
|
+
if (!params.hasOwnProperty("bgAlpha")) params.bgAlpha = .5;
|
|
247
|
+
if (!params.hasOwnProperty("bgFill")) params.bgFill = mod.UIBgFill.Solid;
|
|
244
248
|
}
|
|
245
249
|
function __setNameAndGetWidget(uniqueName, params) {
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
250
|
+
let widget = mod.FindUIWidgetWithName(uniqueName);
|
|
251
|
+
mod.SetUIWidgetName(widget, params.name);
|
|
252
|
+
return widget;
|
|
249
253
|
}
|
|
250
|
-
|
|
254
|
+
const __cUniqueName = "----uniquename----";
|
|
251
255
|
function __addUIContainer(params) {
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
params.padding,
|
|
263
|
-
__asModVector(params.bgColor),
|
|
264
|
-
params.bgAlpha,
|
|
265
|
-
params.bgFill,
|
|
266
|
-
restrict
|
|
267
|
-
);
|
|
268
|
-
} else {
|
|
269
|
-
mod.AddUIContainer(
|
|
270
|
-
__cUniqueName,
|
|
271
|
-
__asModVector(params.position),
|
|
272
|
-
__asModVector(params.size),
|
|
273
|
-
params.anchor,
|
|
274
|
-
params.parent,
|
|
275
|
-
params.visible,
|
|
276
|
-
params.padding,
|
|
277
|
-
__asModVector(params.bgColor),
|
|
278
|
-
params.bgAlpha,
|
|
279
|
-
params.bgFill
|
|
280
|
-
);
|
|
281
|
-
}
|
|
282
|
-
let widget = __setNameAndGetWidget(__cUniqueName, params);
|
|
283
|
-
if (params.children) {
|
|
284
|
-
params.children.forEach((childParams) => {
|
|
285
|
-
childParams.parent = widget;
|
|
286
|
-
__addUIWidget(childParams);
|
|
287
|
-
});
|
|
288
|
-
}
|
|
289
|
-
return widget;
|
|
256
|
+
__fillInDefaultArgs(params);
|
|
257
|
+
let restrict = params.teamId ?? params.playerId;
|
|
258
|
+
if (restrict) mod.AddUIContainer(__cUniqueName, __asModVector(params.position), __asModVector(params.size), params.anchor, params.parent, params.visible, params.padding, __asModVector(params.bgColor), params.bgAlpha, params.bgFill, restrict);
|
|
259
|
+
else mod.AddUIContainer(__cUniqueName, __asModVector(params.position), __asModVector(params.size), params.anchor, params.parent, params.visible, params.padding, __asModVector(params.bgColor), params.bgAlpha, params.bgFill);
|
|
260
|
+
let widget = __setNameAndGetWidget(__cUniqueName, params);
|
|
261
|
+
if (params.children) params.children.forEach((childParams) => {
|
|
262
|
+
childParams.parent = widget;
|
|
263
|
+
__addUIWidget(childParams);
|
|
264
|
+
});
|
|
265
|
+
return widget;
|
|
290
266
|
}
|
|
291
267
|
function __fillInDefaultTextArgs(params) {
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
268
|
+
if (!params.hasOwnProperty("textLabel")) params.textLabel = "";
|
|
269
|
+
if (!params.hasOwnProperty("textSize")) params.textSize = 0;
|
|
270
|
+
if (!params.hasOwnProperty("textColor")) params.textColor = mod.CreateVector(1, 1, 1);
|
|
271
|
+
if (!params.hasOwnProperty("textAlpha")) params.textAlpha = 1;
|
|
272
|
+
if (!params.hasOwnProperty("textAnchor")) params.textAnchor = mod.UIAnchor.CenterLeft;
|
|
297
273
|
}
|
|
298
274
|
function __addUIText(params) {
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
__asModVector(params.position),
|
|
306
|
-
__asModVector(params.size),
|
|
307
|
-
params.anchor,
|
|
308
|
-
params.parent,
|
|
309
|
-
params.visible,
|
|
310
|
-
params.padding,
|
|
311
|
-
__asModVector(params.bgColor),
|
|
312
|
-
params.bgAlpha,
|
|
313
|
-
params.bgFill,
|
|
314
|
-
__asModMessage(params.textLabel),
|
|
315
|
-
params.textSize,
|
|
316
|
-
__asModVector(params.textColor),
|
|
317
|
-
params.textAlpha,
|
|
318
|
-
params.textAnchor,
|
|
319
|
-
restrict
|
|
320
|
-
);
|
|
321
|
-
} else {
|
|
322
|
-
mod.AddUIText(
|
|
323
|
-
__cUniqueName,
|
|
324
|
-
__asModVector(params.position),
|
|
325
|
-
__asModVector(params.size),
|
|
326
|
-
params.anchor,
|
|
327
|
-
params.parent,
|
|
328
|
-
params.visible,
|
|
329
|
-
params.padding,
|
|
330
|
-
__asModVector(params.bgColor),
|
|
331
|
-
params.bgAlpha,
|
|
332
|
-
params.bgFill,
|
|
333
|
-
__asModMessage(params.textLabel),
|
|
334
|
-
params.textSize,
|
|
335
|
-
__asModVector(params.textColor),
|
|
336
|
-
params.textAlpha,
|
|
337
|
-
params.textAnchor
|
|
338
|
-
);
|
|
339
|
-
}
|
|
340
|
-
return __setNameAndGetWidget(__cUniqueName, params);
|
|
275
|
+
__fillInDefaultArgs(params);
|
|
276
|
+
__fillInDefaultTextArgs(params);
|
|
277
|
+
let restrict = params.teamId ?? params.playerId;
|
|
278
|
+
if (restrict) mod.AddUIText(__cUniqueName, __asModVector(params.position), __asModVector(params.size), params.anchor, params.parent, params.visible, params.padding, __asModVector(params.bgColor), params.bgAlpha, params.bgFill, __asModMessage(params.textLabel), params.textSize, __asModVector(params.textColor), params.textAlpha, params.textAnchor, restrict);
|
|
279
|
+
else mod.AddUIText(__cUniqueName, __asModVector(params.position), __asModVector(params.size), params.anchor, params.parent, params.visible, params.padding, __asModVector(params.bgColor), params.bgAlpha, params.bgFill, __asModMessage(params.textLabel), params.textSize, __asModVector(params.textColor), params.textAlpha, params.textAnchor);
|
|
280
|
+
return __setNameAndGetWidget(__cUniqueName, params);
|
|
341
281
|
}
|
|
342
282
|
function __fillInDefaultImageArgs(params) {
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
283
|
+
if (!params.hasOwnProperty("imageType")) params.imageType = mod.UIImageType.None;
|
|
284
|
+
if (!params.hasOwnProperty("imageColor")) params.imageColor = mod.CreateVector(1, 1, 1);
|
|
285
|
+
if (!params.hasOwnProperty("imageAlpha")) params.imageAlpha = 1;
|
|
346
286
|
}
|
|
347
287
|
function __addUIImage(params) {
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
__asModVector(params.position),
|
|
355
|
-
__asModVector(params.size),
|
|
356
|
-
params.anchor,
|
|
357
|
-
params.parent,
|
|
358
|
-
params.visible,
|
|
359
|
-
params.padding,
|
|
360
|
-
__asModVector(params.bgColor),
|
|
361
|
-
params.bgAlpha,
|
|
362
|
-
params.bgFill,
|
|
363
|
-
params.imageType,
|
|
364
|
-
__asModVector(params.imageColor),
|
|
365
|
-
params.imageAlpha,
|
|
366
|
-
restrict
|
|
367
|
-
);
|
|
368
|
-
} else {
|
|
369
|
-
mod.AddUIImage(
|
|
370
|
-
__cUniqueName,
|
|
371
|
-
__asModVector(params.position),
|
|
372
|
-
__asModVector(params.size),
|
|
373
|
-
params.anchor,
|
|
374
|
-
params.parent,
|
|
375
|
-
params.visible,
|
|
376
|
-
params.padding,
|
|
377
|
-
__asModVector(params.bgColor),
|
|
378
|
-
params.bgAlpha,
|
|
379
|
-
params.bgFill,
|
|
380
|
-
params.imageType,
|
|
381
|
-
__asModVector(params.imageColor),
|
|
382
|
-
params.imageAlpha
|
|
383
|
-
);
|
|
384
|
-
}
|
|
385
|
-
return __setNameAndGetWidget(__cUniqueName, params);
|
|
288
|
+
__fillInDefaultArgs(params);
|
|
289
|
+
__fillInDefaultImageArgs(params);
|
|
290
|
+
let restrict = params.teamId ?? params.playerId;
|
|
291
|
+
if (restrict) mod.AddUIImage(__cUniqueName, __asModVector(params.position), __asModVector(params.size), params.anchor, params.parent, params.visible, params.padding, __asModVector(params.bgColor), params.bgAlpha, params.bgFill, params.imageType, __asModVector(params.imageColor), params.imageAlpha, restrict);
|
|
292
|
+
else mod.AddUIImage(__cUniqueName, __asModVector(params.position), __asModVector(params.size), params.anchor, params.parent, params.visible, params.padding, __asModVector(params.bgColor), params.bgAlpha, params.bgFill, params.imageType, __asModVector(params.imageColor), params.imageAlpha);
|
|
293
|
+
return __setNameAndGetWidget(__cUniqueName, params);
|
|
386
294
|
}
|
|
387
295
|
function __fillInDefaultButtonArgs(params) {
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
296
|
+
if (!params.hasOwnProperty("buttonEnabled")) params.buttonEnabled = true;
|
|
297
|
+
if (!params.hasOwnProperty("buttonColorBase")) params.buttonColorBase = mod.CreateVector(.7, .7, .7);
|
|
298
|
+
if (!params.hasOwnProperty("buttonAlphaBase")) params.buttonAlphaBase = 1;
|
|
299
|
+
if (!params.hasOwnProperty("buttonColorDisabled")) params.buttonColorDisabled = mod.CreateVector(.2, .2, .2);
|
|
300
|
+
if (!params.hasOwnProperty("buttonAlphaDisabled")) params.buttonAlphaDisabled = .5;
|
|
301
|
+
if (!params.hasOwnProperty("buttonColorPressed")) params.buttonColorPressed = mod.CreateVector(.25, .25, .25);
|
|
302
|
+
if (!params.hasOwnProperty("buttonAlphaPressed")) params.buttonAlphaPressed = 1;
|
|
303
|
+
if (!params.hasOwnProperty("buttonColorHover")) params.buttonColorHover = mod.CreateVector(1, 1, 1);
|
|
304
|
+
if (!params.hasOwnProperty("buttonAlphaHover")) params.buttonAlphaHover = 1;
|
|
305
|
+
if (!params.hasOwnProperty("buttonColorFocused")) params.buttonColorFocused = mod.CreateVector(1, 1, 1);
|
|
306
|
+
if (!params.hasOwnProperty("buttonAlphaFocused")) params.buttonAlphaFocused = 1;
|
|
399
307
|
}
|
|
400
308
|
function __addUIButton(params) {
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
__asModVector(params.position),
|
|
408
|
-
__asModVector(params.size),
|
|
409
|
-
params.anchor,
|
|
410
|
-
params.parent,
|
|
411
|
-
params.visible,
|
|
412
|
-
params.padding,
|
|
413
|
-
__asModVector(params.bgColor),
|
|
414
|
-
params.bgAlpha,
|
|
415
|
-
params.bgFill,
|
|
416
|
-
params.buttonEnabled,
|
|
417
|
-
__asModVector(params.buttonColorBase),
|
|
418
|
-
params.buttonAlphaBase,
|
|
419
|
-
__asModVector(params.buttonColorDisabled),
|
|
420
|
-
params.buttonAlphaDisabled,
|
|
421
|
-
__asModVector(params.buttonColorPressed),
|
|
422
|
-
params.buttonAlphaPressed,
|
|
423
|
-
__asModVector(params.buttonColorHover),
|
|
424
|
-
params.buttonAlphaHover,
|
|
425
|
-
__asModVector(params.buttonColorFocused),
|
|
426
|
-
params.buttonAlphaFocused,
|
|
427
|
-
restrict
|
|
428
|
-
);
|
|
429
|
-
} else {
|
|
430
|
-
mod.AddUIButton(
|
|
431
|
-
__cUniqueName,
|
|
432
|
-
__asModVector(params.position),
|
|
433
|
-
__asModVector(params.size),
|
|
434
|
-
params.anchor,
|
|
435
|
-
params.parent,
|
|
436
|
-
params.visible,
|
|
437
|
-
params.padding,
|
|
438
|
-
__asModVector(params.bgColor),
|
|
439
|
-
params.bgAlpha,
|
|
440
|
-
params.bgFill,
|
|
441
|
-
params.buttonEnabled,
|
|
442
|
-
__asModVector(params.buttonColorBase),
|
|
443
|
-
params.buttonAlphaBase,
|
|
444
|
-
__asModVector(params.buttonColorDisabled),
|
|
445
|
-
params.buttonAlphaDisabled,
|
|
446
|
-
__asModVector(params.buttonColorPressed),
|
|
447
|
-
params.buttonAlphaPressed,
|
|
448
|
-
__asModVector(params.buttonColorHover),
|
|
449
|
-
params.buttonAlphaHover,
|
|
450
|
-
__asModVector(params.buttonColorFocused),
|
|
451
|
-
params.buttonAlphaFocused
|
|
452
|
-
);
|
|
453
|
-
}
|
|
454
|
-
return __setNameAndGetWidget(__cUniqueName, params);
|
|
309
|
+
__fillInDefaultArgs(params);
|
|
310
|
+
__fillInDefaultButtonArgs(params);
|
|
311
|
+
let restrict = params.teamId ?? params.playerId;
|
|
312
|
+
if (restrict) mod.AddUIButton(__cUniqueName, __asModVector(params.position), __asModVector(params.size), params.anchor, params.parent, params.visible, params.padding, __asModVector(params.bgColor), params.bgAlpha, params.bgFill, params.buttonEnabled, __asModVector(params.buttonColorBase), params.buttonAlphaBase, __asModVector(params.buttonColorDisabled), params.buttonAlphaDisabled, __asModVector(params.buttonColorPressed), params.buttonAlphaPressed, __asModVector(params.buttonColorHover), params.buttonAlphaHover, __asModVector(params.buttonColorFocused), params.buttonAlphaFocused, restrict);
|
|
313
|
+
else mod.AddUIButton(__cUniqueName, __asModVector(params.position), __asModVector(params.size), params.anchor, params.parent, params.visible, params.padding, __asModVector(params.bgColor), params.bgAlpha, params.bgFill, params.buttonEnabled, __asModVector(params.buttonColorBase), params.buttonAlphaBase, __asModVector(params.buttonColorDisabled), params.buttonAlphaDisabled, __asModVector(params.buttonColorPressed), params.buttonAlphaPressed, __asModVector(params.buttonColorHover), params.buttonAlphaHover, __asModVector(params.buttonColorFocused), params.buttonAlphaFocused);
|
|
314
|
+
return __setNameAndGetWidget(__cUniqueName, params);
|
|
455
315
|
}
|
|
456
316
|
function __addUIWidget(params) {
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
return void 0;
|
|
317
|
+
if (params == null) return void 0;
|
|
318
|
+
if (params.type == "Container") return __addUIContainer(params);
|
|
319
|
+
else if (params.type == "Text") return __addUIText(params);
|
|
320
|
+
else if (params.type == "Image") return __addUIImage(params);
|
|
321
|
+
else if (params.type == "Button") return __addUIButton(params);
|
|
463
322
|
}
|
|
464
323
|
function ParseUI(...params) {
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
}
|
|
469
|
-
return widget;
|
|
324
|
+
let widget;
|
|
325
|
+
for (let a = 0; a < params.length; a++) widget = __addUIWidget(params[a]);
|
|
326
|
+
return widget;
|
|
470
327
|
}
|
|
471
328
|
function DisplayCustomNotificationMessage(msg, custom, duration, target) {
|
|
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
|
-
mod.CreateVector(125, 40, 0),
|
|
501
|
-
mod.UIAnchor.TopRight,
|
|
502
|
-
mod.GetUIRoot(),
|
|
503
|
-
true,
|
|
504
|
-
8,
|
|
505
|
-
mod.CreateVector(1, 1, 1),
|
|
506
|
-
1,
|
|
507
|
-
mod.UIBgFill.Blur,
|
|
508
|
-
msg2,
|
|
509
|
-
20,
|
|
510
|
-
mod.CreateVector(1, 1, 1),
|
|
511
|
-
1,
|
|
512
|
-
mod.UIAnchor.Center,
|
|
513
|
-
targetPlayer
|
|
514
|
-
);
|
|
515
|
-
if (duration > 0) {
|
|
516
|
-
await mod.Wait(duration);
|
|
517
|
-
mod.DeleteUIWidget(mod.FindUIWidgetWithName(widgetId));
|
|
518
|
-
}
|
|
519
|
-
};
|
|
520
|
-
const createNotificationFunction = custom < 1 ? CreateHeader : CreateSubText;
|
|
521
|
-
if (target) {
|
|
522
|
-
if (mod.IsType(target, mod.Types.Player)) {
|
|
523
|
-
const widgetId = custom + String(target);
|
|
524
|
-
createNotificationFunction(widgetId, msg, target, custom);
|
|
525
|
-
} else if (mod.IsType(target, mod.Types.Team)) {
|
|
526
|
-
const teamMates = getPlayersInTeam(target);
|
|
527
|
-
teamMates.forEach((player) => {
|
|
528
|
-
const widgetId = custom + String(player);
|
|
529
|
-
createNotificationFunction(widgetId, msg, player, custom);
|
|
530
|
-
});
|
|
531
|
-
}
|
|
532
|
-
} else {
|
|
533
|
-
const allPlayers = mod.AllPlayers();
|
|
534
|
-
const n = mod.CountOf(allPlayers);
|
|
535
|
-
for (let i = 0; i < n; i++) {
|
|
536
|
-
let player = mod.ValueInArray(allPlayers, i);
|
|
537
|
-
const widgetId = custom + String(player);
|
|
538
|
-
createNotificationFunction(widgetId, msg, player, custom);
|
|
539
|
-
}
|
|
540
|
-
}
|
|
329
|
+
const CreateHeader = async (widgetId, msg$1, targetPlayer, slot) => {
|
|
330
|
+
mod.AddUIText(widgetId, mod.CreateVector(50, 250 + slot * 45, 0), mod.CreateVector(250, 60, 0), mod.UIAnchor.TopRight, mod.GetUIRoot(), true, 8, mod.CreateVector(1, 1, 1), 1, mod.UIBgFill.Blur, msg$1, 30, mod.CreateVector(1, 1, 1), 1, mod.UIAnchor.Center, targetPlayer);
|
|
331
|
+
if (duration > 0) {
|
|
332
|
+
await mod.Wait(duration);
|
|
333
|
+
mod.DeleteUIWidget(mod.FindUIWidgetWithName(widgetId));
|
|
334
|
+
}
|
|
335
|
+
};
|
|
336
|
+
const CreateSubText = async (widgetId, msg$1, targetPlayer, slot) => {
|
|
337
|
+
mod.AddUIText(widgetId, mod.CreateVector(85, 270 + slot * 43, 0), mod.CreateVector(125, 40, 0), mod.UIAnchor.TopRight, mod.GetUIRoot(), true, 8, mod.CreateVector(1, 1, 1), 1, mod.UIBgFill.Blur, msg$1, 20, mod.CreateVector(1, 1, 1), 1, mod.UIAnchor.Center, targetPlayer);
|
|
338
|
+
if (duration > 0) {
|
|
339
|
+
await mod.Wait(duration);
|
|
340
|
+
mod.DeleteUIWidget(mod.FindUIWidgetWithName(widgetId));
|
|
341
|
+
}
|
|
342
|
+
};
|
|
343
|
+
const createNotificationFunction = custom < 1 ? CreateHeader : CreateSubText;
|
|
344
|
+
if (target) {
|
|
345
|
+
if (mod.IsType(target, mod.Types.Player)) createNotificationFunction(custom + String(target), msg, target, custom);
|
|
346
|
+
else if (mod.IsType(target, mod.Types.Team)) getPlayersInTeam(target).forEach((player) => {
|
|
347
|
+
createNotificationFunction(custom + String(player), msg, player, custom);
|
|
348
|
+
});
|
|
349
|
+
} else {
|
|
350
|
+
const allPlayers = mod.AllPlayers();
|
|
351
|
+
const n = mod.CountOf(allPlayers);
|
|
352
|
+
for (let i = 0; i < n; i++) {
|
|
353
|
+
let player = mod.ValueInArray(allPlayers, i);
|
|
354
|
+
createNotificationFunction(custom + String(player), msg, player, custom);
|
|
355
|
+
}
|
|
356
|
+
}
|
|
541
357
|
}
|
|
542
358
|
function ShowEventGameModeMessage(event, target) {
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
true,
|
|
553
|
-
8,
|
|
554
|
-
mod.CreateVector(1, 1, 1),
|
|
555
|
-
1,
|
|
556
|
-
mod.UIBgFill.Blur,
|
|
557
|
-
message,
|
|
558
|
-
30,
|
|
559
|
-
mod.CreateVector(1, 1, 1),
|
|
560
|
-
1,
|
|
561
|
-
mod.UIAnchor.Center,
|
|
562
|
-
target2
|
|
563
|
-
);
|
|
564
|
-
} else {
|
|
565
|
-
mod.AddUIText(
|
|
566
|
-
widgetId,
|
|
567
|
-
mod.CreateVector(0, 0, 0),
|
|
568
|
-
mod.CreateVector(2500, 80, 0),
|
|
569
|
-
mod.UIAnchor.TopCenter,
|
|
570
|
-
mod.GetUIRoot(),
|
|
571
|
-
true,
|
|
572
|
-
8,
|
|
573
|
-
mod.CreateVector(1, 1, 1),
|
|
574
|
-
1,
|
|
575
|
-
mod.UIBgFill.Blur,
|
|
576
|
-
message,
|
|
577
|
-
30,
|
|
578
|
-
mod.CreateVector(1, 1, 1),
|
|
579
|
-
1,
|
|
580
|
-
mod.UIAnchor.Center
|
|
581
|
-
);
|
|
582
|
-
}
|
|
583
|
-
await mod.Wait(6);
|
|
584
|
-
mod.DeleteUIWidget(mod.FindUIWidgetWithName(widgetId));
|
|
585
|
-
};
|
|
586
|
-
if (target) {
|
|
587
|
-
MakeShiftDisplayGameModeMessage(event, target);
|
|
588
|
-
} else {
|
|
589
|
-
MakeShiftDisplayGameModeMessage(event);
|
|
590
|
-
}
|
|
359
|
+
const MakeShiftDisplayGameModeMessage = async (message, target$1) => {
|
|
360
|
+
const widgetId = "GameModeMessage";
|
|
361
|
+
if (target$1) mod.AddUIText(widgetId, mod.CreateVector(0, 0, 0), mod.CreateVector(2500, 80, 0), mod.UIAnchor.TopCenter, mod.GetUIRoot(), true, 8, mod.CreateVector(1, 1, 1), 1, mod.UIBgFill.Blur, message, 30, mod.CreateVector(1, 1, 1), 1, mod.UIAnchor.Center, target$1);
|
|
362
|
+
else mod.AddUIText(widgetId, mod.CreateVector(0, 0, 0), mod.CreateVector(2500, 80, 0), mod.UIAnchor.TopCenter, mod.GetUIRoot(), true, 8, mod.CreateVector(1, 1, 1), 1, mod.UIBgFill.Blur, message, 30, mod.CreateVector(1, 1, 1), 1, mod.UIAnchor.Center);
|
|
363
|
+
await mod.Wait(6);
|
|
364
|
+
mod.DeleteUIWidget(mod.FindUIWidgetWithName(widgetId));
|
|
365
|
+
};
|
|
366
|
+
if (target) MakeShiftDisplayGameModeMessage(event, target);
|
|
367
|
+
else MakeShiftDisplayGameModeMessage(event);
|
|
591
368
|
}
|
|
592
369
|
function ShowHighlightedGameModeMessage(event, target) {
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
} else {
|
|
596
|
-
mod.DisplayHighlightedWorldLogMessage(event);
|
|
597
|
-
}
|
|
370
|
+
if (target) mod.DisplayHighlightedWorldLogMessage(event, target);
|
|
371
|
+
else mod.DisplayHighlightedWorldLogMessage(event);
|
|
598
372
|
}
|
|
599
373
|
function ShowNotificationMessage(msg, target) {
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
} else {
|
|
603
|
-
mod.DisplayNotificationMessage(msg);
|
|
604
|
-
}
|
|
374
|
+
if (target) mod.DisplayNotificationMessage(msg, target);
|
|
375
|
+
else mod.DisplayNotificationMessage(msg);
|
|
605
376
|
}
|
|
606
377
|
function ClearAllCustomNotificationMessages(target) {
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
}
|
|
623
|
-
try {
|
|
624
|
-
ClearCustomNotificationMessage(mod.CustomNotificationSlots.MessageText4, target);
|
|
625
|
-
} catch {
|
|
626
|
-
}
|
|
378
|
+
try {
|
|
379
|
+
ClearCustomNotificationMessage(mod.CustomNotificationSlots.HeaderText, target);
|
|
380
|
+
} catch {}
|
|
381
|
+
try {
|
|
382
|
+
ClearCustomNotificationMessage(mod.CustomNotificationSlots.MessageText1, target);
|
|
383
|
+
} catch {}
|
|
384
|
+
try {
|
|
385
|
+
ClearCustomNotificationMessage(mod.CustomNotificationSlots.MessageText2, target);
|
|
386
|
+
} catch {}
|
|
387
|
+
try {
|
|
388
|
+
ClearCustomNotificationMessage(mod.CustomNotificationSlots.MessageText3, target);
|
|
389
|
+
} catch {}
|
|
390
|
+
try {
|
|
391
|
+
ClearCustomNotificationMessage(mod.CustomNotificationSlots.MessageText4, target);
|
|
392
|
+
} catch {}
|
|
627
393
|
}
|
|
628
394
|
function ClearCustomNotificationMessage(custom, target) {
|
|
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
|
-
And,
|
|
655
|
-
AndFn,
|
|
656
|
-
AttachmentType,
|
|
657
|
-
ClearAllCustomNotificationMessages,
|
|
658
|
-
ClearCustomNotificationMessage,
|
|
659
|
-
Concat,
|
|
660
|
-
ConditionState,
|
|
661
|
-
ConvertArray,
|
|
662
|
-
DisplayCustomNotificationMessage,
|
|
663
|
-
Equals,
|
|
664
|
-
FactionID,
|
|
665
|
-
FilteredArray,
|
|
666
|
-
IfThenElse,
|
|
667
|
-
IndexOfFirstTrue,
|
|
668
|
-
IsTrueForAll,
|
|
669
|
-
IsTrueForAny,
|
|
670
|
-
ManDownExperienceType,
|
|
671
|
-
ModBuilderGameMode,
|
|
672
|
-
ParseUI,
|
|
673
|
-
PingBehavior,
|
|
674
|
-
ScoreboardType,
|
|
675
|
-
ShowEventGameModeMessage,
|
|
676
|
-
ShowHighlightedGameModeMessage,
|
|
677
|
-
ShowNotificationMessage,
|
|
678
|
-
SortedArray,
|
|
679
|
-
SquadSpawnType,
|
|
680
|
-
WaitUntil,
|
|
681
|
-
getCapturePointCondition,
|
|
682
|
-
getGlobalCondition,
|
|
683
|
-
getMCOMCondition,
|
|
684
|
-
getPlayerCondition,
|
|
685
|
-
getPlayerId,
|
|
686
|
-
getPlayersInTeam,
|
|
687
|
-
getTeamCondition,
|
|
688
|
-
getTeamId,
|
|
689
|
-
getVehicleCondition
|
|
690
|
-
};
|
|
395
|
+
try {
|
|
396
|
+
if (target) {
|
|
397
|
+
if (mod.IsType(target, mod.Types.Player)) mod.DeleteUIWidget(mod.FindUIWidgetWithName(custom + String(target)));
|
|
398
|
+
else if (mod.IsType(target, mod.Types.Team)) {
|
|
399
|
+
const teamMembers = getPlayersInTeam(target);
|
|
400
|
+
for (let i = 0; i < teamMembers.length; i++) {
|
|
401
|
+
let player = teamMembers[i];
|
|
402
|
+
mod.DeleteUIWidget(mod.FindUIWidgetWithName(custom + String(player)));
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
} else {
|
|
406
|
+
const allPlayers = mod.AllPlayers();
|
|
407
|
+
const n = mod.CountOf(allPlayers);
|
|
408
|
+
for (let i = 0; i < n; i++) {
|
|
409
|
+
let player = mod.ValueInArray(allPlayers, i);
|
|
410
|
+
mod.DeleteUIWidget(mod.FindUIWidgetWithName(custom + String(player)));
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
} catch {
|
|
414
|
+
console.error("Could not clear custom message for specified target(s)");
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
//#endregion
|
|
419
|
+
export { AiSpawnType, And, AndFn, AttachmentType, ClearAllCustomNotificationMessages, ClearCustomNotificationMessage, Concat, ConditionState, ConvertArray, DisplayCustomNotificationMessage, Equals, FactionID, FilteredArray, IfThenElse, IndexOfFirstTrue, IsTrueForAll, IsTrueForAny, ManDownExperienceType, ModBuilderGameMode, ParseUI, PingBehavior, ScoreboardType, ShowEventGameModeMessage, ShowHighlightedGameModeMessage, ShowNotificationMessage, SortedArray, SquadSpawnType, WaitUntil, getCapturePointCondition, getGlobalCondition, getMCOMCondition, getPlayerCondition, getPlayerId, getPlayersInTeam, getTeamCondition, getTeamId, getVehicleCondition };
|
|
691
420
|
//# sourceMappingURL=index.js.map
|