UI: OriginFrames

Level 8
Joined
Mar 26, 2017
Messages
350
Hello Tasyen.

I cannot seem to be able to make the ORIGIN_FRAME_PORTRAIT_HP_TEXT reappear after hiding all UI;
Lua:
BlzFrameSetVisible(BlzGetOriginFrame(ORIGIN_FRAME_PORTRAIT_HP_TEXT,0)

Trying to set its parent causes an immediate crash;
Lua:
BlzFrameSetParent(BlzGetOriginFrame(ORIGIN_FRAME_PORTRAIT_HP_TEXT,0), BlzGetOriginFrame(ORIGIN_FRAME_PORTRAIT,0))

Is there any way to do this?
 
Level 8
Joined
Mar 26, 2017
Messages
350
Aww that is a shame. I was almost there with my desired UI settings :(
Indeed I will have to do it the other way around then, and see if I am able to hide all unwanted UI elements.

Thanks for the answer.
 
Level 8
Joined
Mar 26, 2017
Messages
350
Well I have to say, hiding unwanted UI elements turned out to not be so cumbersome. I just had to hide some Origin Frames, and overwrite the racial UI textures with a blank image.

There is just one thing I want to hide, and I cannot find it among origin frames and simple frames: the Idle Worker button.
It does hide with BlzHideOriginFrames, so I reckon this is an Origin Frame. Do you perhaps know how to hide this?
 
Level 12
Joined
Jan 30, 2020
Messages
876
Hello there !!!

@Tasyen : sorry to bother you again, but I just found out about a terrible problem with one of the origin frames :

If you try to move ORIGIN_FRAME_UNIT_MSG, the frame that actually displays all messages to players, it will actually move (although in a strange way),
But it will cause random (in some cases systematical) crashes when using the Lua print command.

This has given me nightmares for more than a week because I had no idea what caused these crashes.
With the help of @Planetary 's advice, I disabled all my script functions and re-enabled them one by one until I found the faulty part :

Lua:
    -- Messages
    fh=BlzGetOriginFrame(ORIGIN_FRAME_UNIT_MSG, 0)
    -- BlzFrameSetVisible(fh, true)
    BlzFrameClearAllPoints(fh)
    BlzFrameSetAbsPoint(fh, FRAMEPOINT_TOPLEFT, 0.15, 0.44)
    BlzFrameSetAbsPoint(fh, FRAMEPOINT_BOTTOMRIGHT, 0.50, 0.12)

This just makes the map impossible to debug because of these print or debug_msg attempts that crash the whole game.

It would be nice to add this information to your tutorial, to save other players the same trouble that was honestly discouraging (before finding out).


The other problem it leads to is : how can we move that frame properly after :
BlzFrameSetAbsPoint(BlzGetFrameByName("ConsoleUI", 0), FRAMEPOINT_BOTTOM, 0.0, -0.24) as the UNIT_MSG Frame follows the Console and thus is shifted towards the bottom...


I also have another simple question.

Currently, you might have noticed my map displays text on the floor.

I use a special model made of 81 planes with appropriate TVertices to each cover a letter on a grid of 9x9 letters in a Texture.
I am actually currently remaking this model to have higher resolution text, a nicer font and a 10x10 grid for more characters.
It uses 100 animations (lazy, I am using "Stand - 0" to "Stand - 99" and set the animations by ID to makes things easier.

Anyways, the question I have is : is there any way to display a custom frame (that won't move) on the ground ? Or maybe a picture ?
If this is the case, I wouldn't need a dedicated complex model anymore.

Take care !!!
 
Last edited:
Level 23
Joined
Jul 18, 2010
Messages
1,771
If you try to move ORIGIN_FRAME_UNIT_MSG, the frame that actually displays all messages to players, it will actually move (although in a strange way),
But it will cause random (in some cases systematical) crashes when using the Lua print command.
There was some problem with moving ORIGIN_FRAME_UNIT_MSG to the original minimap coords which is this bottomright y=0.12 in your example code. If it would be a little bit higher you would not encounter crashes when I remeber right, did some time ago test together with doomsheep who was telling my about that problem.

BlzFrameSetAbsPoint(BlzGetFrameByName("ConsoleUI", 0), FRAMEPOINT_BOTTOM, 0.0, -0.24)
as the UNIT_MSG Frame follows the Console and thus is shifted towards the bottom...
Sounds silly but, one could wait 1 second after having moved the ConsoleUI.
 
Level 12
Joined
Jan 30, 2020
Messages
876
Oops I was so drawn in my attempts to access the inactive worker Icon frame that I nearly miss your reply !!!

As for the coordinates, I tried to change them :
Code:
    -- Messages
    fh=BlzGetOriginFrame(ORIGIN_FRAME_UNIT_MSG, 0)
    BlzFrameClearAllPoints(fh)
    BlzFrameSetAbsPoint(fh, TOPLEFT, 0.11, 0.42)
    BlzFrameSetAbsPoint(fh, BOTTOMRIGHT, 0.52, 0.14)
But it still crashes my print() attempts. Is the 0.11 x coordinate the issue ?

I had another important question :
- let's say I manage to position the message frame properly, how do the coordinates like in this example :
function DisplayMessageTimed(d) DisplayTimedTextToPlayer(Player(LocalPn-1), 0.15, 0.42, d, Message) end
work once the frame position is changed ? It seems like the coordinates are still absolute because my text does not seem to move as expected.

Maybe a custom frame would do a better job, I'll have to try this alternative...

Sounds silly but, one could wait 1 second after having moved the ConsoleUI

I have to admit I had not thought of that, I'll give this a try too.

Thank you !!!
 
Level 1
Joined
May 26, 2020
Messages
5
the 3d-face should be hidden after using call BlzHideOriginFrames(true), atleast that happens for me.
Help me=)
How to hide this text?
 

Attachments

  • WC3ScrnShot_052620_231254_001.png
    WC3ScrnShot_052620_231254_001.png
    1.3 MB · Views: 124
Level 23
Joined
Jul 18, 2010
Messages
1,771
Can't read that but it looks like "SimpleNameValue" , "SimpleClassValue" and "InventoryText".
InventoryText can be get rid of with Game Interface, their one can change the displayed text to a space " ". One also could do that with code requires the newest version (while the Game Interface works also in 1.31.1)
"SimpleNameValue" and "SimpleClassValue" are probaly most easiest made invisible with a 0 size font.
Lua:
do
  local real = MarkGameStarted
  function MarkGameStarted()
    real()
    local frame = BlzGetFrameByName("SimpleNameValue", 0)
    BlzFrameSetFont(frame, "", 0, 0)
    frame = BlzGetFrameByName("SimpleClassValue", 0)
    BlzFrameSetFont(frame, "", 0, 0)
    --below does not work in V1.31
    frame = BlzGetFrameByName("InventoryText", 0)
    BlzFrameSetText(frame, "")
  end
end
Edited: Replaced selfexecution with a less problematic approach
 
Last edited:
Level 1
Joined
May 26, 2020
Messages
5
Can't read that but it looks like "SimpleNameValue" , "SimpleClassValue" and "InventoryText".
InventoryText can be get rid of with Game Interface, their one can change the displayed text to a space " ". One also could do that with code requires the newest version (while the Game Interface works also in 1.31.1)

"SimpleNameValue" and "SimpleClassValue" are probaly most easiest made invisible with a 0 size font.
Lua:
TimerStart(CreateTimer(), 0.0, false, function()
    local frame = BlzGetFrameByName("SimpleNameValue", 0)
    BlzFrameSetFont(frame, "", 0, 0)
    frame = BlzGetFrameByName("SimpleClassValue", 0)
    BlzFrameSetFont(frame, "", 0, 0)
    --below does not work in V1.31
    frame = BlzGetFrameByName("InventoryText", 0)
    BlzFrameSetText(frame, "")
end)

Which frame is responsible for this?
 

Attachments

  • 12.png
    12.png
    1.2 MB · Views: 172
Level 8
Joined
Mar 26, 2017
Messages
350
There is just one thing I want to hide, and I cannot find it among origin frames and simple frames: the Idle Worker button.
It does hide with BlzHideOriginFrames, so I reckon this is an Origin Frame. Do you perhaps know how to hide this?

Just wanted to mention in this topic a new native that makes the above possible (as mentioned by Tasyen)

Lua:
--Worker Button
BlzFrameGetChild(BlzGetFrameByName("ConsoleUI", 0), 7)
 
Level 12
Joined
Jan 30, 2020
Messages
876
Thanks for updating this post with your research conducted about the 2 new UI natives.

I don't know if I missed something while reading, but I am surprised not to find any of the messages frames on all the children you have found.
Any chance it could be one of those you haven't managed to find out yet ?

Still trying to access some messaging frames, like the one displaying some upgrades informations, or other specific messages that are not directly linked to the CHAT, TOP_MSG or UNIT_MSG.
 
Level 23
Joined
Jul 18, 2010
Messages
1,771
I don't know if I missed something while reading, but I am surprised not to find any of the messages frames on all the children you have found.
Any chance it could be one of those you haven't managed to find out yet ?
I have not found them, also if this frames are String we can not access them with the current behaviour of the child natives.
 
Level 12
Joined
Jan 30, 2020
Messages
876
Ok thanks for these precisions. Well let's hope we'll find ways some time - or maybe Blizzard gives us some more changes/natives to finally be able to have total control of the UI :)
 
Level 12
Joined
Jan 30, 2020
Messages
876
I have some information about a specific child frame.

When hunting the reason for my map's crashes in multiplayer, I finally found the code responsible for it.
My map has a hero builder, but players can buy a unique unit builder. The worker classification gives this unit an inactive worker icon.

As you have noticed, you can access it thanks to the new BlzFrameGetChild. The inactive worker icon container is the 7th child of the Console UI. The child of this container is the icon itself, and the icon's child is the worker counter.
To sum up, you can access the counter with BlzFrameGetChild(BlzFrameGetChild(BlzFrameGetChild(ConsoleUI, 7), 0), 0)
This frame (the counter) only exists after a first worker is created in the map.

So what I did is create a global boolean variable called FirstHealer, set to true at map init.

If the boolean is true once a first player buys a worker, it is set to false to prevent redundancy, and then a one time 0.5s timer is started (just for security, it seems that trying to access this frame immediately causes issues).
Once the timer expires, I move the worker counter off screen with the command :
BlzFrameSetAbsPoint(fBlzFrameGetChild(BlzFrameGetChild(BlzFrameGetChild(ConsoleUI, 7), 0), 0), FRAMEPOINT_BOTTOM, 0.0, -0.6)

This works perfectly... in single player.

In multiplayer, doing this crashes all other player's (that don't have a worker icon) game.
I tried changing the counter's frame position in the local player context only, with identical results.

I didn't try to hide the frame because it would be useless : if it is hidden, it reappears everytime the worker becomes idle again.
I tried most of the other natives to try to move or hide this frame out of visibility, but so far all my alternative attempts have not been able to prevent the crashes.

For the moment I am still trying to find a way to render this counter invisible, but it seems impossible, at least for the moment, except in single player of course.

So I would strongly advise everyone not to try to hide this counter unless a method is found that would prevent other clients from crashing.


EDIT :
I made an attempt to get this to work by creating a dummy worker for all players referenced in my map, and this includes the computer controlled player, and even the neutral passive one.
The attempt to move the Inactive Worker icon counter off screen unfortunately still crashed most clients.
 
Last edited:
Level 23
Joined
Jul 18, 2010
Messages
1,771
Someone asked me privatly, if one could move the UnitInfo-Hover Frame to a fixed position on the screen. The answer is yes, and it should be public common knowlage hence I write that here.

The UnitInfo-Hover Frame is the child at index 8 of ConsoleUI, but it does not exist until any world object is hovered with the mouse.
Hence my solution is that one starts a periodic timer and checks the child count of ConsoleUI, when it becomes bigger than 8 one moves the Child Frame at index 8. (fails if one creates SimpleFrames as children of ConsoleUI, but creating them for GAMEUI is no problem)
The Frame has to be moved using all 4 Corner points to the wanted position on screen (3 would also be enough but one has to make sure that the frame is limited at top, Left, Bottom and right).

Could look like that in Lua

Lua:
SomeTimer = CreateTimer()
TimerStart(SomeTimer, 0, false, function()
    local parent = BlzGetFrameByName("ConsoleUI", 0)
    TimerStart(SomeTimer, 0.01, true, function()
        if BlzFrameGetChildrenCount(parent) > 8 then
            local frame = BlzFrameGetChild(parent, 8)
            --BlzFrameClearAllPoints(frame)
            BlzFrameSetAbsPoint(frame, FRAMEPOINT_TOPLEFT, 0.6, 0.25)
            BlzFrameSetAbsPoint(frame, FRAMEPOINT_TOPRIGHT, 0.8, 0.25)
            BlzFrameSetAbsPoint(frame, FRAMEPOINT_BOTTOMRIGHT, 0.8, 0.2)
            BlzFrameSetAbsPoint(frame, FRAMEPOINT_BOTTOMLEFT, 0.6, 0.2)
            PauseTimer(SomeTimer)
            DestroyTimer(SomeTimer)
            SomeTimer = nil
        end
    end)
end)
A weakness of this is, that after the moving the unitInfo-Frame will not change it's size anymore.

I only tested that in single player.
 
Last edited:
Level 12
Joined
Jan 30, 2020
Messages
876
Thanks, this is some really interesting information !
I guess we could use the same method for some other frames that do not exist yet at Map Init.

As for multiplayer, I suppose it only depends if the UnitInfo-Hover existence is synced by the game engine.
If it is not, the children count will return an async value.

In such circumstance, we'd have two options :
- check the children count locally and move the frame accordingly
- use a second timer with a long enough arbitrary duration to stop and destroy the "SomeTimer" timer.

If the children count is async, i don't know if pausing the timer will desync, but its destruction definitely will.

Note :
you don't need to nil the Timer, it has no effect. Only exception is if you'd need to test if it is nil immediately, as the reference does not disappear immediately but after a very very short duration.
 
Level 23
Joined
Jul 18, 2010
Messages
1,771
I now did a Lan test with running the game twice. As soon any player hovered an world object it desyncs.
After that I removed all actions inside the inner timer except for GetChildCount > 8 and BlzFrameGetChild. It still desyncs.

It is async, and it desyncs with using BlzFrameGetChild(parent, 8). Even when not touching the timer or the ChildFrame's values at all.

Unsure how to solve that without to much effort.

Maybe it would be smarter to force an world object hover and then do the actions.
Or one would have to setup an sync trigger which checks for the amount of player that hovered yet, but that sounds like much effort.
 
Last edited:
Level 12
Joined
Jan 30, 2020
Messages
876
I will let you post the solution you came up with when we discussed this on Discord.

This will definitely help everyone that wants to give that frame a fixed position.
I might even consider using it in my current map or my next project.

Thanks for your hard work !
 
Level 23
Joined
Jul 18, 2010
Messages
1,771
The hover frame is created local only and if it is then refered in code the game will desync for all players not having it created yet.
Hence each player will sent a Sync message telling the others he has created it. Inside the SyncTrigger when all players created it, the frame will be moved.
Lua:
do
  local real = MarkGameStarted
  function MarkGameStarted()
    real()
    local SomeTimer = CreateTimer()
    local parent = BlzGetFrameByName("ConsoleUI", 0)
    local done = false
    local force = CreateForce()
    local trigger = CreateTrigger()
    for index = 0, bj_MAX_PLAYERS-1 do BlzTriggerRegisterPlayerSyncEvent(trigger, Player(index), "HoverDetect", false) end
    TriggerAddAction(trigger, function()
        ForceAddPlayer(force, GetTriggerPlayer())
        local player
        for index = 0, bj_MAX_PLAYERS-1 do
            player = Player(index)
            if GetPlayerSlotState(player) == PLAYER_SLOT_STATE_PLAYING and GetPlayerController(player) == MAP_CONTROL_USER and not IsPlayerInForce(player, force) then
                return false
            end
        end
        print("move")
        local frame = BlzFrameGetChild(parent, 8)
        BlzFrameSetAbsPoint(frame, FRAMEPOINT_TOPLEFT, 0.6, 0.25)
        BlzFrameSetAbsPoint(frame, FRAMEPOINT_TOPRIGHT, 0.8, 0.25)
        BlzFrameSetAbsPoint(frame, FRAMEPOINT_BOTTOMRIGHT, 0.8, 0.2)
        BlzFrameSetAbsPoint(frame, FRAMEPOINT_BOTTOMLEFT, 0.6, 0.2)
        PauseTimer(SomeTimer)
        DestroyTimer(SomeTimer)
        DestroyTrigger(trigger)
        DestroyForce(force)
        SomeTimer = nil
    end)
    TimerStart(SomeTimer, 0.01, true, function()
        if BlzFrameGetChildrenCount(parent) > 8 and not done then
            done = true
            print("hovered")
            BlzSendSyncData("HoverDetect", "true")
        end
    end)
  end
end
Edited: Replaced selfexecution with a less problematic approach
 
Last edited:
Level 23
Joined
Jul 18, 2010
Messages
1,771
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
Minimap moved.jpg
Edited: Replaced selfexecution with a less problematic approach
 
Last edited:
Level 23
Joined
Jul 18, 2010
Messages
1,771
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
 
Last edited:
Level 12
Joined
Jan 30, 2020
Messages
876
Thank you for your research.

This is another really amazing possibility that might allow quite a few things and be easier to handle without side effects than the ConsoleUI Backdrop !
 
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:
TimerStart(CreateTimer(), 0, false, function()
    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)
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.
It it possible to get Frame events of nonsimple Frames created outside the 4:3 bounds that way?
 
Yes that way, one can place Frames outside of 4:3 and they can evoke Frameevents and have Tooltips from there.
I tried the test example you posted, but it seemed to block all interactions with the game. Do I have to manually reset focus?
Or is it because I use a universal world frame?
JASS:
    local framehandle f = BlzCreateFrameByType("FRAME", "", BlzGetOriginFrame(ORIGIN_FRAME_WORLD_FRAME, 0),"", 0)
   call BlzFrameSetAllPoints(f, BlzGetOriginFrame(ORIGIN_FRAME_WORLD_FRAME, 0))
How would a simple snippet creating a basic invisible frame anywhere on the screen that fires mouse_enter, mouse_leave and click events look like?
 
Level 23
Joined
Jul 18, 2010
Messages
1,771
"FRAME" does not support any Frameevent, still catches the mouseinput on the screenspace controlled by it (here the frame screen space control logic is explained to some degree).
An empty "BUTTON" is invisibile still supports many Frameevents.
an invisible only 4:3 Button could look like this in Lua:
Lua:
do
    local real = MarkGameStarted
  function MarkGameStarted()
        real()
    local button = BlzCreateFrameByType("BUTTON", "someButtonFrame", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0)
    local trigger = CreateTrigger()
    BlzFrameSetAbsPoint(button, FRAMEPOINT_CENTER, 0.4, 0.3)
    BlzFrameSetSize(button, 0.2, 0.2)
    BlzTriggerRegisterFrameEvent(trigger, button, FRAMEEVENT_CONTROL_CLICK)
    BlzTriggerRegisterFrameEvent(trigger, button, FRAMEEVENT_MOUSE_ENTER)
    BlzTriggerRegisterFrameEvent(trigger, button, FRAMEEVENT_MOUSE_LEAVE)
    TriggerAddAction(trigger, function()
        if BlzGetTriggerFrameEvent() == FRAMEEVENT_CONTROL_CLICK then
            print("Click")
            BlzFrameSetVisible(BlzGetTriggerFrame(), false)
            BlzFrameSetVisible(BlzGetTriggerFrame(), true)
        elseif BlzGetTriggerFrameEvent() == FRAMEEVENT_MOUSE_ENTER then
            print("Enter")
        elseif BlzGetTriggerFrameEvent() == FRAMEEVENT_MOUSE_LEAVE then
            print("Leave")
        end
    end)
  end
end
when you want that also out of the 4:3 one has to change the parent of the BUTTON.
Edited: Replaced selfexecution with a less problematic approach
 
Last edited:
Level 3
Joined
Jan 20, 2020
Messages
48
Is it possible to (once all of the UI is hidden) just show the unit inventory? The SimpleInfoPanel shows the inventory, but also the unit's weapon, armor ect.
 
Level 8
Joined
Feb 7, 2020
Messages
291
Is it possible to (once all of the UI is hidden) just show the unit inventory? The SimpleInfoPanel shows the inventory, but also the unit's weapon, armor ect.
You should be able to show each of the buttons individually with their frame name or by using the new BlzFrameGetChild() function (more here UI: OriginFrames).
Lua:
local ib = {
    [0] = "InventoryButton_0",
    [1] = "InventoryButton_1",
    [2] = "InventoryButton_2",
    [3] = "InventoryButton_3",
    [4] = "InventoryButton_4",
    [5] = "InventoryButton_5"
}
for i = 0,#ib do
    BlzFrameSetVisible(BlzGetFrameByName(ib[i],0), true)
end
 
Level 3
Joined
Jan 20, 2020
Messages
48
Thanks man, i'll try that out in a little bit!
You should be able to show each of the buttons individually with their frame name or by using the new BlzFrameGetChild() function (more here UI: OriginFrames).
Lua:
local ib = {
    [0] = "InventoryButton_0",
    [1] = "InventoryButton_1",
    [2] = "InventoryButton_2",
    [3] = "InventoryButton_3",
    [4] = "InventoryButton_4",
    [5] = "InventoryButton_5"
}
for i = 0,#ib do
    BlzFrameSetVisible(BlzGetFrameByName(ib[i],0), true)
end
 
Level 3
Joined
Jan 20, 2020
Messages
48
You should be able to show each of the buttons individually with their frame name or by using the new BlzFrameGetChild() function (more here UI: OriginFrames).
Lua:
local ib = {
    [0] = "InventoryButton_0",
    [1] = "InventoryButton_1",
    [2] = "InventoryButton_2",
    [3] = "InventoryButton_3",
    [4] = "InventoryButton_4",
    [5] = "InventoryButton_5"
}
for i = 0,#ib do
    BlzFrameSetVisible(BlzGetFrameByName(ib[i],0), true)
end
Idk I can't seem to get this to work - I barely understand jass or lua as it is; but logically, I feel like the parent of the inventory is the simpleUI and that is hidden, so I'm unable to turn on the child (the individual inventory buttons). I'm not getting errors, but I also don't exactly know what I'm doing. I tried this:
Code:
call BlzFrameSetVisible(BlzFrameGetChild(BlzGetFrameByName("InventoryButton_0",0),0), true)
 
Level 23
Joined
Jul 18, 2010
Messages
1,771
In V1.31 one can show the inventory with this one liner.
JASS:
call BlzFrameSetParent(BlzFrameGetParent(BlzGetOriginFrame(ORIGIN_FRAME_ITEM_BUTTON, 0)), BlzGetFrameByName("ConsoleUI", 0))

But it does not work in V1.32.8. There is something quite wierd going on with Item Buttons since the release of the Name Frame version. Technicaly it should show the inventory when one changes the parent of "SimpleInventoryBar" to "ConsoleUI" and show that Inventory Frame. But for unknown reasons (atleast to me) "SimpleInventoryBar" hides itself frequently and the cooldowns are not shown.

The simplest (in Current Version) I can think of is to show the bottom Unit UI push it out of the screen and move the item buttons to the place you want them.
 
Level 3
Joined
Jan 20, 2020
Messages
48
In V1.31 one can show the inventory with this one liner.
JASS:
call BlzFrameSetParent(BlzFrameGetParent(BlzGetOriginFrame(ORIGIN_FRAME_ITEM_BUTTON, 0)), BlzGetFrameByName("ConsoleUI", 0))

But it does not work in V1.32.8. There is something quite wierd going on with Item Buttons since the release of the Name Frame version. Technicaly it should show the inventory when one changes the parent of "SimpleInventoryBar" to "ConsoleUI" and show that Inventory Frame. But for unknown reasons (atleast to me) "SimpleInventoryBar" hides itself frequently and the cooldowns are not shown.

The simplest (in Current Version) I can think of is to show the bottom Unit UI push it out of the screen and move the item buttons to the place you want them.
Damn that's a pain to hear - I barely know what I'm doing with these scripts as it is. Wish they would add some GUI for these UI commands. But thank you for the reply, much appreciated.
 
Level 8
Joined
May 19, 2020
Messages
249
To remove the dark background, all right! But, it's possible to increase the size of the portrait on the panel, through some code? So that the model is left with more space to appear from the height of the bust with good visibility, standard the version BlizzCon.:
HrYxhRXycIKtagL5WtdDzDuglWS2xaH17tRIu2XtKHk.png
 
Level 3
Joined
Jan 20, 2020
Messages
48
To remove the dark background, all right! But, it's possible to increase the size of the portrait on the panel, through some code? So that the model is left with more space to appear from the height of the bust with good visibility, standard the version BlizzCon.:
HrYxhRXycIKtagL5WtdDzDuglWS2xaH17tRIu2XtKHk.png
I gotta figure out how to get my abilities and inventory laid out like that - everything else I want to hide. Trying to develop this RPG; I'm pretty good with GUI but can't do jack with jass, it confuses the hell out of me
 
Level 23
Joined
Jul 18, 2010
Messages
1,771
To remove the dark background, all right! But, it's possible to increase the size of the portrait on the panel, through some code? So that the model is left with more space to appear from the height of the bust with good visibility, standard the version BlizzCon.:
One can resize the Portrait Frame. But first one has to free it. That can be done with call BlzEnableUIAutoPosition(false), hiding default UI or by setting the TOPLEFT position.
One access it with BlzGetOriginFrame(ORIGIN_FRAME_PORTRAIT, 0). After that one can resize it with
JASS:
call BlzFrameSetSize(BlzGetOriginFrame(ORIGIN_FRAME_PORTRAIT, 0), 0.3, 0.3)

I gotta figure out how to get my abilities and inventory laid out like that - everything else I want to hide. Trying to develop this RPG; I'm pretty good with GUI but can't do jack with jass, it confuses the hell out of me
That looks like these 4 Lines:
JASS:
call BlzHideOriginFrames(true)
call BlzFrameSetVisible(BlzGetFrameByName("ConsoleUIBackdrop",0), false)
call BlzFrameSetVisible(BlzFrameGetParent(BlzGetFrameByName("SimpleInfoPanelUnitDetail", 0)), true)
call BlzFrameSetAlpha(BlzGetFrameByName("SimpleInventoryCover", 0), 0)
 
Level 3
Joined
Jan 20, 2020
Messages
48
One can resize the Portrait Frame. But first one has to free it. That can be done with call BlzEnableUIAutoPosition(false), hiding default UI or by setting the TOPLEFT position.
One access it with BlzGetOriginFrame(ORIGIN_FRAME_PORTRAIT, 0). After that one can resize it with
JASS:
call BlzFrameSetSize(BlzGetOriginFrame(ORIGIN_FRAME_PORTRAIT, 0), 0.3, 0.3)


That looks like these 4 Lines:
JASS:
call BlzHideOriginFrames(true)
call BlzFrameSetVisible(BlzGetFrameByName("ConsoleUIBackdrop",0), false)
call BlzFrameSetVisible(BlzFrameGetParent(BlzGetFrameByName("SimpleInfoPanelUnitDetail", 0)), true)
call BlzFrameSetAlpha(BlzGetFrameByName("SimpleInventoryCover", 0), 0)
haha the video clip is what I have now - but i need to move the abilities, move the inventory, and hide the unit name, attack damage and defense somehow
 
Level 23
Joined
Jul 18, 2010
Messages
1,771
In Reforged one access the CommandButton Frames with
BlzGetFrameByName("CommandButton_0", 0)
BlzGetFrameByName("CommandButton_1", 0)
BlzGetFrameByName("CommandButton_2", 0)
BlzGetFrameByName("CommandButton_11", 0)

And the Inventory Buttons with
BlzGetFrameByName("InventoryButton_0", 0)
BlzGetFrameByName("InventoryButton_1", 0)
BlzGetFrameByName("InventoryButton_5", 0)

That Frames you clear Points and move them to the wanted position. For example:
local framehandle itemButtonFrame = BlzGetFrameByName("InventoryButton_0", 0)
call BlzFrameClearAllPoints(itemButtonFrame)
call BlzFrameSetAbsPoint(itemButtonFrame, FRAMEPOINT_BOTTOMLEFT, 0.45, 0.12)
[JASS/AI] - UI: Positionate Frames

if you want to get rid of the whole unitInfo bottom use this, works only if the unit selected is not training nor a transporter.
call BlzFrameSetScale(BlzGetFrameByName("SimpleInfoPanelUnitDetail", 0), 0.0001)

Edit: added the missing type in the local
 
Last edited:
Level 3
Joined
Jan 20, 2020
Messages
48
In Reforged one access the CommandButton Frames with
BlzGetFrameByName("CommandButton_0", 0)
BlzGetFrameByName("CommandButton_1", 0)
BlzGetFrameByName("CommandButton_2", 0)
BlzGetFrameByName("CommandButton_11", 0)

And the Inventory Buttons with
BlzGetFrameByName("InventoryButton_0", 0)
BlzGetFrameByName("InventoryButton_1", 0)
BlzGetFrameByName("InventoryButton_5", 0)

That Frames you clear Points and move them to the wanted position. For example:
local itemButtonFrame = BlzGetFrameByName("InventoryButton_0", 0)
call BlzFrameClearAllPoints(itemButtonFrame)
call BlzFrameSetAbsPoint(itemButtonFrame, FRAMEPOINT_BOTTOMLEFT, 0.45, 0.12)
[JASS/AI] - UI: Positionate Frames

if you want to get rid of the whole unitInfo bottom use this, works only if the unit selected is not training nor a transporter.
call BlzFrameSetScale(BlzGetFrameByName("SimpleInfoPanelUnitDetail", 0), 0.0001)
Thanks a lot for the elaborate answer, this helps a lot. I'll try this tonight and post results. Thanks!!
 
Level 3
Joined
Jan 20, 2020
Messages
48
That Frames you clear Points and move them to the wanted position. For example:
local itemButtonFrame = BlzGetFrameByName("InventoryButton_0", 0)
call BlzFrameClearAllPoints(itemButtonFrame)
call BlzFrameSetAbsPoint(itemButtonFrame, FRAMEPOINT_BOTTOMLEFT, 0.45, 0.12)
[JASS/AI] - UI: Positionate Frames

if you want to get rid of the whole unitInfo bottom use this, works only if the unit selected is not training nor a transporter.
call BlzFrameSetScale(BlzGetFrameByName("SimpleInfoPanelUnitDetail", 0), 0.0001)

Oddly, I can't seem to get past the first line - not quite sure what the syntax error is
fMsvMKg


Imgur: The magic of the Internet

Code:
//===========================================================================
// Trigger: User Interface
//===========================================================================
function Trig_User_Interface_Actions takes nothing returns nothing
    local AbilityButtonFrame1 = BlzGetFrameByName("CommandButton_8", 0)
    local AbilityButtonFrame2 = BlzGetFrameByName("CommandButton_9", 0)
    local AbilityButtonFrame3 = BlzGetFrameByName("CommandButton_10", 0)
    local AbilityButtonFrame4 = BlzGetFrameByName("CommandButton_11", 0)
    local AbilityButtonFrame5 = BlzGetFrameByName("CommandButton_4", 0)
    local AbilityButtonFrame6 = BlzGetFrameByName("CommandButton_5", 0)
    local AbilityButtonFrame7 = BlzGetFrameByName("CommandButton_6", 0)
    local AbilityButtonFrame8 = BlzGetFrameByName("CommandButton_7", 0)
    call BlzHideOriginFrames(true)
    call BlzFrameSetVisible(BlzGetFrameByName("ConsoleUIBackdrop",0), false)
    call BlzFrameSetVisible(BlzFrameGetParent(BlzGetFrameByName("SimpleInfoPanelUnitDetail", 0)), true)
    call BlzFrameSetSize(BlzFrameGetParent(BlzGetFrameByName("SimpleInfoPanelUnitDetail", 0)), .3, .3)
    call BlzFrameClearAllPoints(AbilityButtonFrame1)
    call BlzFrameSetAbsPoint(AbilityButtonFrame1, FRAMEPOINT_BOTTOMLEFT, 0.03, 0.15)
    call BlzFrameClearAllPoints(AbilityButtonFrame2)
    call BlzFrameSetAbsPoint(AbilityButtonFrame2, FRAMEPOINT_BOTTOMLEFT, 0.07, 0.15)
    call BlzFrameClearAllPoints(AbilityButtonFrame3)
    call BlzFrameSetAbsPoint(AbilityButtonFrame3, FRAMEPOINT_BOTTOMLEFT, 0.11, 0.15)
    call BlzFrameClearAllPoints(AbilityButtonFrame4)
    call BlzFrameSetAbsPoint(AbilityButtonFrame4, FRAMEPOINT_BOTTOMLEFT, 0.15, 0.15)
    call BlzFrameClearAllPoints(AbilityButtonFrame5)
    call BlzFrameSetAbsPoint(AbilityButtonFrame5, FRAMEPOINT_BOTTOMLEFT, 0.19, 0.15)
    call BlzFrameClearAllPoints(AbilityButtonFrame6)
    call BlzFrameSetAbsPoint(AbilityButtonFrame6, FRAMEPOINT_BOTTOMLEFT, 0.23, 0.15)
    call BlzFrameClearAllPoints(AbilityButtonFrame7)
    call BlzFrameSetAbsPoint(AbilityButtonFrame7, FRAMEPOINT_BOTTOMLEFT, 0.27, 0.15)
    call BlzFrameClearAllPoints(AbilityButtonFrame8)
    call BlzFrameSetAbsPoint(AbilityButtonFrame8, FRAMEPOINT_BOTTOMLEFT, 0.31, 0.15)
endfunction

//===========================================================================
function InitTrig_User_Interface takes nothing returns nothing
    set gg_trg_User_Interface = CreateTrigger(  )
    call TriggerAddAction( gg_trg_User_Interface, function Trig_User_Interface_Actions )
endfunction
 
Level 3
Joined
Jan 20, 2020
Messages
48
I Forgot to tell type, one has to do that in (v)jass.
add framehandle as type for the locals

local framehandle AbilityButtonFrame1
oh! gotcha - not your fault, I'm just illiterate when it comes to scripting - that worked like a charm though, thank you!
 
Level 8
Joined
May 19, 2020
Messages
249
Perfect @Tasyen , thank you very much. You are a real expert! Now I just need to remove the TC frame at the bottom of the portrait units.
Everything worked flawlessly. Staying like this:
upload_2020-9-17_8-58-30.png

But now the only question is that the last two numbers correspond exactly to the scale shift on the Y-axis "up" and X-axis "to the right". If possible, you could tell if there was a way to reposition the portrait from the point of origin?
I mean moving the portrait frame completely, moving from the starting point XY, moving more to the left side (next to the minimap) or down a little bit (next to the HP / SP points):
upload_2020-9-17_8-58-24.png

Concomitantly, a code to completely reposition the "minimap" to launch it totally to the left of the screen... if possible, in case you can remember ...
 
Last edited:
Level 23
Joined
Jul 18, 2010
Messages
1,771
I am unsure what you mean with TC Frame.

One would have to change the point which bounds the frame, then the size extends the frame in a different direction. Or you clear the point then you can use any point to move it.

On default the minimap can not leave the 4:3 Screen. You have to change the parent of it, to a frame that can leave the 4:3 Screen (but no SimpleFrame). Then you can move it with -x values to the left 16:9 part or beyond that.
UI: OriginFrames
UI: OriginFrames

A common tutorial about this frame position
[JASS/AI] - UI: Positionate Frames
 
Level 8
Joined
May 19, 2020
Messages
249
I am unsure what you mean with TC Frame.
One would have to change the point which bounds the frame, then the size extends the frame in a different direction. Or you clear the point then you can use any point to move it.
On default the minimap can not leave the 4:3 Screen. You have to change the parent of it, to a frame that can leave the 4:3 Screen (but no SimpleFrame). Then you can move it with -x values to the left 16:9 part or beyond that.

I think when it comes to moving the portrait, the best way would be to clean all the points and have the freedom to move ORIGIN_FRAME_PORTRAIT to any side in frame 4:3.
Maybe, it could be something like this, correct me if I'm wrong:
local framehandle portrait = BlzGetOriginFrame(ORIGIN_FRAME_PORTRAIT, 0)
call BlzFrameClearAllPoints(portrait)
call BlzFrameSetPoint(portrait, FRAMEPOINT_BOTTOMLEFT, BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), FRAMEPOINT_BOTTOMLEFT, 0.0200, 0.009)

