• 🏆 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!

UI: OriginFrames

Didn't see your edit earlier.
in jass in a callable function it would be.
JASS:
function MoveMinimapOutOf43Screen takes nothing returns nothing
    local framehandle parent = BlzGetFrameByName("ConsoleUIBackdrop", 0)
    local framehandle frame = BlzGetFrameByName("MiniMapFrame", 0)
    call BlzFrameSetParent(frame, parent)
    call BlzFrameSetAbsPoint(frame, FRAMEPOINT_BOTTOMLEFT, 0.9, 0.3)
    call BlzFrameSetAbsPoint(frame, FRAMEPOINT_TOPRIGHT, 1.05, 0.45)
endfunction
The code above would move the minimap outside the 4:3Screen to the right middle.
But beaware that with "ConsoleUIBackdrop" as parent the Minimap is layerwise below SimpleFrames.
 
Level 4
Joined
May 19, 2020
Messages
319
Didn't see your edit earlier.
in jass in a callable function it would be.
JASS:
function MoveMinimapOutOf43Screen takes nothing returns nothing
    local framehandle parent = BlzGetFrameByName("ConsoleUIBackdrop", 0)
    local framehandle frame = BlzGetFrameByName("MiniMapFrame", 0)
    call BlzFrameSetParent(frame, parent)
    call BlzFrameSetAbsPoint(frame, FRAMEPOINT_BOTTOMLEFT, 0.9, 0.3)
    call BlzFrameSetAbsPoint(frame, FRAMEPOINT_TOPRIGHT, 1.05, 0.45)
endfunction
The code above would move the minimap outside the 4:3Screen to the right middle.
But beaware that with "ConsoleUIBackdrop" as parent the Minimap is layerwise below SimpleFrames.
It works... But unfortunately it only works if I have the "black background" activated.
In my case, I use the "call BlzFrameSetVisible(BlzGetFrameByName("ConsoleUIBackdrop",0), false)" function and in that sense, the Minimap won't appear either.
I need to be without the black background too... since I use portraits without backgrounds, in BlizzCon style, I need to keep "ConsoleUIBackdrop" disabled.
Did this have to do with the parent? There would be another way using another parent.. removing the Mini Map from the 4: 3 screen and at the same time the black background does not show up?
Thanks for listening!
 
Last edited:
Level 4
Joined
May 19, 2020
Messages
319
I thank Tasyen for the vJASS code. You're crack!!!

You can use this function to move away the black background, and still have its children visible:
Lua:
BlzFrameSetAbsPoint(BlzGetFrameByName("ConsoleUIBackdrop", 0), FRAMEPOINT_TOPRIGHT, 0, -0.8)
Thanks brother, you saved my afternoon ... lol
Now it keeps the black background hidden and preserves the Minimap.
 
Last edited:
Hello, I've been trying to hide the ORIGIN_FRAME_HERO_HP_BAR & ORIGIN_FRAME_HERO_MANA_BAR by using the BlzFrameSetVisible with the correct index and noted that it didn't work, I'd say I passed the right parameter as I can change their size, setting them to 0.0001 to hide them, I was just wondering is this is... the correct way? Why can't I hide those frame?
 
The game might reshow them when something happens to heroes.

Another way to hide something is to create a custom hidden Frame. The wanted hidden Frames become the children of that custom frame. Frames can only be visible when their parent is visible, hence by doing it that way the frames become hidden and the default game logic is unlikely to change it because it does not know about that changed parentShip.
If the target frame belongs to the Frame-Group you also need a FRAME-Parent, for SimpleFrames you need a SIMPLEFRAME-Parent.

HeroFrames should belong to the SimpleFrames.

JASS:
local framehandle newParent = BlzCreateFrameByType("SIMPLEFRAME", "", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0)
local framehandle frameA = BlzGetOriginFrame(ORIGIN_FRAME_HERO_MANA_BAR, 0)
call BlzFrameSetVisible(newParent, false)
call BlzFrameSetParent(frameA, newParent)

Might not work that well for Texture/String-SimpleFrames.
 
Last edited:
Level 3
Joined
Oct 30, 2020
Messages
20
Is it possible to perform a click directly on the specific frame?
e.g. I can get this frame BlzGetFrameByName("InventoryButton_0", 0)
Can I somehow invoke this frame using code (simulate mouse click)?
 
Level 9
Joined
Mar 26, 2017
Messages
376
Yes, this is done with BlzFrameClick, if it involves a clickable button frame.

I'm not sure if it'll produce desired results for Inventory frame, but it does work with the Menu buttons for instance.
 
