Building Components Icons Hardcoded?

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?

I’ll leave a few tags here @Relyss @RepeatPan @sdee @tom ;p

Thanks a bunch!


P.S. @SteveAdamo @Relyss @Geoffers747 Modding or Support? Such a difficult decision to make… xD


sounds good to me… :+1:

1 Like

Not sure I know what you are exactly looking for, but could it be this @Avairian?


From what I see this are the icons used in the building tool. There are some additional ones, i.e. color variants created with “color_border.png”.

@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. :confused:

If so it’s a big no no for them to be hard coded instead of data based xD

… and how about the .json-files in the “\stonehearth\data\build”-folder? Especially “building_parts.json”.

I’ve quadruple checked the paths, they are correct but are not loading the picture. :frowning:

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.

1 Like

Well crap… I forgot all about. xD Now to remember how to do that again /facepalm.

1 Like

I complained about this several times. Even on a stream that I managed to catch!

But seems it’s low on the priority list…

Point 4 here on the OP:

It’s in stonehearth\ui\game\modes\build_mode\building_designer_2 , file building_designer_base.js

line 255, for example:

background = 'url(/stonehearth/ui/game/modes/build_mode/building_designer_2/images/palettes/' + toolId + '.png)';

The path is hardcoded, so we can’t add our icons in any way without overriding the whole thing :sob:


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.

1 Like

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 :wink:.

1 Like

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:

.brush.wooden_door_2 {
        background-image: url(/stonehearth/entities/construction/wooden_door_2/wooden_door_2.png);

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…

1 Like

Thanks for looking into it… got it working in the meanwhile, although I do not like to edit .less and .js-files for modding :disappointed:.

P.S. My statement above is wrong. I had to fix some typos and links to wrong folders to make it happen.

1 Like