Sheeo wrote:The change that was previously implemented (It's not on github), duplicated the icon along with its name. So we would have this issue with people using old mods.
The change is only to allow ASI to do this, so if you have an idea of what to do please let me know
In order to keep compatibility with older icon mods, the implementation of my idea should look like this:
- Code: Select all
UnitBlueprint {
Merge = true,
BlueprintId = "ueb1106",
StrategicIconName = get_name_if_file_exist('icon_structure1_mass_storage', StrategicIconName)
}
function get_name_if_file_exist(new_file_name, default_file_name)
local file_found=io.open(new_file_name, "r")
if file_found==nil then
io.close(file_found)
return default_file_name
else
io.close(file_found)
return new_file_name
end
end
The function sets the new icon's file name if the icon file exist, otherwise it leaves it at default.
(LUA is not my programing language).