Level 3
Joined
Oct 30, 2020
Messages
20
Yes, this is done with BlzFrameClick, if it involves a clickable button frame.

I'm not sure if it'll produce desired results for Inventory frame, but it does work with the Menu buttons for instance.

Hmm, Thank you.
Btw do you know how can I find this frame? Looks like drop-down menu. This is statistic in Dota (kills/deaths/assists) and so on.

thumb_show.php


I am talking about this red lined element at the top right corner.
 
Level 9
Joined
Mar 26, 2017
Messages
376
I'm not sure but can you try this: "MultiboardMinimizeButton"

Also if you just mean to minimize a multiboard, you can use following function;

Code:
native MultiboardMinimize               takes multiboard lb, boolean minimize returns nothing
 
Level 3
Joined
Oct 30, 2020
Messages
20
Ohh. Looks like this native functions (BlzGetFrameByName, BlzFrameClick) were added in 1.31 patch. But I would like to work get frames and make click on them in 1.26 version of Warcraft III. So it's impossible in 1.26, right? :peasant-blushing:
 
Many Origin-Frames are not contained in fdf only in gameCode, ORIGIN_FRAME_UNIT_MSG is one of these. Such gameCode ones can only (if at all) be reached over OrginFrame-access or over parent/child natives (There is a list of some child access in the First Post in a hidden block, UI: OriginFrames | HIVE (hiveworkshop.com)).
 
Level 10
Joined
Sep 27, 2009
Messages
24
Thank you very much for all your hard work making these tutorials. I learned so much, I like how you link all the tutorials together as they all correspond with one another. Beautiful work, you will make already amazing Warcraft III Maps look even better thanks to your teachings. I cant wait to learn more from you.
 
One could export the default cooldown model and scale it down then import the scaled down model into your map, either onto the default Cooldown path or by changing the used model in game interface. Though Item cooldown's would also scale down at the same time.

I am unsure how to change the actual cooldown frame.
 
Level 12
Joined
Mar 13, 2020
Messages
421
One could export the default cooldown model and scale it down then import the scaled down model into your map, either onto the default Cooldown path or by changing the used model in game interface. Though Item cooldown's would also scale down at the same time.

I am unsure how to change the actual cooldown frame.

@Tasyen Thanks for your Anwser, so i think i scale them up again so it looks better
 

Cokemonkey11

Code Reviewer
Level 29
Joined
May 9, 2006
Messages
3,516
Not really. For some reasons custom Frames can not leave the 4:3 Screen, I say custom cause there are Frames that can leave it like Multiboards, TimerDialogs, LeaderBoard unsure about that Hero Buttons they could be simple frames which would free them anyway from the restriction. Currently only custom SimpleFrames can leave the 4:3 Part.

@Tasyen I don't think this is really true, I've seen this done. Since writing this, have you come across a technique to put frames flush to the right-hand-side of the 16:9 world frame?
 
One can create custom Frames as children/offspring of a Frame that can leave the 4:3 Screen than they can also leave the 4:3 Screen.
It seems like the 4:3 Screen Limition for Frames can be avoided by creating them as child/offspring of ("ConsoleUIBackdrop", 0). ("ConsoleUIBackdrop", 0) does only exist in Reforged.
The custom Frame does not have to be a direct Child it also can be a child's child of ("ConsoleUIBackdrop", 0).
But by using that the Frame drops Layerwise below default SimpleFrames.
One also has to get rid of the blackbox ("ConsoleUIBackdrop", 0) in a different manner when one use it as parent. Hiding it is in that case no option.
It also can be used to move for example the minimap out of the 4:3 Screen like shown in the Lua code following:
one swaps the parent of the Minimap to ConsoleUIBackdrop then one sets the position
Lua:
do
    local real = MarkGameStarted
    function MarkGameStarted()
        real()
    local parent = BlzGetFrameByName("ConsoleUIBackdrop", 0)
    local frame = BlzGetFrameByName("MiniMapFrame", 0)
    BlzFrameSetParent(frame, parent)
     BlzFrameSetAbsPoint(frame, FRAMEPOINT_BOTTOMLEFT, 0.9, 0.3)
     BlzFrameSetAbsPoint(frame, FRAMEPOINT_TOPRIGHT, 1.05, 0.45)
end
end
View attachment 359406
Edited: Replaced selfexecution with a less problematic approach

I searched for other such Frames that can leave the 4:3 Screen which also exist in 1.31.1.
Now that I think about it there are 3 Frames that can Leave the 4:3 Screen, when starting the map with 16:9 they are pushed to the top right outside of 4:3.
I talk about Multiboard, TimerDialog and LeaderBoard.


