• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Script] display item icons

Status
Not open for further replies.
Level 14
Joined
Jan 24, 2017
Messages
280
You are not very specific, but I made a proof of concept.
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
And for simplicity I update the frames periodicly:
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
I put it in a testmap so you can check it out.
 

Attachments

  • display_items.w3m
    14.6 KB · Views: 8
Level 7
Joined
Aug 26, 2016
Messages
139
You are not very specific, but I made a proof of concept.
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
And for simplicity I update the frames periodicly:
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
I put it in a testmap so you can check it out.
Thank you) and how to make tooltip for these items?
And sorry my knowledge of English is not very good.
 
Level 14
Joined
Jan 24, 2017
Messages
280
Thank you) and how to make tooltip for these items?
And sorry my knowledge of English is not very good.
 
Status
Not open for further replies.
Top