I'd like to request mounting an extra directory in init, to allow mods for adding new strategic icons.
Game only reads strategic icons from textures/ui/common/game/strategicicons (regular) and textures/ui/icons_strategic (optional big icons in building panel). The only way for modders to add them currently is to pack them into an .scd and put it in the gamedata folder, which has to be done manually and is prone to overlooking by the users.
I'm asking to mount mods/<mod_name>/textures/ui directories as textures/ui, which will enable us modders to remove the need for manual installation of strategic icons.
Following code added to init_faf.lua in bin folder works in achieving this. At least it did on my end.
- Code: Select all
function mount_strategic_icons(MODFOLDER)
for _,mod in io.dir( MODFOLDER..'\\*.*') do
if mod != '.' and mod != '..' then
for _,folder in io.dir(MODFOLDER..'\\'..mod..'\\*.*') do
if folder == 'textures' then
for _,folder in io.dir(MODFOLDER..'\\'..mod..'\\textures\\*.*') do
if folder == 'ui' then
LOG('Found mod icons in: '..mod)
mount_dir(MODFOLDER..'\\'..mod..'\\textures\\ui', '/textures/ui')
break
end
end
end
end
end
end
end
mount_strategic_icons(SHGetFolderPath('PERSONAL') .. 'My Games\\Gas Powered Games\\Supreme Commander Forged Alliance\\mods')
mount_strategic_icons(InitFileDir .. '\\..\\user\\My Games\\Gas Powered Games\\Supreme Commander Forged Alliance\\mods')