First up, here's
the Mod I made in pursuit of this, then I'll go into detail for those who follow as to how I did it. For this post MXX stands for the mod folder.
As mentioned in the first post, define your resource (in MXX/common/strategic_resources/, make sure that you name the file something like 'mxx_strategic_resources.txt' to avoid conflicts with existing resources). Then define your building that uses it (MXX/common/buildings/mxx_buildings.txt). Techs etc as required.
Now, you need graphics. MXX/gfx/interface/icons/ is where you want to start. MXX/gfx/interface/icons/resources/ is where you want to put the icon for your resource. Let's call it MXX/gfx/interface/icons/resources/mxx_resource.dds . You can use various programs to turn a file into a .dds file, I use paint.net because it's free and simple. For your building, do the same (MXX/gfx/interface/icons/buildings/building_mxx.dds). Make sure that the name of your resource (mxx_resource) and your building (building_mxx) are the same as the names of the resource and building in their 'common' files, or they won't get referenced properly.
I'm not 100% on the next step being necessary, but I did it anyway. Create MXX/interface/ and add a file called MXX/interface/mxx_resources.gfx . You can copy the base from the Stellaris/interface/resources.gfx, just delete all the other resources and add something like the below:
spriteTypes = {
spriteType = {
name = "GFX_resource_stored_food"
textureFile = "gfx/interface/icons/resources/stored_food.dds"
}
}
I'm not sure you need it, it seems to work without it.
Finally, in MXX/localisation/ you want to add a file along the lines of mxx_l_english.yml, which is a text file that looks like this:
l_english:
##########
# My Mod!
##########
#Resource
mxx_resource: "Modded Resource"
mxx_resource_desc: "This resource was added by a passing hyperdimensional traveller."
#Building
building_mxx: "Modded Building"
building_mxx_desc: "This building uses the Modded Resource, or perhaps produces it."
With luck and a little tinkering, this should all work out just fine!