Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
619 changes: 582 additions & 37 deletions hollow-knight-save-parser/src/lib.rs

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions hollow-knight-save-parser/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ fn main() {
};
println!("Parsing save file `{path}`");
let mut parser = Parser::new();
if parser.parse_save_file(&data).is_err() {
println!("Failed to parse save file");
if let Err(e) = parser.parse_save_file(&data) {
println!("Failed to parse save file: {e}");
return;
}
let map = parser.get_map();
Expand Down
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
},
"dependencies": {
"hollow-knight-save-parser": "./pkg",
"immer": "^10.1.1",
"object-deep-merge": "^1.0.4",
"immer": "^10.1.3",
"object-deep-merge": "^1.0.5",
"react": "^19.1.1",
"react-dom": "^19.1.1",
"styled-components": "^6.1.19",
Expand All @@ -24,18 +24,18 @@
"zustand": "^4.5.7"
},
"devDependencies": {
"@eslint/js": "^9.34.0",
"@types/react": "^19.1.12",
"@eslint/js": "^9.35.0",
"@types/react": "^19.1.13",
"@types/react-dom": "^19.1.9",
"@vitejs/plugin-react": "^5.0.2",
"eslint": "^9.34.0",
"eslint": "^9.35.0",
"eslint-plugin-react-hooks": "^5.2.0",
"eslint-plugin-react-refresh": "^0.4.20",
"globals": "^16.3.0",
"type-fest": "^4.41.0",
"globals": "^16.4.0",
"type-fest": "^5.0.0",
"typescript": "^5.9.2",
"typescript-eslint": "^8.41.0",
"vite": "^7.1.4",
"typescript-eslint": "^8.43.0",
"vite": "^7.1.5",
"vite-plugin-checker": "^0.10.3",
"wasm-pack": "^0.13.1"
},
Expand Down
34 changes: 28 additions & 6 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,30 @@ const Info = ({ game, sidebar }: { game: GameKey; sidebar?: boolean }) => {
['[GEO]', geo, geoReq],
['[ESSENCE]', essence, Math.max(...essenceReq)],
['[PALE_ORE]', paleOre, paleOreReq],
['[SIMPLE_KEY]', simpleKeys, simpleKeysReq],
['[SIMPLE_KEY_(HOLLOW_KNIGHT)]', simpleKeys, simpleKeysReq],
] as const;
} else {
const { rosaries, rosariesReq } = useChecklistStore(game)();
info = [['[ROSARIES]', rosaries, rosariesReq]] as const;
const {
rosaries,
rosariesReq,
paleOil,
paleOilReq,
simpleKeys,
simpleKeysReq,
memoryLockets,
memoryLocketsReq,
craftmetal,
craftmetalReq,
acts,
} = useChecklistStore(game)();
info = [
['[ROSARY]', rosaries, rosariesReq],
['[PALE_OIL]', paleOil, paleOilReq],
['[SIMPLE_KEY_(SILKSONG)]', simpleKeys, simpleKeysReq],
['[MEMORY_LOCKET]', memoryLockets, Math.max(...memoryLocketsReq)],
['[CRAFTMETAL]', craftmetal, craftmetalReq],
['[Act](Acts)', acts, acts],
] as const;
}

