--#*****************************************************************************
--#*
--#*
--#*
--#*****************************************************************************

do
    local IconSettings = import('/mods/SupremeUnitPackV6official/UnitTable.lua')
    local MyIconPath = IconSettings.MyIconPath

    local oldFileNameFn = GetUnitIconFileNames
    function GetUnitIconFileNames(blueprint)
        local myIconID = IconSettings.IsMyUnit(blueprint.Display.IconName)   
        if myIconID then
            local iconName = MyIconPath .. '/icons/units/' .. (blueprint.Display.IconName or myIconID) .. "_icon.dds"
            local upIconName = MyIconPath .. '/icons/units/' .. (blueprint.Display.IconName or myIconID) .. "_icon.dds"
            local downIconName = MyIconPath  .. '/icons/units/' .. (blueprint.Display.IconName or myIconID) .. "_icon.dds"
            local overIconName = MyIconPath .. '/icons/units/' .. (blueprint.Display.IconName or myIconID) .. "_icon.dds"
             
            if DiskGetFileInfo(iconName) == false then
                WARN('Blueprint icon for unit '.. blueprint.Display.IconName ..' could not be found, check your file path and icon names!')
                iconName = '/textures/ui/common/icons/units/default_icon.dds'
                upIconName = '/textures/ui/common/icons/units/default_icon.dds'
                downIconName = '/textures/ui/common/icons/units/default_icon.dds'
                overIconName = '/textures/ui/common/icons/units/default_icon.dds'
            end
            return iconName, upIconName, downIconName, overIconName
        else
            return oldFileNameFn(blueprint)
        end
   end
end