Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function SetIconTextures(control, optID)
- local id = optID or control.Data.id
- -- AZ ADDITION
- -- Load the unit icons into a cache instead of retrieving it every time.
- -- This helps performance significantly.
- if id then
- if not UnitIconCache[id] then
- if DiskGetFileInfo(UIUtil.UIFile('/icons/units/'..id..'_icon.dds')) then
- UnitIconCache[id] = UIUtil.UIFile('/icons/units/'..id..'_icon.dds')
- else
- UnitIconCache[id] = default_icon
- end
- end
- control.Icon:SetTexture(UnitIconCache[id])
- if __blueprints[id].StrategicIconName then
- local iconName = __blueprints[id].StrategicIconName
- if DiskGetFileInfo('/textures/ui/common/game/strategicicons/'..iconName..'_rest.dds') then
- control.StratIcon:SetTexture('/textures/ui/common/game/strategicicons/'..iconName..'_rest.dds')
- control.StratIcon.Height:Set(control.StratIcon.BitmapHeight)
- control.StratIcon.Width:Set(control.StratIcon.BitmapWidth)
- else
- control.StratIcon:SetSolidColor('ff00ff00')
- end
- else
- control.StratIcon:SetSolidColor('00000000')
- end
- else
- control.Icon:SetTexture(default_icon)
- control.StratIcon:SetSolidColor('ff00ff00')
- end
- -- END AZ ADDITION
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement