- Joined
- Jun 26, 2020
- Messages
- 1,928
Hello, I wanna move the unit group selected buttons to some place, I did this:
It worked, but I have 2 issues, I only can move them if I select a group for the first time, that's why I did the trigger, but the selection event happens after a delay, so I tried to hide it in the map init and then show it when the event fires, but that only works sometimes.
My second issue is I wanna hide the health and mana bars of the selected units, I thought that I could hide some childs of the buttonFrame, but didn't work.
vJASS:
library myLib initializer init
private function onSelect takes nothing returns nothing
local framehandle unitFrame = BlzGetFrameByName("SimpleInfoPanelUnitDetail", 0)
local framehandle bottomCenterUI = BlzFrameGetParent(unitFrame)
local framehandle groupFrame = BlzFrameGetChild(bottomCenterUI, 5)
local framehandle buttonContainerFrame = BlzFrameGetChild(groupFrame, 0)
local framehandle buttonFrame
local integer i = 0
loop
exitwhen i > 11
set buttonFrame = BlzFrameGetChild(buttonContainerFrame, i)
call BlzFrameSetAbsPoint(buttonFrame, FRAMEPOINT_TOPLEFT, 0.30 + 0.03*i, 0.19)
set i = i + 1
endloop
call BlzFrameSetVisible(BlzGetFrameByName("SimpleInfoPanelUnitDetail", 0), true)
endfunction
private function init takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterPlayerSelectionEventBJ(t, Player(0), true)
call TriggerAddAction(t, function onSelect)
call BlzFrameSetVisible(BlzGetFrameByName("SimpleInfoPanelUnitDetail", 0), false)
endfunction
endlibrary
My second issue is I wanna hide the health and mana bars of the selected units, I thought that I could hide some childs of the buttonFrame, but didn't work.