Hey there fellow modders / devs. I’m working on updating Nihonjin to Alpha 10 and ran into an issue. By the looks of it the icons for the various building pieces (roof/wall/ types etc.) are all hardcoded in the ui design by the looks of it…
Can anyone confirm this and does anyone have any ways around this issue if that is the case?
@Voxelpirate Yeah I found that last night. The images are there but i cant find exactly what calls upon them. It doesnt seem to be the brush files or portrait files in the stonehearth/data/building folder files, so im assuming they are hardcoded in the html, though i cant find it.
If so it’s a big no no for them to be hard coded instead of data based xD
I’ve quadruple checked the paths, they are correct but are not loading the picture.
The paths in the “building_parts.json” link to the entities folder, but the icons that seem to be used by the ui itself seem to be the ones in the link you provided.
Check it out using CEF debugging (the “connect Chrome with SH” thing). You’ll see what image it tries to load and can then adjust the path accordingly.
I’ve played a bit around with adding doors and windows to the building tool, which works apart from… the icon of course. So where I would like to see a picture of my new door or window in the tool, I see a blank space (which can be selected and the e.g. door can be place and will be build).
Did not find a place where this could be hard-coded. Anyone tried to do something similar with more success?
Hmm… You could always debug the UI with the web inspector. Perhaps it’s in the .less file (building_designer_2.less) around line 264. But maybe that’s deprecated code, and the path it’s in a js file, I haven’t checked.
The less-code seems not to influence the displayed options. Thought that maybe someone did look into it already and I could avoid installing and getting used to the web inspector .
I inspected the UI and by the looks of it, the url of the icon (which is located inside the entity’s folder) is indeed in the file that I mentioned. Unless something has changed since I’m playing with an older version, but the css didn’t lie, it showed the classes and identifiers that lead to the url in the less file:
I think that for UI files you have to override them, since we don’t have a way to make the game read our html/css/js files when it loads the UI when you launch the game…