Unlike "ConsoleUIBackdrop" they do not exist until one creates them with the none frame creater api. They are also above SimpleFrames.

After they are created one can get the frame handling them by name. I recomment either LeaderBoard or MultiBoard. TimerDialog has a complex/wierd CreateContext usage, the other two are much simpler. LeaderBoard or Multiboard always use createContext 0.
Anyway I suggest LeaderBoard.
it would be TimerDialog, but TimerDialog has wierd behaviours. I also encountered a bug when I used BlzGetFrameByName("TimerDialog", 0) as parent, when I used restart map the custom Frame was not shown anymore.​

A Lua example to spawn a ScriptDialogButton right to the command buttons.
Lua:
do
    local real = MarkGameStarted
  function MarkGameStarted()
        real()
    CreateLeaderboardBJ(bj_FORCE_ALL_PLAYERS, "title")
    local parent = BlzGetFrameByName("Leaderboard", 0)
    BlzFrameSetSize(parent, 0, 0)
    BlzFrameSetVisible(BlzGetFrameByName("LeaderboardBackdrop", 0), false)
    BlzFrameSetVisible(BlzGetFrameByName("LeaderboardTitle", 0), false)
    local button1 = BlzCreateFrameByType("GLUETEXTBUTTON", "name", parent, "ScriptDialogButton", 0)
    BlzFrameSetAbsPoint(button1, FRAMEPOINT_LEFT , 0.85, 0.1)
end
end
First one creates the LeaderBoard with the normal api. Then one gets the new frame sets the size to 0 to make the screen space it takes clickable for the playable-world. Then one hides the Title and Backdrop Frame (to fix a grafic glitch). After that one uses it as parent of the Frame.
If one wants to use LeaderBoards, one has to save the parentFrame in a global and has to show it with BlzFrameSetVisible after the other was shown.

Edited: Replaced selfexecution with a less problematic approach
 
Level 9
Joined
Mar 26, 2017
Messages
376
Hi Tasyen,

You have any idea how to change the look of the ORIGIN_FRAME_SYSTEM_BUTTON?
I don't mean the text inside, but the button itself.

I cannot find system button in the game fdf's, and the origin frames don't seem to have a child.
 
Hi Tasyen,

You have any idea how to change the look of the ORIGIN_FRAME_SYSTEM_BUTTON?
I don't mean the text inside, but the button itself.

I cannot find system button in the game fdf's, and the origin frames don't seem to have a child.
The System Buttons belong to the SimpleFrames and can be found in "ui\framedef\ui\upperbuttonbar.fdf". Their Texture could be changed by setting the used Texture in game interface to something different. Key "UpperMenuButtonTexture"

I have no idea how one would change them during the game.


Hi. It became known how to get rid of this frame?
If you use the lastest version of warcraft 3, Then yes.
One can access that frame over the Frame-Child api and change the parentship of the group selection frame to a custom SimpleFrame which is allways hidden.

That groupSelection Frame is the 5 child of the BottomCenter UI.
My description mentioned earlier in Lua though it should be put into a function that runs at 0s or later. In this example I place the buttonContainer not the groupSelection into the customFrame.
Lua:
local bottomUI = BlzFrameGetParent(BlzGetFrameByName("SimpleInfoPanelUnitDetail", 0))
local groupFrame = BlzFrameGetChild(BlzFrameGetChild(bottomUI, 5),0)
local customFrame = BlzCreateFrameByType("SIMPLEFRAME", "", BlzGetFrameByName("ConsoleUI", 0), "", 0)
BlzFrameSetParent(groupFrame, customFrame)
BlzFrameSetVisible(customFrame, false)
After this run the Group selection Button are not visible anymore hence can not be clicked with the Mouse, but one can still change the current Main Unit using the hotkey.

I noted some of this UI-childFrames in a spoiler in this tutorial
UI: OriginFrames | HIVE (hiveworkshop.com)
 
Level 4
Joined
Nov 4, 2019
Messages
47
Lua:
local bottomUI = BlzFrameGetParent(BlzGetFrameByName("SimpleInfoPanelUnitDetail", 0))
local groupFrame = BlzFrameGetChild(BlzFrameGetChild(bottomUI, 5),0)
local customFrame = BlzCreateFrameByType("SIMPLEFRAME", "", BlzGetFrameByName("ConsoleUI", 0), "", 0)
BlzFrameSetParent(groupFrame, customFrame)
BlzFrameSetVisible(customFrame, false)
Wow! Perfect! Thanks
 