In Minimap we can also clean up all of its points, then add frame point constants to move and maybe even increase its size.
As used in this script:
local framehandle frame = BlzGetOriginFrame(ORIGIN_FRAME_MINIMAP, 0)
call BlzFrameClearAllPoints(frame)
call BlzFrameSetPoint(frame, FRAMEPOINT_BOTTOMLEFT, BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), FRAMEPOINT_BOTTOMLEFT, 0.0200, 0.009)
call BlzFrameSetSize(frame, 0.10, 0.09)

But it is apparently not possible to drag the Minimap all the way to the left. It's not such a common frame, it can hardly be moved outside the 4: 3 frame limit. So this method of yours can work best to drag it as far as possible ... I'll try, thanks!
TimerStart(CreateTimer(), 0, false, function()
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)

PS.
Was talking about the TC in relation to TeamColor the frame to the back of the model.
I was referring to the polygonal frame to be removed directly within the Portrait model, with Retera ModelStudio perhaps.
In this case, it is just a frame within the model, not exactly the UI. lol

EDIT: Everything works very well to move only with triggers through the GUI, using vJASS script.
But as i imagined, you can see in the photo that the 3D portrait is easily positioned to any end without needing to change its parent, but Minimap does not really exceed the limit of the 4: 3 screen, and to reach the end, will be necessary this its revolutionary Lua code itself.
I'm stupid for JASS, for Lua codes I'm stupid squared.
@Tasyen , you wouldn't have this LUA code in the form of JASS, I have no idea how to use Lua, neither to trigger it in the GUI without having any function to start it ??
upload_2020-9-18_9-10-33.png
 
Last edited:
Top