• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

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,853
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,853
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: 5
(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.
 
Level 12
Joined
Jan 10, 2023
Messages
191
For the cooldown frame, I think you could move them off-screen, I don't seem to have any issue doing this with other frames such as the chat when I move them below or to the right of the screen, it might be worth testing if you need the cooldown elsewhere.
 
Status
Not open for further replies.
Top