Level 9
Joined
Mar 26, 2017
Messages
376
Hi Tasyen, Another question from me :)
I'm looking at displaying information through the default quest panels. However, there is a big black hole in the middle of the quest display, and only a tiny portion of the screen displays text. It is really annoying to read through this.

1618166751463.png


I was hoping there is a way to manipulate the quest frames to use the full text field. I looked through the game fdf's, and found some frames that might be promising, but unfortunately, they didn't do anything.

Lua:
local f = fbn("QuestDisplay", 0)
BlzFrameClearAllPoints(f)
fap(f, tr, .4, -.3)
BlzFrameSetSize(f, .3, .3)

local f = fbn("QuestListItem", 0)
BlzFrameClearAllPoints(f)
fap(f, tr, .4, -.3)
BlzFrameSetSize(f, .3, .3)

You know if it possible to improve this situation?
 
The Quest Frames are created when they are needed. Force the players to open the quest Dialog and close the quest Dialog. After that change the Quest Frames.
Could look like that:
JASS:
call BlzFrameClick(BlzGetFrameByName("UpperButtonBarQuestsButton", 0))
call BlzFrameClick(BlzGetFrameByName("QuestAcceptButton", 0))

call BlzFrameSetSize(BlzGetFrameByName("QuestItemListContainer", 0), 0.01, 0.01)
call BlzFrameSetSize(BlzGetFrameByName("QuestItemListScrollBar", 0), 0.001, 0.001)
 

deepstrasz

Map Reviewer
Level 68
Joined
Jun 4, 2009
Messages
18,706
Hey, sorry for the bother. I'm having some issues. I'm using these triggers:
Code:
Custom script:   BlzFrameSetAllPoints( BlzGetOriginFrame(ORIGIN_FRAME_WORLD_FRAME,0), BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI,0) )
Custom script:   BlzHideOriginFrames( true )

And when I try to revert them:
Code:
Custom script:   BlzFrameSetAllPoints( BlzGetOriginFrame(ORIGIN_FRAME_WORLD_FRAME,1), BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI,1) )
Custom script:   BlzHideOriginFrames( false )

And the result is this:
anima2.png
from this:
anima.png
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,182
You are using 1 as the index/id which I don't think is correct?
There is only one world frame and one game frame so you'd need to use index 0.

Additionally:
Custom script: BlzFrameSetAllPoints( BlzGetOriginFrame(ORIGIN_FRAME_WORLD_FRAME,0), ORIGINAL WORLD POSITION VARIABLE HERE) )
Custom script: BlzHideOriginFrames( false )

because you changed the original world points you cannot dynamically get the position anymore. You'd need to hardcode it (I forget how the coordinate system works, but presumably 0, 0?) but you could just save the data on init instead.

I suppose there is also a slim chance that you cannot reset/go back, I have not tried it myself.
 
Level 9
Joined
Mar 26, 2017
Messages
376
Yet another UI question :)

Is there a Unit Panel frame that can be used to control the visibility of UI elements? Specifically Heroes.

For instance this can be done for Inventory, by using this as a parent: BlzGetOriginFrame(ORIGIN_FRAME_ITEM_BUTTON, 0)
But for Unit Panel (and specifically Heroes) I have tried a bunch of Unit Panel frames and their parents, but none work succesfully to control visibility of UI.

Hope there is a known frame, it would be much better than a trigger on selections.
 
There are some Hero SimpleFrames in the single Unit selection.

The Parent of the Hero simpleframes
("SimpleInfoPanelIconHero", 6)

The Parent of the attribute texts
("SimpleInfoPanelIconHeroText", 6)

this one only shows for own heroes without active morph/poly
("SimpleHeroLevelBar", 0)

As all belong to SimpleFrames you can only create other SimpleFrames as their children, if you can not do that you might have to use a timer and mimic visibility.
 
Level 9
Joined
Mar 26, 2017
Messages
376
There are some Hero SimpleFrames in the single Unit selection.

The Parent of the Hero simpleframes
("SimpleInfoPanelIconHero", 6)

The Parent of the attribute texts
("SimpleInfoPanelIconHeroText", 6)

this one only shows for own heroes without active morph/poly
("SimpleHeroLevelBar", 0)

As all belong to SimpleFrames you can only create other SimpleFrames as their children, if you can not do that you might have to use a timer and mimic visibility.
Oh Awesome. I had been using Frames instead of Simpleframes, therefore it didn't work at first.
 
