-- Private native boss widgets: never borrow the game's reusable extension widgets. local U=require('ue_observe') local Renderer={} local CLASS='/Game/PBZContent/UI/Hud/WB_BossHPBar.WB_BossHPBar_C' local ROW_HEIGHT,ROW_PITCH=128,132 local SIDE_MARGIN,TOP_MARGIN,BOTTOM_MARGIN=24,18,24 local MIN_SCALE=0.5 local HIDDEN,SHOWN=2,3 -- ESlateVisibility.Hidden and HitTestInvisible. local function densityScale(count,height) if type(count)~='number' or count<=3 then return 1 end local density=math.sqrt(3/count) local fit=height and (height-TOP_MARGIN-BOTTOM_MARGIN)/(count*ROW_PITCH) or density return math.max(MIN_SCALE,math.min(density,fit)) end local function same(a,b)local key=U.key(a);return key~=nil and key==U.key(b)end local function call(obj,name,...) assert(U.valid(obj),'invalid widget object: '..name) return obj[name](obj,...) end local function text(value) if type(value)=='string' then return value end local ok,s=pcall(function()return value:ToString()end);return ok and s or nil end local function dimension(value) return type(value)=='number' and value>0 and value