How can I hide the unit command buttons when I hide the UI and don't be able to select a unit?

Status
Not open for further replies.
Level 24
Joined
Jun 26, 2020
Messages
1,928
Hello, I made this to hide the UI:
JASS:
BlzHideOriginFrames(true)
BlzFrameSetSize(BlzGetFrameByName("ConsoleUIBackdrop",0), 0, 0.0001)
And worked well, but if I select a unit, the command buttons still appear, I think is because I didn't hide the ConsoleUIBackdrop, but I can't do that because I need it visible.
How can I hide them then? Also how can I make me won't able to select any unit to reappear them? I tried:
JASS:
BlzFrameSetEnable(BlzGetOriginFrame(ORIGIN_FRAME_WORLD_FRAME, 0), false)
But didn't work and disabling the user control is not an option because I still wanna be able to control the mouse.
What can I do?
 
You create a hidden simpleframe and make the parent of the command buttons a child of it. Then it is hidden and won't show anymore until you make it a child of "ConsoleUI" again.
Lua:
HideSimpleFrame = BlzCreateFrameByType("SIMPLEFRAME", "HideSimpleFrame", BlzGetFrameByName("ConsoleUI", 0), "", 0)
BlzFrameSetVisible(HideSimpleFrame, false)
-- Warcraft 3 V1.31
BlzFrameSetParent(BlzFrameGetParent(BlzGetOriginFrame(ORIGIN_FRAME_COMMAND_BUTTON, 0)), HideSimpleFrame)
-- Current has access by Name for it (Parent hierachy is a little bit different from V1.31)
BlzFrameSetParent(BlzGetFrameByName("CommandBarFrame", 0), HideSimpleFrame)
 
Level 24
Joined
Jun 26, 2020
Messages
1,928
You create a hidden simpleframe and make the parent of the command buttons a child of it. Then it is hidden and won't show anymore until you make it a child of "ConsoleUI" again.
Lua:
HideSimpleFrame = BlzCreateFrameByType("SIMPLEFRAME", "HideSimpleFrame", BlzGetFrameByName("ConsoleUI", 0), "", 0)
BlzFrameSetVisible(HideSimpleFrame, false)
-- Warcraft 3 V1.31
BlzFrameSetParent(BlzFrameGetParent(BlzGetOriginFrame(ORIGIN_FRAME_COMMAND_BUTTON, 0)), HideSimpleFrame)
-- Current has access by Name for it (Parent hierachy is a little bit different from V1.31)
BlzFrameSetParent(BlzGetFrameByName("CommandBarFrame", 0), HideSimpleFrame)
It worked (except that the cooldown effect is still appearing), but now for some reason everytime I leave the match, the game crashes, here is the log.
 

Attachments

  • War3Log.txt
    45.5 KB · Views: 7
(except that the cooldown effect is still appearing)
Oh no. Well abilitybutton cooldown frame access is bad. it is easier to replace the cooldown model or the texture used by the cooldown model (when they are not needed in your map).

Import a empty txt file to ui\feedback\cooldown\ui-cooldown-indicator.mdx and replace the cooldown model with it.

but now for some reason everytime I leave the match, the game crashes, here is the log.
Lucky fellow, for me the test map only crashs sometimes. When it only crashs sometimes one can't even be sure that the change fixed it.
 
Status
Not open for further replies.
Top