@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/std/index.js
CHANGED
|
@@ -1,431 +1,247 @@
|
|
|
1
|
-
|
|
2
|
-
var __typeError = (msg) => {
|
|
3
|
-
throw TypeError(msg);
|
|
4
|
-
};
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
10
|
-
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
11
|
-
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
12
|
-
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
13
|
-
var __privateWrapper = (obj, member, setter, getter) => ({
|
|
14
|
-
set _(value) {
|
|
15
|
-
__privateSet(obj, member, value, setter);
|
|
16
|
-
},
|
|
17
|
-
get _() {
|
|
18
|
-
return __privateGet(obj, member, getter);
|
|
19
|
-
}
|
|
20
|
-
});
|
|
1
|
+
import { t as __export } from "./chunk-Bp6m_JJh.js";
|
|
21
2
|
|
|
22
|
-
|
|
23
|
-
var message_exports = {};
|
|
24
|
-
__export(message_exports, {
|
|
25
|
-
MakeMessage: () => MakeMessage
|
|
26
|
-
});
|
|
3
|
+
//#region src/std/message.ts
|
|
4
|
+
var message_exports = /* @__PURE__ */ __export({ MakeMessage: () => MakeMessage });
|
|
27
5
|
function MakeMessage(message, ...args) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
case 3:
|
|
36
|
-
return mod.Message(message, args[0], args[1], args[2]);
|
|
37
|
-
default:
|
|
38
|
-
throw new Error("Invalid number of arguments");
|
|
39
|
-
}
|
|
6
|
+
switch (args.length) {
|
|
7
|
+
case 0: return mod.Message(message);
|
|
8
|
+
case 1: return mod.Message(message, args[0]);
|
|
9
|
+
case 2: return mod.Message(message, args[0], args[1]);
|
|
10
|
+
case 3: return mod.Message(message, args[0], args[1], args[2]);
|
|
11
|
+
default: throw new Error("Invalid number of arguments");
|
|
12
|
+
}
|
|
40
13
|
}
|
|
41
14
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
__export(ui_exports, {
|
|
45
|
-
CountdownUI: () => CountdownUI,
|
|
46
|
-
bf6Strings: () => bf6Strings,
|
|
47
|
-
default: () => ui_default
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
// src/std/ui/countdown.ts
|
|
51
|
-
var countdown_exports = {};
|
|
52
|
-
__export(countdown_exports, {
|
|
53
|
-
CountdownUI: () => CountdownUI,
|
|
54
|
-
bf6Strings: () => bf6Strings
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
// src/modlib/index.ts
|
|
15
|
+
//#endregion
|
|
16
|
+
//#region src/modlib/index.ts
|
|
58
17
|
var ConditionState = class {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
18
|
+
constructor() {
|
|
19
|
+
this.lastState = false;
|
|
20
|
+
}
|
|
21
|
+
update(newState) {
|
|
22
|
+
if (!newState) {
|
|
23
|
+
this.lastState = false;
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
if (this.lastState) return false;
|
|
27
|
+
this.lastState = true;
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
71
30
|
};
|
|
72
31
|
var Conditions = class {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
return this.conditionStates[n];
|
|
81
|
-
}
|
|
32
|
+
constructor() {
|
|
33
|
+
this.conditionStates = [];
|
|
34
|
+
}
|
|
35
|
+
getConditionState(n) {
|
|
36
|
+
while (n >= this.conditionStates.length) this.conditionStates.push(new ConditionState());
|
|
37
|
+
return this.conditionStates[n];
|
|
38
|
+
}
|
|
82
39
|
};
|
|
83
|
-
|
|
40
|
+
let globalConditions = new Conditions();
|
|
84
41
|
function __asModVector(param) {
|
|
85
|
-
|
|
86
|
-
|
|
42
|
+
if (Array.isArray(param)) return mod.CreateVector(param[0], param[1], param.length == 2 ? 0 : param[2]);
|
|
43
|
+
else return param;
|
|
87
44
|
}
|
|
88
45
|
function __asModMessage(param) {
|
|
89
|
-
|
|
90
|
-
|
|
46
|
+
if (typeof param === "string") return mod.Message(param);
|
|
47
|
+
return param;
|
|
91
48
|
}
|
|
92
49
|
function __fillInDefaultArgs(params) {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
50
|
+
if (!params.hasOwnProperty("name")) params.name = "";
|
|
51
|
+
if (!params.hasOwnProperty("position")) params.position = mod.CreateVector(0, 0, 0);
|
|
52
|
+
if (!params.hasOwnProperty("size")) params.size = mod.CreateVector(100, 100, 0);
|
|
53
|
+
if (!params.hasOwnProperty("anchor")) params.anchor = mod.UIAnchor.TopLeft;
|
|
54
|
+
if (!params.hasOwnProperty("parent")) params.parent = mod.GetUIRoot();
|
|
55
|
+
if (!params.hasOwnProperty("visible")) params.visible = true;
|
|
56
|
+
if (!params.hasOwnProperty("padding")) params.padding = params.type == "Container" ? 0 : 8;
|
|
57
|
+
if (!params.hasOwnProperty("bgColor")) params.bgColor = mod.CreateVector(.25, .25, .25);
|
|
58
|
+
if (!params.hasOwnProperty("bgAlpha")) params.bgAlpha = .5;
|
|
59
|
+
if (!params.hasOwnProperty("bgFill")) params.bgFill = mod.UIBgFill.Solid;
|
|
103
60
|
}
|
|
104
61
|
function __setNameAndGetWidget(uniqueName, params) {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
62
|
+
let widget = mod.FindUIWidgetWithName(uniqueName);
|
|
63
|
+
mod.SetUIWidgetName(widget, params.name);
|
|
64
|
+
return widget;
|
|
108
65
|
}
|
|
109
|
-
|
|
66
|
+
const __cUniqueName = "----uniquename----";
|
|
110
67
|
function __addUIContainer(params) {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
params.padding,
|
|
122
|
-
__asModVector(params.bgColor),
|
|
123
|
-
params.bgAlpha,
|
|
124
|
-
params.bgFill,
|
|
125
|
-
restrict
|
|
126
|
-
);
|
|
127
|
-
} else {
|
|
128
|
-
mod.AddUIContainer(
|
|
129
|
-
__cUniqueName,
|
|
130
|
-
__asModVector(params.position),
|
|
131
|
-
__asModVector(params.size),
|
|
132
|
-
params.anchor,
|
|
133
|
-
params.parent,
|
|
134
|
-
params.visible,
|
|
135
|
-
params.padding,
|
|
136
|
-
__asModVector(params.bgColor),
|
|
137
|
-
params.bgAlpha,
|
|
138
|
-
params.bgFill
|
|
139
|
-
);
|
|
140
|
-
}
|
|
141
|
-
let widget = __setNameAndGetWidget(__cUniqueName, params);
|
|
142
|
-
if (params.children) {
|
|
143
|
-
params.children.forEach((childParams) => {
|
|
144
|
-
childParams.parent = widget;
|
|
145
|
-
__addUIWidget(childParams);
|
|
146
|
-
});
|
|
147
|
-
}
|
|
148
|
-
return widget;
|
|
68
|
+
__fillInDefaultArgs(params);
|
|
69
|
+
let restrict = params.teamId ?? params.playerId;
|
|
70
|
+
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);
|
|
71
|
+
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);
|
|
72
|
+
let widget = __setNameAndGetWidget(__cUniqueName, params);
|
|
73
|
+
if (params.children) params.children.forEach((childParams) => {
|
|
74
|
+
childParams.parent = widget;
|
|
75
|
+
__addUIWidget(childParams);
|
|
76
|
+
});
|
|
77
|
+
return widget;
|
|
149
78
|
}
|
|
150
79
|
function __fillInDefaultTextArgs(params) {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
80
|
+
if (!params.hasOwnProperty("textLabel")) params.textLabel = "";
|
|
81
|
+
if (!params.hasOwnProperty("textSize")) params.textSize = 0;
|
|
82
|
+
if (!params.hasOwnProperty("textColor")) params.textColor = mod.CreateVector(1, 1, 1);
|
|
83
|
+
if (!params.hasOwnProperty("textAlpha")) params.textAlpha = 1;
|
|
84
|
+
if (!params.hasOwnProperty("textAnchor")) params.textAnchor = mod.UIAnchor.CenterLeft;
|
|
156
85
|
}
|
|
157
86
|
function __addUIText(params) {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
__asModVector(params.position),
|
|
165
|
-
__asModVector(params.size),
|
|
166
|
-
params.anchor,
|
|
167
|
-
params.parent,
|
|
168
|
-
params.visible,
|
|
169
|
-
params.padding,
|
|
170
|
-
__asModVector(params.bgColor),
|
|
171
|
-
params.bgAlpha,
|
|
172
|
-
params.bgFill,
|
|
173
|
-
__asModMessage(params.textLabel),
|
|
174
|
-
params.textSize,
|
|
175
|
-
__asModVector(params.textColor),
|
|
176
|
-
params.textAlpha,
|
|
177
|
-
params.textAnchor,
|
|
178
|
-
restrict
|
|
179
|
-
);
|
|
180
|
-
} else {
|
|
181
|
-
mod.AddUIText(
|
|
182
|
-
__cUniqueName,
|
|
183
|
-
__asModVector(params.position),
|
|
184
|
-
__asModVector(params.size),
|
|
185
|
-
params.anchor,
|
|
186
|
-
params.parent,
|
|
187
|
-
params.visible,
|
|
188
|
-
params.padding,
|
|
189
|
-
__asModVector(params.bgColor),
|
|
190
|
-
params.bgAlpha,
|
|
191
|
-
params.bgFill,
|
|
192
|
-
__asModMessage(params.textLabel),
|
|
193
|
-
params.textSize,
|
|
194
|
-
__asModVector(params.textColor),
|
|
195
|
-
params.textAlpha,
|
|
196
|
-
params.textAnchor
|
|
197
|
-
);
|
|
198
|
-
}
|
|
199
|
-
return __setNameAndGetWidget(__cUniqueName, params);
|
|
87
|
+
__fillInDefaultArgs(params);
|
|
88
|
+
__fillInDefaultTextArgs(params);
|
|
89
|
+
let restrict = params.teamId ?? params.playerId;
|
|
90
|
+
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);
|
|
91
|
+
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);
|
|
92
|
+
return __setNameAndGetWidget(__cUniqueName, params);
|
|
200
93
|
}
|
|
201
94
|
function __fillInDefaultImageArgs(params) {
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
95
|
+
if (!params.hasOwnProperty("imageType")) params.imageType = mod.UIImageType.None;
|
|
96
|
+
if (!params.hasOwnProperty("imageColor")) params.imageColor = mod.CreateVector(1, 1, 1);
|
|
97
|
+
if (!params.hasOwnProperty("imageAlpha")) params.imageAlpha = 1;
|
|
205
98
|
}
|
|
206
99
|
function __addUIImage(params) {
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
__asModVector(params.position),
|
|
214
|
-
__asModVector(params.size),
|
|
215
|
-
params.anchor,
|
|
216
|
-
params.parent,
|
|
217
|
-
params.visible,
|
|
218
|
-
params.padding,
|
|
219
|
-
__asModVector(params.bgColor),
|
|
220
|
-
params.bgAlpha,
|
|
221
|
-
params.bgFill,
|
|
222
|
-
params.imageType,
|
|
223
|
-
__asModVector(params.imageColor),
|
|
224
|
-
params.imageAlpha,
|
|
225
|
-
restrict
|
|
226
|
-
);
|
|
227
|
-
} else {
|
|
228
|
-
mod.AddUIImage(
|
|
229
|
-
__cUniqueName,
|
|
230
|
-
__asModVector(params.position),
|
|
231
|
-
__asModVector(params.size),
|
|
232
|
-
params.anchor,
|
|
233
|
-
params.parent,
|
|
234
|
-
params.visible,
|
|
235
|
-
params.padding,
|
|
236
|
-
__asModVector(params.bgColor),
|
|
237
|
-
params.bgAlpha,
|
|
238
|
-
params.bgFill,
|
|
239
|
-
params.imageType,
|
|
240
|
-
__asModVector(params.imageColor),
|
|
241
|
-
params.imageAlpha
|
|
242
|
-
);
|
|
243
|
-
}
|
|
244
|
-
return __setNameAndGetWidget(__cUniqueName, params);
|
|
100
|
+
__fillInDefaultArgs(params);
|
|
101
|
+
__fillInDefaultImageArgs(params);
|
|
102
|
+
let restrict = params.teamId ?? params.playerId;
|
|
103
|
+
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);
|
|
104
|
+
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);
|
|
105
|
+
return __setNameAndGetWidget(__cUniqueName, params);
|
|
245
106
|
}
|
|
246
107
|
function __fillInDefaultButtonArgs(params) {
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
108
|
+
if (!params.hasOwnProperty("buttonEnabled")) params.buttonEnabled = true;
|
|
109
|
+
if (!params.hasOwnProperty("buttonColorBase")) params.buttonColorBase = mod.CreateVector(.7, .7, .7);
|
|
110
|
+
if (!params.hasOwnProperty("buttonAlphaBase")) params.buttonAlphaBase = 1;
|
|
111
|
+
if (!params.hasOwnProperty("buttonColorDisabled")) params.buttonColorDisabled = mod.CreateVector(.2, .2, .2);
|
|
112
|
+
if (!params.hasOwnProperty("buttonAlphaDisabled")) params.buttonAlphaDisabled = .5;
|
|
113
|
+
if (!params.hasOwnProperty("buttonColorPressed")) params.buttonColorPressed = mod.CreateVector(.25, .25, .25);
|
|
114
|
+
if (!params.hasOwnProperty("buttonAlphaPressed")) params.buttonAlphaPressed = 1;
|
|
115
|
+
if (!params.hasOwnProperty("buttonColorHover")) params.buttonColorHover = mod.CreateVector(1, 1, 1);
|
|
116
|
+
if (!params.hasOwnProperty("buttonAlphaHover")) params.buttonAlphaHover = 1;
|
|
117
|
+
if (!params.hasOwnProperty("buttonColorFocused")) params.buttonColorFocused = mod.CreateVector(1, 1, 1);
|
|
118
|
+
if (!params.hasOwnProperty("buttonAlphaFocused")) params.buttonAlphaFocused = 1;
|
|
258
119
|
}
|
|
259
120
|
function __addUIButton(params) {
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
__asModVector(params.position),
|
|
267
|
-
__asModVector(params.size),
|
|
268
|
-
params.anchor,
|
|
269
|
-
params.parent,
|
|
270
|
-
params.visible,
|
|
271
|
-
params.padding,
|
|
272
|
-
__asModVector(params.bgColor),
|
|
273
|
-
params.bgAlpha,
|
|
274
|
-
params.bgFill,
|
|
275
|
-
params.buttonEnabled,
|
|
276
|
-
__asModVector(params.buttonColorBase),
|
|
277
|
-
params.buttonAlphaBase,
|
|
278
|
-
__asModVector(params.buttonColorDisabled),
|
|
279
|
-
params.buttonAlphaDisabled,
|
|
280
|
-
__asModVector(params.buttonColorPressed),
|
|
281
|
-
params.buttonAlphaPressed,
|
|
282
|
-
__asModVector(params.buttonColorHover),
|
|
283
|
-
params.buttonAlphaHover,
|
|
284
|
-
__asModVector(params.buttonColorFocused),
|
|
285
|
-
params.buttonAlphaFocused,
|
|
286
|
-
restrict
|
|
287
|
-
);
|
|
288
|
-
} else {
|
|
289
|
-
mod.AddUIButton(
|
|
290
|
-
__cUniqueName,
|
|
291
|
-
__asModVector(params.position),
|
|
292
|
-
__asModVector(params.size),
|
|
293
|
-
params.anchor,
|
|
294
|
-
params.parent,
|
|
295
|
-
params.visible,
|
|
296
|
-
params.padding,
|
|
297
|
-
__asModVector(params.bgColor),
|
|
298
|
-
params.bgAlpha,
|
|
299
|
-
params.bgFill,
|
|
300
|
-
params.buttonEnabled,
|
|
301
|
-
__asModVector(params.buttonColorBase),
|
|
302
|
-
params.buttonAlphaBase,
|
|
303
|
-
__asModVector(params.buttonColorDisabled),
|
|
304
|
-
params.buttonAlphaDisabled,
|
|
305
|
-
__asModVector(params.buttonColorPressed),
|
|
306
|
-
params.buttonAlphaPressed,
|
|
307
|
-
__asModVector(params.buttonColorHover),
|
|
308
|
-
params.buttonAlphaHover,
|
|
309
|
-
__asModVector(params.buttonColorFocused),
|
|
310
|
-
params.buttonAlphaFocused
|
|
311
|
-
);
|
|
312
|
-
}
|
|
313
|
-
return __setNameAndGetWidget(__cUniqueName, params);
|
|
121
|
+
__fillInDefaultArgs(params);
|
|
122
|
+
__fillInDefaultButtonArgs(params);
|
|
123
|
+
let restrict = params.teamId ?? params.playerId;
|
|
124
|
+
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);
|
|
125
|
+
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);
|
|
126
|
+
return __setNameAndGetWidget(__cUniqueName, params);
|
|
314
127
|
}
|
|
315
128
|
function __addUIWidget(params) {
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
return void 0;
|
|
129
|
+
if (params == null) return void 0;
|
|
130
|
+
if (params.type == "Container") return __addUIContainer(params);
|
|
131
|
+
else if (params.type == "Text") return __addUIText(params);
|
|
132
|
+
else if (params.type == "Image") return __addUIImage(params);
|
|
133
|
+
else if (params.type == "Button") return __addUIButton(params);
|
|
322
134
|
}
|
|
323
135
|
function ParseUI(...params) {
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
}
|
|
328
|
-
return widget;
|
|
136
|
+
let widget;
|
|
137
|
+
for (let a = 0; a < params.length; a++) widget = __addUIWidget(params[a]);
|
|
138
|
+
return widget;
|
|
329
139
|
}
|
|
330
140
|
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
var
|
|
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
|
-
|
|
141
|
+
//#endregion
|
|
142
|
+
//#region src/std/ui/countdown.ts
|
|
143
|
+
var countdown_exports = /* @__PURE__ */ __export({
|
|
144
|
+
CountdownUI: () => CountdownUI,
|
|
145
|
+
bf6Strings: () => bf6Strings
|
|
146
|
+
});
|
|
147
|
+
var CountdownUI = class CountdownUI {
|
|
148
|
+
static #uniqueID = 0;
|
|
149
|
+
#playerId;
|
|
150
|
+
#playerProfileId;
|
|
151
|
+
constructor(playerId) {
|
|
152
|
+
this.#playerProfileId = CountdownUI.#uniqueID++;
|
|
153
|
+
this.#playerId = playerId;
|
|
154
|
+
const bfBlueColor = [
|
|
155
|
+
.678,
|
|
156
|
+
.753,
|
|
157
|
+
.8
|
|
158
|
+
];
|
|
159
|
+
const height = 125;
|
|
160
|
+
this.headerWidget = ParseUI({
|
|
161
|
+
type: "Container",
|
|
162
|
+
size: [150, height],
|
|
163
|
+
position: [0, 50],
|
|
164
|
+
name: `countdown_${this.#playerProfileId}`,
|
|
165
|
+
anchor: mod.UIAnchor.TopCenter,
|
|
166
|
+
bgFill: mod.UIBgFill.Blur,
|
|
167
|
+
bgColor: [
|
|
168
|
+
.2,
|
|
169
|
+
.2,
|
|
170
|
+
.3
|
|
171
|
+
],
|
|
172
|
+
bgAlpha: .9,
|
|
173
|
+
playerId: this.#playerId,
|
|
174
|
+
visible: false,
|
|
175
|
+
children: [
|
|
176
|
+
{
|
|
177
|
+
type: "Container",
|
|
178
|
+
name: `countdown_line_right_${this.#playerProfileId}`,
|
|
179
|
+
size: [2, height],
|
|
180
|
+
position: [75, 0],
|
|
181
|
+
anchor: mod.UIAnchor.Center,
|
|
182
|
+
bgFill: mod.UIBgFill.Solid,
|
|
183
|
+
bgColor: bfBlueColor,
|
|
184
|
+
bgAlpha: 1
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
type: "Container",
|
|
188
|
+
name: `countdown_line_left_${this.#playerProfileId}`,
|
|
189
|
+
size: [2, height],
|
|
190
|
+
position: [-75, 0],
|
|
191
|
+
anchor: mod.UIAnchor.Center,
|
|
192
|
+
bgFill: mod.UIBgFill.Solid,
|
|
193
|
+
bgColor: bfBlueColor,
|
|
194
|
+
bgAlpha: 1
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
type: "Text",
|
|
198
|
+
name: `countdown_text${this.#playerProfileId}`,
|
|
199
|
+
size: [100, height],
|
|
200
|
+
position: [0, 0],
|
|
201
|
+
anchor: mod.UIAnchor.Center,
|
|
202
|
+
bgFill: mod.UIBgFill.None,
|
|
203
|
+
textColor: bfBlueColor,
|
|
204
|
+
textAnchor: mod.UIAnchor.Center,
|
|
205
|
+
textLabel: MakeMessage(mod.stringkeys.__sdk__CountdownUI),
|
|
206
|
+
textSize: 85
|
|
207
|
+
}
|
|
208
|
+
]
|
|
209
|
+
});
|
|
210
|
+
this.textWidget = mod.FindUIWidgetWithName(`countdown_text${this.#playerProfileId}`);
|
|
211
|
+
}
|
|
212
|
+
delete() {
|
|
213
|
+
this.headerWidget && mod.DeleteUIWidget(this.headerWidget);
|
|
214
|
+
}
|
|
215
|
+
open(text, countdowntime) {
|
|
216
|
+
this.headerWidget && mod.SetUIWidgetVisible(this.headerWidget, true);
|
|
217
|
+
this.textWidget && mod.SetUITextLabel(this.textWidget, MakeMessage(text, countdowntime));
|
|
218
|
+
}
|
|
219
|
+
update(text, countdowntime) {
|
|
220
|
+
this.textWidget && mod.SetUITextLabel(this.textWidget, MakeMessage(text, countdowntime));
|
|
221
|
+
}
|
|
222
|
+
async close(delayclose = 0) {
|
|
223
|
+
await mod.Wait(delayclose);
|
|
224
|
+
this.headerWidget && mod.SetUIWidgetVisible(this.headerWidget, false);
|
|
225
|
+
}
|
|
413
226
|
};
|
|
227
|
+
const bf6Strings = { __sdk__CountdownUI: "{}" };
|
|
414
228
|
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
229
|
+
//#endregion
|
|
230
|
+
//#region src/std/ui/index.ts
|
|
231
|
+
var ui_exports = /* @__PURE__ */ __export({
|
|
232
|
+
CountdownUI: () => CountdownUI,
|
|
233
|
+
bf6Strings: () => bf6Strings,
|
|
234
|
+
default: () => ui_default
|
|
235
|
+
});
|
|
236
|
+
var ui_default = { countdown: countdown_exports };
|
|
419
237
|
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
export {
|
|
426
|
-
CountdownUI,
|
|
427
|
-
MakeMessage,
|
|
428
|
-
bf6Strings,
|
|
429
|
-
index_default as default
|
|
238
|
+
//#endregion
|
|
239
|
+
//#region src/std/index.ts
|
|
240
|
+
var std_default = {
|
|
241
|
+
message: message_exports,
|
|
242
|
+
ui: ui_exports
|
|
430
243
|
};
|
|
244
|
+
|
|
245
|
+
//#endregion
|
|
246
|
+
export { CountdownUI, MakeMessage, bf6Strings, std_default as default };
|
|
431
247
|
//# sourceMappingURL=index.js.map
|