@modlock/modlock 0.1.93 → 0.1.95
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/chat.d.ts +29 -6
- package/host.gen.d.ts +7 -0
- package/hud.d.ts +62 -14
- package/index.d.ts +2 -2
- package/index.js +961 -642
- package/package.json +6 -6
- package/theme.d.ts +5 -0
package/index.js
CHANGED
|
@@ -7599,6 +7599,32 @@ var ReadFileResponse = /* @__PURE__ */ createMessageType(
|
|
|
7599
7599
|
}
|
|
7600
7600
|
}
|
|
7601
7601
|
);
|
|
7602
|
+
var ReadFileBytesResponse = /* @__PURE__ */ createMessageType(
|
|
7603
|
+
"modlock.wasm.ReadFileBytesResponse",
|
|
7604
|
+
() => [[1, "data", 12, 4]],
|
|
7605
|
+
{
|
|
7606
|
+
decode: (r, end, m) => {
|
|
7607
|
+
while (r.pos < end) {
|
|
7608
|
+
const t = r.tag();
|
|
7609
|
+
if ((t & 7) === 4) return m;
|
|
7610
|
+
switch (t >>> 3) {
|
|
7611
|
+
case 1:
|
|
7612
|
+
m.data = r.bytes();
|
|
7613
|
+
break;
|
|
7614
|
+
default:
|
|
7615
|
+
r.skip(t);
|
|
7616
|
+
}
|
|
7617
|
+
}
|
|
7618
|
+
return m;
|
|
7619
|
+
},
|
|
7620
|
+
encode: (m, w) => {
|
|
7621
|
+
{
|
|
7622
|
+
const v = m.data;
|
|
7623
|
+
if (v != null) w.uint32(10).bytes(v);
|
|
7624
|
+
}
|
|
7625
|
+
}
|
|
7626
|
+
}
|
|
7627
|
+
);
|
|
7602
7628
|
var WriteFileRequest = /* @__PURE__ */ createMessageType(
|
|
7603
7629
|
"modlock.wasm.WriteFileRequest",
|
|
7604
7630
|
() => [
|
|
@@ -15582,6 +15608,12 @@ function readFile(path) {
|
|
|
15582
15608
|
const response = ReadFileResponse.fromBinary(reply2);
|
|
15583
15609
|
return response.text;
|
|
15584
15610
|
}
|
|
15611
|
+
function readFileBytes(path) {
|
|
15612
|
+
const reply2 = call("ReadFileBytes", ReadFileRequest.toBinary({ path }));
|
|
15613
|
+
if (reply2 === void 0) return void 0;
|
|
15614
|
+
const response = ReadFileBytesResponse.fromBinary(reply2);
|
|
15615
|
+
return response.data;
|
|
15616
|
+
}
|
|
15585
15617
|
function writeFile(path, text2) {
|
|
15586
15618
|
return call("WriteFile", WriteFileRequest.toBinary({ path, text: text2 })) !== void 0;
|
|
15587
15619
|
}
|
|
@@ -16577,56 +16609,12 @@ function endServiceCall(event) {
|
|
|
16577
16609
|
done(event.payload);
|
|
16578
16610
|
}
|
|
16579
16611
|
|
|
16580
|
-
// js/src/format.ts
|
|
16581
|
-
var format_exports = {};
|
|
16582
|
-
__export(format_exports, {
|
|
16583
|
-
clip: () => clip,
|
|
16584
|
-
clock: () => clock,
|
|
16585
|
-
count: () => count,
|
|
16586
|
-
grouped: () => grouped,
|
|
16587
|
-
ordinal: () => ordinal,
|
|
16588
|
-
percent: () => percent,
|
|
16589
|
-
stopwatch: () => stopwatch
|
|
16590
|
-
});
|
|
16591
|
-
function clock(seconds) {
|
|
16592
|
-
const whole = Math.max(0, Math.ceil(seconds));
|
|
16593
|
-
return `${Math.floor(whole / 60)}:${String(whole % 60).padStart(2, "0")}`;
|
|
16594
|
-
}
|
|
16595
|
-
function stopwatch(seconds) {
|
|
16596
|
-
const hundredths = Math.max(0, Math.floor(seconds * 100));
|
|
16597
|
-
const minutes = Math.floor(hundredths / 6e3);
|
|
16598
|
-
const rest = hundredths % 6e3 / 100;
|
|
16599
|
-
return `${minutes}:${rest.toFixed(2).padStart(5, "0")}`;
|
|
16600
|
-
}
|
|
16601
|
-
function percent(part, whole) {
|
|
16602
|
-
if (!(whole > 0)) {
|
|
16603
|
-
return "-";
|
|
16604
|
-
}
|
|
16605
|
-
return `${Math.round(Math.max(0, Math.min(part / whole, 1)) * 100)}%`;
|
|
16606
|
-
}
|
|
16607
|
-
function grouped(value) {
|
|
16608
|
-
return String(Math.round(value)).replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
16609
|
-
}
|
|
16610
|
-
function ordinal(place2) {
|
|
16611
|
-
const tens = place2 % 100;
|
|
16612
|
-
const suffix = tens >= 11 && tens <= 13 ? "th" : ["th", "st", "nd", "rd"][place2 % 10] ?? "th";
|
|
16613
|
-
return `${place2}${suffix}`;
|
|
16614
|
-
}
|
|
16615
|
-
function count(number, thing, plural = `${thing}s`) {
|
|
16616
|
-
return `${grouped(number)} ${number === 1 ? thing : plural}`;
|
|
16617
|
-
}
|
|
16618
|
-
function clip(text2, width) {
|
|
16619
|
-
if (text2.length <= width) return text2;
|
|
16620
|
-
const cut = text2.slice(0, width - 1);
|
|
16621
|
-
const space = cut.lastIndexOf(" ");
|
|
16622
|
-
return `${(space > 0 ? cut.slice(0, space) : cut).trimEnd()}\u2026`;
|
|
16623
|
-
}
|
|
16624
|
-
|
|
16625
16612
|
// js/src/theme.ts
|
|
16626
16613
|
var theme_exports = {};
|
|
16627
16614
|
__export(theme_exports, {
|
|
16628
16615
|
emptyPip: () => emptyPip,
|
|
16629
16616
|
fpsReadoutBottom: () => fpsReadoutBottom,
|
|
16617
|
+
minimapTop: () => minimapTop,
|
|
16630
16618
|
motion: () => motion,
|
|
16631
16619
|
objectiveBarBottom: () => objectiveBarBottom,
|
|
16632
16620
|
pillEdge: () => pillEdge,
|
|
@@ -16723,484 +16711,209 @@ var emptyPip = "#00000000";
|
|
|
16723
16711
|
var teamBarBottom = 84;
|
|
16724
16712
|
var objectiveBarBottom = 220;
|
|
16725
16713
|
var fpsReadoutBottom = 68;
|
|
16714
|
+
var minimapTop = 625;
|
|
16726
16715
|
var sounds = {
|
|
16727
16716
|
hover: "UI.MainMenu.Hover",
|
|
16728
16717
|
press: "UI.MainMenu.Activate"
|
|
16729
16718
|
};
|
|
16730
16719
|
var motion = { hover: 0.15, meter: 0.25 };
|
|
16731
16720
|
|
|
16732
|
-
// js/src/
|
|
16733
|
-
|
|
16734
|
-
|
|
16721
|
+
// js/src/chat.ts
|
|
16722
|
+
var lines = /* @__PURE__ */ new Map();
|
|
16723
|
+
var shown;
|
|
16724
|
+
function showChatLines(options = {}) {
|
|
16725
|
+
shown = options;
|
|
16735
16726
|
}
|
|
16736
|
-
function
|
|
16727
|
+
function chatShown() {
|
|
16728
|
+
return shown !== void 0;
|
|
16729
|
+
}
|
|
16730
|
+
function hearChat(line2, now4) {
|
|
16731
|
+
if (!shown) return false;
|
|
16732
|
+
const text2 = line2.text.trim();
|
|
16733
|
+
if (text2 === "" || text2.startsWith("/")) return false;
|
|
16734
|
+
const team = line2.all ? 0 : line2.player.pawn()?.team ?? 0;
|
|
16735
|
+
lines.delete(line2.player.slot);
|
|
16736
|
+
lines.set(line2.player.slot, {
|
|
16737
|
+
speaker: line2.player,
|
|
16738
|
+
text: text2,
|
|
16739
|
+
team,
|
|
16740
|
+
until: now4 + (shown.seconds ?? 6)
|
|
16741
|
+
});
|
|
16742
|
+
return true;
|
|
16743
|
+
}
|
|
16744
|
+
function expireChat(now4) {
|
|
16745
|
+
let expired = false;
|
|
16746
|
+
for (const [slot, line2] of lines) {
|
|
16747
|
+
if (now4 >= line2.until) {
|
|
16748
|
+
lines.delete(slot);
|
|
16749
|
+
expired = true;
|
|
16750
|
+
}
|
|
16751
|
+
}
|
|
16752
|
+
return expired;
|
|
16753
|
+
}
|
|
16754
|
+
function forgetChat(slot) {
|
|
16755
|
+
return lines.delete(slot);
|
|
16756
|
+
}
|
|
16757
|
+
function chatLines(viewer) {
|
|
16758
|
+
if (lines.size === 0 || !shown) return void 0;
|
|
16759
|
+
const team = viewer.pawn()?.team ?? 0;
|
|
16760
|
+
const readable = [];
|
|
16761
|
+
for (const line2 of lines.values()) {
|
|
16762
|
+
if (line2.team === 0 || line2.team === team) readable.push(line2);
|
|
16763
|
+
}
|
|
16764
|
+
if (readable.length === 0) return void 0;
|
|
16765
|
+
const kept = readable.slice(-(shown.lines ?? 4));
|
|
16737
16766
|
return {
|
|
16738
|
-
|
|
16767
|
+
type: "panel",
|
|
16739
16768
|
props: {
|
|
16740
|
-
...component.props,
|
|
16741
16769
|
style: {
|
|
16742
|
-
|
|
16743
|
-
|
|
16770
|
+
flow: "down",
|
|
16771
|
+
horizontalAlign: "center",
|
|
16772
|
+
verticalAlign: "bottom",
|
|
16773
|
+
margin: [0, 0, shown.bottom ?? abilityBarTop, 0]
|
|
16744
16774
|
},
|
|
16745
|
-
|
|
16746
|
-
|
|
16775
|
+
children: kept.map(
|
|
16776
|
+
(line2, at3) => subtitle(line2, viewer, kept.length - 1 - at3)
|
|
16777
|
+
)
|
|
16747
16778
|
}
|
|
16748
16779
|
};
|
|
16749
16780
|
}
|
|
16750
|
-
|
|
16751
|
-
|
|
16752
|
-
|
|
16753
|
-
|
|
16754
|
-
|
|
16755
|
-
|
|
16756
|
-
|
|
16757
|
-
|
|
16758
|
-
|
|
16759
|
-
|
|
16760
|
-
|
|
16761
|
-
|
|
16762
|
-
|
|
16763
|
-
|
|
16764
|
-
|
|
16765
|
-
|
|
16766
|
-
|
|
16781
|
+
var abilityBarTop = 190;
|
|
16782
|
+
var bandWidth = 640;
|
|
16783
|
+
var nameWidth = 180;
|
|
16784
|
+
var lineWidth = bandWidth - (4 + 10) - 24 - 7 - nameWidth - 9;
|
|
16785
|
+
var fades = [1, 0.85, 0.7];
|
|
16786
|
+
var lifted = {
|
|
16787
|
+
amber: "#f0a73a",
|
|
16788
|
+
sapphire: "#8fb1f0"
|
|
16789
|
+
};
|
|
16790
|
+
var words = {
|
|
16791
|
+
face: "body",
|
|
16792
|
+
weight: "bold",
|
|
16793
|
+
verticalAlign: "top",
|
|
16794
|
+
lineHeight: 23,
|
|
16795
|
+
textAlign: "left"
|
|
16796
|
+
};
|
|
16797
|
+
var portraits = new Map(heroes.map((hero) => [hero.id, hero.portrait]));
|
|
16798
|
+
function subtitle(line2, viewer, age) {
|
|
16799
|
+
const pawn = line2.speaker.pawn();
|
|
16800
|
+
const seen = shown?.speaker?.(line2.speaker, viewer) ?? {};
|
|
16801
|
+
const tone = teamTones[pawn?.team ?? 0];
|
|
16802
|
+
const color2 = seen.out ? shades.quiet : seen.color ?? (tone ? lifted[tone] : void 0) ?? tones.text;
|
|
16803
|
+
const notes = [line2.team !== 0 ? "team" : "", seen.note ?? ""].filter((note) => note !== "").map((note) => ` (${note})`).join("");
|
|
16804
|
+
const name = `${connection(line2.speaker)?.name ?? ""}${notes}`;
|
|
16805
|
+
const src = portraits.get(seen.hero ?? pawn?.hero ?? 0);
|
|
16806
|
+
const portrait = {
|
|
16807
|
+
type: "panel",
|
|
16808
|
+
props: {
|
|
16809
|
+
style: {
|
|
16810
|
+
width: 24,
|
|
16811
|
+
height: 24,
|
|
16812
|
+
verticalAlign: "top",
|
|
16813
|
+
borderRadius: 2,
|
|
16814
|
+
background: shades.raised,
|
|
16815
|
+
saturation: seen.out ? 0 : 1
|
|
16816
|
+
},
|
|
16817
|
+
children: src !== void 0 && {
|
|
16818
|
+
type: "image",
|
|
16819
|
+
props: { src, style: { width: "100%", height: "100%" } }
|
|
16820
|
+
}
|
|
16821
|
+
}
|
|
16822
|
+
};
|
|
16823
|
+
const speaker = {
|
|
16824
|
+
type: "label",
|
|
16825
|
+
props: {
|
|
16826
|
+
style: {
|
|
16827
|
+
...words,
|
|
16828
|
+
fontSize: 16,
|
|
16829
|
+
color: color2,
|
|
16830
|
+
margin: [1, 0, 0, 7],
|
|
16831
|
+
maxWidth: nameWidth
|
|
16832
|
+
},
|
|
16833
|
+
children: name
|
|
16834
|
+
}
|
|
16835
|
+
};
|
|
16836
|
+
const said = {
|
|
16837
|
+
type: "label",
|
|
16838
|
+
props: {
|
|
16839
|
+
style: {
|
|
16840
|
+
...words,
|
|
16841
|
+
fontSize: 18,
|
|
16842
|
+
color: tones.text,
|
|
16843
|
+
margin: [0, 0, 0, 9],
|
|
16844
|
+
maxWidth: lineWidth
|
|
16845
|
+
},
|
|
16846
|
+
children: line2.text
|
|
16847
|
+
}
|
|
16848
|
+
};
|
|
16849
|
+
return {
|
|
16850
|
+
type: "panel",
|
|
16851
|
+
key: `line-${line2.speaker.slot}`,
|
|
16852
|
+
props: {
|
|
16853
|
+
style: {
|
|
16854
|
+
flow: "right",
|
|
16855
|
+
horizontalAlign: "center",
|
|
16856
|
+
background: "#10130d9e",
|
|
16857
|
+
borderRadius: 3,
|
|
16858
|
+
padding: [3, 10, 4, 4],
|
|
16859
|
+
margin: [0, 0, 4, 0],
|
|
16860
|
+
opacity: fades[age] ?? fades[fades.length - 1],
|
|
16861
|
+
transition: { seconds: 0.25, easing: "out" }
|
|
16862
|
+
},
|
|
16863
|
+
enter: { opacity: 0, translate: [0, 8] },
|
|
16864
|
+
exit: { opacity: 0 },
|
|
16865
|
+
children: [portrait, speaker, said]
|
|
16866
|
+
}
|
|
16867
|
+
};
|
|
16767
16868
|
}
|
|
16768
|
-
|
|
16769
|
-
|
|
16770
|
-
|
|
16771
|
-
|
|
16772
|
-
|
|
16773
|
-
|
|
16774
|
-
|
|
16775
|
-
|
|
16776
|
-
|
|
16777
|
-
|
|
16778
|
-
|
|
16779
|
-
|
|
16780
|
-
|
|
16869
|
+
|
|
16870
|
+
// js/src/bystander.ts
|
|
16871
|
+
var bystanderStates = [
|
|
16872
|
+
"MODIFIER_STATE_IMMOBILIZED",
|
|
16873
|
+
"MODIFIER_STATE_DISARMED",
|
|
16874
|
+
"MODIFIER_STATE_MELEE_DISABLED",
|
|
16875
|
+
"MODIFIER_STATE_SILENCED",
|
|
16876
|
+
"MODIFIER_STATE_INVULNERABLE",
|
|
16877
|
+
"MODIFIER_STATE_TECH_UNTARGETABLE_BY_ENEMIES",
|
|
16878
|
+
"MODIFIER_STATE_TECH_UNTARGETABLE_BY_TEAMMATES",
|
|
16879
|
+
"MODIFIER_STATE_DISPLACEMENT_IMMUNE",
|
|
16880
|
+
"MODIFIER_STATE_IGNORE_BULLETS",
|
|
16881
|
+
"MODIFIER_STATE_IGNORE_MELEE",
|
|
16882
|
+
"MODIFIER_STATE_IN_ABILITY_DISABLE_ZOOM"
|
|
16883
|
+
];
|
|
16884
|
+
function holdBystander(entity, active = true) {
|
|
16885
|
+
let held = true;
|
|
16886
|
+
for (const state of bystanderStates) {
|
|
16887
|
+
held = holdModifierState(entity, state, active) && held;
|
|
16888
|
+
}
|
|
16889
|
+
return held;
|
|
16781
16890
|
}
|
|
16782
|
-
|
|
16783
|
-
|
|
16784
|
-
|
|
16785
|
-
|
|
16786
|
-
|
|
16787
|
-
|
|
16788
|
-
|
|
16789
|
-
|
|
16790
|
-
|
|
16791
|
-
|
|
16792
|
-
|
|
16793
|
-
|
|
16794
|
-
|
|
16795
|
-
|
|
16796
|
-
|
|
16797
|
-
|
|
16798
|
-
|
|
16799
|
-
|
|
16800
|
-
|
|
16801
|
-
|
|
16802
|
-
|
|
16803
|
-
|
|
16804
|
-
|
|
16805
|
-
|
|
16806
|
-
|
|
16807
|
-
|
|
16808
|
-
{
|
|
16809
|
-
width: shape.width,
|
|
16810
|
-
height: shape.height,
|
|
16811
|
-
borderRadius: shape.radius,
|
|
16812
|
-
margin: [0, 2],
|
|
16813
|
-
background: lit(index) ? tones[props.tone] : emptyPip,
|
|
16814
|
-
borderWidth: 2,
|
|
16815
|
-
borderColor: lit(index) ? pipRings.filled : pipRings.empty
|
|
16816
|
-
},
|
|
16817
|
-
void 0,
|
|
16818
|
-
`pip-${index}`
|
|
16819
|
-
)
|
|
16820
|
-
)
|
|
16821
|
-
);
|
|
16822
|
-
}
|
|
16823
|
-
function Tag(props) {
|
|
16824
|
-
const filled = props.fill === "filled";
|
|
16825
|
-
return element(
|
|
16826
|
-
"label",
|
|
16827
|
-
{
|
|
16828
|
-
face: "block",
|
|
16829
|
-
fontSize: 12,
|
|
16830
|
-
letterSpacing: 1,
|
|
16831
|
-
uppercase: true,
|
|
16832
|
-
color: filled ? tones.onAccent : tones[props.tone],
|
|
16833
|
-
background: filled ? tones[props.tone] : void 0,
|
|
16834
|
-
borderWidth: 1,
|
|
16835
|
-
borderColor: tones[props.tone],
|
|
16836
|
-
borderRadius: sizes.radius,
|
|
16837
|
-
padding: [4, 8],
|
|
16838
|
-
verticalAlign: "center",
|
|
16839
|
-
...props.style
|
|
16840
|
-
},
|
|
16841
|
-
props.children
|
|
16842
|
-
);
|
|
16843
|
-
}
|
|
16844
|
-
function Banner(props) {
|
|
16845
|
-
const banner = element(
|
|
16846
|
-
"panel",
|
|
16847
|
-
{
|
|
16848
|
-
flow: "down",
|
|
16849
|
-
horizontalAlign: "center",
|
|
16850
|
-
margin: [20, 0, 0, 0],
|
|
16851
|
-
...props.style
|
|
16852
|
-
},
|
|
16853
|
-
[
|
|
16854
|
-
Text({ role: "title", tone: props.tone, children: props.title }),
|
|
16855
|
-
props.detail && Text({ role: "caption", tone: "muted", children: props.detail })
|
|
16856
|
-
]
|
|
16857
|
-
);
|
|
16858
|
-
return arriving(banner, { scale: 0.92 });
|
|
16859
|
-
}
|
|
16860
|
-
function TopStrip(props) {
|
|
16861
|
-
const block2 = [
|
|
16862
|
-
props.heading && Text({
|
|
16863
|
-
role: "label",
|
|
16864
|
-
style: { letterSpacing: 1 },
|
|
16865
|
-
children: props.heading
|
|
16866
|
-
}),
|
|
16867
|
-
Pill({ style: { margin: [4, 0, 0, 0] }, children: props.children })
|
|
16868
|
-
];
|
|
16869
|
-
const line2 = props.line && Text({
|
|
16870
|
-
role: "label",
|
|
16871
|
-
tone: props.lineTone ?? "text",
|
|
16872
|
-
style: { margin: [4, 0, 0, 0], fontSize: 18, letterSpacing: 1 },
|
|
16873
|
-
children: props.line
|
|
16874
|
-
});
|
|
16875
|
-
const column = (top, children) => element(
|
|
16876
|
-
"panel",
|
|
16877
|
-
{ flow: "down", horizontalAlign: "center", margin: [top, 0, 0, 0] },
|
|
16878
|
-
children
|
|
16879
|
-
);
|
|
16880
|
-
if (!props.keepTeamBar) return column(14, [...block2, line2]);
|
|
16881
|
-
return element("panel", { width: "fill", height: "fill" }, [
|
|
16882
|
-
column(teamBarBottom, block2),
|
|
16883
|
-
line2 && column(objectiveBarBottom, line2)
|
|
16884
|
-
]);
|
|
16885
|
-
}
|
|
16886
|
-
function Score2(props) {
|
|
16887
|
-
const [near, far] = props.tones ?? ["accent", "text"];
|
|
16888
|
-
const side = (points, tone) => Text({
|
|
16889
|
-
role: "title",
|
|
16890
|
-
tone,
|
|
16891
|
-
plated: true,
|
|
16892
|
-
style: { margin: [0, 10], horizontalAlign: void 0 },
|
|
16893
|
-
children: `${points}`
|
|
16894
|
-
});
|
|
16895
|
-
return element("panel", { flow: "right", verticalAlign: "center" }, [
|
|
16896
|
-
side(props.points[0], near),
|
|
16897
|
-
Text({
|
|
16898
|
-
role: "title",
|
|
16899
|
-
tone: "muted",
|
|
16900
|
-
plated: true,
|
|
16901
|
-
style: { horizontalAlign: void 0 },
|
|
16902
|
-
children: ":"
|
|
16903
|
-
}),
|
|
16904
|
-
side(props.points[1], far)
|
|
16905
|
-
]);
|
|
16906
|
-
}
|
|
16907
|
-
var rosterRows = 6;
|
|
16908
|
-
var rosterName = 24;
|
|
16909
|
-
var portraitSize = 44;
|
|
16910
|
-
var badgeSize = 18;
|
|
16911
|
-
var portraits = new Map(heroes.map((hero) => [hero.id, hero.portrait]));
|
|
16912
|
-
function rosterKey(rows) {
|
|
16913
|
-
return rows.slice(0, rosterRows).map(
|
|
16914
|
-
(row2) => `${row2.self ? "*" : ""}${row2.selected ? "+" : ""}${row2.onPress ? ">" : ""}${row2.name} ${row2.hero} ${row2.activity} ${row2.steamId ?? ""}`
|
|
16915
|
-
).join("\n");
|
|
16916
|
-
}
|
|
16917
|
-
function Roster(props) {
|
|
16918
|
-
if (props.rows.length === 0) return null;
|
|
16919
|
-
return element(
|
|
16920
|
-
"panel",
|
|
16921
|
-
{
|
|
16922
|
-
width: "fit",
|
|
16923
|
-
height: "fit",
|
|
16924
|
-
flow: "down",
|
|
16925
|
-
horizontalAlign: "right",
|
|
16926
|
-
verticalAlign: "top",
|
|
16927
|
-
margin: [props.top ?? fpsReadoutBottom, 24, 0, 0]
|
|
16928
|
-
},
|
|
16929
|
-
props.rows.slice(0, rosterRows).map(rosterRow)
|
|
16930
|
-
);
|
|
16931
|
-
}
|
|
16932
|
-
function rosterRow(row2, index) {
|
|
16933
|
-
const right = { horizontalAlign: "right", textAlign: "right" };
|
|
16934
|
-
const text2 = element(
|
|
16935
|
-
"panel",
|
|
16936
|
-
{ flow: "down", verticalAlign: "center", margin: [0, 12, 0, 0] },
|
|
16937
|
-
[
|
|
16938
|
-
Text({
|
|
16939
|
-
role: "label",
|
|
16940
|
-
tone: "text",
|
|
16941
|
-
style: right,
|
|
16942
|
-
children: clip(row2.name.toUpperCase(), rosterName)
|
|
16943
|
-
}),
|
|
16944
|
-
Text({
|
|
16945
|
-
role: "caption",
|
|
16946
|
-
tone: "muted",
|
|
16947
|
-
style: { ...right, margin: [1, 0, 0, 0] },
|
|
16948
|
-
children: row2.activity
|
|
16949
|
-
})
|
|
16950
|
-
]
|
|
16951
|
-
);
|
|
16952
|
-
const src = portraits.get(row2.hero);
|
|
16953
|
-
const badge = row2.steamId === void 0 ? false : avatarBadge(row2.steamId);
|
|
16954
|
-
const image = src === void 0 ? false : portraitImage(src);
|
|
16955
|
-
const portrait = element(
|
|
16956
|
-
"panel",
|
|
16957
|
-
{
|
|
16958
|
-
width: portraitSize,
|
|
16959
|
-
height: portraitSize,
|
|
16960
|
-
padding: 1,
|
|
16961
|
-
verticalAlign: "center",
|
|
16962
|
-
background: row2.self || row2.selected ? tones.accent : shades.dim
|
|
16963
|
-
},
|
|
16964
|
-
element(
|
|
16965
|
-
"panel",
|
|
16966
|
-
{ width: "100%", height: "100%", background: shades.raised },
|
|
16967
|
-
[image, badge]
|
|
16968
|
-
)
|
|
16969
|
-
);
|
|
16970
|
-
const style = {
|
|
16971
|
-
flow: "right",
|
|
16972
|
-
horizontalAlign: "right",
|
|
16973
|
-
margin: [0, 0, 8, 0]
|
|
16974
|
-
};
|
|
16975
|
-
const line2 = row2.onPress ? {
|
|
16976
|
-
type: "button",
|
|
16977
|
-
props: {
|
|
16978
|
-
style: {
|
|
16979
|
-
...style,
|
|
16980
|
-
borderRadius: sizes.radius,
|
|
16981
|
-
transition: motion.hover
|
|
16982
|
-
},
|
|
16983
|
-
hover: { background: shades.raised },
|
|
16984
|
-
hoverSound: sounds.hover,
|
|
16985
|
-
sound: sounds.press,
|
|
16986
|
-
onPress: row2.onPress,
|
|
16987
|
-
children: [text2, portrait]
|
|
16988
|
-
},
|
|
16989
|
-
key: `row-${index}`
|
|
16990
|
-
} : element("panel", style, [text2, portrait], `row-${index}`);
|
|
16991
|
-
return arriving(line2, { translate: [16, 0] });
|
|
16992
|
-
}
|
|
16993
|
-
function portraitImage(src) {
|
|
16994
|
-
return {
|
|
16995
|
-
type: "image",
|
|
16996
|
-
props: { src, style: { width: "100%", height: "100%" } }
|
|
16997
|
-
};
|
|
16998
|
-
}
|
|
16999
|
-
function avatarBadge(steamId) {
|
|
17000
|
-
return {
|
|
17001
|
-
type: "avatar",
|
|
17002
|
-
props: {
|
|
17003
|
-
steamId,
|
|
17004
|
-
style: {
|
|
17005
|
-
width: badgeSize,
|
|
17006
|
-
height: badgeSize,
|
|
17007
|
-
horizontalAlign: "left",
|
|
17008
|
-
verticalAlign: "bottom",
|
|
17009
|
-
borderRadius: badgeSize / 2,
|
|
17010
|
-
borderWidth: 1,
|
|
17011
|
-
borderColor: shades.dim
|
|
17012
|
-
}
|
|
17013
|
-
}
|
|
17014
|
-
};
|
|
17015
|
-
}
|
|
17016
|
-
var actionLooks = {
|
|
17017
|
-
primary: {
|
|
17018
|
-
idle: { background: tones.text },
|
|
17019
|
-
hover: { background: shades.white },
|
|
17020
|
-
text: shades.ink
|
|
17021
|
-
},
|
|
17022
|
-
secondary: {
|
|
17023
|
-
idle: {
|
|
17024
|
-
background: shades.raised,
|
|
17025
|
-
borderWidth: 1,
|
|
17026
|
-
borderColor: shades.faint
|
|
17027
|
-
},
|
|
17028
|
-
hover: { background: shades.lit, borderColor: tones.text },
|
|
17029
|
-
text: tones.text
|
|
17030
|
-
},
|
|
17031
|
-
quiet: {
|
|
17032
|
-
idle: { background: shades.clear },
|
|
17033
|
-
hover: { background: shades.raised },
|
|
17034
|
-
text: shades.quiet
|
|
17035
|
-
}
|
|
17036
|
-
};
|
|
17037
|
-
function Action(props) {
|
|
17038
|
-
const look = actionLooks[props.kind ?? "secondary"];
|
|
17039
|
-
const label = element(
|
|
17040
|
-
"label",
|
|
17041
|
-
{
|
|
17042
|
-
face: "block",
|
|
17043
|
-
fontSize: 16,
|
|
17044
|
-
uppercase: true,
|
|
17045
|
-
letterSpacing: 1,
|
|
17046
|
-
color: look.text,
|
|
17047
|
-
horizontalAlign: "center",
|
|
17048
|
-
verticalAlign: "center",
|
|
17049
|
-
noWrap: true
|
|
17050
|
-
},
|
|
17051
|
-
props.children
|
|
17052
|
-
);
|
|
17053
|
-
return {
|
|
17054
|
-
type: "button",
|
|
17055
|
-
props: {
|
|
17056
|
-
style: {
|
|
17057
|
-
height: sizes.control,
|
|
17058
|
-
padding: [0, 14],
|
|
17059
|
-
borderRadius: sizes.radius,
|
|
17060
|
-
transition: motion.hover,
|
|
17061
|
-
...look.idle,
|
|
17062
|
-
...props.disabled ? { opacity: 0.4 } : {},
|
|
17063
|
-
...props.style
|
|
17064
|
-
},
|
|
17065
|
-
hover: props.disabled ? void 0 : look.hover,
|
|
17066
|
-
hoverSound: props.disabled ? void 0 : sounds.hover,
|
|
17067
|
-
sound: sounds.press,
|
|
17068
|
-
disabled: props.disabled,
|
|
17069
|
-
onPress: props.onPress,
|
|
17070
|
-
children: label
|
|
17071
|
-
}
|
|
17072
|
-
};
|
|
17073
|
-
}
|
|
17074
|
-
function Meter(props) {
|
|
17075
|
-
const height = props.height ?? 8;
|
|
17076
|
-
const value = Math.min(1, Math.max(0, props.value));
|
|
17077
|
-
return element(
|
|
17078
|
-
"panel",
|
|
17079
|
-
{
|
|
17080
|
-
width: props.width ?? 160,
|
|
17081
|
-
height,
|
|
17082
|
-
background: shades.raised,
|
|
17083
|
-
borderRadius: height / 2,
|
|
17084
|
-
overflow: "clip",
|
|
17085
|
-
...props.style
|
|
17086
|
-
},
|
|
17087
|
-
// The fill scales rather than resizes, so it eases without layout work.
|
|
17088
|
-
element("panel", {
|
|
17089
|
-
width: "100%",
|
|
17090
|
-
height: "100%",
|
|
17091
|
-
background: tones[props.tone ?? "accent"],
|
|
17092
|
-
scale: [value, 1],
|
|
17093
|
-
origin: [0, 50],
|
|
17094
|
-
transition: motion.meter
|
|
17095
|
-
})
|
|
17096
|
-
);
|
|
17097
|
-
}
|
|
17098
|
-
|
|
17099
|
-
// js/src/chat.ts
|
|
17100
|
-
var lineWidth = 40;
|
|
17101
|
-
var lines = /* @__PURE__ */ new Map();
|
|
17102
|
-
var shown;
|
|
17103
|
-
function showChatLines(options = {}) {
|
|
17104
|
-
shown = options;
|
|
17105
|
-
}
|
|
17106
|
-
function chatShown() {
|
|
17107
|
-
return shown !== void 0;
|
|
17108
|
-
}
|
|
17109
|
-
function hearChat(line2, now4) {
|
|
17110
|
-
if (!shown) return false;
|
|
17111
|
-
const text2 = line2.text.trim();
|
|
17112
|
-
if (text2 === "" || text2.startsWith("/")) return false;
|
|
17113
|
-
const team = line2.all ? 0 : line2.player.pawn()?.team ?? 0;
|
|
17114
|
-
lines.set(line2.player.slot, {
|
|
17115
|
-
speaker: line2.player,
|
|
17116
|
-
text: `\u201C${clip(text2, lineWidth)}\u201D`,
|
|
17117
|
-
team,
|
|
17118
|
-
until: now4 + (shown.seconds ?? 6)
|
|
17119
|
-
});
|
|
17120
|
-
return true;
|
|
17121
|
-
}
|
|
17122
|
-
function expireChat(now4) {
|
|
17123
|
-
let expired = false;
|
|
17124
|
-
for (const [slot, line2] of lines) {
|
|
17125
|
-
if (now4 >= line2.until) {
|
|
17126
|
-
lines.delete(slot);
|
|
17127
|
-
expired = true;
|
|
17128
|
-
}
|
|
17129
|
-
}
|
|
17130
|
-
return expired;
|
|
17131
|
-
}
|
|
17132
|
-
function forgetChat(slot) {
|
|
17133
|
-
return lines.delete(slot);
|
|
17134
|
-
}
|
|
17135
|
-
function chatLines(viewer) {
|
|
17136
|
-
if (lines.size === 0) return void 0;
|
|
17137
|
-
const team = viewer.pawn()?.team ?? 0;
|
|
17138
|
-
const readable = [];
|
|
17139
|
-
for (const line2 of lines.values()) {
|
|
17140
|
-
if (line2.team === 0 || line2.team === team) readable.push(line2);
|
|
17141
|
-
}
|
|
17142
|
-
readable.sort((a, b) => b.until - a.until);
|
|
17143
|
-
return Roster({
|
|
17144
|
-
top: shown?.top,
|
|
17145
|
-
rows: readable.map((line2) => {
|
|
17146
|
-
const speaker = connection(line2.speaker);
|
|
17147
|
-
return {
|
|
17148
|
-
name: speaker?.name ?? "",
|
|
17149
|
-
hero: line2.speaker.pawn()?.hero ?? 0,
|
|
17150
|
-
activity: line2.text,
|
|
17151
|
-
steamId: speaker && !speaker.bot ? speaker.steamId : void 0
|
|
17152
|
-
};
|
|
17153
|
-
})
|
|
17154
|
-
});
|
|
17155
|
-
}
|
|
17156
|
-
|
|
17157
|
-
// js/src/bystander.ts
|
|
17158
|
-
var bystanderStates = [
|
|
17159
|
-
"MODIFIER_STATE_IMMOBILIZED",
|
|
17160
|
-
"MODIFIER_STATE_DISARMED",
|
|
17161
|
-
"MODIFIER_STATE_MELEE_DISABLED",
|
|
17162
|
-
"MODIFIER_STATE_SILENCED",
|
|
17163
|
-
"MODIFIER_STATE_INVULNERABLE",
|
|
17164
|
-
"MODIFIER_STATE_TECH_UNTARGETABLE_BY_ENEMIES",
|
|
17165
|
-
"MODIFIER_STATE_TECH_UNTARGETABLE_BY_TEAMMATES",
|
|
17166
|
-
"MODIFIER_STATE_DISPLACEMENT_IMMUNE",
|
|
17167
|
-
"MODIFIER_STATE_IGNORE_BULLETS",
|
|
17168
|
-
"MODIFIER_STATE_IGNORE_MELEE",
|
|
17169
|
-
"MODIFIER_STATE_IN_ABILITY_DISABLE_ZOOM"
|
|
17170
|
-
];
|
|
17171
|
-
function holdBystander(entity, active = true) {
|
|
17172
|
-
let held = true;
|
|
17173
|
-
for (const state of bystanderStates) {
|
|
17174
|
-
held = holdModifierState(entity, state, active) && held;
|
|
17175
|
-
}
|
|
17176
|
-
return held;
|
|
17177
|
-
}
|
|
17178
|
-
var parkedStates = [
|
|
17179
|
-
"MODIFIER_STATE_DO_NOT_DRAW_MODEL",
|
|
17180
|
-
"MODIFIER_STATE_UNIT_STATUS_HIDDEN",
|
|
17181
|
-
"MODIFIER_STATE_INVISIBLE_ON_MINIMAP",
|
|
17182
|
-
"MODIFIER_STATE_IGNORE_OUT_OF_PLAY_AREA_CHECK"
|
|
17183
|
-
];
|
|
17184
|
-
var parkHeight = 4e3;
|
|
17185
|
-
function spectateFrom(player, position, facing, park) {
|
|
17186
|
-
const pawn = player.pawn();
|
|
17187
|
-
if (pawn === void 0 || pawn.hero === 0) return void 0;
|
|
17188
|
-
const stood = pawn.position;
|
|
17189
|
-
const faced = pawn.eyeAngles;
|
|
17190
|
-
hideParked(pawn.entity, true);
|
|
17191
|
-
player.teleport(park ?? { ...stood, z: stood.z + parkHeight }, faced, {
|
|
17192
|
-
x: 0,
|
|
17193
|
-
y: 0,
|
|
17194
|
-
z: 0
|
|
17195
|
-
});
|
|
17196
|
-
player.freeze(true);
|
|
17197
|
-
player.freeCamera(position, facing);
|
|
17198
|
-
return (restore = true) => {
|
|
17199
|
-
player.unwatch();
|
|
17200
|
-
player.freeze(false);
|
|
17201
|
-
if (restore) player.teleport(stood, faced, { x: 0, y: 0, z: 0 });
|
|
17202
|
-
hideParked(pawn.entity, false);
|
|
17203
|
-
};
|
|
16891
|
+
var parkedStates = [
|
|
16892
|
+
"MODIFIER_STATE_DO_NOT_DRAW_MODEL",
|
|
16893
|
+
"MODIFIER_STATE_UNIT_STATUS_HIDDEN",
|
|
16894
|
+
"MODIFIER_STATE_INVISIBLE_ON_MINIMAP",
|
|
16895
|
+
"MODIFIER_STATE_IGNORE_OUT_OF_PLAY_AREA_CHECK"
|
|
16896
|
+
];
|
|
16897
|
+
var parkHeight = 4e3;
|
|
16898
|
+
function spectateFrom(player, position, facing, park) {
|
|
16899
|
+
const pawn = player.pawn();
|
|
16900
|
+
if (pawn === void 0 || pawn.hero === 0) return void 0;
|
|
16901
|
+
const stood = pawn.position;
|
|
16902
|
+
const faced = pawn.eyeAngles;
|
|
16903
|
+
hideParked(pawn.entity, true);
|
|
16904
|
+
player.teleport(park ?? { ...stood, z: stood.z + parkHeight }, faced, {
|
|
16905
|
+
x: 0,
|
|
16906
|
+
y: 0,
|
|
16907
|
+
z: 0
|
|
16908
|
+
});
|
|
16909
|
+
player.freeze(true);
|
|
16910
|
+
player.freeCamera(position, facing);
|
|
16911
|
+
return (restore = true) => {
|
|
16912
|
+
player.unwatch();
|
|
16913
|
+
player.freeze(false);
|
|
16914
|
+
if (restore) player.teleport(stood, faced, { x: 0, y: 0, z: 0 });
|
|
16915
|
+
hideParked(pawn.entity, false);
|
|
16916
|
+
};
|
|
17204
16917
|
}
|
|
17205
16918
|
function hideParked(entity, active) {
|
|
17206
16919
|
holdBystander(entity, active);
|
|
@@ -17402,15 +17115,15 @@ function Fragment(props) {
|
|
|
17402
17115
|
}
|
|
17403
17116
|
function show(player, root) {
|
|
17404
17117
|
views.set(player.slot, { ...view(player), root });
|
|
17405
|
-
return draw(player);
|
|
17118
|
+
return draw(player, ["view"]);
|
|
17406
17119
|
}
|
|
17407
17120
|
function hideHud(player, parts) {
|
|
17408
17121
|
views.set(player.slot, { ...view(player), hud: parts });
|
|
17409
|
-
return draw(player);
|
|
17122
|
+
return draw(player, []);
|
|
17410
17123
|
}
|
|
17411
17124
|
function hideHudForAll(parts) {
|
|
17412
17125
|
everyoneHud = parts;
|
|
17413
|
-
drawAll();
|
|
17126
|
+
drawAll([]);
|
|
17414
17127
|
}
|
|
17415
17128
|
function freeCursor(player, free) {
|
|
17416
17129
|
const current = view(player);
|
|
@@ -17419,18 +17132,18 @@ function freeCursor(player, free) {
|
|
|
17419
17132
|
cursor: free,
|
|
17420
17133
|
asks: free ? current.asks + 1 : current.asks
|
|
17421
17134
|
});
|
|
17422
|
-
return draw(player);
|
|
17135
|
+
return draw(player, []);
|
|
17423
17136
|
}
|
|
17424
17137
|
function abilityBarPresses(player, onPress) {
|
|
17425
17138
|
views.set(player.slot, {
|
|
17426
17139
|
...view(player),
|
|
17427
17140
|
bar: onPress ? { handler: onPress } : void 0
|
|
17428
17141
|
});
|
|
17429
|
-
return draw(player);
|
|
17142
|
+
return draw(player, []);
|
|
17430
17143
|
}
|
|
17431
17144
|
function abilityDisplay(viewer, rows = []) {
|
|
17432
17145
|
views.set(viewer.slot, { ...view(viewer), display: rows.slice(0, 64) });
|
|
17433
|
-
return draw(viewer);
|
|
17146
|
+
return draw(viewer, []);
|
|
17434
17147
|
}
|
|
17435
17148
|
function displayRows(viewer, rows) {
|
|
17436
17149
|
if (rows.length === 0) return [];
|
|
@@ -17471,7 +17184,7 @@ function sheet(path) {
|
|
|
17471
17184
|
}
|
|
17472
17185
|
sheets.push(path);
|
|
17473
17186
|
for (const current of views.values()) {
|
|
17474
|
-
draw(current.player);
|
|
17187
|
+
draw(current.player, []);
|
|
17475
17188
|
}
|
|
17476
17189
|
return true;
|
|
17477
17190
|
}
|
|
@@ -17489,7 +17202,7 @@ function route(player, name, value) {
|
|
|
17489
17202
|
routes.set(name, encoded);
|
|
17490
17203
|
}
|
|
17491
17204
|
views.set(player.slot, { ...view(player), routes });
|
|
17492
|
-
return draw(player);
|
|
17205
|
+
return draw(player, ["routes"]);
|
|
17493
17206
|
}
|
|
17494
17207
|
var routeName = /^[\w.-]+$/;
|
|
17495
17208
|
function hide(player) {
|
|
@@ -17504,10 +17217,10 @@ function joined(player) {
|
|
|
17504
17217
|
function left(player) {
|
|
17505
17218
|
views.delete(player.slot);
|
|
17506
17219
|
screens.delete(player.slot);
|
|
17507
|
-
if (forgetChat(player.slot)) drawAll();
|
|
17220
|
+
if (forgetChat(player.slot)) drawAll(["chat"]);
|
|
17508
17221
|
}
|
|
17509
17222
|
function heard(line2) {
|
|
17510
|
-
if (hearChat(line2, now2)) drawAll();
|
|
17223
|
+
if (hearChat(line2, now2)) drawAll(["chat"]);
|
|
17511
17224
|
}
|
|
17512
17225
|
function toast(player, text2, seconds = 4) {
|
|
17513
17226
|
const current = view(player);
|
|
@@ -17516,7 +17229,7 @@ function toast(player, text2, seconds = 4) {
|
|
|
17516
17229
|
...current,
|
|
17517
17230
|
notices: [...current.notices, notice].slice(-maxNotices)
|
|
17518
17231
|
});
|
|
17519
|
-
return draw(player);
|
|
17232
|
+
return draw(player, ["notices"]);
|
|
17520
17233
|
}
|
|
17521
17234
|
function uiSound(player, sound, options = {}) {
|
|
17522
17235
|
const current = view(player);
|
|
@@ -17530,11 +17243,11 @@ function uiSound(player, sound, options = {}) {
|
|
|
17530
17243
|
...current,
|
|
17531
17244
|
cues: [...current.cues, cue].slice(-maxCues)
|
|
17532
17245
|
});
|
|
17533
|
-
return draw(player);
|
|
17246
|
+
return draw(player, []);
|
|
17534
17247
|
}
|
|
17535
17248
|
function press(player, node, action = "", payload = "") {
|
|
17536
17249
|
if (action !== "") {
|
|
17537
|
-
const pressed2 =
|
|
17250
|
+
const pressed2 = partOf(player.slot, node)?.actions.get(node);
|
|
17538
17251
|
if (pressed2) {
|
|
17539
17252
|
let value = void 0;
|
|
17540
17253
|
try {
|
|
@@ -17551,30 +17264,30 @@ function press(player, node, action = "", payload = "") {
|
|
|
17551
17264
|
views.get(player.slot)?.bar?.handler(player, Number(bar[1]));
|
|
17552
17265
|
return;
|
|
17553
17266
|
}
|
|
17554
|
-
const pressed =
|
|
17267
|
+
const pressed = partOf(player.slot, node)?.presses.get(node);
|
|
17555
17268
|
if (pressed) {
|
|
17556
17269
|
pressed.handler(player);
|
|
17557
17270
|
}
|
|
17558
17271
|
}
|
|
17559
17272
|
function change(player, node, value) {
|
|
17560
17273
|
if (typeof value === "object" && value !== null) {
|
|
17561
|
-
|
|
17274
|
+
partOf(player.slot, node)?.wheels.get(node)?.handler(player, value);
|
|
17562
17275
|
return;
|
|
17563
17276
|
}
|
|
17564
|
-
const changed =
|
|
17277
|
+
const changed = partOf(player.slot, node)?.changes.get(node);
|
|
17565
17278
|
if (changed) {
|
|
17566
17279
|
changed.handler(player, value);
|
|
17567
17280
|
}
|
|
17568
17281
|
}
|
|
17569
17282
|
function tick(seconds) {
|
|
17570
17283
|
now2 = seconds;
|
|
17571
|
-
if (expireChat(now2)) drawAll();
|
|
17284
|
+
if (expireChat(now2)) drawAll(["chat"]);
|
|
17572
17285
|
for (const current of views.values()) {
|
|
17573
17286
|
if (!current.notices.some((notice) => notice.until <= now2)) {
|
|
17574
17287
|
continue;
|
|
17575
17288
|
}
|
|
17576
17289
|
current.notices = current.notices.filter((notice) => notice.until > now2);
|
|
17577
|
-
draw(current.player);
|
|
17290
|
+
draw(current.player, ["notices"]);
|
|
17578
17291
|
}
|
|
17579
17292
|
}
|
|
17580
17293
|
var views = /* @__PURE__ */ new Map();
|
|
@@ -17603,40 +17316,13 @@ function view(player) {
|
|
|
17603
17316
|
notices: []
|
|
17604
17317
|
};
|
|
17605
17318
|
}
|
|
17606
|
-
|
|
17607
|
-
|
|
17608
|
-
const root = [
|
|
17609
|
-
current.root,
|
|
17610
|
-
chatLines(player),
|
|
17611
|
-
current.notices.length !== 0 && notices(current.notices)
|
|
17612
|
-
];
|
|
17319
|
+
var layers = ["view", "chat", "notices", "routes"];
|
|
17320
|
+
function draw(player, changed = layers) {
|
|
17613
17321
|
const previous = screens.get(player.slot);
|
|
17614
|
-
const
|
|
17615
|
-
const display = displayRows(player, current.display);
|
|
17616
|
-
const next = render(
|
|
17617
|
-
previous,
|
|
17618
|
-
root,
|
|
17619
|
-
hud,
|
|
17620
|
-
current.cursor,
|
|
17621
|
-
current.asks,
|
|
17622
|
-
current.routes,
|
|
17623
|
-
current.cues,
|
|
17624
|
-
current.bar !== void 0,
|
|
17625
|
-
display
|
|
17626
|
-
);
|
|
17322
|
+
const next = compose(player, previous, previous ? changed : layers);
|
|
17627
17323
|
const change2 = diff(previous, next);
|
|
17628
17324
|
if (change2 && !send(player.slot, change2)) {
|
|
17629
|
-
const whole =
|
|
17630
|
-
void 0,
|
|
17631
|
-
root,
|
|
17632
|
-
hud,
|
|
17633
|
-
current.cursor,
|
|
17634
|
-
current.asks,
|
|
17635
|
-
current.routes,
|
|
17636
|
-
current.cues,
|
|
17637
|
-
current.bar !== void 0,
|
|
17638
|
-
display
|
|
17639
|
-
);
|
|
17325
|
+
const whole = compose(player, void 0, layers);
|
|
17640
17326
|
if (!send(player.slot, diff(void 0, whole))) {
|
|
17641
17327
|
screens.delete(player.slot);
|
|
17642
17328
|
return false;
|
|
@@ -17647,9 +17333,58 @@ function draw(player) {
|
|
|
17647
17333
|
screens.set(player.slot, next);
|
|
17648
17334
|
return true;
|
|
17649
17335
|
}
|
|
17650
|
-
function drawAll() {
|
|
17336
|
+
function drawAll(changed = layers) {
|
|
17651
17337
|
for (const { player } of players()) {
|
|
17652
|
-
draw(player);
|
|
17338
|
+
draw(player, changed);
|
|
17339
|
+
}
|
|
17340
|
+
}
|
|
17341
|
+
function compose(player, previous, changed) {
|
|
17342
|
+
const current = view(player);
|
|
17343
|
+
const screen = {
|
|
17344
|
+
parts: new Map(previous?.parts),
|
|
17345
|
+
root: { node: {}, encoded: "" },
|
|
17346
|
+
next: previous?.next ?? 0
|
|
17347
|
+
};
|
|
17348
|
+
for (const layer of changed) {
|
|
17349
|
+
const layout = new Layout(previous?.parts.get(layer), screen);
|
|
17350
|
+
if (layer === "routes") {
|
|
17351
|
+
for (const [name, data] of current.routes) {
|
|
17352
|
+
layout.add({ id: `route:${name}`, kind: 5 /* ROUTE */, route: name, data });
|
|
17353
|
+
}
|
|
17354
|
+
} else {
|
|
17355
|
+
layout.part.top = place(layout, content(layer, current), "/");
|
|
17356
|
+
}
|
|
17357
|
+
screen.parts.set(layer, layout.part);
|
|
17358
|
+
}
|
|
17359
|
+
const children = [];
|
|
17360
|
+
for (const layer of layers) {
|
|
17361
|
+
children.push(...screen.parts.get(layer)?.top ?? []);
|
|
17362
|
+
}
|
|
17363
|
+
const root = {
|
|
17364
|
+
id: "",
|
|
17365
|
+
kind: 0 /* PANEL */,
|
|
17366
|
+
children,
|
|
17367
|
+
hideHud: hiddenParts(current.hud),
|
|
17368
|
+
freeCursor: current.cursor,
|
|
17369
|
+
freeCursorAsks: current.asks,
|
|
17370
|
+
sheets: [...sheets],
|
|
17371
|
+
cues: [...current.cues],
|
|
17372
|
+
abilityBarPresses: current.bar !== void 0,
|
|
17373
|
+
abilityDisplay: displayRows(player, current.display)
|
|
17374
|
+
};
|
|
17375
|
+
screen.root = { node: root, encoded: JSON.stringify(root) };
|
|
17376
|
+
return screen;
|
|
17377
|
+
}
|
|
17378
|
+
function content(layer, current) {
|
|
17379
|
+
switch (layer) {
|
|
17380
|
+
case "view":
|
|
17381
|
+
return current.root;
|
|
17382
|
+
case "chat":
|
|
17383
|
+
return chatLines(current.player);
|
|
17384
|
+
case "notices":
|
|
17385
|
+
return current.notices.length !== 0 && notices(current.notices);
|
|
17386
|
+
default:
|
|
17387
|
+
return void 0;
|
|
17653
17388
|
}
|
|
17654
17389
|
}
|
|
17655
17390
|
function hiddenParts(own) {
|
|
@@ -17695,46 +17430,35 @@ function notices(stack) {
|
|
|
17695
17430
|
return jsx("panel", { style, exit: noticeMotion.exit, children: labels });
|
|
17696
17431
|
}
|
|
17697
17432
|
var screens = /* @__PURE__ */ new Map();
|
|
17698
|
-
function
|
|
17699
|
-
const
|
|
17700
|
-
|
|
17701
|
-
id: "",
|
|
17702
|
-
kind: 0 /* PANEL */,
|
|
17703
|
-
children: place(layout, root, "/"),
|
|
17704
|
-
hideHud: [...hud],
|
|
17705
|
-
freeCursor: cursor,
|
|
17706
|
-
freeCursorAsks: asks,
|
|
17707
|
-
sheets: [...sheets],
|
|
17708
|
-
cues: [...cues],
|
|
17709
|
-
abilityBarPresses: bar,
|
|
17710
|
-
abilityDisplay: [...display]
|
|
17711
|
-
});
|
|
17712
|
-
for (const [name, data] of routes) {
|
|
17713
|
-
layout.add({ id: `route:${name}`, kind: 5 /* ROUTE */, route: name, data });
|
|
17433
|
+
function partOf(slot, id) {
|
|
17434
|
+
for (const part of screens.get(slot)?.parts.values() ?? []) {
|
|
17435
|
+
if (part.nodes.has(id)) return part;
|
|
17714
17436
|
}
|
|
17715
|
-
return
|
|
17437
|
+
return void 0;
|
|
17716
17438
|
}
|
|
17717
17439
|
var Layout = class {
|
|
17718
|
-
|
|
17440
|
+
part;
|
|
17719
17441
|
previous;
|
|
17720
|
-
|
|
17721
|
-
|
|
17442
|
+
screen;
|
|
17443
|
+
/** The layout keeps previous's ids and numbers new nodes from screen's counter. */
|
|
17444
|
+
constructor(previous, screen) {
|
|
17722
17445
|
this.previous = previous;
|
|
17723
|
-
this.screen =
|
|
17446
|
+
this.screen = screen;
|
|
17447
|
+
this.part = {
|
|
17724
17448
|
nodes: /* @__PURE__ */ new Map(),
|
|
17725
17449
|
ids: /* @__PURE__ */ new Map(),
|
|
17726
17450
|
presses: /* @__PURE__ */ new Map(),
|
|
17727
17451
|
changes: /* @__PURE__ */ new Map(),
|
|
17728
17452
|
actions: /* @__PURE__ */ new Map(),
|
|
17729
17453
|
wheels: /* @__PURE__ */ new Map(),
|
|
17730
|
-
|
|
17454
|
+
top: []
|
|
17731
17455
|
};
|
|
17732
17456
|
}
|
|
17733
17457
|
/** add records a node. */
|
|
17734
17458
|
add(node) {
|
|
17735
17459
|
const value = node.steamId === void 0 ? node : { ...node, steamId: String(node.steamId) };
|
|
17736
17460
|
const encoded = JSON.stringify(value);
|
|
17737
|
-
this.
|
|
17461
|
+
this.part.nodes.set(node.id, { node, encoded });
|
|
17738
17462
|
}
|
|
17739
17463
|
/** id returns the node id for the element at place. */
|
|
17740
17464
|
id(place2) {
|
|
@@ -17742,7 +17466,7 @@ var Layout = class {
|
|
|
17742
17466
|
if (found === void 0) {
|
|
17743
17467
|
found = (this.screen.next++).toString(36);
|
|
17744
17468
|
}
|
|
17745
|
-
this.
|
|
17469
|
+
this.part.ids.set(place2, found);
|
|
17746
17470
|
return found;
|
|
17747
17471
|
}
|
|
17748
17472
|
};
|
|
@@ -17793,7 +17517,7 @@ function place(layout, child, at3) {
|
|
|
17793
17517
|
node.text = text(props.children);
|
|
17794
17518
|
node.token = props.token;
|
|
17795
17519
|
node.variables = variables(props.variables);
|
|
17796
|
-
node.clock =
|
|
17520
|
+
node.clock = clock(props.clock);
|
|
17797
17521
|
break;
|
|
17798
17522
|
case "avatar":
|
|
17799
17523
|
node.kind = 8 /* AVATAR */;
|
|
@@ -17821,7 +17545,7 @@ function place(layout, child, at3) {
|
|
|
17821
17545
|
node.sound = props.sound;
|
|
17822
17546
|
node.disabled = props.disabled;
|
|
17823
17547
|
if (props.onPress && !props.disabled) {
|
|
17824
|
-
layout.
|
|
17548
|
+
layout.part.presses.set(node.id, { handler: props.onPress });
|
|
17825
17549
|
}
|
|
17826
17550
|
node.children = place(layout, props.children, `${at3}/`);
|
|
17827
17551
|
break;
|
|
@@ -17830,7 +17554,7 @@ function place(layout, child, at3) {
|
|
|
17830
17554
|
node.layout = props.src ?? "";
|
|
17831
17555
|
node.data = props.data === void 0 ? "" : JSON.stringify(props.data) ?? "";
|
|
17832
17556
|
if (props.onAction) {
|
|
17833
|
-
layout.
|
|
17557
|
+
layout.part.actions.set(node.id, { handler: props.onAction });
|
|
17834
17558
|
}
|
|
17835
17559
|
break;
|
|
17836
17560
|
default:
|
|
@@ -17848,7 +17572,7 @@ function input(layout, node, kind, props) {
|
|
|
17848
17572
|
node.kind = 7 /* INPUT */;
|
|
17849
17573
|
node.disabled = props.disabled;
|
|
17850
17574
|
if (props.onChange && !props.disabled) {
|
|
17851
|
-
layout.
|
|
17575
|
+
layout.part.changes.set(node.id, { handler: props.onChange });
|
|
17852
17576
|
}
|
|
17853
17577
|
switch (kind) {
|
|
17854
17578
|
case "entry":
|
|
@@ -17863,7 +17587,7 @@ function input(layout, node, kind, props) {
|
|
|
17863
17587
|
break;
|
|
17864
17588
|
case "slider":
|
|
17865
17589
|
if (props.onWheel && !props.disabled) {
|
|
17866
|
-
layout.
|
|
17590
|
+
layout.part.wheels.set(node.id, { handler: props.onWheel });
|
|
17867
17591
|
}
|
|
17868
17592
|
node.input = {
|
|
17869
17593
|
case: "slider",
|
|
@@ -17890,7 +17614,7 @@ function input(layout, node, kind, props) {
|
|
|
17890
17614
|
};
|
|
17891
17615
|
}
|
|
17892
17616
|
}
|
|
17893
|
-
function
|
|
17617
|
+
function clock(value) {
|
|
17894
17618
|
if (!value) {
|
|
17895
17619
|
return void 0;
|
|
17896
17620
|
}
|
|
@@ -17907,7 +17631,7 @@ var clockFormats = {
|
|
|
17907
17631
|
seconds: 1 /* SECONDS */,
|
|
17908
17632
|
tenths: 2 /* TENTHS */
|
|
17909
17633
|
};
|
|
17910
|
-
function
|
|
17634
|
+
function clip(value) {
|
|
17911
17635
|
if (!value) {
|
|
17912
17636
|
return void 0;
|
|
17913
17637
|
}
|
|
@@ -17948,12 +17672,20 @@ function cycle(value) {
|
|
|
17948
17672
|
};
|
|
17949
17673
|
}
|
|
17950
17674
|
function diff(previous, next) {
|
|
17951
|
-
const set = [
|
|
17952
|
-
|
|
17953
|
-
|
|
17954
|
-
const
|
|
17955
|
-
|
|
17956
|
-
|
|
17675
|
+
const set = [];
|
|
17676
|
+
const removed = [];
|
|
17677
|
+
if (previous?.root.encoded !== next.root.encoded) set.push(next.root.node);
|
|
17678
|
+
for (const layer of layers) {
|
|
17679
|
+
const before2 = previous?.parts.get(layer);
|
|
17680
|
+
const after2 = next.parts.get(layer);
|
|
17681
|
+
if (before2 === after2) continue;
|
|
17682
|
+
for (const { node, encoded } of after2?.nodes.values() ?? []) {
|
|
17683
|
+
if (before2?.nodes.get(node.id)?.encoded !== encoded) set.push(node);
|
|
17684
|
+
}
|
|
17685
|
+
for (const id of before2?.nodes.keys() ?? []) {
|
|
17686
|
+
if (!after2?.nodes.has(id)) removed.push(id);
|
|
17687
|
+
}
|
|
17688
|
+
}
|
|
17957
17689
|
if (previous && set.length === 0 && removed.length === 0) {
|
|
17958
17690
|
return void 0;
|
|
17959
17691
|
}
|
|
@@ -18124,7 +17856,7 @@ function wireStyle(style) {
|
|
|
18124
17856
|
decoration: style.decoration === void 0 ? void 0 : decorations[style.decoration],
|
|
18125
17857
|
transform: transform(style),
|
|
18126
17858
|
turn: style.turn,
|
|
18127
|
-
clip:
|
|
17859
|
+
clip: clip(style.clip),
|
|
18128
17860
|
transition: transition(style.transition)
|
|
18129
17861
|
};
|
|
18130
17862
|
}
|
|
@@ -18654,8 +18386,53 @@ function sendCurve(player, options, curve) {
|
|
|
18654
18386
|
return true;
|
|
18655
18387
|
});
|
|
18656
18388
|
}
|
|
18657
|
-
function zero2(value) {
|
|
18658
|
-
return typeof value === "number" ? 0 : { x: 0, y: 0, z: 0 };
|
|
18389
|
+
function zero2(value) {
|
|
18390
|
+
return typeof value === "number" ? 0 : { x: 0, y: 0, z: 0 };
|
|
18391
|
+
}
|
|
18392
|
+
|
|
18393
|
+
// js/src/format.ts
|
|
18394
|
+
var format_exports = {};
|
|
18395
|
+
__export(format_exports, {
|
|
18396
|
+
clip: () => clip2,
|
|
18397
|
+
clock: () => clock2,
|
|
18398
|
+
count: () => count,
|
|
18399
|
+
grouped: () => grouped,
|
|
18400
|
+
ordinal: () => ordinal,
|
|
18401
|
+
percent: () => percent,
|
|
18402
|
+
stopwatch: () => stopwatch
|
|
18403
|
+
});
|
|
18404
|
+
function clock2(seconds) {
|
|
18405
|
+
const whole = Math.max(0, Math.ceil(seconds));
|
|
18406
|
+
return `${Math.floor(whole / 60)}:${String(whole % 60).padStart(2, "0")}`;
|
|
18407
|
+
}
|
|
18408
|
+
function stopwatch(seconds) {
|
|
18409
|
+
const hundredths = Math.max(0, Math.floor(seconds * 100));
|
|
18410
|
+
const minutes = Math.floor(hundredths / 6e3);
|
|
18411
|
+
const rest = hundredths % 6e3 / 100;
|
|
18412
|
+
return `${minutes}:${rest.toFixed(2).padStart(5, "0")}`;
|
|
18413
|
+
}
|
|
18414
|
+
function percent(part, whole) {
|
|
18415
|
+
if (!(whole > 0)) {
|
|
18416
|
+
return "-";
|
|
18417
|
+
}
|
|
18418
|
+
return `${Math.round(Math.max(0, Math.min(part / whole, 1)) * 100)}%`;
|
|
18419
|
+
}
|
|
18420
|
+
function grouped(value) {
|
|
18421
|
+
return String(Math.round(value)).replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
18422
|
+
}
|
|
18423
|
+
function ordinal(place2) {
|
|
18424
|
+
const tens = place2 % 100;
|
|
18425
|
+
const suffix = tens >= 11 && tens <= 13 ? "th" : ["th", "st", "nd", "rd"][place2 % 10] ?? "th";
|
|
18426
|
+
return `${place2}${suffix}`;
|
|
18427
|
+
}
|
|
18428
|
+
function count(number, thing, plural = `${thing}s`) {
|
|
18429
|
+
return `${grouped(number)} ${number === 1 ? thing : plural}`;
|
|
18430
|
+
}
|
|
18431
|
+
function clip2(text2, width) {
|
|
18432
|
+
if (text2.length <= width) return text2;
|
|
18433
|
+
const cut = text2.slice(0, width - 1);
|
|
18434
|
+
const space = cut.lastIndexOf(" ");
|
|
18435
|
+
return `${(space > 0 ? cut.slice(0, space) : cut).trimEnd()}\u2026`;
|
|
18659
18436
|
}
|
|
18660
18437
|
|
|
18661
18438
|
// js/src/items.gen.ts
|
|
@@ -18849,53 +18626,594 @@ var Hook = class {
|
|
|
18849
18626
|
reset() {
|
|
18850
18627
|
this.thrownAt = 0;
|
|
18851
18628
|
}
|
|
18852
|
-
/**
|
|
18853
|
-
* update reads the thrower's hook at game time now, keeps it fully upgraded
|
|
18854
|
-
* and sets the length of any cooldown a throw started. It reports nothing
|
|
18855
|
-
* for a hero without the hook. A caller that already read this frame's
|
|
18856
|
-
* abilities passes them to avoid another read.
|
|
18857
|
-
*/
|
|
18858
|
-
update(player, now4, abilities = player.abilities()) {
|
|
18859
|
-
const ability = abilities.find((a) => a.name === hookAbility);
|
|
18860
|
-
if (!ability) {
|
|
18861
|
-
return void 0;
|
|
18862
|
-
}
|
|
18863
|
-
const victim = this.victim(ability.entity);
|
|
18864
|
-
if ((ability.upgrades & hookUpgrades) !== hookUpgrades) {
|
|
18865
|
-
player.setAbility({ ability: hookAbility, upgrades: hookUpgrades });
|
|
18866
|
-
}
|
|
18867
|
-
if (ability.cooldownEnd <= now4) {
|
|
18868
|
-
return { victim, thrown: false };
|
|
18869
|
-
}
|
|
18870
|
-
const thrown = ability.cooldownStart > this.thrownAt;
|
|
18871
|
-
if (thrown) {
|
|
18872
|
-
this.thrownAt = ability.cooldownStart;
|
|
18629
|
+
/**
|
|
18630
|
+
* update reads the thrower's hook at game time now, keeps it fully upgraded
|
|
18631
|
+
* and sets the length of any cooldown a throw started. It reports nothing
|
|
18632
|
+
* for a hero without the hook. A caller that already read this frame's
|
|
18633
|
+
* abilities passes them to avoid another read.
|
|
18634
|
+
*/
|
|
18635
|
+
update(player, now4, abilities = player.abilities()) {
|
|
18636
|
+
const ability = abilities.find((a) => a.name === hookAbility);
|
|
18637
|
+
if (!ability) {
|
|
18638
|
+
return void 0;
|
|
18639
|
+
}
|
|
18640
|
+
const victim = this.victim(ability.entity);
|
|
18641
|
+
if ((ability.upgrades & hookUpgrades) !== hookUpgrades) {
|
|
18642
|
+
player.setAbility({ ability: hookAbility, upgrades: hookUpgrades });
|
|
18643
|
+
}
|
|
18644
|
+
if (ability.cooldownEnd <= now4) {
|
|
18645
|
+
return { victim, thrown: false };
|
|
18646
|
+
}
|
|
18647
|
+
const thrown = ability.cooldownStart > this.thrownAt;
|
|
18648
|
+
if (thrown) {
|
|
18649
|
+
this.thrownAt = ability.cooldownStart;
|
|
18650
|
+
}
|
|
18651
|
+
this.setCooldown(player, ability);
|
|
18652
|
+
return { victim, thrown };
|
|
18653
|
+
}
|
|
18654
|
+
/** victim is the hero the hook entity holds, or undefined while it holds none. */
|
|
18655
|
+
victim(hookEntity) {
|
|
18656
|
+
const victim = this.read(
|
|
18657
|
+
hookEntity,
|
|
18658
|
+
"CCitadel_Ability_Hook",
|
|
18659
|
+
"m_hHookVictim",
|
|
18660
|
+
"handle"
|
|
18661
|
+
);
|
|
18662
|
+
return typeof victim === "number" ? victim : void 0;
|
|
18663
|
+
}
|
|
18664
|
+
/** setCooldown ends the cooldown cooldownSeconds after the hook's throw. */
|
|
18665
|
+
setCooldown(player, ability) {
|
|
18666
|
+
if (this.cooldownSeconds <= 0) {
|
|
18667
|
+
player.refreshAbility(hookAbility);
|
|
18668
|
+
return;
|
|
18669
|
+
}
|
|
18670
|
+
const cooldownEnd = ability.cooldownStart + this.cooldownSeconds;
|
|
18671
|
+
if (cooldownEnd !== ability.cooldownEnd) {
|
|
18672
|
+
player.setAbility({ ability: hookAbility, cooldownEnd });
|
|
18673
|
+
}
|
|
18674
|
+
}
|
|
18675
|
+
};
|
|
18676
|
+
|
|
18677
|
+
// js/src/hud.ts
|
|
18678
|
+
function element(type, style, children, key) {
|
|
18679
|
+
return { type, props: { style, children }, key };
|
|
18680
|
+
}
|
|
18681
|
+
function arriving(component, from) {
|
|
18682
|
+
return {
|
|
18683
|
+
...component,
|
|
18684
|
+
props: {
|
|
18685
|
+
...component.props,
|
|
18686
|
+
style: {
|
|
18687
|
+
transition: { seconds: 0.25, easing: "out" },
|
|
18688
|
+
...component.props.style
|
|
18689
|
+
},
|
|
18690
|
+
enter: { opacity: 0, ...from },
|
|
18691
|
+
exit: { opacity: 0 }
|
|
18692
|
+
}
|
|
18693
|
+
};
|
|
18694
|
+
}
|
|
18695
|
+
function Text(props) {
|
|
18696
|
+
const type = types[props.role];
|
|
18697
|
+
const text2 = element(
|
|
18698
|
+
"label",
|
|
18699
|
+
{
|
|
18700
|
+
face: type.face,
|
|
18701
|
+
fontSize: type.size,
|
|
18702
|
+
uppercase: type.uppercase,
|
|
18703
|
+
shadow: !props.plated,
|
|
18704
|
+
color: tones[props.tone ?? (props.role === "label" ? "muted" : "text")],
|
|
18705
|
+
horizontalAlign: "center",
|
|
18706
|
+
textAlign: "center",
|
|
18707
|
+
...props.style
|
|
18708
|
+
},
|
|
18709
|
+
props.children
|
|
18710
|
+
);
|
|
18711
|
+
return props.clock ? { ...text2, props: { ...text2.props, clock: props.clock } } : text2;
|
|
18712
|
+
}
|
|
18713
|
+
function Plate(props) {
|
|
18714
|
+
return element(
|
|
18715
|
+
"panel",
|
|
18716
|
+
{
|
|
18717
|
+
flow: props.flow ?? "down",
|
|
18718
|
+
horizontalAlign: "center",
|
|
18719
|
+
background: plate.color,
|
|
18720
|
+
borderRadius: plate.radius,
|
|
18721
|
+
padding: plate.padding,
|
|
18722
|
+
...props.style
|
|
18723
|
+
},
|
|
18724
|
+
props.children
|
|
18725
|
+
);
|
|
18726
|
+
}
|
|
18727
|
+
function Pill(props) {
|
|
18728
|
+
return element(
|
|
18729
|
+
"panel",
|
|
18730
|
+
{
|
|
18731
|
+
flow: props.flow ?? "right",
|
|
18732
|
+
horizontalAlign: "center",
|
|
18733
|
+
background: plate.color,
|
|
18734
|
+
borderRadius: 50,
|
|
18735
|
+
borderWidth: 2,
|
|
18736
|
+
borderColor: pillEdge,
|
|
18737
|
+
padding: [3, 6],
|
|
18738
|
+
...props.style
|
|
18739
|
+
},
|
|
18740
|
+
props.children
|
|
18741
|
+
);
|
|
18742
|
+
}
|
|
18743
|
+
function Pips(props) {
|
|
18744
|
+
const shape = pipShapes[props.shape ?? "round"];
|
|
18745
|
+
const lit = (index) => props.mirror ? index >= props.total - props.filled : index < props.filled;
|
|
18746
|
+
return element(
|
|
18747
|
+
"panel",
|
|
18748
|
+
{ flow: "right", verticalAlign: "center", ...props.style },
|
|
18749
|
+
Array.from(
|
|
18750
|
+
{ length: props.total },
|
|
18751
|
+
(_, index) => element(
|
|
18752
|
+
"panel",
|
|
18753
|
+
{
|
|
18754
|
+
width: shape.width,
|
|
18755
|
+
height: shape.height,
|
|
18756
|
+
borderRadius: shape.radius,
|
|
18757
|
+
margin: [0, 2],
|
|
18758
|
+
background: lit(index) ? tones[props.tone] : emptyPip,
|
|
18759
|
+
borderWidth: 2,
|
|
18760
|
+
borderColor: lit(index) ? pipRings.filled : pipRings.empty
|
|
18761
|
+
},
|
|
18762
|
+
void 0,
|
|
18763
|
+
`pip-${index}`
|
|
18764
|
+
)
|
|
18765
|
+
)
|
|
18766
|
+
);
|
|
18767
|
+
}
|
|
18768
|
+
function Tag(props) {
|
|
18769
|
+
const filled = props.fill === "filled";
|
|
18770
|
+
return element(
|
|
18771
|
+
"label",
|
|
18772
|
+
{
|
|
18773
|
+
face: "block",
|
|
18774
|
+
fontSize: 12,
|
|
18775
|
+
letterSpacing: 1,
|
|
18776
|
+
uppercase: true,
|
|
18777
|
+
color: filled ? tones.onAccent : tones[props.tone],
|
|
18778
|
+
background: filled ? tones[props.tone] : void 0,
|
|
18779
|
+
borderWidth: 1,
|
|
18780
|
+
borderColor: tones[props.tone],
|
|
18781
|
+
borderRadius: sizes.radius,
|
|
18782
|
+
padding: [4, 8],
|
|
18783
|
+
verticalAlign: "center",
|
|
18784
|
+
...props.style
|
|
18785
|
+
},
|
|
18786
|
+
props.children
|
|
18787
|
+
);
|
|
18788
|
+
}
|
|
18789
|
+
function Banner(props) {
|
|
18790
|
+
const banner = element(
|
|
18791
|
+
"panel",
|
|
18792
|
+
{
|
|
18793
|
+
flow: "down",
|
|
18794
|
+
horizontalAlign: "center",
|
|
18795
|
+
margin: [20, 0, 0, 0],
|
|
18796
|
+
...props.style
|
|
18797
|
+
},
|
|
18798
|
+
[
|
|
18799
|
+
Text({ role: "title", tone: props.tone, children: props.title }),
|
|
18800
|
+
props.detail && Text({ role: "caption", tone: "muted", children: props.detail })
|
|
18801
|
+
]
|
|
18802
|
+
);
|
|
18803
|
+
return arriving(banner, { scale: 0.92 });
|
|
18804
|
+
}
|
|
18805
|
+
function TopStrip(props) {
|
|
18806
|
+
const block2 = [
|
|
18807
|
+
props.heading && Text({
|
|
18808
|
+
role: "label",
|
|
18809
|
+
style: { letterSpacing: 1 },
|
|
18810
|
+
children: props.heading
|
|
18811
|
+
}),
|
|
18812
|
+
Pill({ style: { margin: [4, 0, 0, 0] }, children: props.children })
|
|
18813
|
+
];
|
|
18814
|
+
const line2 = props.line && Text({
|
|
18815
|
+
role: "label",
|
|
18816
|
+
tone: props.lineTone ?? "text",
|
|
18817
|
+
style: { margin: [4, 0, 0, 0], fontSize: 18, letterSpacing: 1 },
|
|
18818
|
+
children: props.line
|
|
18819
|
+
});
|
|
18820
|
+
const column = (top, children) => element(
|
|
18821
|
+
"panel",
|
|
18822
|
+
{ flow: "down", horizontalAlign: "center", margin: [top, 0, 0, 0] },
|
|
18823
|
+
children
|
|
18824
|
+
);
|
|
18825
|
+
if (!props.keepTeamBar) return column(14, [...block2, line2]);
|
|
18826
|
+
return element("panel", { width: "fill", height: "fill" }, [
|
|
18827
|
+
column(teamBarBottom, block2),
|
|
18828
|
+
line2 && column(objectiveBarBottom, line2)
|
|
18829
|
+
]);
|
|
18830
|
+
}
|
|
18831
|
+
function Score2(props) {
|
|
18832
|
+
const [near, far] = props.tones ?? ["accent", "text"];
|
|
18833
|
+
const side = (points, tone) => Text({
|
|
18834
|
+
role: "title",
|
|
18835
|
+
tone,
|
|
18836
|
+
plated: true,
|
|
18837
|
+
style: { margin: [0, 10], horizontalAlign: void 0 },
|
|
18838
|
+
children: `${points}`
|
|
18839
|
+
});
|
|
18840
|
+
return element("panel", { flow: "right", verticalAlign: "center" }, [
|
|
18841
|
+
side(props.points[0], near),
|
|
18842
|
+
Text({
|
|
18843
|
+
role: "title",
|
|
18844
|
+
tone: "muted",
|
|
18845
|
+
plated: true,
|
|
18846
|
+
style: { horizontalAlign: void 0 },
|
|
18847
|
+
children: ":"
|
|
18848
|
+
}),
|
|
18849
|
+
side(props.points[1], far)
|
|
18850
|
+
]);
|
|
18851
|
+
}
|
|
18852
|
+
var rosterDensities = [
|
|
18853
|
+
{
|
|
18854
|
+
portrait: 44,
|
|
18855
|
+
pitch: 52,
|
|
18856
|
+
nameSize: 15,
|
|
18857
|
+
activity: true,
|
|
18858
|
+
badge: 18,
|
|
18859
|
+
columns: 1
|
|
18860
|
+
},
|
|
18861
|
+
{
|
|
18862
|
+
portrait: 32,
|
|
18863
|
+
pitch: 38,
|
|
18864
|
+
nameSize: 15,
|
|
18865
|
+
activity: false,
|
|
18866
|
+
badge: 14,
|
|
18867
|
+
columns: 1
|
|
18868
|
+
},
|
|
18869
|
+
{
|
|
18870
|
+
portrait: 24,
|
|
18871
|
+
pitch: 27,
|
|
18872
|
+
nameSize: 13,
|
|
18873
|
+
activity: false,
|
|
18874
|
+
badge: 0,
|
|
18875
|
+
columns: 3
|
|
18876
|
+
}
|
|
18877
|
+
];
|
|
18878
|
+
var rosterName = 24;
|
|
18879
|
+
var rosterCell = 150;
|
|
18880
|
+
var rosterColumnGap = 12;
|
|
18881
|
+
var rosterHeading = 24;
|
|
18882
|
+
var rosterGroupGap = 10;
|
|
18883
|
+
var rosterGap = 12;
|
|
18884
|
+
var portraits2 = new Map(heroes.map((hero) => [hero.id, hero.portrait]));
|
|
18885
|
+
function rosterKey(groups) {
|
|
18886
|
+
return groups.map(
|
|
18887
|
+
(group) => `${group.key} ${group.title ?? ""} ${group.tone ?? ""} ${group.note ?? ""}
|
|
18888
|
+
${group.rows.map(
|
|
18889
|
+
(row2) => `${row2.key ?? ""} ${row2.self ? "*" : ""}${row2.selected ? "+" : ""}${row2.out ? "-" : ""}${row2.onPress ? ">" : ""}${row2.name} ${row2.hero} ${row2.activity ?? ""} ${row2.steamId ?? ""}`
|
|
18890
|
+
).join("\n")}`
|
|
18891
|
+
).join("\n\n");
|
|
18892
|
+
}
|
|
18893
|
+
function linesOf(rows, columns) {
|
|
18894
|
+
return Math.ceil(rows / columns);
|
|
18895
|
+
}
|
|
18896
|
+
function rosterLayout(groups, height) {
|
|
18897
|
+
const chrome = groups.reduce(
|
|
18898
|
+
(sum, group, index) => sum + (group.title === void 0 ? 0 : rosterHeading) + (index > 0 ? rosterGroupGap : 0),
|
|
18899
|
+
0
|
|
18900
|
+
);
|
|
18901
|
+
for (const density2 of rosterDensities) {
|
|
18902
|
+
for (let columns2 = 1; columns2 <= density2.columns; columns2++) {
|
|
18903
|
+
const lines3 = groups.map((group) => linesOf(group.rows.length, columns2));
|
|
18904
|
+
const total2 = lines3.reduce((sum, count2) => sum + count2, 0);
|
|
18905
|
+
if (chrome + total2 * density2.pitch <= height) {
|
|
18906
|
+
return {
|
|
18907
|
+
density: density2,
|
|
18908
|
+
columns: columns2,
|
|
18909
|
+
lines: lines3,
|
|
18910
|
+
height: chrome + total2 * density2.pitch
|
|
18911
|
+
};
|
|
18912
|
+
}
|
|
18873
18913
|
}
|
|
18874
|
-
this.setCooldown(player, ability);
|
|
18875
|
-
return { victim, thrown };
|
|
18876
|
-
}
|
|
18877
|
-
/** victim is the hero the hook entity holds, or undefined while it holds none. */
|
|
18878
|
-
victim(hookEntity) {
|
|
18879
|
-
const victim = this.read(
|
|
18880
|
-
hookEntity,
|
|
18881
|
-
"CCitadel_Ability_Hook",
|
|
18882
|
-
"m_hHookVictim",
|
|
18883
|
-
"handle"
|
|
18884
|
-
);
|
|
18885
|
-
return typeof victim === "number" ? victim : void 0;
|
|
18886
18914
|
}
|
|
18887
|
-
|
|
18888
|
-
|
|
18889
|
-
|
|
18890
|
-
|
|
18891
|
-
|
|
18915
|
+
const density = rosterDensities[rosterDensities.length - 1];
|
|
18916
|
+
const columns = density.columns;
|
|
18917
|
+
const wanted = groups.map((group) => linesOf(group.rows.length, columns));
|
|
18918
|
+
const lines2 = groups.map(() => 1);
|
|
18919
|
+
let spare = Math.max(groups.length, Math.floor((height - chrome) / density.pitch)) - groups.length;
|
|
18920
|
+
while (spare > 0 && lines2.some((count2, at3) => count2 < wanted[at3])) {
|
|
18921
|
+
for (let at3 = 0; at3 < lines2.length && spare > 0; at3++) {
|
|
18922
|
+
if (lines2[at3] < wanted[at3]) {
|
|
18923
|
+
lines2[at3] = lines2[at3] + 1;
|
|
18924
|
+
spare -= 1;
|
|
18925
|
+
}
|
|
18892
18926
|
}
|
|
18893
|
-
|
|
18894
|
-
|
|
18895
|
-
|
|
18927
|
+
}
|
|
18928
|
+
const total = lines2.reduce((sum, count2) => sum + count2, 0);
|
|
18929
|
+
return { density, columns, lines: lines2, height: chrome + total * density.pitch };
|
|
18930
|
+
}
|
|
18931
|
+
function rosterPlan(props) {
|
|
18932
|
+
const groups = (props.groups ?? [{ key: "players", rows: props.rows ?? [] }]).filter((group) => group.rows.length > 0);
|
|
18933
|
+
if (groups.length === 0) return null;
|
|
18934
|
+
const top = props.top ?? fpsReadoutBottom;
|
|
18935
|
+
const bottom = (props.bottom ?? minimapTop) - rosterGap;
|
|
18936
|
+
return { groups, top, layout: rosterLayout(groups, bottom - top) };
|
|
18937
|
+
}
|
|
18938
|
+
function rosterBottom(props) {
|
|
18939
|
+
const plan = rosterPlan(props);
|
|
18940
|
+
return plan ? plan.top + plan.layout.height : props.top ?? fpsReadoutBottom;
|
|
18941
|
+
}
|
|
18942
|
+
function Roster(props) {
|
|
18943
|
+
const plan = rosterPlan(props);
|
|
18944
|
+
if (!plan) return null;
|
|
18945
|
+
const { groups, top, layout } = plan;
|
|
18946
|
+
return element(
|
|
18947
|
+
"panel",
|
|
18948
|
+
{
|
|
18949
|
+
width: "fit",
|
|
18950
|
+
height: "fit",
|
|
18951
|
+
flow: "down",
|
|
18952
|
+
horizontalAlign: "right",
|
|
18953
|
+
verticalAlign: "top",
|
|
18954
|
+
margin: [top, 24, 0, 0]
|
|
18955
|
+
},
|
|
18956
|
+
groups.map(
|
|
18957
|
+
(group, index) => rosterGroup(group, index, layout, layout.lines[index])
|
|
18958
|
+
)
|
|
18959
|
+
);
|
|
18960
|
+
}
|
|
18961
|
+
function rosterGroup(group, index, layout, lines2) {
|
|
18962
|
+
const { density, columns } = layout;
|
|
18963
|
+
const room = lines2 * columns;
|
|
18964
|
+
const cut = group.rows.length > room;
|
|
18965
|
+
const shown2 = cut ? group.rows.slice(0, room - 1) : group.rows;
|
|
18966
|
+
const cells = shown2.map(
|
|
18967
|
+
(row2, at3) => rosterRow(row2, at3, density, columns > 1)
|
|
18968
|
+
);
|
|
18969
|
+
if (cut) cells.push(rosterRest(group.rows.length - shown2.length, density));
|
|
18970
|
+
const body = columns === 1 ? cells : Array.from(
|
|
18971
|
+
{ length: lines2 },
|
|
18972
|
+
(_, line2) => element(
|
|
18973
|
+
"panel",
|
|
18974
|
+
{ flow: "right", horizontalAlign: "right" },
|
|
18975
|
+
cells.slice(line2 * columns, (line2 + 1) * columns),
|
|
18976
|
+
`line-${line2}`
|
|
18977
|
+
)
|
|
18978
|
+
);
|
|
18979
|
+
const heading = group.title === void 0 ? false : element(
|
|
18980
|
+
"panel",
|
|
18981
|
+
{
|
|
18982
|
+
flow: "right",
|
|
18983
|
+
horizontalAlign: "right",
|
|
18984
|
+
height: rosterHeading
|
|
18985
|
+
},
|
|
18986
|
+
[
|
|
18987
|
+
Text({
|
|
18988
|
+
role: "label",
|
|
18989
|
+
tone: group.tone ?? "muted",
|
|
18990
|
+
style: { letterSpacing: 1, horizontalAlign: void 0 },
|
|
18991
|
+
children: group.title
|
|
18992
|
+
}),
|
|
18993
|
+
group.note !== void 0 && Text({
|
|
18994
|
+
role: "label",
|
|
18995
|
+
tone: "muted",
|
|
18996
|
+
style: { margin: [0, 0, 0, 8], horizontalAlign: void 0 },
|
|
18997
|
+
children: group.note
|
|
18998
|
+
})
|
|
18999
|
+
]
|
|
19000
|
+
);
|
|
19001
|
+
return element(
|
|
19002
|
+
"panel",
|
|
19003
|
+
{
|
|
19004
|
+
flow: "down",
|
|
19005
|
+
horizontalAlign: "right",
|
|
19006
|
+
margin: [index > 0 ? rosterGroupGap : 0, 0, 0, 0]
|
|
19007
|
+
},
|
|
19008
|
+
[heading, ...body],
|
|
19009
|
+
`group-${group.key}`
|
|
19010
|
+
);
|
|
19011
|
+
}
|
|
19012
|
+
function rosterRow(row2, index, density, cell2) {
|
|
19013
|
+
const right = { horizontalAlign: "right", textAlign: "right" };
|
|
19014
|
+
const nameWidth2 = cell2 ? rosterCell - density.portrait - 8 - rosterColumnGap : void 0;
|
|
19015
|
+
const text2 = element(
|
|
19016
|
+
"panel",
|
|
19017
|
+
{ flow: "down", verticalAlign: "center", margin: [0, 8, 0, 0] },
|
|
19018
|
+
[
|
|
19019
|
+
Text({
|
|
19020
|
+
role: "label",
|
|
19021
|
+
tone: row2.out ? "muted" : "text",
|
|
19022
|
+
style: {
|
|
19023
|
+
...right,
|
|
19024
|
+
fontSize: density.nameSize,
|
|
19025
|
+
...nameWidth2 === void 0 ? {} : { width: nameWidth2, noWrap: true, textOverflow: "ellipsis" }
|
|
19026
|
+
},
|
|
19027
|
+
children: clip2(row2.name.toUpperCase(), rosterName)
|
|
19028
|
+
}),
|
|
19029
|
+
density.activity && row2.activity !== void 0 && row2.activity !== "" && Text({
|
|
19030
|
+
role: "caption",
|
|
19031
|
+
tone: "muted",
|
|
19032
|
+
style: { ...right, margin: [1, 0, 0, 0] },
|
|
19033
|
+
children: row2.activity
|
|
19034
|
+
})
|
|
19035
|
+
]
|
|
19036
|
+
);
|
|
19037
|
+
const src = portraits2.get(row2.hero);
|
|
19038
|
+
const picture = src !== void 0 ? [
|
|
19039
|
+
portraitImage(src),
|
|
19040
|
+
density.badge > 0 && row2.steamId !== void 0 && avatarBadge(row2.steamId, density.badge)
|
|
19041
|
+
] : row2.steamId !== void 0 ? [avatarFill(row2.steamId)] : [];
|
|
19042
|
+
const portrait = element(
|
|
19043
|
+
"panel",
|
|
19044
|
+
{
|
|
19045
|
+
width: density.portrait,
|
|
19046
|
+
height: density.portrait,
|
|
19047
|
+
padding: 1,
|
|
19048
|
+
verticalAlign: "center",
|
|
19049
|
+
background: row2.self || row2.selected ? tones.accent : shades.dim
|
|
19050
|
+
},
|
|
19051
|
+
element(
|
|
19052
|
+
"panel",
|
|
19053
|
+
{
|
|
19054
|
+
width: "100%",
|
|
19055
|
+
height: "100%",
|
|
19056
|
+
background: shades.raised,
|
|
19057
|
+
saturation: row2.out ? 0 : 1
|
|
19058
|
+
},
|
|
19059
|
+
picture
|
|
19060
|
+
)
|
|
19061
|
+
);
|
|
19062
|
+
const style = {
|
|
19063
|
+
flow: "right",
|
|
19064
|
+
horizontalAlign: "right",
|
|
19065
|
+
height: density.pitch,
|
|
19066
|
+
opacity: row2.out ? 0.55 : 1,
|
|
19067
|
+
...cell2 ? { width: rosterCell } : {}
|
|
19068
|
+
};
|
|
19069
|
+
const key = `row-${row2.key ?? index}`;
|
|
19070
|
+
const line2 = row2.onPress ? {
|
|
19071
|
+
type: "button",
|
|
19072
|
+
props: {
|
|
19073
|
+
style: {
|
|
19074
|
+
...style,
|
|
19075
|
+
borderRadius: sizes.radius,
|
|
19076
|
+
transition: motion.hover
|
|
19077
|
+
},
|
|
19078
|
+
hover: { background: shades.raised },
|
|
19079
|
+
hoverSound: sounds.hover,
|
|
19080
|
+
sound: sounds.press,
|
|
19081
|
+
onPress: row2.onPress,
|
|
19082
|
+
children: [text2, portrait]
|
|
19083
|
+
},
|
|
19084
|
+
key
|
|
19085
|
+
} : element("panel", style, [text2, portrait], key);
|
|
19086
|
+
return arriving(line2, { translate: [16, 0] });
|
|
19087
|
+
}
|
|
19088
|
+
function rosterRest(count2, density) {
|
|
19089
|
+
return element(
|
|
19090
|
+
"panel",
|
|
19091
|
+
{ height: density.pitch, width: rosterCell, horizontalAlign: "right" },
|
|
19092
|
+
Text({
|
|
19093
|
+
role: "label",
|
|
19094
|
+
tone: "muted",
|
|
19095
|
+
style: {
|
|
19096
|
+
fontSize: density.nameSize,
|
|
19097
|
+
horizontalAlign: "right",
|
|
19098
|
+
verticalAlign: "center",
|
|
19099
|
+
textAlign: "right"
|
|
19100
|
+
},
|
|
19101
|
+
children: `+${count2} more`
|
|
19102
|
+
}),
|
|
19103
|
+
"rest"
|
|
19104
|
+
);
|
|
19105
|
+
}
|
|
19106
|
+
function portraitImage(src) {
|
|
19107
|
+
return {
|
|
19108
|
+
type: "image",
|
|
19109
|
+
props: { src, style: { width: "100%", height: "100%" } }
|
|
19110
|
+
};
|
|
19111
|
+
}
|
|
19112
|
+
function avatarFill(steamId) {
|
|
19113
|
+
return {
|
|
19114
|
+
type: "avatar",
|
|
19115
|
+
props: { steamId, style: { width: "100%", height: "100%" } }
|
|
19116
|
+
};
|
|
19117
|
+
}
|
|
19118
|
+
function avatarBadge(steamId, side) {
|
|
19119
|
+
return {
|
|
19120
|
+
type: "avatar",
|
|
19121
|
+
props: {
|
|
19122
|
+
steamId,
|
|
19123
|
+
style: {
|
|
19124
|
+
width: side,
|
|
19125
|
+
height: side,
|
|
19126
|
+
horizontalAlign: "left",
|
|
19127
|
+
verticalAlign: "bottom",
|
|
19128
|
+
borderRadius: side / 2,
|
|
19129
|
+
borderWidth: 1,
|
|
19130
|
+
borderColor: shades.dim
|
|
19131
|
+
}
|
|
18896
19132
|
}
|
|
19133
|
+
};
|
|
19134
|
+
}
|
|
19135
|
+
var actionLooks = {
|
|
19136
|
+
primary: {
|
|
19137
|
+
idle: { background: tones.text },
|
|
19138
|
+
hover: { background: shades.white },
|
|
19139
|
+
text: shades.ink
|
|
19140
|
+
},
|
|
19141
|
+
secondary: {
|
|
19142
|
+
idle: {
|
|
19143
|
+
background: shades.raised,
|
|
19144
|
+
borderWidth: 1,
|
|
19145
|
+
borderColor: shades.faint
|
|
19146
|
+
},
|
|
19147
|
+
hover: { background: shades.lit, borderColor: tones.text },
|
|
19148
|
+
text: tones.text
|
|
19149
|
+
},
|
|
19150
|
+
quiet: {
|
|
19151
|
+
idle: { background: shades.clear },
|
|
19152
|
+
hover: { background: shades.raised },
|
|
19153
|
+
text: shades.quiet
|
|
18897
19154
|
}
|
|
18898
19155
|
};
|
|
19156
|
+
function Action(props) {
|
|
19157
|
+
const look = actionLooks[props.kind ?? "secondary"];
|
|
19158
|
+
const label = element(
|
|
19159
|
+
"label",
|
|
19160
|
+
{
|
|
19161
|
+
face: "block",
|
|
19162
|
+
fontSize: 16,
|
|
19163
|
+
uppercase: true,
|
|
19164
|
+
letterSpacing: 1,
|
|
19165
|
+
color: look.text,
|
|
19166
|
+
horizontalAlign: "center",
|
|
19167
|
+
verticalAlign: "center",
|
|
19168
|
+
noWrap: true
|
|
19169
|
+
},
|
|
19170
|
+
props.children
|
|
19171
|
+
);
|
|
19172
|
+
return {
|
|
19173
|
+
type: "button",
|
|
19174
|
+
props: {
|
|
19175
|
+
style: {
|
|
19176
|
+
height: sizes.control,
|
|
19177
|
+
padding: [0, 14],
|
|
19178
|
+
borderRadius: sizes.radius,
|
|
19179
|
+
transition: motion.hover,
|
|
19180
|
+
...look.idle,
|
|
19181
|
+
...props.disabled ? { opacity: 0.4 } : {},
|
|
19182
|
+
...props.style
|
|
19183
|
+
},
|
|
19184
|
+
hover: props.disabled ? void 0 : look.hover,
|
|
19185
|
+
hoverSound: props.disabled ? void 0 : sounds.hover,
|
|
19186
|
+
sound: sounds.press,
|
|
19187
|
+
disabled: props.disabled,
|
|
19188
|
+
onPress: props.onPress,
|
|
19189
|
+
children: label
|
|
19190
|
+
}
|
|
19191
|
+
};
|
|
19192
|
+
}
|
|
19193
|
+
function Meter(props) {
|
|
19194
|
+
const height = props.height ?? 8;
|
|
19195
|
+
const value = Math.min(1, Math.max(0, props.value));
|
|
19196
|
+
return element(
|
|
19197
|
+
"panel",
|
|
19198
|
+
{
|
|
19199
|
+
width: props.width ?? 160,
|
|
19200
|
+
height,
|
|
19201
|
+
background: shades.raised,
|
|
19202
|
+
borderRadius: height / 2,
|
|
19203
|
+
overflow: "clip",
|
|
19204
|
+
...props.style
|
|
19205
|
+
},
|
|
19206
|
+
// The fill scales rather than resizes, so it eases without layout work.
|
|
19207
|
+
element("panel", {
|
|
19208
|
+
width: "100%",
|
|
19209
|
+
height: "100%",
|
|
19210
|
+
background: tones[props.tone ?? "accent"],
|
|
19211
|
+
scale: [value, 1],
|
|
19212
|
+
origin: [0, 50],
|
|
19213
|
+
transition: motion.meter
|
|
19214
|
+
})
|
|
19215
|
+
);
|
|
19216
|
+
}
|
|
18899
19217
|
|
|
18900
19218
|
// js/src/frameclock.ts
|
|
18901
19219
|
var now3 = () => performance.now();
|
|
@@ -18982,12 +19300,12 @@ var frameClock = new FrameClock();
|
|
|
18982
19300
|
function ground(point, {
|
|
18983
19301
|
above = 64,
|
|
18984
19302
|
below = 1024,
|
|
18985
|
-
layers = Layers.solid | Layers.playerClip
|
|
19303
|
+
layers: layers2 = Layers.solid | Layers.playerClip
|
|
18986
19304
|
} = {}) {
|
|
18987
19305
|
const hit = trace({
|
|
18988
19306
|
start: { ...point, z: point.z + above },
|
|
18989
19307
|
end: { ...point, z: point.z - below },
|
|
18990
|
-
layers
|
|
19308
|
+
layers: layers2
|
|
18991
19309
|
});
|
|
18992
19310
|
return hit && !hit.startSolid ? hit.position : void 0;
|
|
18993
19311
|
}
|
|
@@ -21929,6 +22247,7 @@ export {
|
|
|
21929
22247
|
readField,
|
|
21930
22248
|
readFieldList,
|
|
21931
22249
|
readFile,
|
|
22250
|
+
readFileBytes,
|
|
21932
22251
|
readModifierField,
|
|
21933
22252
|
remapInput,
|
|
21934
22253
|
removeEntities,
|
|
@@ -21939,8 +22258,8 @@ export {
|
|
|
21939
22258
|
restoreHero,
|
|
21940
22259
|
restoreNpcs,
|
|
21941
22260
|
rift,
|
|
22261
|
+
rosterBottom,
|
|
21942
22262
|
rosterKey,
|
|
21943
|
-
rosterRows,
|
|
21944
22263
|
route,
|
|
21945
22264
|
sequence,
|
|
21946
22265
|
serve,
|