@modlock/modlock 0.1.64 → 0.1.68
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/console.d.ts +44 -0
- package/curve.d.ts +18 -9
- package/entities.d.ts +10000 -9169
- package/entities.js +29879 -8910
- package/host.gen.d.ts +96 -15
- package/index.d.ts +2 -1
- package/index.js +627 -95
- package/item-id.d.ts +2 -0
- package/items.d.ts +24 -0
- package/items.gen.d.ts +3 -0
- package/package.json +6 -6
- package/timer.d.ts +2 -1
- package/ui.d.ts +31 -7
package/item-id.d.ts
ADDED
package/items.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export { itemId } from './item-id.js';
|
|
2
|
+
/** Slot is the shop tab an item sits on. */
|
|
3
|
+
export type Slot = 'weapon' | 'vitality' | 'spirit';
|
|
4
|
+
/** Item is one of the shop's items. */
|
|
5
|
+
export interface Item {
|
|
6
|
+
/** name is the item's class name, which giveItem takes. */
|
|
7
|
+
readonly name: string;
|
|
8
|
+
/** id is the game's id of the item. */
|
|
9
|
+
readonly id: number;
|
|
10
|
+
/** slot is the shop tab the item sits on. */
|
|
11
|
+
readonly slot: Slot;
|
|
12
|
+
/** tier is the item's tier, 1 to 4. */
|
|
13
|
+
readonly tier: number;
|
|
14
|
+
/** active is true for an item the player casts. */
|
|
15
|
+
readonly active: boolean;
|
|
16
|
+
/** imbue is true for an item that strengthens an ability it is put on. */
|
|
17
|
+
readonly imbue: boolean;
|
|
18
|
+
/** icon is the item's shop icon, as an image's src. */
|
|
19
|
+
readonly icon: string;
|
|
20
|
+
}
|
|
21
|
+
/** items are the shop's items, by class name. */
|
|
22
|
+
export declare const items: readonly Item[];
|
|
23
|
+
/** item returns the shop's item with class name, or undefined. */
|
|
24
|
+
export declare function item(name: string): Item | undefined;
|
package/items.gen.d.ts
ADDED
package/package.json
CHANGED
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"name": "@modlock/modlock",
|
|
9
9
|
"optionalDependencies": {
|
|
10
|
-
"@modlock/darwin-arm64": "0.1.
|
|
11
|
-
"@modlock/darwin-x64": "0.1.
|
|
12
|
-
"@modlock/linux-arm64": "0.1.
|
|
13
|
-
"@modlock/linux-x64": "0.1.
|
|
14
|
-
"@modlock/win32-x64": "0.1.
|
|
10
|
+
"@modlock/darwin-arm64": "0.1.68",
|
|
11
|
+
"@modlock/darwin-x64": "0.1.68",
|
|
12
|
+
"@modlock/linux-arm64": "0.1.68",
|
|
13
|
+
"@modlock/linux-x64": "0.1.68",
|
|
14
|
+
"@modlock/win32-x64": "0.1.68"
|
|
15
15
|
},
|
|
16
16
|
"repository": {
|
|
17
17
|
"type": "git",
|
|
@@ -20,5 +20,5 @@
|
|
|
20
20
|
"sideEffects": false,
|
|
21
21
|
"type": "module",
|
|
22
22
|
"types": "index.d.ts",
|
|
23
|
-
"version": "0.1.
|
|
23
|
+
"version": "0.1.68"
|
|
24
24
|
}
|
package/timer.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export declare function every(seconds: number, fn: () => void): Timer;
|
|
|
17
17
|
export declare function sequence(fn: (run: number) => number | void): Timer;
|
|
18
18
|
/**
|
|
19
19
|
* advance moves the clock to a frame and runs the timers that came due. A
|
|
20
|
-
* callback that throws ends only its own timer.
|
|
20
|
+
* callback that throws ends only its own timer. A clock that runs backward,
|
|
21
|
+
* as a new map's does, keeps each timer's remaining delay.
|
|
21
22
|
*/
|
|
22
23
|
export declare function advance(seconds: number): void;
|
package/ui.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Player } from './host.gen.js';
|
|
1
|
+
import type { Player, Wheel } from './host.gen.js';
|
|
2
2
|
/**
|
|
3
3
|
* Length is a size: pixels, a percentage of the parent, 'fit' to size to the
|
|
4
4
|
* children, or 'fill' to share the space left in the parent's flow.
|
|
@@ -163,7 +163,7 @@ export interface Style {
|
|
|
163
163
|
* with its hints and district name, 'abilities' the ability and active item
|
|
164
164
|
* bar. Whatever a part does not name stays, such as the crosshair and chat.
|
|
165
165
|
*/
|
|
166
|
-
export type HudPart = 'levelUp' | 'ownHealth' | 'topBar' | 'ammo' | 'souls' | 'minimap' | 'abilities';
|
|
166
|
+
export type HudPart = 'levelUp' | 'ownHealth' | 'topBar' | 'ammo' | 'souls' | 'minimap' | 'abilities' | 'status';
|
|
167
167
|
/** Child is anything an element may hold. Text becomes a label. */
|
|
168
168
|
export type Child = UiElement | string | number | boolean | null | undefined | readonly Child[];
|
|
169
169
|
/** Component returns the elements that stand for its props. */
|
|
@@ -177,6 +177,16 @@ export interface UiElement {
|
|
|
177
177
|
readonly props: Props;
|
|
178
178
|
readonly key?: string;
|
|
179
179
|
}
|
|
180
|
+
/**
|
|
181
|
+
* ChangeHandler is the handler of any input: it takes the value the control
|
|
182
|
+
* holds, whose type each element's props narrow. The method form makes the
|
|
183
|
+
* parameter bivariant, so a handler of a text, a number or a flag fits, and
|
|
184
|
+
* the host checks the value against the handler's own type when it calls; a
|
|
185
|
+
* parameter of type never would refuse every value in a scriptc build.
|
|
186
|
+
*/
|
|
187
|
+
type ChangeHandler = {
|
|
188
|
+
bivarianceHack(player: Player, value: unknown): void;
|
|
189
|
+
}['bivarianceHack'];
|
|
180
190
|
/**
|
|
181
191
|
* Props are an element's props: every intrinsic element's, by name, so the
|
|
182
192
|
* encoder reads them as typed fields. A component's props pass through to it.
|
|
@@ -186,6 +196,7 @@ export interface Props {
|
|
|
186
196
|
readonly style?: Style;
|
|
187
197
|
readonly hover?: Style;
|
|
188
198
|
readonly tooltip?: string;
|
|
199
|
+
readonly item?: string;
|
|
189
200
|
readonly hoverSound?: string;
|
|
190
201
|
readonly children?: Child;
|
|
191
202
|
readonly src?: string;
|
|
@@ -211,14 +222,17 @@ export interface Props {
|
|
|
211
222
|
readonly on?: boolean;
|
|
212
223
|
readonly options?: readonly string[];
|
|
213
224
|
readonly selected?: number;
|
|
214
|
-
readonly onChange?:
|
|
225
|
+
readonly onChange?: ChangeHandler;
|
|
226
|
+
readonly onWheel?: (player: Player, wheel: Wheel) => void;
|
|
215
227
|
}
|
|
216
228
|
/**
|
|
217
229
|
* ElementProps are the props every drawn element takes. hover is the style
|
|
218
230
|
* drawn over style while the pointer is over the element; tooltip is the text
|
|
219
|
-
* the game's tooltip shows then,
|
|
220
|
-
*
|
|
221
|
-
*
|
|
231
|
+
* the game's tooltip shows then, item names an item by class name, such as
|
|
232
|
+
* 'upgrade_ability_power_shard', whose shop card shows instead, and
|
|
233
|
+
* hoverSound is the game's sound event played as the pointer enters, such as
|
|
234
|
+
* 'UI.MainMenu.Hover'. An element with any of them takes the pointer, so the
|
|
235
|
+
* game behind it does not.
|
|
222
236
|
*/
|
|
223
237
|
export interface ElementProps {
|
|
224
238
|
/** class names the element's classes in the mod's sheets, separated by spaces. */
|
|
@@ -226,6 +240,7 @@ export interface ElementProps {
|
|
|
226
240
|
style?: Style;
|
|
227
241
|
hover?: Style;
|
|
228
242
|
tooltip?: string;
|
|
243
|
+
item?: string;
|
|
229
244
|
hoverSound?: string;
|
|
230
245
|
/** enter is the style the element's panel starts from when it first shows. */
|
|
231
246
|
enter?: Style;
|
|
@@ -289,6 +304,8 @@ export interface SliderProps extends InputProps {
|
|
|
289
304
|
max?: number;
|
|
290
305
|
step?: number;
|
|
291
306
|
onChange?: (player: Player, value: number) => void;
|
|
307
|
+
/** onWheel receives one wheel step and its pointer anchor while enabled. */
|
|
308
|
+
onWheel?: (player: Player, wheel: Wheel) => void;
|
|
292
309
|
}
|
|
293
310
|
/** ToggleProps make a box the player checks, labeled by its text children. */
|
|
294
311
|
export interface ToggleProps extends InputProps {
|
|
@@ -393,6 +410,12 @@ export declare function show(player: Player, root: Child): boolean;
|
|
|
393
410
|
* an empty list shows them all again.
|
|
394
411
|
*/
|
|
395
412
|
export declare function hideHud(player: Player, parts: readonly HudPart[]): boolean;
|
|
413
|
+
/**
|
|
414
|
+
* freeCursor shows player's mouse cursor without Tab held while free is true,
|
|
415
|
+
* so they can click the mod's panels, such as a pick screen; false gives the
|
|
416
|
+
* mouse back to aiming.
|
|
417
|
+
*/
|
|
418
|
+
export declare function freeCursor(player: Player, free: boolean): boolean;
|
|
396
419
|
/**
|
|
397
420
|
* sheet adds the style sheet at path in the mod's content styles directory,
|
|
398
421
|
* such as 'hud.css', to every interface the mod shows, after the sheets added
|
|
@@ -423,6 +446,7 @@ export declare function press(player: Player, node: string): void;
|
|
|
423
446
|
* change runs the handler of the input the player changed, with its value as
|
|
424
447
|
* the host checked it.
|
|
425
448
|
*/
|
|
426
|
-
export declare function change(player: Player, node: string, value: string | number | boolean | undefined): void;
|
|
449
|
+
export declare function change(player: Player, node: string, value: string | number | boolean | Wheel | undefined): void;
|
|
427
450
|
/** tick advances the clock to the frame at seconds and fades expiring notices. */
|
|
428
451
|
export declare function tick(seconds: number): void;
|
|
452
|
+
export {};
|