return (
Expand All @@ -124,7 +143,7 @@ const Info = ({ game, sidebar }: { game: GameKey; sidebar?: boolean }) => {
if (sidebar) {
return (
<FText color={decide(val, req)} key={it}>
{it} {val} / {req}
{it} {val} {it !== '[Act](Acts)' ? `/ ${req}` : ''}
</FText>
);
}
Expand All @@ -138,7 +157,10 @@ const Info = ({ game, sidebar }: { game: GameKey; sidebar?: boolean }) => {

return (
<FText color={decide(val, req)} key={it}>
{it} {val} collected / {req} required
{it} {val}
{it !== '[Act](Acts)'
? `collected / ${req} required`
: ''}
{paren}
</FText>
);
Expand All @@ -155,7 +177,7 @@ const SectionColumns = <Game extends GameKey>({ game }: { game: Game }) => {
useEffect(() => {
if (game === 'silksong') {
setTooltipText(`NOTE: THIS SECTION IS WIP
EXPECT MORE ITEMS TO BE ADDED, ALONGSIDE WITH SAVEFILE SUPPORT`);
Some requirements are not yet implemented.`);
openTooltip();
}
}, [game]);
Expand Down
Binary file added src/assets/craftmetal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 7 additions & 3 deletions src/assets/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export { default as ARCANE_EGG } from './arcaneegg.png';
export { default as POINTER } from './button-pointer.png';
export { default as CHARM_NOTCH } from './charmnotch.png';
export { CheckIcon } from './checkmark';
export { default as CRAFTMETAL } from './craftmetal.png';
export { default as BOTTOM } from './dialog-fleur-bottom.png';
export { default as TOP } from './dialog-fleur-top.png';
export { default as ELEGANT_KEY } from './elegantkey.png';
Expand All @@ -15,13 +16,16 @@ export { default as HR2 } from './hr2.png';
export { default as KINGS_IDOL } from './kingsidol.png';
export { default as LOGO } from './logo.png';
export { default as LOVE_KEY } from './lovekey.png';
export { default as MEMORY_LOCKET } from './memory-locket.png';
export { default as PALE_OIL } from './paleoil.png';
export { default as PALE_ORE } from './paleore.png';
export { QuestionMark } from './questionmark';
export { default as ROSARIES } from './rosaries.png';
export { default as ROSARY } from './rosary.png';
export { default as SLY_KEY } from './shopkeeperskey.png';
export { default as SILKSONG } from './silksong.png';
export { default as SILKSONG_BACKGROUND } from './silksongplaceholderbg.png';
export { default as SIMPLE_KEY } from './simplekey.png';
export { default as SILKSONG_BACKGROUND } from './silksongbg.png';
export { default as SIMPLE_KEY_HK } from './simplekey-hk.png';
export { default as SIMPLE_KEY_SS } from './simplekey-ss.png';
export { default as TRAM_PASS } from './trampass.png';
export { default as HOLLOW_KNIGHT_BACKGROUD } from './voidheart.png';
export { default as JOURNAL } from './wanderersjournal.png';
Binary file added src/assets/memory-locket.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/paleoil.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file added src/assets/silksongbg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/assets/silksongplaceholderbg.png
Binary file not shown.
File renamed without changes
Binary file added src/assets/simplekey-ss.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 1 addition & 5 deletions src/components/Checkbox/SectionCheckBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,7 @@ export const SectionCheckBox = <Game extends GameKey>({
const { description } = check;
const error = formatCheckListError(
checkName,
errors
? errors![sectionName]
? errors![sectionName]![checkName] // wtf typescript
: undefined
: undefined
errors?.[sectionName]?.[checkName]
);

let label =
Expand Down
42 changes: 35 additions & 7 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ const HOLLOW_KNIGHT_SECTION_TITLES: Record<
> = {
bosses: '[Bosses](Bosses (Hollow Knight))',
optionalBosses: '[Bosses](Bosses (Hollow Knight)) (no percents)',
equipment: '[Equipment](Abilities)',
equipment: '[Equipment](Abilities (Hollow Knight))',
spells: '[Spells]',
nail: '[Nail]',
dreamNail: '[Dream Nail]',
nailArts: '[Nail Arts]',
charms: '[Charms]',
maskShards: '[Mask Shards]',
maskShards: '[Mask Shards](Mask Shard (Hollow Knight))',
vesselFragments: '[Vessel Fragments]',
colosseum: '[Colosseum of Fools]',
dreamers: '[Dreamers]',
Expand All @@ -41,14 +41,30 @@ const HOLLOW_KNIGHT_SECTION_TITLES: Record<
'[Dream Bosses](Bosses (Hollow Knight)#Boss_Variants) (no percents)',
godhome: '[Godhome]',
grubs: '[Grubs](Grub#Rewards_and_locations) (no percents)',
items: '[Items](Items (Hollow_Knight)) (no percents)',
relics: '[Relics](Items (Hollow_Knight)#Tradables) (no percents)',
items: '[Items](Items (Hollow Knight)) (no percents)',
relics: '[Relics](Items (Hollow Knight)#Tradables) (no percents)',
whisperingRoots: '[Whispering Roots](Whispering Root) (no percents)',
// endings: '[Endings](Endings (Hollow Knight))',
};

const SILKSONG_SECTION_TITLES: Record<SectionNames<'silksong'>, string> = {
bosses: '[Bosses](Bosses (Silksong))',
bosses: '[Bosses](Bosses (Silksong)) (no percents)',
melodies: '[Threefold Melody](The Cradle#How_to_Access) (no percents)',
silkHearts: '[Silk Hearts]',
tools: '[Tools]',
silkSkills: '[Silk Skills](Crests#List_of_Skills)',
ancestralArts: '[Ancestral Arts]',
crests: '[Crests]',
eva: '[Eva]',
maskShards: '[Mask Shards](Mask Shard (Silksong))',
needle: '[Needle]',
spoolFragments: '[Spool Fragments]',
toolPouch: '[Tool Pouch] and [Crafting Kit]',
items: '[Items](Items (Silksong)) (no percents)',
everbloom: '[Everbloom]',
wishes: '[Wishes] (no percents)',
fleas: '[Fleas] (no percents)',
relics: '[Relics](Items (Silksong)#Tradables) (no percents)',
};

export const SECTION_TITLES = {
Expand Down Expand Up @@ -84,8 +100,20 @@ export const HOLLOW_KNIGHT_DISTRIBUTED_SECTIONS = [
] as const satisfies SectionNames<'hollow-knight'>[][];

export const SILKSONG_DISTRIBUTED_SECTIONS = [
['bosses'],
[],
['silkHearts', 'ancestralArts', 'silkSkills', 'tools', 'items', 'relics'],
[
'needle',
'crests',
'eva',
'maskShards',
'spoolFragments',
'toolPouch',
'everbloom',
'bosses',
'melodies',
'fleas',
'wishes',
],
] as const satisfies SectionNames<'silksong'>[][];

type MissingSectionNames<Game extends GameKey> = UnionToArray<
Expand Down
Loading