[JASS] How to hide system buttons and time indicator

Status
Not open for further replies.

Oli

Oli

Level 4
Joined
Aug 9, 2015
Messages
35
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: 103
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
 
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: 80
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:
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

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
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
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: 82
Status
Not open for further replies.
Back
Top