Level 2
Joined
Jun 18, 2021
Messages
5
Sorry to bother you Tasyen,I'm trying to move and zoom "CommandButton". Do you know how to find the frame of this skill cooldown?
 

Attachments

  • QQ截图20211127174624.png
    QQ截图20211127174624.png
    925.5 KB · Views: 66
fiddling with Cooldown Frames is much unsafe work.
But I advise scale the cooldown model, it limits you to the same scale (default size vs new size) for both items&commandbuttons but it is far easier.

If you wana try use the frame child api. At the beginning force the selection of a shop-Unit with all command buttons & item buttons occuppied and on cooldown. That will bring all the needed frames into "life". Then you can reach them using the child Frame API:
BlzFrameGetChild(frame, index)

Before an unit was selected "CommandBarFrame" has 24 childs "CommandButton_0" to "CommandButton_11" and (ORIGIN_FRAME_COMMAND_BUTTON,0 to 11)
After an unit was selected ORIGIN_FRAME_COMMAND_BUTTONs become children of "CommandButton_0" to "CommandButton_11"
[0] "CommandBarFrame"
[0 to 11] "CommandButton_0" to "CommandButton_11"
[0] ORIGIN_FRAME_COMMAND_BUTTON
Created when required
[0] Cooldown
[1]
[2] ChargeBox
 
Level 4
Joined
Apr 20, 2023
Messages
43
Screenshot_2023-05-04-22-46-16-58_149003a2d400f6adb210d7e357a3a646.jpg

hi guys, in this screenshot,(if i wait long time and do not anything )it will show the this panel ingame, which text means wait host,button means disconnect. how can i hide this panel?or use script close it? i am not find this panel UI name in your article. hope you can get help! many thanks.
 
It won't help you, if you just hide that "disconnected" panel. There are network problems or worser a desync.

To reduce desync risk, players should not have played any different map before (warcraft 3 does not correctly undo used files/gameplay constants etc).

some natives give unexpected values when the game is minimized like screen height = 0 which can lead to a div 0 thread crash.

The async map script (GetLocalPlayer() & others) needs to be careful to not alter (in)direct the gamestate or values relevant for sync checksums.

But anyway that ui-frame is named ("UnresponsiveDialog", 0)
 
Level 4
Joined
Apr 20, 2023
Messages
43
It won't help you, if you just hide that "disconnected" panel. There are network problems or worser a desync.

To reduce desync risk, players should not have played any different map before (warcraft 3 does not correctly undo used files/gameplay constants etc).

some natives give unexpected values when the game is minimized like screen height = 0 which can lead to a div 0 thread crash.

The async map script (GetLocalPlayer() & others) needs to be careful to not alter (in)direct the gamestate or values relevant for sync checksums.

But anyway that ui-frame is named ("UnresponsiveDialog", 0)
thank you guys, it very helpful the me!
 
Level 4
Joined
Apr 20, 2023
Messages
43
It won't help you, if you just hide that "disconnected" panel. There are network problems or worser a desync.

To reduce desync risk, players should not have played any different map before (warcraft 3 does not correctly undo used files/gameplay constants etc).

some natives give unexpected values when the game is minimized like screen height = 0 which can lead to a div 0 thread crash.

The async map script (GetLocalPlayer() & others) needs to be careful to not alter (in)direct the gamestate or values relevant for sync checksums.

But anyway that ui-frame is named ("UnresponsiveDialog", 0)
Screenshot_2023-05-08-01-21-21-21_149003a2d400f6adb210d7e357a3a646.jpg

i try use lua script to hide it, but it seems not work, (set frame width 0 height0.11111)could you give me example api to hide it?
 
Maybe try to start the game in offline mode. Reforged can be launched without loging in for ~3 weeks with an exe arg -launch.

That UnresponsiveDialog is created when needed, until that point it does not exist (only for the players losing conection to the server and pauses the game means it freezes timers, one can't access the frame until it shows up and accessing the frame in mp when it exists ensures the dc.)
BlzFrameSetVisible(BlzGetFrameByName("UnresponsiveDialog", 0), false)
 
Level 4
Joined
Apr 20, 2023
Messages
43
Maybe try to start the game in offline mode. Reforged can be launched without loging in for ~3 weeks with an exe arg -launch.

That UnresponsiveDialog is created when needed, until that point it does not exist (only for the players losing conection to the server and pauses the game means it freezes timers, one can't access the frame until it shows up and accessing the frame in mp when it exists ensures the dc.)
BlzFrameSetVisible(BlzGetFrameByName("UnresponsiveDialog", 0), false)
thank you for your reply,i will try it again
 
Top