@modlock/modlock 0.1.64 → 0.1.67

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/item-id.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ /** itemId returns the game's id of the item with class name, such as 'upgrade_ability_power_shard'. */
2
+ export declare function itemId(name: string): number;
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
@@ -0,0 +1,3 @@
1
+ import type { Item } from './items.js';
2
+ /** itemTable lists the shop's items by class name. */
3
+ export declare const itemTable: readonly Item[];
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.64",
11
- "@modlock/darwin-x64": "0.1.64",
12
- "@modlock/linux-arm64": "0.1.64",
13
- "@modlock/linux-x64": "0.1.64",
14
- "@modlock/win32-x64": "0.1.64"
10
+ "@modlock/darwin-arm64": "0.1.67",
11
+ "@modlock/darwin-x64": "0.1.67",
12
+ "@modlock/linux-arm64": "0.1.67",
13
+ "@modlock/linux-x64": "0.1.67",
14
+ "@modlock/win32-x64": "0.1.67"
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.64"
23
+ "version": "0.1.67"
24
24
  }
package/ui.d.ts CHANGED
@@ -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. */
@@ -186,6 +186,7 @@ export interface Props {
186
186
  readonly style?: Style;
187
187
  readonly hover?: Style;
188
188
  readonly tooltip?: string;
189
+ readonly item?: string;
189
190
  readonly hoverSound?: string;
190
191
  readonly children?: Child;
191
192
  readonly src?: string;
@@ -216,9 +217,11 @@ export interface Props {
216
217
  /**
217
218
  * ElementProps are the props every drawn element takes. hover is the style
218
219
  * drawn over style while the pointer is over the element; tooltip is the text
219
- * the game's tooltip shows then, and hoverSound the game's sound event played
220
- * as the pointer enters, such as 'UI.MainMenu.Hover'. An element with any of
221
- * them takes the pointer, so the game behind it does not.
220
+ * the game's tooltip shows then, item names an item by class name, such as
221
+ * 'upgrade_ability_power_shard', whose shop card shows instead, and
222
+ * hoverSound is the game's sound event played as the pointer enters, such as
223
+ * 'UI.MainMenu.Hover'. An element with any of them takes the pointer, so the
224
+ * game behind it does not.
222
225
  */
223
226
  export interface ElementProps {
224
227
  /** class names the element's classes in the mod's sheets, separated by spaces. */
@@ -226,6 +229,7 @@ export interface ElementProps {
226
229
  style?: Style;
227
230
  hover?: Style;
228
231
  tooltip?: string;
232
+ item?: string;
229
233
  hoverSound?: string;
230
234
  /** enter is the style the element's panel starts from when it first shows. */
231
235
  enter?: Style;
@@ -393,6 +397,12 @@ export declare function show(player: Player, root: Child): boolean;
393
397
  * an empty list shows them all again.
394
398
  */
395
399
  export declare function hideHud(player: Player, parts: readonly HudPart[]): boolean;
400
+ /**
401
+ * freeCursor shows player's mouse cursor without Tab held while free is true,
402
+ * so they can click the mod's panels, such as a pick screen; false gives the
403
+ * mouse back to aiming.
404
+ */
405
+ export declare function freeCursor(player: Player, free: boolean): boolean;
396
406
  /**
397
407
  * sheet adds the style sheet at path in the mod's content styles directory,
398
408
  * such as 'hud.css', to every interface the mod shows, after the sheets added