function GetWidgetUIDefById takes integer wid returns integer
local integer addr= GameDLL + 0x32C880
if addr != 0 and wid != 0 then
return this_call_1(addr , wid)
endif
return 0
endfunction
function GetUnitBaseUIDataById takes integer uid returns integer
local integer addr= GameDLL + 0xAB58D4
if addr != 0 and uid != 0 then
return GetWidgetUIDefById(uid)
endif
return 0
endfunction
function GetUnitBaseUIDataByIdCaching takes integer uid returns integer
// DEF_ADR_UNIT_UI = 3
local integer pUnit= 0
if uid > 0 then
if HaveSavedInteger(htObjectDataPointers, 3, uid) then
return LoadInteger(htObjectDataPointers, 3, uid)
endif
set pUnit=GetUnitBaseUIDataById(uid)
if pUnit > 0 then
call SaveInteger(htObjectDataPointers, 3, uid, pUnit)
endif
return pUnit
endif
return 0
endfunction
function SetUnitBaseScaleById takes integer uid, real scale returns nothing
local integer pData= 0
if uid > 0 then
set pData=GetUnitBaseUIDataByIdCaching(uid)
if pData > 0 then
call WriteRealFloat(pData + 0xB0 , scale)
endif
endif
endfunction
function SetUnitBaseScale takes unit u,real scale returns nothing
call SetUnitBaseScaleById(GetUnitTypeId(u) , scale)
endfunction