• 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.

[JASS] How to hide system buttons and time indicator

Status
Not open for further replies.

Oli

Oli

Level 3
Joined
Aug 9, 2015
Messages
33
Hi,
using this library i have hidden most of the UI. Only the system buttons and time indicator remain. The question is short and stupid, but unanswerable by me as i am an unexperienced scripter; how do I hide/remove them? (Don't have to be a function from the library i am using.)
 

Attachments

  • ui-1.PNG
    ui-1.PNG
    4.3 MB · Views: 45
I ran into the same problem a few weeks ago.
JASS:
//To hide the daytime indicator
call BlzFrameSetVisible( BlzFrameGetChild(BlzFrameGetChild(BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0),5), 0) , false )
//and the systems buttons
call BlzFrameSetVisible( BlzFrameGetChild(BlzFrameGetChild(BlzGetOriginFrame(ORIGIN_FRAME_SIMPLE_UI_PARENT,0),3),buttonNumber) , false )
//buttonNumber = 0-3
 

Oli

Oli

Level 3
Joined
Aug 9, 2015
Messages
33
I ran into the same problem a few weeks ago.
JASS:
//To hide the daytime indicator
call BlzFrameSetVisible( BlzFrameGetChild(BlzFrameGetChild(BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0),5), 0) , false )
//and the systems buttons
call BlzFrameSetVisible( BlzFrameGetChild(BlzFrameGetChild(BlzGetOriginFrame(ORIGIN_FRAME_SIMPLE_UI_PARENT,0),3),buttonNumber) , false )
//buttonNumber = 0-3
Yo this doesn't work?
(the toc line doesnt matter)
 

Attachments

  • belly.PNG
    belly.PNG
    20.8 KB · Views: 24

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
Still won't work.
(Made sure to disenable any other scripts).
That's not how you call the BlzLoadTOCFile function or any function for that matter.
vJASS:
native BlzLoadTOCFile takes string TOCFile returns boolean
^ This tells us that the function's name is BlzLoadTOCFile. It also tells us that it takes a string which serves as the name of the TOCFile that you want to load. Lastly it tells us that it will return a boolean that I assume will be True if it found the file or False if it failed.

So this is how you would call the function:
vJASS:
call BlzLoadTOCFile("TOCFile")
Then replace "TOCFile" with the full name of the file that you want to load.

But that's besides the point, you don't even need to call the BlzLoadTOCFile() function. If you delete that line from your code it should work without any errors.
 
Last edited:

Oli

Oli

Level 3
Joined
Aug 9, 2015
Messages
33
I might be a pain in the ass, but it still doesn't work for me, even after deleting and changing the non-valid line for the TOCFile (which didn't matter anyways i think as i don't have my own TOCFile). Tried turning off and on the UI Utils aswell. If I might have some questions:
1. Can you hide child frames without hiding their parent frames?
2. Is there an image, tutorial, reference or anything that would tell how frames on the UI are named (from the player's perspective)?

(Sending the changed script in attached files aswell as the map, as it seems like I can't manage this on my own)
 

Attachments

  • hiding-frames.w3m
    48.5 KB · Views: 17
  • Przechwytywanie.PNG
    Przechwytywanie.PNG
    34 KB · Views: 13

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
This seems to work:
vJASS:
function test takes nothing returns nothing
    local integer i = 0
 
    loop
        call BlzFrameSetVisible( BlzFrameGetChild(BlzFrameGetChild(BlzGetOriginFrame(ORIGIN_FRAME_SIMPLE_UI_PARENT,0),3),i) , false )
        set i = i + 1
        exitwhen i > 3
    endloop
 
    call BlzFrameSetVisible( BlzFrameGetChild(BlzFrameGetChild(BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0),5), 0) , false )
endfunction
  • call test
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
    • Conditions
    • Actions
      • Custom script: call test()
I tested it with UI Utils disabled.
 
Last edited:
  • Like
Reactions: Oli
I might be a pain in the ass, but it still doesn't work for me, even after deleting and changing the non-valid line for the TOCFile (which didn't matter anyways i think as i don't have my own TOCFile). Tried turning off and on the UI Utils aswell. If I might have some questions:
1. Can you hide child frames without hiding their parent frames?
2. Is there an image, tutorial, reference or anything that would tell how frames on the UI are named (from the player's perspective)?

(Sending the changed script in attached files aswell as the map, as it seems like I can't manage this on my own)
Your code isn't being run. "Run on map initialization" doesn't work here. It executes a trigger after creating it, but you don't have a trigger here, only a function. Try this:
Code:
scope test initializer test

function test takes nothing returns nothing
	local integer i = 0
	call BlzFrameSetVisible(BlzFrameGetChild(BlzFrameGetChild(BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), 5), 0), false)
	loop
		exitwhen i > 3
		call BlzFrameSetVisible(BlzFrameGetChild(BlzFrameGetChild(BlzGetOriginFrame(ORIGIN_FRAME_SIMPLE_UI_PARENT, 0), 3), i), false)
		set i = i+1
	endloop
	set i = 0
endfunction

endscope
This will hide the Daytime Indicator. The system buttons still don't hide unless you disable UI Utils. Why that happens, I have no idea. Someone else has to answer.
 
  • Like
Reactions: Oli
Level 11
Joined
Dec 11, 2009
Messages
234
Try this:
JASS:
call BlzFrameSetVisible(BlzGetOriginFrame(ORIGIN_FRAME_SYSTEM_BUTTON, 0), false) // F10 (Menu)
call BlzFrameSetVisible(BlzGetOriginFrame(ORIGIN_FRAME_SYSTEM_BUTTON, 1), false) // F11 (Allies)
call BlzFrameSetVisible(BlzGetOriginFrame(ORIGIN_FRAME_SYSTEM_BUTTON, 2), false) // F12 (Log)
call BlzFrameSetVisible(BlzGetOriginFrame(ORIGIN_FRAME_SYSTEM_BUTTON, 3), false) // F9  (Quests)
 
  • Like
Reactions: Oli

Oli

Oli

Level 3
Joined
Aug 9, 2015
Messages
33
Thanks a lot to everyone. I have changed my concept from making a loop to calling each frame individually and made a scope as Antaras said (ty!). This is the final trigger if someone wants to see it.
 

Attachments

  • Przechwytywanie.PNG
    Przechwytywanie.PNG
    26.7 KB · Views: 29
Status
Not open for further replies.
Top