globals
framehandle array Items
endglobals
library ITEMUI initializer init
private function init takes nothing returns nothing
set Items[1] = BlzCreateFrame("QuestButtonBaseTemplate", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0),0,0)
call BlzFrameSetAbsPoint(Items[1], FRAMEPOINT_TOPLEFT, 0.0136700, 0.209900)
call BlzFrameSetAbsPoint(Items[1], FRAMEPOINT_BOTTOMRIGHT, 0.0536700, 0.169900)
set Items[2] = BlzCreateFrame("QuestButtonBaseTemplate", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0),0,0)
call BlzFrameSetAbsPoint(Items[2], FRAMEPOINT_TOPLEFT, 0.0535100, 0.209900)
call BlzFrameSetAbsPoint(Items[2], FRAMEPOINT_BOTTOMRIGHT, 0.0935100, 0.169900)
set Items[3] = BlzCreateFrame("QuestButtonBaseTemplate", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0),0,0)
call BlzFrameSetAbsPoint(Items[3], FRAMEPOINT_TOPLEFT, 0.0933500, 0.209900)
call BlzFrameSetAbsPoint(Items[3], FRAMEPOINT_BOTTOMRIGHT, 0.133350, 0.169900)
set Items[4] = BlzCreateFrame("QuestButtonBaseTemplate", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0),0,0)
call BlzFrameSetAbsPoint(Items[4], FRAMEPOINT_TOPLEFT, 0.133190, 0.209900)
call BlzFrameSetAbsPoint(Items[4], FRAMEPOINT_BOTTOMRIGHT, 0.173190, 0.169900)
set Items[5] = BlzCreateFrame("QuestButtonBaseTemplate", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0),0,0)
call BlzFrameSetAbsPoint(Items[5], FRAMEPOINT_TOPLEFT, 0.173030, 0.209900)
call BlzFrameSetAbsPoint(Items[5], FRAMEPOINT_BOTTOMRIGHT, 0.213030, 0.169900)
set Items[6] = BlzCreateFrame("QuestButtonBaseTemplate", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0),0,0)
call BlzFrameSetAbsPoint(Items[6], FRAMEPOINT_TOPLEFT, 0.212870, 0.209900)
call BlzFrameSetAbsPoint(Items[6], FRAMEPOINT_BOTTOMRIGHT, 0.252870, 0.169900)
call BlzFrameSetTexture(Items[1], "Textures\\Black32.blp" , 0, true)
call BlzFrameSetTexture(Items[2], "Textures\\Black32.blp" , 0, true)
call BlzFrameSetTexture(Items[3], "Textures\\Black32.blp" , 0, true)
call BlzFrameSetTexture(Items[4], "Textures\\Black32.blp" , 0, true)
call BlzFrameSetTexture(Items[5], "Textures\\Black32.blp" , 0, true)
call BlzFrameSetTexture(Items[6], "Textures\\Black32.blp" , 0, true)
endfunction
endlibrary
function Trig_Update_Actions takes nothing returns nothing
local integer i = 1
local unit u = <YOUR_UNIT>
loop
exitwhen i > 6
if BlzGetItemIconPath(UnitItemInSlotBJ(u, i)) == null then
call BlzFrameSetTexture(Items[i], "Textures\\Black32.blp" , 0, true)
else
call BlzFrameSetTexture(Items[i], BlzGetItemIconPath(UnitItemInSlotBJ(u, i)) , 0, true)
endif
set i = i + 1
endloop
endfunction
//===========================================================================
function InitTrig_Update takes nothing returns nothing
set gg_trg_Update = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_Update, 0.01 )
call TriggerAddAction( gg_trg_Update, function Trig_Update_Actions )
endfunction
Thank you) and how to make tooltip for these items?You are not very specific, but I made a proof of concept.
And for simplicity I update the frames periodicly:globals framehandle array Items endglobals library ITEMUI initializer init private function init takes nothing returns nothing set Items[1] = BlzCreateFrame("QuestButtonBaseTemplate", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0),0,0) call BlzFrameSetAbsPoint(Items[1], FRAMEPOINT_TOPLEFT, 0.0136700, 0.209900) call BlzFrameSetAbsPoint(Items[1], FRAMEPOINT_BOTTOMRIGHT, 0.0536700, 0.169900) set Items[2] = BlzCreateFrame("QuestButtonBaseTemplate", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0),0,0) call BlzFrameSetAbsPoint(Items[2], FRAMEPOINT_TOPLEFT, 0.0535100, 0.209900) call BlzFrameSetAbsPoint(Items[2], FRAMEPOINT_BOTTOMRIGHT, 0.0935100, 0.169900) set Items[3] = BlzCreateFrame("QuestButtonBaseTemplate", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0),0,0) call BlzFrameSetAbsPoint(Items[3], FRAMEPOINT_TOPLEFT, 0.0933500, 0.209900) call BlzFrameSetAbsPoint(Items[3], FRAMEPOINT_BOTTOMRIGHT, 0.133350, 0.169900) set Items[4] = BlzCreateFrame("QuestButtonBaseTemplate", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0),0,0) call BlzFrameSetAbsPoint(Items[4], FRAMEPOINT_TOPLEFT, 0.133190, 0.209900) call BlzFrameSetAbsPoint(Items[4], FRAMEPOINT_BOTTOMRIGHT, 0.173190, 0.169900) set Items[5] = BlzCreateFrame("QuestButtonBaseTemplate", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0),0,0) call BlzFrameSetAbsPoint(Items[5], FRAMEPOINT_TOPLEFT, 0.173030, 0.209900) call BlzFrameSetAbsPoint(Items[5], FRAMEPOINT_BOTTOMRIGHT, 0.213030, 0.169900) set Items[6] = BlzCreateFrame("QuestButtonBaseTemplate", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0),0,0) call BlzFrameSetAbsPoint(Items[6], FRAMEPOINT_TOPLEFT, 0.212870, 0.209900) call BlzFrameSetAbsPoint(Items[6], FRAMEPOINT_BOTTOMRIGHT, 0.252870, 0.169900) call BlzFrameSetTexture(Items[1], "Textures\\Black32.blp" , 0, true) call BlzFrameSetTexture(Items[2], "Textures\\Black32.blp" , 0, true) call BlzFrameSetTexture(Items[3], "Textures\\Black32.blp" , 0, true) call BlzFrameSetTexture(Items[4], "Textures\\Black32.blp" , 0, true) call BlzFrameSetTexture(Items[5], "Textures\\Black32.blp" , 0, true) call BlzFrameSetTexture(Items[6], "Textures\\Black32.blp" , 0, true) endfunction endlibrary
I put it in a testmap so you can check it out.function Trig_Update_Actions takes nothing returns nothing local integer i = 1 local unit u = <YOUR_UNIT> loop exitwhen i > 6 if BlzGetItemIconPath(UnitItemInSlotBJ(u, i)) == null then call BlzFrameSetTexture(Items[i], "Textures\\Black32.blp" , 0, true) else call BlzFrameSetTexture(Items[i], BlzGetItemIconPath(UnitItemInSlotBJ(u, i)) , 0, true) endif set i = i + 1 endloop endfunction //=========================================================================== function InitTrig_Update takes nothing returns nothing set gg_trg_Update = CreateTrigger( ) call TriggerRegisterTimerEventPeriodic( gg_trg_Update, 0.01 ) call TriggerAddAction( gg_trg_Update, function Trig_Update_Actions ) endfunction
Thank you) and how to make tooltip for these items?
And sorry my knowledge of English is not very good.