afnm-types 0.6.52 → 0.6.53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/GameScreen.d.ts +1 -0
- package/dist/avatarEffects.d.ts +4 -3
- package/dist/avatarEffects.js +5 -4
- package/dist/cli/extract-mod-translations/index.js +1 -1
- package/dist/cli/extract-translations/reporters.js +34 -32
- package/dist/components.d.ts +19 -1
- package/dist/craftingState.d.ts +1 -1
- package/dist/dualCultivation.d.ts +6 -6
- package/dist/dualCultivation.js +3 -3
- package/dist/entity.js +8 -1
- package/dist/gameVersion.d.ts +1 -1
- package/dist/gameVersion.js +1 -1
- package/dist/mod.d.ts +115 -32
- package/dist/reduxState.d.ts +2 -1
- package/package.json +1 -1
- package/dist/itemAction.d.ts +0 -33
- package/dist/itemAction.js +0 -1
- package/dist/manual.d.ts +0 -8
- package/dist/manual.js +0 -1
- package/dist/typeTests.d.ts +0 -9
package/dist/GameScreen.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
1
|
export type GameScreen = 'location' | 'recipe' | 'mission' | 'craftingHall' | 'manual' | 'cultivation' | 'map' | 'healer' | 'market' | 'favour' | 'herbField' | 'mine' | 'recipeLibrary' | 'requestBoard' | 'compendium' | 'library' | 'altar' | 'research' | 'reforge' | 'pillarGrid' | 'fallenStar' | 'trainingGround' | 'tenThousandFlames' | 'lifeScreen' | 'soulShardDelve' | 'enchantmentShop' | 'challengeBoard';
|
|
2
|
+
export type ScreenType = GameScreen | 'newgame' | 'combat' | 'crafting' | 'dualCultivation' | 'event' | 'auction' | 'mysticalRegion' | 'tournament' | 'house' | 'guild' | 'stoneCutting' | 'fallenStar' | 'soulShardDelve';
|
package/dist/avatarEffects.d.ts
CHANGED
|
@@ -10,9 +10,10 @@
|
|
|
10
10
|
export type AvatarEffectId = 'glitch';
|
|
11
11
|
export interface AvatarEffectShader {
|
|
12
12
|
/**
|
|
13
|
-
* Fragment shader source
|
|
14
|
-
*
|
|
15
|
-
* u_canvasAspect
|
|
13
|
+
* Fragment shader source (GLSL ES 3.00, must begin with `#version 300 es`).
|
|
14
|
+
* Must accept the same uniforms as the base shader: u_texA, u_texB, u_mix,
|
|
15
|
+
* u_aspectA, u_aspectB, u_canvasAspect, u_time (seconds since effect started).
|
|
16
|
+
* Use `in vec2 v_uv` and `out vec4 fragColor` instead of the ES 1.00 forms.
|
|
16
17
|
*/
|
|
17
18
|
fragSrc: string;
|
|
18
19
|
}
|
package/dist/avatarEffects.js
CHANGED
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
// Replicates the hand-authored glitch art style: strong persistent chromatic
|
|
12
12
|
// aberration (cyan/magenta fringing always visible), periodic brightness
|
|
13
13
|
// washout, and horizontal scanline tears during burst events.
|
|
14
|
-
const GLITCH_FRAG_SRC =
|
|
14
|
+
const GLITCH_FRAG_SRC = `#version 300 es
|
|
15
15
|
precision mediump float;
|
|
16
|
-
|
|
16
|
+
in vec2 v_uv;
|
|
17
17
|
uniform sampler2D u_texA;
|
|
18
18
|
uniform sampler2D u_texB;
|
|
19
19
|
uniform float u_mix;
|
|
@@ -21,6 +21,7 @@ uniform float u_aspectA;
|
|
|
21
21
|
uniform float u_aspectB;
|
|
22
22
|
uniform float u_canvasAspect;
|
|
23
23
|
uniform float u_time;
|
|
24
|
+
out vec4 fragColor;
|
|
24
25
|
|
|
25
26
|
float hash(float n) {
|
|
26
27
|
return fract(sin(n) * 43758.5453);
|
|
@@ -39,7 +40,7 @@ vec4 sampleContain(sampler2D tex, vec2 uv, float texAspect) {
|
|
|
39
40
|
if (mapped.x < 0.0 || mapped.x > 1.0 || mapped.y < 0.0 || mapped.y > 1.0) {
|
|
40
41
|
return vec4(0.0);
|
|
41
42
|
}
|
|
42
|
-
return
|
|
43
|
+
return texture(tex, mapped);
|
|
43
44
|
}
|
|
44
45
|
|
|
45
46
|
void main() {
|
|
@@ -86,7 +87,7 @@ void main() {
|
|
|
86
87
|
float blowout = decay * 0.45;
|
|
87
88
|
col.rgb = mix(col.rgb, vec3(1.0), blowout * col.a);
|
|
88
89
|
|
|
89
|
-
|
|
90
|
+
fragColor = col;
|
|
90
91
|
}`;
|
|
91
92
|
// ─── Registry ─────────────────────────────────────────────────────────────────
|
|
92
93
|
/**
|
|
@@ -326,7 +326,7 @@ async function main() {
|
|
|
326
326
|
console.log(`Template-ready strings : ${templateStrings.length}`);
|
|
327
327
|
// Generate hierarchical template
|
|
328
328
|
console.log('\nGenerating translation template...');
|
|
329
|
-
const template = (0, reporters_js_1.generateHierarchicalTemplate)(templateStrings);
|
|
329
|
+
const template = (0, reporters_js_1.generateHierarchicalTemplate)(templateStrings, undefined, undefined, false);
|
|
330
330
|
const sortedTemplate = deepSortObject(template);
|
|
331
331
|
const stringCount = countHierarchicalStrings(sortedTemplate);
|
|
332
332
|
console.log(` ${stringCount} unique translatable entries found.`);
|
|
@@ -243,7 +243,7 @@ function findMinimalUniquePaths(paths) {
|
|
|
243
243
|
* - If different texts have same simple field -> use minimal unique path prefix
|
|
244
244
|
* - If text is unique for its simple field -> just use simple field
|
|
245
245
|
*/
|
|
246
|
-
function generateHierarchicalTemplate(allStrings, techniqueTooltipsData, textsRequiringContext) {
|
|
246
|
+
function generateHierarchicalTemplate(allStrings, techniqueTooltipsData, textsRequiringContext, includeRootPatterns = true) {
|
|
247
247
|
const template = {};
|
|
248
248
|
const intermediate = new Map();
|
|
249
249
|
// Helper to add entry to intermediate structure
|
|
@@ -637,37 +637,39 @@ function generateHierarchicalTemplate(allStrings, techniqueTooltipsData, textsRe
|
|
|
637
637
|
}
|
|
638
638
|
}
|
|
639
639
|
}
|
|
640
|
-
// Add hardcoded patterns to a special category
|
|
641
|
-
if (
|
|
642
|
-
template['_patterns']
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
template['_patterns']['hardcoded']
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
template['_patterns']['conditions']
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
template['_patterns']['requirements']
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
640
|
+
// Add hardcoded patterns to a special category (only when extracting for the game, not for mods)
|
|
641
|
+
if (includeRootPatterns) {
|
|
642
|
+
if (!template['_patterns']) {
|
|
643
|
+
template['_patterns'] = {};
|
|
644
|
+
}
|
|
645
|
+
if (!template['_patterns']['hardcoded']) {
|
|
646
|
+
template['_patterns']['hardcoded'] = {};
|
|
647
|
+
}
|
|
648
|
+
// Add stack-related strings
|
|
649
|
+
template['_patterns']['hardcoded']['[word] stack'] = '';
|
|
650
|
+
template['_patterns']['hardcoded']['[word] stacks'] = '';
|
|
651
|
+
// Add dynamic template patterns
|
|
652
|
+
for (const tmpl of config_js_1.HARDCODED_TEMPLATE_PATTERNS) {
|
|
653
|
+
template['_patterns']['hardcoded'][`[template] ${tmpl}`] = '';
|
|
654
|
+
}
|
|
655
|
+
// Add condition words
|
|
656
|
+
if (!template['_patterns']['conditions']) {
|
|
657
|
+
template['_patterns']['conditions'] = {};
|
|
658
|
+
}
|
|
659
|
+
for (const word of config_js_1.CONDITION_WORDS) {
|
|
660
|
+
template['_patterns']['conditions'][`[word] ${word}`] = '';
|
|
661
|
+
}
|
|
662
|
+
// Add condition template strings from describeTechniqueCondition.ts and describeCraftingTechniqueCondition.ts
|
|
663
|
+
for (const tmpl of config_js_1.CONDITION_TEMPLATES) {
|
|
664
|
+
template['_patterns']['conditions'][`[condition] ${tmpl}`] = '';
|
|
665
|
+
}
|
|
666
|
+
// Add requirement strings
|
|
667
|
+
if (!template['_patterns']['requirements']) {
|
|
668
|
+
template['_patterns']['requirements'] = {};
|
|
669
|
+
}
|
|
670
|
+
for (const reqStr of config_js_1.REQUIREMENT_STRINGS) {
|
|
671
|
+
template['_patterns']['requirements'][`[requirement] ${reqStr}`] = '';
|
|
672
|
+
}
|
|
671
673
|
}
|
|
672
674
|
return template;
|
|
673
675
|
}
|
package/dist/components.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Breakpoint, ButtonProps, IconButtonProps } from '@mui/material';
|
|
2
|
-
import type { ReactNode, PropsWithChildren } from 'react';
|
|
2
|
+
import type { ReactNode, PropsWithChildren, ReactElement } from 'react';
|
|
3
3
|
import type { SoundEffectName } from './audio';
|
|
4
4
|
import type { ScreenEffectType } from './ScreenEffectType';
|
|
5
5
|
import type React from 'react';
|
|
@@ -55,4 +55,22 @@ export interface BackgroundImageProps {
|
|
|
55
55
|
}
|
|
56
56
|
export type BackgroundImageFC = React.FC<BackgroundImageProps>;
|
|
57
57
|
export type MemoBackgroundImageFC = React.NamedExoticComponent<BackgroundImageProps>;
|
|
58
|
+
export interface GameTooltipProps {
|
|
59
|
+
provider: () => ReactNode;
|
|
60
|
+
children: ReactElement;
|
|
61
|
+
flipped?: boolean;
|
|
62
|
+
disabled?: boolean;
|
|
63
|
+
minimal?: boolean;
|
|
64
|
+
}
|
|
65
|
+
export interface GameTooltipBoxProps {
|
|
66
|
+
isSecondary?: boolean;
|
|
67
|
+
isAux?: boolean;
|
|
68
|
+
removeWidthLimit?: boolean;
|
|
69
|
+
}
|
|
70
|
+
export interface TooltipLineProps {
|
|
71
|
+
children?: React.ReactNode;
|
|
72
|
+
}
|
|
73
|
+
export type GameTooltipFC = React.FC<GameTooltipProps>;
|
|
74
|
+
export type GameTooltipBoxFC = React.FC<PropsWithChildren<GameTooltipBoxProps>>;
|
|
75
|
+
export type TooltipLineFC = React.ComponentType<TooltipLineProps>;
|
|
58
76
|
export {};
|
package/dist/craftingState.d.ts
CHANGED
|
@@ -27,7 +27,7 @@ export interface HarmonyData {
|
|
|
27
27
|
inscribedPatterns?: InscribedPatternsData;
|
|
28
28
|
resonance?: ResonanceData;
|
|
29
29
|
recommendedTechniqueTypes: CraftingTechniqueType[];
|
|
30
|
-
additionalData?:
|
|
30
|
+
additionalData?: unknown;
|
|
31
31
|
}
|
|
32
32
|
export interface CraftingEffectTracking {
|
|
33
33
|
icon: string;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { Translatable } from './translatable';
|
|
2
|
-
declare const
|
|
3
|
-
export type IntimateStat = (typeof
|
|
4
|
-
declare const
|
|
5
|
-
export type IntimateResource = (typeof
|
|
6
|
-
declare const
|
|
7
|
-
export type IntimateTechniqueType = (typeof
|
|
2
|
+
declare const _intimateStats: readonly ["satisfaction", "energy", "painThreshold"];
|
|
3
|
+
export type IntimateStat = (typeof _intimateStats)[number];
|
|
4
|
+
declare const _intimateResources: readonly ["pain", "harmony", "excitement", "rhythm"];
|
|
5
|
+
export type IntimateResource = (typeof _intimateResources)[number];
|
|
6
|
+
declare const _intimateTechniqueTypes: readonly ["rough", "tender", "passionate"];
|
|
7
|
+
export type IntimateTechniqueType = (typeof _intimateTechniqueTypes)[number];
|
|
8
8
|
export declare const intimateTechniqueTypeToName: Record<IntimateTechniqueType, string>;
|
|
9
9
|
export declare const intimateResourceToName: Record<IntimateResource, string>;
|
|
10
10
|
export declare const dualCultivationCompletionStateToName: Record<string, string>;
|
package/dist/dualCultivation.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const
|
|
2
|
-
const
|
|
3
|
-
const
|
|
1
|
+
const _intimateStats = ['satisfaction', 'energy', 'painThreshold'];
|
|
2
|
+
const _intimateResources = ['pain', 'harmony', 'excitement', 'rhythm'];
|
|
3
|
+
const _intimateTechniqueTypes = ['rough', 'tender', 'passionate'];
|
|
4
4
|
export const intimateTechniqueTypeToName = {
|
|
5
5
|
rough: 'Rough',
|
|
6
6
|
tender: 'Tender',
|
package/dist/entity.js
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
export const entityTypes = [
|
|
1
|
+
export const entityTypes = [
|
|
2
|
+
'Player',
|
|
3
|
+
'Lifeform',
|
|
4
|
+
'Enemy',
|
|
5
|
+
'PlayerParty',
|
|
6
|
+
'EnemyParty',
|
|
7
|
+
'System',
|
|
8
|
+
];
|
|
2
9
|
export const sexes = ['male', 'female'];
|
|
3
10
|
export const sexToName = {
|
|
4
11
|
male: 'Male',
|
package/dist/gameVersion.d.ts
CHANGED
package/dist/gameVersion.js
CHANGED
package/dist/mod.d.ts
CHANGED
|
@@ -6,6 +6,8 @@ import type { AuctionItemDef, AuctionItem } from './auction';
|
|
|
6
6
|
import type { Background } from './background';
|
|
7
7
|
import type { Breakthrough } from './breakthrough';
|
|
8
8
|
import type { Buff } from './buff';
|
|
9
|
+
import type { BreakthroughState } from './breakthrough';
|
|
10
|
+
import type { CharactersState } from './reduxState';
|
|
9
11
|
import type { CalendarEvent } from './calendar';
|
|
10
12
|
import type { Character } from './character';
|
|
11
13
|
import type { CraftingTechnique, CraftingRecipeStats } from './craftingTechnique';
|
|
@@ -35,7 +37,7 @@ import type { ItemKind } from './item';
|
|
|
35
37
|
import type { SoundEffectName } from './audio';
|
|
36
38
|
import type { ScreenEffectType } from './ScreenEffectType';
|
|
37
39
|
import type { RootState } from './reduxState';
|
|
38
|
-
import type { GameDialogFC, GameButtonExoticFC, GameIconButtonExoticFC, MemoBackgroundImageFC } from './components';
|
|
40
|
+
import type { GameDialogFC, GameButtonExoticFC, GameIconButtonExoticFC, MemoBackgroundImageFC, GameTooltipFC, GameTooltipBoxFC, TooltipLineFC } from './components';
|
|
39
41
|
import type { PuppetType } from './trainingGround';
|
|
40
42
|
import type { TechniqueElement } from './element';
|
|
41
43
|
import type { AlternativeStart } from './alternativeStart';
|
|
@@ -43,8 +45,10 @@ import type { Tutorial } from './tutorial';
|
|
|
43
45
|
import type { Sex } from './entity';
|
|
44
46
|
import type { DamageType } from './DamageType';
|
|
45
47
|
import { AvatarEffectShader } from './avatarEffects';
|
|
46
|
-
import type { Translatable, TranslatableString } from '
|
|
48
|
+
import type { Translatable, TranslatableString } from './translatable';
|
|
47
49
|
import type { SaveFileInfo } from './electron';
|
|
50
|
+
import type { KeybindingDefinition } from './keybindings';
|
|
51
|
+
import { ScreenType } from './GameScreen';
|
|
48
52
|
/**
|
|
49
53
|
* Sprite images for a custom player character.
|
|
50
54
|
* All images should be strings (either mod:// URLs for mod assets, or data: URLs).
|
|
@@ -163,7 +167,7 @@ export interface ModReduxAPI {
|
|
|
163
167
|
* @example
|
|
164
168
|
* setModData('myMod', 'customNPC_affinity', { npcId: 'elder_li', value: 75 });
|
|
165
169
|
*/
|
|
166
|
-
setModData: (modName: string, key: string, data:
|
|
170
|
+
setModData: (modName: string, key: string, data: unknown) => void;
|
|
167
171
|
/**
|
|
168
172
|
* Move player to a different location on the world map.
|
|
169
173
|
* @param location - Location key from the locations data
|
|
@@ -303,35 +307,6 @@ export interface ModReduxAPI {
|
|
|
303
307
|
* console.log('Completion after:', preview.progressState?.completion);
|
|
304
308
|
*/
|
|
305
309
|
previewCraftingTechnique: (technique: CraftingTechnique, state: CraftingState) => CraftingState;
|
|
306
|
-
/**
|
|
307
|
-
* Save the current game state to a character-scoped backup file. The save is
|
|
308
|
-
* written to the character's backup folder with the given filename. Throws an
|
|
309
|
-
* error if no save is currently loaded or if the save operation fails.
|
|
310
|
-
* @param filename - Name of the save file (e.g. 'quicksave-001.json')
|
|
311
|
-
* @example
|
|
312
|
-
* makeSave('quicksave-001.json'); // Save to character-backup/quicksave-001.json
|
|
313
|
-
* makeSave('backup-myprogress.json');
|
|
314
|
-
*/
|
|
315
|
-
makeSave: (filename: string) => Promise<void>;
|
|
316
|
-
/**
|
|
317
|
-
* Load game state from a character-scoped backup file. The current game state
|
|
318
|
-
* will be replaced by the loaded save. Throws an error if the file cannot be
|
|
319
|
-
* read or parsed.
|
|
320
|
-
* @param filename - Name of the save file to load (must exist in character backup folder)
|
|
321
|
-
* @example
|
|
322
|
-
* loadSave('quicksave-001.json'); // Load from character-backup/quicksave-001.json
|
|
323
|
-
* loadSave('backup-myprogress.json');
|
|
324
|
-
*/
|
|
325
|
-
loadSave: (filename: string) => Promise<void>;
|
|
326
|
-
/**
|
|
327
|
-
* List all backup save files available for the current character. Throws if
|
|
328
|
-
* no save is currently loaded or if the operation fails.
|
|
329
|
-
* @returns Array of save file metadata
|
|
330
|
-
* @example
|
|
331
|
-
* const saves = listSaves();
|
|
332
|
-
* saves.forEach(s => console.log(s.name, new Date(s.lastModified)));
|
|
333
|
-
*/
|
|
334
|
-
listSaves: () => Promise<SaveFileInfo[]>;
|
|
335
310
|
};
|
|
336
311
|
components: {
|
|
337
312
|
GameDialog: GameDialogFC;
|
|
@@ -339,6 +314,14 @@ export interface ModReduxAPI {
|
|
|
339
314
|
GameIconButton: GameIconButtonExoticFC;
|
|
340
315
|
BackgroundImage: MemoBackgroundImageFC;
|
|
341
316
|
PlayerComponent: React.FC;
|
|
317
|
+
GameTooltip: GameTooltipFC;
|
|
318
|
+
GameTooltipBox: GameTooltipBoxFC;
|
|
319
|
+
TooltipLine: TooltipLineFC;
|
|
320
|
+
};
|
|
321
|
+
utils: {
|
|
322
|
+
parseTooltipLine: (tooltip: string) => React.ReactNode;
|
|
323
|
+
expandTooltipTemplate: (template: string, templateValues: Map<string, string>, addPeriod?: boolean) => string;
|
|
324
|
+
expandTooltipTags: (template: string) => string;
|
|
342
325
|
};
|
|
343
326
|
}
|
|
344
327
|
export type ModScreenFC = React.FC<{
|
|
@@ -1062,6 +1045,22 @@ export interface ModAPI {
|
|
|
1062
1045
|
* const highScore = flags['myMod_highScore'] ?? 0;
|
|
1063
1046
|
*/
|
|
1064
1047
|
getGlobalFlags: () => Record<string, number>;
|
|
1048
|
+
/**
|
|
1049
|
+
* Register a custom keybinding for your mod.
|
|
1050
|
+
* Once registered, the keybinding is permanent for the session (mods cannot be unloaded without restarting the game).
|
|
1051
|
+
* Users can rebind registered keybindings in the game settings Controls tab.
|
|
1052
|
+
* @param definition - The keybinding definition including action name, category, display name, and default key
|
|
1053
|
+
* @example
|
|
1054
|
+
* registerKeybinding({
|
|
1055
|
+
* action: 'myMod.specialAction',
|
|
1056
|
+
* category: 'general',
|
|
1057
|
+
* displayName: 'Special Action',
|
|
1058
|
+
* description: 'Performs a special action',
|
|
1059
|
+
* defaultKey: 'F',
|
|
1060
|
+
* allowRebind: true,
|
|
1061
|
+
* });
|
|
1062
|
+
*/
|
|
1063
|
+
registerKeybinding: (definition: KeybindingDefinition) => void;
|
|
1065
1064
|
};
|
|
1066
1065
|
utils: {
|
|
1067
1066
|
/**
|
|
@@ -1952,8 +1951,92 @@ export interface ModAPI {
|
|
|
1952
1951
|
* };
|
|
1953
1952
|
*/
|
|
1954
1953
|
tr: (key: string, variables?: Record<string, Translatable | number>, context?: string) => TranslatableString;
|
|
1954
|
+
/**
|
|
1955
|
+
* Save the current game state to a character-scoped backup file.
|
|
1956
|
+
* Throws if no save is loaded or if the write fails.
|
|
1957
|
+
* @param filename - Name of the backup file (e.g. 'quicksave-001.json')
|
|
1958
|
+
*/
|
|
1959
|
+
makeSave: (filename: string) => Promise<void>;
|
|
1960
|
+
/**
|
|
1961
|
+
* Load game state from a character-scoped backup file, replacing current state.
|
|
1962
|
+
* Throws if no save is loaded or if the file cannot be read.
|
|
1963
|
+
* @param filename - Name of the backup file to load
|
|
1964
|
+
*/
|
|
1965
|
+
loadSave: (filename: string) => Promise<void>;
|
|
1966
|
+
/**
|
|
1967
|
+
* List all backup save files available for the current character.
|
|
1968
|
+
* Throws if no save is loaded.
|
|
1969
|
+
* @returns Array of backup file metadata
|
|
1970
|
+
*/
|
|
1971
|
+
listSaves: () => Promise<SaveFileInfo[]>;
|
|
1972
|
+
/**
|
|
1973
|
+
* Display a toast notification on the screen.
|
|
1974
|
+
* @param message - The text message or ReactNode to display
|
|
1975
|
+
* @param timeout - Optional timeout in milliseconds (default 3000ms)
|
|
1976
|
+
* @param style - Optional toast style: 'info' (default), 'success', 'warning', 'error'
|
|
1977
|
+
* @param customStyle - Optional custom styling { bg?, border?, color? }
|
|
1978
|
+
* @example
|
|
1979
|
+
* showToast('Item added to inventory');
|
|
1980
|
+
* showToast('Quest completed!', 5000);
|
|
1981
|
+
* showToast('Warning message', 3000, 'warning');
|
|
1982
|
+
* showToast('Error!', 5000, 'error');
|
|
1983
|
+
* showToast(<div><button>Click me</button></div>, 5000, 'info', { bg: '#ff0000', color: '#ffffff' });
|
|
1984
|
+
*/
|
|
1985
|
+
showToast: (message: React.ReactNode, timeout?: number, style?: 'info' | 'success' | 'warning' | 'error', customStyle?: {
|
|
1986
|
+
bg?: string;
|
|
1987
|
+
border?: string;
|
|
1988
|
+
color?: string;
|
|
1989
|
+
}) => void;
|
|
1990
|
+
/**
|
|
1991
|
+
* Determine the current screen/game state from the Redux root state.
|
|
1992
|
+
* @param rootState - The Redux root state
|
|
1993
|
+
* @returns The current screen type identifier
|
|
1994
|
+
* @example
|
|
1995
|
+
* const screen = determineCurrentScreen(store.getState());
|
|
1996
|
+
*/
|
|
1997
|
+
determineCurrentScreen: (rootState: RootState) => ScreenType;
|
|
1955
1998
|
};
|
|
1956
1999
|
hooks: {
|
|
2000
|
+
/**
|
|
2001
|
+
* Hook into player combat entity creation to modify stats.
|
|
2002
|
+
* @param interceptor - Function to modify combat entity
|
|
2003
|
+
* @example
|
|
2004
|
+
* onCreatePlayerCombatEntity((player, combatEntity, breakthrough, flags) => {
|
|
2005
|
+
* if (flags.enhanced_powers) {
|
|
2006
|
+
* combatEntity.stats.power *= 1.2;
|
|
2007
|
+
* }
|
|
2008
|
+
* return combatEntity;
|
|
2009
|
+
* });
|
|
2010
|
+
*/
|
|
2011
|
+
onCreatePlayerCombatEntity: (interceptor: (player: PlayerEntity, combatEntity: CombatEntity, breakthrough: BreakthroughState, gameFlags: Record<string, number>) => CombatEntity) => void;
|
|
2012
|
+
/**
|
|
2013
|
+
* Hook into player crafting entity creation to modify stats.
|
|
2014
|
+
* @param interceptor - Function to modify crafting entity
|
|
2015
|
+
* @example
|
|
2016
|
+
* onCreatePlayerCraftingEntity((player, craftingEntity, breakthrough, characters, flags) => {
|
|
2017
|
+
* if (flags.master_craftsman) {
|
|
2018
|
+
* craftingEntity.stats.control *= 1.2;
|
|
2019
|
+
* }
|
|
2020
|
+
* return craftingEntity;
|
|
2021
|
+
* });
|
|
2022
|
+
*/
|
|
2023
|
+
onCreatePlayerCraftingEntity: (interceptor: (player: PlayerEntity, craftingEntity: CraftingEntity, breakthrough: BreakthroughState, characters: CharactersState | undefined, gameFlags: Record<string, number>) => CraftingEntity) => void;
|
|
2024
|
+
/**
|
|
2025
|
+
* Hook called before crafting begins to modify recipe, recipe stats, or player.
|
|
2026
|
+
* @param interceptor - Function returning modified recipe/stats/player or undefined
|
|
2027
|
+
* @example
|
|
2028
|
+
* onBeforeCraft((player, recipe, recipeStats, flags) => {
|
|
2029
|
+
* if (flags.sharp_tools && recipeStats.difficulty > 100) {
|
|
2030
|
+
* return { recipeStats: { ...recipeStats, difficulty: recipeStats.difficulty * 0.9 } };
|
|
2031
|
+
* }
|
|
2032
|
+
* return undefined;
|
|
2033
|
+
* });
|
|
2034
|
+
*/
|
|
2035
|
+
onBeforeCraft: (interceptor: (player: CraftingEntity, recipe: RecipeItem, recipeStats: CraftingRecipeStats, gameFlags: Record<string, number>) => {
|
|
2036
|
+
recipe?: RecipeItem;
|
|
2037
|
+
recipeStats?: CraftingRecipeStats;
|
|
2038
|
+
player?: CraftingEntity;
|
|
2039
|
+
} | undefined) => void;
|
|
1957
2040
|
/**
|
|
1958
2041
|
* Hook into enemy combat entity creation to modify stats.
|
|
1959
2042
|
* @param interceptor - Function to modify combat entity
|
package/dist/reduxState.d.ts
CHANGED
|
@@ -62,6 +62,7 @@ export interface InventoryState {
|
|
|
62
62
|
recipes: RecipeState[];
|
|
63
63
|
money: number;
|
|
64
64
|
favour: number;
|
|
65
|
+
favoritedItems?: string[];
|
|
65
66
|
}
|
|
66
67
|
export interface StanceTracking {
|
|
67
68
|
techniques: string[];
|
|
@@ -275,7 +276,7 @@ export interface HouseState {
|
|
|
275
276
|
}
|
|
276
277
|
export interface ModSliceProps {
|
|
277
278
|
activeMods: string[];
|
|
278
|
-
data: Record<string, Record<string,
|
|
279
|
+
data: Record<string, Record<string, unknown>>;
|
|
279
280
|
}
|
|
280
281
|
export interface DualCultivationState {
|
|
281
282
|
partner?: {
|
package/package.json
CHANGED
package/dist/itemAction.d.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
|
-
import type { AppDispatch } from '../store';
|
|
3
|
-
import type { BreakthroughState } from './breakthrough';
|
|
4
|
-
import type { SoundEffectName } from './audio';
|
|
5
|
-
import type { Item } from './item';
|
|
6
|
-
import type { PlayerEntity } from './entity';
|
|
7
|
-
import type { InventoryState } from './reduxState';
|
|
8
|
-
interface OpenItem {
|
|
9
|
-
item: Item;
|
|
10
|
-
data: unknown;
|
|
11
|
-
onComplete: () => void;
|
|
12
|
-
}
|
|
13
|
-
export interface ItemActionContext {
|
|
14
|
-
item: Item;
|
|
15
|
-
player: PlayerEntity;
|
|
16
|
-
inventory: InventoryState;
|
|
17
|
-
breakthrough: BreakthroughState;
|
|
18
|
-
flags: Record<string, number | string | boolean>;
|
|
19
|
-
dispatch: AppDispatch;
|
|
20
|
-
setResult: (result: ReactNode) => void;
|
|
21
|
-
setClicked: (clicked: boolean) => void;
|
|
22
|
-
setOpenItem?: (openItem: OpenItem) => void;
|
|
23
|
-
setDoEnchant?: (doEnchant: boolean) => void;
|
|
24
|
-
setDoUpgrade?: (doUpgrade: boolean) => void;
|
|
25
|
-
setDoAppearanceChange?: (doAppearanceChange: boolean) => void;
|
|
26
|
-
playSfx: (sound: SoundEffectName) => void;
|
|
27
|
-
usageRestricted: boolean;
|
|
28
|
-
}
|
|
29
|
-
export interface ItemActionResult {
|
|
30
|
-
buttons: ReactNode[];
|
|
31
|
-
}
|
|
32
|
-
export type ItemActionHandler = (context: ItemActionContext) => ItemActionResult;
|
|
33
|
-
export {};
|
package/dist/itemAction.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/manual.d.ts
DELETED
package/dist/manual.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/typeTests.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Type Tests - These files ensure type compatibility across the codebase
|
|
3
|
-
* If any of these fail to compile, it means we have a type mismatch
|
|
4
|
-
*/
|
|
5
|
-
import type { RootState as StoreRootState } from '../store';
|
|
6
|
-
import type { RootState as TypesRootState } from './reduxState';
|
|
7
|
-
type TestExactMatch = StoreRootState extends TypesRootState ? TypesRootState extends StoreRootState ? true : false : false;
|
|
8
|
-
export type RootStateIsConsistent = TestExactMatch;
|
|
9
|
-
export {};
|