--#*****************************************************************************
--#* Hook File: lua/ui/game/unitview.lua
--#*
--#* Modded By: Gilbot-X
--#*
--#* Summary  : Rollover unit view control
--#*
--#*****************************************************************************

do
    local IconSettings = import('/mods/SupremeUnitPackV6official/UnitTable.lua')
    local MyIconPath = IconSettings.MyIconPath
    
    local oldUpdateWindow = UpdateWindow
    function UpdateWindow(info)
      oldUpdateWindow(info)
      local myIconID = IconSettings.IsMyUnit(info.blueprintId)   
      if myIconID
        and DiskGetFileInfo(MyIconPath .. '/icons/units/' .. myIconID .. '_icon.dds') then
          controls.icon:SetTexture(MyIconPath .. '/icons/units/' .. myIconID .. '_icon.dds')
      end
   end
end