@modlock/modlock 0.1.88 → 0.1.90
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/bystander.d.ts +23 -0
- package/chat.d.ts +28 -0
- package/index.d.ts +11 -2
- package/index.js +2238 -2050
- package/package.json +6 -6
- package/ui.d.ts +30 -3
package/bystander.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type Angles, type Player, type Vector } from './host.gen.js';
|
|
1
2
|
/** bystanderStates are the modifier states that keep a hero out of play. */
|
|
2
3
|
export declare const bystanderStates: readonly string[];
|
|
3
4
|
/**
|
|
@@ -7,3 +8,25 @@ export declare const bystanderStates: readonly string[];
|
|
|
7
8
|
* state did not take, such as on a pawn that is gone.
|
|
8
9
|
*/
|
|
9
10
|
export declare function holdBystander(entity: number, active?: boolean): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* parkedStates hide a parked hero on top of bystanderStates: no model, no
|
|
13
|
+
* health bar or name, no minimap icon, and no out of play area check, so the
|
|
14
|
+
* game leaves a hero hanging above the map alone.
|
|
15
|
+
*/
|
|
16
|
+
export declare const parkedStates: readonly string[];
|
|
17
|
+
/**
|
|
18
|
+
* parkHeight is how far above where it stood spectateFrom parks a hero, above
|
|
19
|
+
* the roofs of a map and out of every hero's reach.
|
|
20
|
+
*/
|
|
21
|
+
export declare const parkHeight = 4000;
|
|
22
|
+
/**
|
|
23
|
+
* spectateFrom takes the player's hero out of play and out of sight, and gives
|
|
24
|
+
* the player the free camera from position. The hero is held as a bystander,
|
|
25
|
+
* hidden by parkedStates, moved parkHeight above where it stood (or to park)
|
|
26
|
+
* and frozen there, where gravity does not pull it, so it works on any map.
|
|
27
|
+
* It returns a function that ends the view: it returns the player to their
|
|
28
|
+
* hero, releases the hold and the freeze and puts the hero back where it
|
|
29
|
+
* stood. A mod that respawns or moves the hero itself may skip the move back
|
|
30
|
+
* with back(false). It returns undefined when the player has no hero.
|
|
31
|
+
*/
|
|
32
|
+
export declare function spectateFrom(player: Player, position: Vector, facing: Angles, park?: Vector): ((restore?: boolean) => void) | undefined;
|
package/chat.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ChatEvent, Player } from './host.gen.js';
|
|
2
|
+
import type { Child } from './ui.js';
|
|
3
|
+
/** ChatLinesOptions shape the lines showChatLines draws. */
|
|
4
|
+
export interface ChatLinesOptions {
|
|
5
|
+
/** seconds is how long a line stays up; 6 unless set. */
|
|
6
|
+
readonly seconds?: number;
|
|
7
|
+
/** top is the lines' top margin, as Roster's, to clear the mod's own HUD. */
|
|
8
|
+
readonly top?: number;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* showChatLines shows each player's chat lines beside their hero portrait at
|
|
12
|
+
* the top right, for every player, for as long as the mod runs. Call it when
|
|
13
|
+
* the mod loads, as with onChat, so the server sends the mod its chat.
|
|
14
|
+
*/
|
|
15
|
+
export declare function showChatLines(options?: ChatLinesOptions): void;
|
|
16
|
+
/** chatShown reports whether the mod shows chat lines. */
|
|
17
|
+
export declare function chatShown(): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* hearChat keeps line, written at now, and reports whether the lines changed.
|
|
20
|
+
* It keeps nothing while the mod shows no chat lines.
|
|
21
|
+
*/
|
|
22
|
+
export declare function hearChat(line: ChatEvent, now: number): boolean;
|
|
23
|
+
/** expireChat drops the lines past their time and reports whether any went. */
|
|
24
|
+
export declare function expireChat(now: number): boolean;
|
|
25
|
+
/** forgetChat drops the line of the player who left slot, reporting whether one went. */
|
|
26
|
+
export declare function forgetChat(slot: number): boolean;
|
|
27
|
+
/** chatLines draws the fresh lines viewer may read, newest at the top. */
|
|
28
|
+
export declare function chatLines(viewer: Player): Child;
|
package/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference path="./globals.d.ts" />
|
|
2
2
|
import { type AbilityCastEvent, type KillEvent, type DamageEvent, type ChatEvent, type DamagedEvent, type DamageResult, type FrameEvent, type HealEvent, type ImpactEvent, type LandedEvent, type LaunchEvent, type LevelEvent, type MeleeEvent, type ModifierFiredEvent, type ParryEvent, type Pawn, Player, type PlayerJoinedEvent, type PlayerLeftEvent } from './host.gen.js';
|
|
3
|
+
import { type StragglersOptions } from './stragglers.js';
|
|
3
4
|
export * as vector from './vector.js';
|
|
4
5
|
export { Buttons, Layers } from './bits.js';
|
|
5
6
|
export { callServiceLater, type ServiceDone } from './service-later.js';
|
|
@@ -20,9 +21,10 @@ export { ground, type GroundOptions } from './ground.js';
|
|
|
20
21
|
export { RaceGate, type RaceGateOptions, raceGateResources, } from './racegate.js';
|
|
21
22
|
export { connection, players } from './players.js';
|
|
22
23
|
export { afterMatch, fewestPlayed, leaderboard, leastUsed, nextMatch, ratingChange, ratingStep, settle, type Standing, Standings, startingRating, } from './rotation.js';
|
|
23
|
-
export { bystanderStates, holdBystander } from './bystander.js';
|
|
24
|
+
export { bystanderStates, holdBystander, parkedStates, parkHeight, spectateFrom, } from './bystander.js';
|
|
24
25
|
export { Strays, strayGraceSeconds } from './strays.js';
|
|
25
26
|
export { Stragglers, stragglerConnectSeconds, type StragglersOptions, } from './stragglers.js';
|
|
27
|
+
export { type ChatLinesOptions, showChatLines } from './chat.js';
|
|
26
28
|
export { type Check, ProbeRun } from './probe.js';
|
|
27
29
|
export { poseAt, type Pose, Puppet, type PuppetOptions, type PuppetState, ghostStates, ticksPerSecond, type Track, trackTicks, } from './puppet.js';
|
|
28
30
|
export { type HeroSnapshot, restoreHero } from './restore.js';
|
|
@@ -31,7 +33,7 @@ export { type CatalogEntry, Dropper, dropperButtons } from './dropper.js';
|
|
|
31
33
|
export { persist, type PersistChange, type PersistChanges, type PersistDone, type PersistOptions, type PersistRead, type PersistRecord, type PersistValue, } from './persist.js';
|
|
32
34
|
export { bindScorePlayer, type BoardPage, type BoardRead, type BoardRow, type BoardWindow, type MatchPlace, readBoard, reportMatch, reportScore, type ScoreDone, type ScoreOptions, type ScorePlayer, } from './scores.js';
|
|
33
35
|
export { decodeSpot, encodeSpot, LoadedSpot, loadSpot, type Placed, type Spot, type SpotObject, triggers, } from './spot.js';
|
|
34
|
-
export { type ButtonProps, type Child, type Component, type Edges, type ElementProps, Fragment, type Gradient, type HeroLookName, type HeroProps, hide, hideHud, cursorFree, freeCursor, abilityBarPresses, type AbilityBarHandler, abilityDisplay, type AbilityRow, type ShownAbility, type HudPart, type ImageProps, type JSX, jsx, jsxs, type LabelProps, type LayoutProps, type Length, type Overflow, type PanelProps, route, type Scaling, type Shadow, sheet, show, type Style, toast, type Transition, type UiElement, uiSound, } from './ui.js';
|
|
36
|
+
export { type ButtonProps, type Child, type Component, type Edges, type ElementProps, Fragment, type Gradient, type HeroLookName, type HeroProps, hide, hideHud, hideHudForAll, cursorFree, freeCursor, abilityBarPresses, type AbilityBarHandler, abilityDisplay, type AbilityRow, type ShownAbility, type HudPart, type ImageProps, type JSX, jsx, jsxs, type LabelProps, type LayoutProps, type Length, type Overflow, type PanelProps, route, type Scaling, type Shadow, sheet, show, type Style, toast, type Transition, type UiElement, uiSound, } from './ui.js';
|
|
35
37
|
/** LogPart is a value log writes as text. */
|
|
36
38
|
export type LogPart = string | number | bigint | boolean | null | undefined;
|
|
37
39
|
/**
|
|
@@ -131,6 +133,13 @@ declare module './host.gen.js' {
|
|
|
131
133
|
* game again.
|
|
132
134
|
*/
|
|
133
135
|
export declare function setRespawnDelay(seconds?: number): void;
|
|
136
|
+
/**
|
|
137
|
+
* sweepStragglers runs a Stragglers sweep each frame for as long as the mod
|
|
138
|
+
* runs: it kicks a human still joining after options.connectSeconds and lays
|
|
139
|
+
* down each hero no player holds, such as the hero of a player who left.
|
|
140
|
+
* Only the first call's options apply.
|
|
141
|
+
*/
|
|
142
|
+
export declare function sweepStragglers(options?: StragglersOptions): void;
|
|
134
143
|
/** onFrame calls handler once per server frame. */
|
|
135
144
|
export declare function onFrame(handler: (frame: FrameEvent) => void): void;
|
|
136
145
|
/**
|