UI: OriginFrames

Level 22
Joined
Jul 18, 2010
Messages
1,761
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 8
Joined
May 19, 2020
Messages
247
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 8
Joined
May 19, 2020
Messages
247
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?
 
Level 22
Joined
Jul 18, 2010
Messages
1,761
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 2
Joined
Oct 30, 2020
Messages
18
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 2
Joined
Oct 30, 2020
Messages
18
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 8
Joined
Mar 26, 2017
Messages
350
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 2
Joined
Oct 30, 2020
Messages
18
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:
 
Level 6
Joined
Sep 27, 2009
Messages
20
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.
 
Level 9
Joined
Mar 13, 2020
Messages
319
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 Moderator
Level 26
Joined
May 9, 2006
Messages
3,369
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?
 
Level 22
Joined
Jul 18, 2010
Messages
1,761
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 8
Joined
Mar 26, 2017
Messages
350
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.
 
Level 22
Joined
Jul 18, 2010
Messages
1,761
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 3
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 8
Joined
Mar 26, 2017
Messages
350
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?
 
Level 22
Joined
Jul 18, 2010
Messages
1,761
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)
 
Top