herbix / hoi4modutilities

A VSCode extension that contains utilities for Heart of Iron IV mods developers
MIT License
83 stars 10 forks source link

Icon preview in technology and focus trees not always showing with gfxIndex enabled or with dependencies set. #88

Open BiscuitCookies opened 7 months ago

BiscuitCookies commented 7 months ago

I have gfxIndex featureflag enabled. So it seems to in some cases not read in load order or not at all

For example for La resistance the armored car in the preview even with dependencies set: image It does load a modified icon of the same name if I place one in the mod folder image when gfx define removed from the dlc file but still set in the mod file image in the game: image

Cases of gfxIndex not working With gfxIndex enabled image when dependencies specifically set: image

And these are only examples for the technology tree

herbix commented 7 months ago

Does reopening the preview fix this? There's a known limitation that gfx index needs time to load. And it won't update when .gfx in your mod folder changes.

BiscuitCookies commented 7 months ago

No, it does not. And these are were checked when the building of the gfx index is done notification has popped up. There are sometimes cases where doing a edit in the file causes the preview to show icons that were previously not shown, but it doesn't always do that

BiscuitCookies commented 7 months ago

I did notice browsing through the code that there is no mention of gfindex in the src/previewdef/technology/loader.ts file. Which still wouldn't explain why certain icons aren't being overridden by later defined icons or not shown at all.

herbix commented 7 months ago

gfxindex usage is here: https://github.com/herbix/hoi4modutilities/blob/6a9201de7a3d57b9ded17cf3a37c843294a39514/src/util/image/imagecache.ts#L39

BiscuitCookies commented 7 months ago

I meant I didn't see these in technology https://github.com/herbix/hoi4modutilities/blob/6a9201de7a3d57b9ded17cf3a37c843294a39514/src/previewdef/focustree/loader.ts#L6 https://github.com/herbix/hoi4modutilities/blob/6a9201de7a3d57b9ded17cf3a37c843294a39514/src/previewdef/focustree/loader.ts#L34

but I might be completely wrong on what those do.

BiscuitCookies commented 7 months ago

Does reopening the preview fix this? There's a known limitation that gfx index needs time to load. And it won't update when .gfx in your mod folder changes.

Odd behavior I found is that when you reload the entire vscode window while on the preview and when you've set the gfx dependencies in the file. It does show the correct images, but when you then make any changes to the technology file the incorrect icons or no icons will show again.