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

Hiding / Showing original UI frames nightmare...

Status
Not open for further replies.
Level 12
Joined
Jan 30, 2020
Messages
875
OK.

I have read some of @Tasyen amazing tutorials about UI Frames.

I feel ready to start creating my own UI elements.

But once again in Warcraft 3 nothing works like your intuition would let you think.

Before starting to make my own UI frames, I wanted to hide the Origin Frame and the remaining Black Backdrop. I do this at map init, and so far so good.

Now I wanted to make a few elements visible again, and modifying a few others.

Some frames just refuse to show.

Here is the function I call at map init :
JASS:
function UIInit takes nothing returns nothing
    local framehandle fh=null
    local framehandle menu=null
    local framehandle log=null
    local framehandle help=null

    // Hide standard UI
    call BlzHideOriginFrames(true)
    call BlzEnableUIAutoPosition(false)
    call BlzFrameSetVisible(BlzGetFrameByName("ConsoleUIBackdrop", 0), false)

     // Show / hide some standard UI elements
    set fh=BlzGetFrameByName("ResourceBarFrame", 0)
    call BlzFrameSetVisible(fh, true)

    set fh=BlzGetFrameByName("EscMenuBorder",0) // not working
    call BlzFrameSetVisible(fh, false)

    set fh=BlzGetFrameByName("CinematicBorder",0) // not working
    call BlzFrameSetVisible(fh, false)

    set fh=BlzGetFrameByName("ChatDialog", 0)
    call BlzFrameSetVisible(fh, true)

    set fh=BlzGetFrameByName("MiniMapFrame", 0)
    call BlzFrameSetVisible(fh, true)

    set fh=BlzGetFrameByName("MinimapSignalButton", 0)
    call BlzFrameSetVisible(fh, true)

    set fh=BlzGetOriginFrame(ORIGIN_FRAME_PORTRAIT, 0) // not working
    call BlzFrameSetVisible(fh, true)

    set fh=BlzGetFrameByName("ChatDialog", 0)
    call BlzFrameSetVisible(fh, true)

    set fh=BlzGetFrameByName("CommandBarFrame", 0)
    call BlzFrameSetVisible(fh, true)

    set fh=BlzGetOriginFrame(ORIGIN_FRAME_HERO_BAR, 0)
    call BlzFrameSetVisible(fh, true)

    set fh=BlzGetOriginFrame(ORIGIN_FRAME_HERO_BUTTON, 0)
    call BlzFrameSetVisible(fh, true)

    set menu=BlzGetFrameByName("UpperButtonBarMenuButton",0) // All 3 not working
    set log=BlzGetFrameByName("UpperButtonBarChatButton",0)
    set help=BlzGetFrameByName("UpperButtonBarQuestsButton",0)
    call BlzFrameSetVisible(menu, true)
    call BlzFrameSetVisible(log, true)
    call BlzFrameSetVisible(help, true)
endfunction

I use the local fh even when not really needed, but I did this in case I would need further modifications.

Anyways, as you can see in comments on the code, I can't seem to be able to prevent the Main Frame Border (I don't want stones around my main frame like in the human UI !) - But I guess there that I am not using the right Frame Names.

As for the Portrait not showing, nor the 3 upper buttons, I don't understand why they don't show either.

After the map is initialized, I try to change these 3 buttons like I have seen on one of @Tasyen tutorials, so I use another function :
JASS:
function UISetup takes nothing returns nothing
    local framehandle menu=null
    local framehandle log=null
    local framehandle help=null

    set menu=BlzGetFrameByName("UpperButtonBarMenuButton",0)
    set log=BlzGetFrameByName("UpperButtonBarChatButton",0)
    set help=BlzGetFrameByName("UpperButtonBarQuestsButton",0)
    call BlzFrameClearAllPoints(menu)
    call BlzFrameClearAllPoints(log)
    call BlzFrameClearAllPoints(help)
    call BlzFrameSetAbsPoint(menu, FRAMEPOINT_LEFT, 0.0, 0.0)
    call BlzFrameSetPoint(log, FRAMEPOINT_TOP, log, FRAMEPOINT_BOTTOM, 0.0, 0.0)
    call BlzFrameSetPoint(help, FRAMEPOINT_TOP, log, FRAMEPOINT_BOTTOM, 0.0, 0.0)
    call BlzFrameSetSize(help, 0.08, 0.0008)  // random values, haven't checked yet (need a wider button)
endfunction

So I want to know, while I'm at it if, once the 3 buttons finally decide to show, this function will indeed place them on the top left of the 4:3 screen, one below the other.

By the way, reading dozens of fdf files, the frame name for the portrait, the hero bar and hero button ...and maybe even the frames borders seem nowhere to be found....

EDIT : found a typo in my second function, it should be call BlzFrameSetPoint(log, FRAMEPOINT_TOP, menu, FRAMEPOINT_BOTTOM, 0.0, 0.0). Anyways this doesn't change a thing on the problem though...
 
Last edited:

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,183
Fun coincidence I spent my afternoon doing a very similar thing.

upload_2020-4-7_5-46-43.png


Needless to say things get a bit complex because Blizzard's UI API is hot garbage.

Anyway.. I think all I did when it came to hiding stuff is this:
BlzHideOriginFrames(true)
BlzFrameSetVisible(BlzGetFrameByName("ConsoleUIBackdrop",0), false)
BlzEnableUIAutoPosition(false)

Unless I got a oneliner somewhere else I forgot about but I don't think so.

ecc21fbc0ca84329a82ea03a40bfc668.jpg
 
  • Like
Reactions: pyf
Level 12
Joined
Jan 30, 2020
Messages
875
Well I tried the other way round as I could not get things to work.

But then I realized I didn't know how to hide the textures from the console, so I hid them by replacing their texture with the identical path.

That part works, but now I am not much more advanced as for some reason the portrait decided to die on me.
I do everything at map init now, and got more things to work thanks to the texture change (any texture with just 100% transparency seems to work).

Here is my new UI setup
JASS:
function UISetup takes nothing returns nothing
    local framehandle fh=null
    local framehandle menu=null
    local framehandle log=null
    local framehandle help=null
    local framehandle multi=null

    call BlzEnableUIAutoPosition(false)
    call BlzFrameSetVisible(BlzGetFrameByName("ConsoleUIBackdrop", 0), false) // Hide Black Backdrop

     // Hide some standard UI elements
    set fh=BlzGetFrameByName("MiniMapTerrainButton", 0)
    call BlzFrameSetVisible(fh, false)
    set fh=BlzGetFrameByName("MiniMapAllyButton", 0)
    call BlzFrameSetVisible(fh, false)
    set fh=BlzGetFrameByName("MiniMapCreepButton", 0)
    call BlzFrameSetVisible(fh, false)
    set fh=BlzGetFrameByName("FormationButton", 0)
    call BlzFrameSetVisible(fh, false)
    set fh=BlzGetFrameByName("UpperButtonBarAlliesButton", 0)
    call BlzFrameSetVisible(fh, false)

    set menu=BlzGetFrameByName("UpperButtonBarMenuButton",0)
    set log=BlzGetFrameByName("UpperButtonBarChatButton",0)
    set help=BlzGetFrameByName("UpperButtonBarQuestsButton",0)
    call BlzFrameClearAllPoints(menu)
    call BlzFrameClearAllPoints(log)
    call BlzFrameClearAllPoints(help)
    call BlzFrameSetAbsPoint(menu, FRAMEPOINT_LEFT, 0.0, 0.59)
    call BlzFrameSetPoint(log, FRAMEPOINT_TOP, menu, FRAMEPOINT_BOTTOM, 0.0, 0.0)
    call BlzFrameSetPoint(help, FRAMEPOINT_TOP, log, FRAMEPOINT_BOTTOM, 0.0, 0.0)
    call BlzFrameSetSize(help, 0.12, 0.026)

    set fh=BlzGetFrameByName("ResourceBarFrame",0)
    call BlzFrameClearAllPoints(fh)
    call BlzFrameSetPoint(fh, FRAMEPOINT_LEFT, menu, FRAMEPOINT_RIGHT, 0.02, 0.0)


    // set multi=BlzGetFrameByName("Multiboard", 0) // nope doesn't work
    // call BlzFrameClearAllPoints(multi)
    // call BlzFrameSetAbsPoint(multi, FRAMEPOINT_RIGHT, 0.0, 0.0)


    // set fh=BlzGetFrameByName("TimerDialog",0) // doesn't work as position is relative to multi
    // call BlzFrameClearAllPoints(fh)
    // call BlzFrameSetPoint(fh, FRAMEPOINT_TOP, multi, FRAMEPOINT_BOTTOM, 0.0, 0.0)

    // set fh=BlzGetFrameByName("EscMenuSliderBackground", 0) // nope can't remove the background of a slider that way, same as frame borders or backgrounds
    // call BlzFrameSetVisible(fh, false)
endfunction

Fun thing when some people were complaining they could not make the portrait disappear for good, I can't seem to get the portrait to display AT ALL ! Why do I always need to head in the opposite direction of normal people ???

I don't know how to remove parts of frames like the backgrounds, the borders, or any element used in fdf frame descriptions...

Also I Have completely failed to hide the TimeOfTheDay indicator. Haven't found any related frame.
Tried importing a custom version of the model with materials I wanted to hide removed... failed
Tried changing the related textures in ui\console\human\ but it failed too...

I can imagine people end up working all this out like I am very slowly trying to do, but yes I also find this API is a nightmare like I haven't seen many.


Notes :
...Wurst dam I was supposed to test it to compare it with Lua... but isn't it just transcoded to Lua anyways ?
I admit Lua is a pain to learn when you haven't done C or C++ for more than 10 years... but if the final code is sill Lua, I don't know ?
 
Level 12
Joined
Jan 30, 2020
Messages
875
Thanks for the information, It seems I am back to square one then.

Oh well I'll wait until our UI expert is awake (@Tasyen ^^) and tells me what he thinks of my strange issues.

Wurst is compiled to Jass ???
But then does it mean you cannot define callback functions with arguments inside the main function ?

As I use so many timers, and other things requiring constant use of hashtables just because Jass is unable to define its callback functions locally, that was my main reason for a switch. If I can't do this in Wurst, it seems I am stuck with Lua then :'(
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,183
Wurst can do even better.
This is what is called closures which is basically a nicer way of writing callbacks.
upload_2020-4-7_7-31-13.png


note that you can write manual callbacks too, this is just more convenient though.

So the "doAfter" is basically creating a timer, waiting X milliseconds and then running the callback.
And yes there is a doPeriodic equivalent
 
Level 12
Joined
Jan 30, 2020
Messages
875
Yes, I had the feeling Wurst was very similar to JavaScript.
But then that is strange that it transpiles to Jass, because Jass in unable to achieve this.

It seems I still have a lot to learn !

Anyways back to my problem.
Removed all imported UI textures, calls this at map init :
JASS:
function UIInit takes nothing returns nothing
    // Hide standard UI
    call BlzHideOriginFrames(true)
    call BlzFrameSetVisible(BlzGetFrameByName("ConsoleUIBackdrop", 0), false)
    call BlzEnableUIAutoPosition(false)
endfunction
and this after map init (when a very short timer has expired) :
JASS:
function UISetup takes nothing returns nothing
    local framehandle fh=null
    local framehandle menu=null
    local framehandle log=null
    local framehandle help=null
    local framehandle multi=null

     // Show / modify some standard UI elements

    set menu=BlzGetFrameByName("UpperButtonBarMenuButton",0) // none od these 3 work anymore
    set log=BlzGetFrameByName("UpperButtonBarChatButton",0)
    set help=BlzGetFrameByName("UpperButtonBarQuestsButton",0)
    call BlzFrameSetVisible(menu, true)
    call BlzFrameSetVisible(log, true)
    call BlzFrameSetVisible(help, true)
    call BlzFrameClearAllPoints(menu)
    call BlzFrameClearAllPoints(log)
    call BlzFrameClearAllPoints(help)
    call BlzFrameSetAbsPoint(menu, FRAMEPOINT_LEFT, 0.0, 0.59)
    call BlzFrameSetPoint(log, FRAMEPOINT_TOP, menu, FRAMEPOINT_BOTTOM, 0.0, 0.0)
    call BlzFrameSetPoint(help, FRAMEPOINT_TOP, log, FRAMEPOINT_BOTTOM, 0.0, 0.0)
    call BlzFrameSetSize(help, 0.12, 0.026)

    set fh=BlzGetFrameByName("ResourceBarFrame", 0)
    call BlzFrameSetVisible(fh, true)
    call BlzFrameClearAllPoints(fh)
    call BlzFrameSetPoint(fh, FRAMEPOINT_LEFT, menu, FRAMEPOINT_RIGHT, 0.02, 0.0)

    set fh=BlzGetFrameByName("ChatDialog", 0)
    call BlzFrameSetVisible(fh, true)

    set fh=BlzGetFrameByName("MiniMapFrame", 0)
    call BlzFrameSetVisible(fh, true)

    set fh=BlzGetFrameByName("MinimapSignalButton", 0) // does not work anymore
    call BlzFrameSetVisible(fh, true)

    set fh=BlzGetOriginFrame(ORIGIN_FRAME_PORTRAIT, 0) // not working at Map Init nor after map init
    call BlzFrameSetVisible(fh, true)

    set fh=BlzGetFrameByName("CommandBarFrame", 0)
    call BlzFrameSetVisible(fh, true)

    set fh=BlzGetOriginFrame(ORIGIN_FRAME_HERO_BAR, 0)
    call BlzFrameSetVisible(fh, true)

    set fh=BlzGetOriginFrame(ORIGIN_FRAME_HERO_BUTTON, 0)
    call BlzFrameSetVisible(fh, true)


    // set multi=BlzGetFrameByName("Multiboard", 0)
    // call BlzFrameClearAllPoints(multi)
    // call BlzFrameSetAbsPoint(multi, FRAMEPOINT_RIGHT, 0.0, 0.0)


    // set fh=BlzGetFrameByName("TimerDialog",0)
    // call BlzFrameClearAllPoints(fh)
    // call BlzFrameSetPoint(fh, FRAMEPOINT_TOP, multi, FRAMEPOINT_BOTTOM, 0.0, 0.0)

    // set fh=BlzGetFrameByName("EscMenuSliderBackground", 0)
    // call BlzFrameSetVisible(fh, false)
endfunction

Alas it is even worse than my attempt with only hiding specific parts of the Original UI because not only doesn't the portrait show, but neither do the upper system buttons, not the minimap ping button

What is still working is :
- repositioned upper ressource bar
- minimap
- Hero Bar and icon
- commandbar
- Chat dialog

thats all...

I really don't understand why it is so inconsistent. Why would it work one way but not another.

I mean most of these are origin frames ans thus have no real parent, haven't they ?

So why would BlzFrameSetVisible native not work for these specific frames ??
 
Well I suggest to do UI stuff at 0s. There are some wierd problems with SimpleFrames when they are modified at map init, they get missposed happened to me in that tutorial in which the MenuButtons are moved around.

I mean most of these are origin frames ans thus have no real parent, haven't they ?
Many originframes are nothing special, they are just some other way to access this frames. They can have parents which can be modified.
A Frame needs it's Ancestors to be visible to be visible itself, hence "UpperButtonBarMenuButton" can not be shown, it requires "UpperButtonBarFrame".
Simliars applies for the Hero Buttons, the Minimap Buttons, Item Buttons for all of them. they require their ancenstors to be visible.
Would show the Minimap Buttons: call BlzFrameSetVisible( BlzFrameGetParent(BlzGetOriginFrame(ORIGIN_FRAME_MINIMAP_BUTTON, 0)), true )

Warcraft 3 was created for computers with low powers (from todays view) some frames do not exist until they are needed by the player, like quest frames, hp/mp display, multiboard, ... .

I dislike this portrait frame. It's position and size is somehow faked to fit the current resolution, it also requires a background otherwise the stuff (unit, dooadds ...) below it affects it depends on the current displayed model. Placing others relative to it can produce wierd results.
But I don't get the problem with showing/hiding it (Edit: Oh wait it performs different in Reforged compared to 1.31.1).
 
Last edited:
Level 12
Joined
Jan 30, 2020
Messages
875
@Chaosy thanks, I think I really need to try Wurst as I really love the syntax.

@Tasyen : your understanding of these Frames is definitely not just a legend :D

The frames now all work perfectly.
It was all about their parents. Of course rendering these parents visible required me to hide the other unwanted frames (the allies upper button and the other minimap icons). And even more strange, one of them must share a common parent with the portrait, as it magically also started to show..

Really, thank you this is a serious important point you made there, saving the day !

While I'm at it, any advice on removing parts of Frames like backgrounds, borders, etc... would you say I am looking in the right direction if I say "fdf" ?
 
Level 12
Joined
Jan 30, 2020
Messages
875
Ok back to this after a busy day.

@Chaosy : This is really strange.

I tried to do something similar as you did in Wurst, but in Jass, and fun enough using your BOTTOMLEFT and TOPRIGHT FramePoints, my portrait and minimap are not aligned at all. I set them up in the same order as your Wurst trigger, but to get a similar result, I had to use really different values (I guess it could be related to screen resolution) :
JASS:
    // Minimap
    set fh=BlzGetFrameByName("MiniMapFrame", 0)
    call BlzFrameSetVisible(fh, true)
    call BlzFrameClearAllPoints(fh)
    call BlzFrameSetAbsPoint(fh, FRAMEPOINT_BOTTOMLEFT, 0.0, 0.0)
    call BlzFrameSetAbsPoint(fh, FRAMEPOINT_TOPRIGHT, 0.12, 0.12)
    set fh=BlzFrameGetParent(BlzGetOriginFrame(ORIGIN_FRAME_MINIMAP_BUTTON, 0))
    call BlzFrameSetVisible(fh, true)
    set fh=BlzGetFrameByName("MinimapSignalButton", 0)
    call BlzFrameSetVisible(fh, true)
    set fh=BlzGetFrameByName("MiniMapTerrainButton", 0)
    call BlzFrameSetVisible(fh, false)
    set fh=BlzGetFrameByName("MiniMapAllyButton", 0)
    call BlzFrameSetVisible(fh, false)
    set fh=BlzGetFrameByName("MiniMapCreepButton", 0)
    call BlzFrameSetVisible(fh, false)
    set fh=BlzGetFrameByName("FormationButton", 0)
    call BlzFrameSetVisible(fh, false)

    // Portrait
    set fh=BlzGetOriginFrame(ORIGIN_FRAME_PORTRAIT, 0)
    call BlzFrameSetVisible(fh, true)
    call BlzFrameClearAllPoints(fh)
    call BlzFrameSetAbsPoint(fh, FRAMEPOINT_BOTTOMLEFT, 0.0, 0.0)
    call BlzFrameSetAbsPoint(fh, FRAMEPOINT_TOPRIGHT, 0.12, 0.138)

Also, unlike you, since I had to render some parents visible to show some UI Frames that refused too, I had to show the minimap ping icon and hide the others.
This said, thanks for showing your frames, this positioning is really good, clearing the main playing area.

Now I am not sure I want to follow your HP and Mana style (really nice btw), as mana in map map tends to be irrelevant, but I am not sure I want to show the default infocard either.

EDIT : I was also pleased the minimap icons were not attached to the minimap frame itself !

This said, I get this issue when ALT-TABBING from the game and back, here are two screens, before and after going back to windows desktop :

before :
WC3ScrnShot_040720_233015_001.png


after :
WC3ScrnShot_040720_233111_001.png


I wonder if that can be fixed or not...

Anyways, now I need to place the vertical zoom slider and the minimap ping button a bit more on the left, then move multiboard further up, maybe make a custom FDF for the ressources bar that could be improved, ...

... and figure out what to do with the infocard panel !

EDIT 2 : This is even more strange, when I re-tested the map, my values positioned the portrait and the minimap extactly like in the second screenshot.

Setting back all TOPRIGHT Frame Points to 0.12, 0.12, now both frames seem aligned.
@Tasyen : this looks like the issues you were mentioning about problems caused by changing screen resolution...
 
Last edited:
  • Love
Reactions: pyf
Level 12
Joined
Jan 30, 2020
Messages
875
I already do actually.

Anyways I have not encountered the problem again so far. I suppose this sometimes happens when testing a map from WE, probably a cache issue.

Anyways, I have everything working now.
I am now trying to change the Multiboard and the Timer windows positions. I tried to get inspiration from a tutorial made by @Tasyen, but it failed :
JASS:
    set GameBoard=CreateMultiboard()
    set GameBoardFH=BlzGetFrameByName("Multiboard", 0)
    call BlzFrameClearAllPoints(GameBoardFH)
    call BlzFrameSetAbsPoint(GameBoardFH, FRAMEPOINT_TOPRIGHT, 0.8, 0.6)

Does absolutely nothing. But I am not too surprised, and I guess it is time for me to start learning how to make my own FDF files, especially if I also want to remove the stone borders from frames like Dialogs or escape menus.

In the meantime thanks to both of you for your precious help, it helped me make great progress in understanding frames.
Also thanks for the input about Wurst, I will keep it high in my TODO list.
 
Level 12
Joined
Jan 30, 2020
Messages
875
@Tasyen : thank you.

I actually managed to fix it exactly how you just suggested : showing the Multiboard before saving the frame. I have no excuse on this one, it was clearly stated in your tutorial !

Since then I realized TimerDialog frames can conflict with Multiboard frames for some reason (timerdialogs seem to always want to be positioned on top right of the screen). Worse !!! If I save the TimerDialog in a rfame, it seems I can not hide it anymore, even when trying both the native to hide the dialog itself, but not even the saved frame with the BlzFrameSetVisible native.

I don't use tons of timer dialogs. In fact there are just 2 in my entire map :
- one when players have to wait for the host to chose the game difficulties
- one at the end of every level
I know I should maybe recycle the second timer and its dialog, and that was my plan, but before that I wanted to be able to manipulate the frame.

At some point, I replaced my native calls to create a timer dialog with this to recreate both the dialog and save /position its frame :
JASS:
function CreateTimerWindow takes timer t, string message returns nothing
    call BlzFrameSetVisible(TimerDialogFH, false)
    call TimerDialogDisplay(TimerWindow, false)
    set TimerWindow=CreateTimerDialog(t)
    call TimerDialogSetTitle(TimerWindow, message)
    call TimerDialogSetTitleColor(TimerWindow, 200, 250, 180, 255)
    call TimerDialogSetTimeColor(TimerWindow, 200, 250, 180, 255)
    call TimerDialogDisplay(TimerWindow, true)
    set TimerDialogFH=BlzGetFrameByName("TimerDialog", 0)
    call BlzFrameClearAllPoints(TimerDialogFH)
    call BlzFrameSetAbsPoint(TimerDialogFH, FRAMEPOINT_BOTTOMLEFT, 1.00, 0.00)
endfunction

The position fails, and is set to somewhere in the top right. Only positive change is that after the first timer dialog has expired, it does not conflict with the multiboard anymore for some reason.

As it's such a simple frame, I wonder if I should not simulate them !
Anyways I will try all sorts of things, I believe the best way to learn is keep trying.


I also have a couple of other issues.

First issue : Once I move the command buttons, the rectangle of its original position is not clickable anymore. I believe this question was already asked in your Tutorial
UI: OriginFrames by @bgcy_ro002 but I guess fixing it involved moving the ConsoluUI out of the view at map init.
Is there another way to make this area clickable ?

Last but not the least :
UnitInfoPanel.... for some reason this is a mess. It seems I can move the part that displays a multiple selection of units but not the UnitInfoPanel itself.

The info panel refuses to move :

WC3ScrnShot_040920_150553_001.png


Multiple Unit Selection works (I didn't optimize placement ^^) :

WC3ScrnShot_040920_150604_001.png


How would you solve that ?

Now once this will be solved, and to avoid creating a new thread before I have tested it with the right directions, As you can see in my UI positioning, it seems to indeed clear a lot of space around the playable area center, and I am very pleased with it (again, thank you by the way!).

But you also notice that, especially with my game's dominant colors, things are not easy to instantly identify like the minimap.
So I would like to add a tiny border around my origin frames.

Is it possible to add something like a backdrop to them for this ?

Can I actually change all the properties of an origin frame like texture, model, etc... or do they need to be hidden and replaced by something else ?
Because on a side note I also want to remove the big border around the Escape menus and the Dialog frames.

I know I am asking a lot of questions, and that you managed to figure all this out on your own as Blizzard did not give us any help in the matter.
But it seems you have such a clever approach and understanding, and I can't seem to figure these things out the way you do. You have all my respect just for that.

EDIT :
I was so involved with the frame scripting that I forgot there was a Game Interface entry in the Advanced Menu. With the help of Photoshop, I have edited the 3 different frame borders used (cinematic, menu-cinematic and options-menu) and that solved this specific problem :

WC3ScrnShot_040920_174746_001.png


So now, do I need to do the same for the minimap, the portrait and the resource bar ? How do I show their specific borders frames ?

Once this, the TimerDialog and the UnitInfoPanel will be solved, my customized UI will be complete.

EDIT 2 :
I have to throw the towel for the moment. Nothing works for the problematic frames.
If I don't use TimerDialogs at all, the multiboard works perfectly and its position is solid.

If I use any TimerDialog, with or without assigning its frame to a variable, it messes up the multiboard position everytime this TimerDialog is displayed.
Even more strange, if I set a TimerDialog, save its frame and change its position, it seems to work.... but as soon as a multiboard comes into play, the TimerDialog seems to stick to some position around the multiboard.

I even tried editing the original timerdialog.fdf, gave the frame a relative position to the minimap (random example) and imported it with the same path as the original fdf to replace it, but it didn't seem to work at all. I suppose I can't just create a copy of the fdf with a different name and keeping the same frames names inside it.

So until I find a solution I have to completely disable timer dialogs...

Now for the UnitInfoPanel, it's another dead end.
First I realized that I was using the frame name "SimpleUnitInfoPanel".

When I enable the visibility of this frame's parent, it allows to display the multiple selection of units, and it can even be positioned.
The SimpleUnitInfoPanel itself refuses to obey the BlzClearAllPoints and BlzFrameSetAbsPoint natives.

I tried using the frame name "UnitInfoPanel" or "BuildingInfoPanel" but these did not seem to be related to anything and refused to display anything.

So for now, I can only display the SimpleUnitInfoPanel in the middle of the screen IF I don't use call BlzFrameSetAbsPoint(BlzGetFrameByName("ConsoleUI", 0), FRAMEPOINT_BOTTOM, 0.0, -0.18) at map init. This also means I can not get rid of the un-clickable area on the bottom right of the screen.

Honestly, all this UI API is the worst thing I have ever encountered in 40 years of programming.
Some Frames (only a few really) simply make no sense whatsoever when it comes to their placement, or even random "collisions" - like timer dialogs vs multiboards.

EDIT 3:
Sinking even deeper in the nonsense.

Actually, SimpleUnitInfoPanel is not the UnitInfoPanel !!!!
But I need its parent to be visible to enable the frame that displays the multiple unit selection !
I realize now that what displayed the UnitInfoPanel was in the end only enabling the visibility of the parent of that Frame.

So what could be the name of the UnitInfoPanel Frame ? It is definitely not UnitInfoPanel as I tried it earlier. And while we're there, What is the name of the frame that displays the unit multiple selection ?

As I can position that multiple selection's frame by moving SimpleUnitInfoPanel's parent to the appropriate position, don't tell me it IS actually the parent of SimpleUnitInfoPanel ?

Last but not the least, I realized I forgot to add the display of the portrait's HP (or mana) texts.
Using :
JASS:
    // Portrait and HP
    set portrait=BlzGetOriginFrame(ORIGIN_FRAME_PORTRAIT, 0)
    call BlzFrameSetVisible(portrait, true)
    call BlzFrameClearAllPoints(portrait)
    call BlzFrameSetAbsPoint(portrait, FRAMEPOINT_BOTTOMLEFT, 0.0, 0.0)
    call BlzFrameSetAbsPoint(portrait, FRAMEPOINT_TOPRIGHT, 0.10, 0.12)
    set fh=BlzGetOriginFrame(ORIGIN_FRAME_PORTRAIT_HP_TEXT, 0) // HP and Mana text don't seem to work
    call BlzFrameSetVisible(fh, true)
    call BlzFrameClearAllPoints(fh)
    call BlzFrameSetAbsPoint(fh, FRAMEPOINT_BOTTOMLEFT, 0.0, 0.0)
Does not make the HP text visible, and changing the position in the last line does not solve it.

I know for this last part I could probably create a tooltip for the Portrait frame, but thats not optimal.

Anyways, It seems the guys at Blizzard made this UI API with brain murdering in mind, and I think that worked on me, as I am stuck on a dead end...

EDIT 4 :

Well I found a way out of Twilight Zone, at least for the UnitInfoPanel.
It seems that, by trying to set the SimpleUnitInfoPanel Frame visible, clearing its points and trying to change its position, 2 frames were messed up :
- the Info Panel for the units that I wanted to display and move
- the frames used to display messages on the screen for players (ORIGIN_FRAME_UNIT_MSG)
They were both suddenly shifted to the bottom, following the -0.18 of call BlzFrameSetAbsPoint(BlzGetFrameByName("ConsoleUI", 0), FRAMEPOINT_BOTTOM, 0.0, -0.18)

Removing the manipulations on SeimpleUnitInfoPanel ended up placing the Unit Info panel at the same position as the frame displaying multiple unit selections. At last !

But there is still a small issue : the text displayed by the game when you don't have enough gold (euros in my map) keeps following the -0.18 shift.

What is the frame related to that text ?

Here is a new screenshot, the text is displayed in yellow, under the Command Buttons :

WC3ScrnShot_041020_010507_001.png


So now I have fixed a big issue, I am still completely stuck as regards to the Timer Dialogs conflicting with the Multiboard frame, and the HP Text for the portrait unit. (the HP text is not displayed anywhere else as far as I can see).
 
Last edited:
You put much effort into this.
Does not make the HP text visible, and changing the position in the last line does not solve it.

I know for this last part I could probably create a tooltip for the Portrait frame, but thats not optimal.
The HP/MP Text Display frames are not existing until any player selected some unit and that selection was synced (the selection can be forced with triggers). Hence if you do stuff to it before than selection was done & synced your alterations are void. They also crash the game if you use SetVisible onto them.

Timer Dialogs
TimerDialog instead uses BlzGetFrameByName("TimerDialog", x), x for the amount of created/shown ones, starting with 0 for the first one. A CreateContext of a Destroyed TimerDialogs is not reused. ScriptDialogButtons from Dialogs also use rising createcontext (through it is a bit more fucked up).
My random notes to that Leaderboard, Multiboard, TimerDialog, Dialog and Frames | HIVE

But there is still a small issue : the text displayed by the game when you don't have enough gold (euros in my map) keeps following the -0.18 shift.

What is the frame related to that text ?
Don't know how to access that Frame, like some other ones. It's position is relative to ConsoleUI therefore it moves when moving ConsoleUI.
 
Level 12
Joined
Jan 30, 2020
Messages
875
Thanks for the pointers once again.

I actually create the Hero Builder and add them to their respective local player's selection, as soon as the host player has chosen game difficulties.
Of course this is not synced.
Would it work if, everytime I create the hero for a player, I would add it to the selection outside of the localplayer check, and then save the frame in a framehandle array.
If I understand what you just said about synced selections, does it mean there will be a different frame handle for the HP/MP text for each player, unlike the Vertical Slider ?

If it is really problematic, I could also simply create a frame and use the unit selection event. Maybe I could even add a texture as well as the text, to make it more visual.

For the gold text, thank you. At least I won't be wasting several hours trying to find it.
I suppose it's the same problem as the "unclickable" placeholder frame. Well as I, thanks to your help, have managed to find my error and thats the last uncontrollable frame attached to ConsoleUI, I'll simply shift it further down to hide the text.

Now for the timer dialogs, I completely understand what you are saying. I will then experiment with the contexts, hoping that the increment is 1 on every creation of a new timer dialog. And it is really worth knowing that destroying it and nulling it does not allow to use it again.
This said I was wondering, and maybe I will try that first, as I only have 1 timer with a dialog in the game that I recreate at every end of level (next level timer), maybe I could make it repeatable and just stop it and hide the frame once the level starts and just start it again and show the frame at the end.

Just read your note, I understand changing both text fields are problematic, each in its own way. To change visuals, I will tinker with the backdrop texture.
Would you recommend reading the time left from the frame native or from TimerGetRemaining() ?

Now my last question (as I have so many new possibilities to check ^^), Is it possible to add a texture via backdrop to an existing origin frame, or does it have to be a custom frame or a specific frame using inheritance ?

Thank you again for always saving the say !

EDIT :

Great news, with your advice, now everything works perfectly !!!
I chose to recycle the timer and its dialog, storing them in globals. This way I only need to save the frame once, thus I didn't even need to increment the context.
Now time to figure out about the HP Text. I will try to display it as a bar on top of the portrait, removing the necessity to give it a border.
Once done with this, I will try to read the last tutorials of yours I haven't read yet, and see if that helps with adding a border to the MiniMap Frame. and even maybe customize the resources bar or just give it a border.

Many thanks, again !

EDIT 2: Had to take a break. When I returned,I made custom borders for Minimap, resources, Unit Info panel and command Buttons.
I use the same method to try to display each border :
JASS:
    // Minimap border
    set fh=BlzCreateFrameByType("BACKDROP", "MinimapBorder", MiniMap, "", 0)
    call BlzFrameSetAbsPoint(fh, FRAMEPOINT_TOPLEFT, 0.0, 0.60)
    call BlzFrameSetAbsPoint(fh, FRAMEPOINT_BOTTOMRIGHT, 0.14, 0.46)
    call BlzFrameSetTexture(fh, "ui\\minimap-border.blp",0, true)
For some reasons, only the Minimap border shows. In this example I tried to use the related frame as the parent, but if I chose ConsoleUI instead, it does not make any difference.

I tried both types of placements : absolute with 1 or 2 Framepoints or relative to the related frame with an offset.

Not a big deal as the only Frame I really wanted a border for was the Minimap, but still strange as I cannot find any reason why it is the only one that does.

I will keep reading your tutorials, and then make a custom HP/Mana Frame with text and textures, that will update everytime a new unit is added to localplayer selection. I think it should work as the latest value that will be read will definitely be the one of the latest selected unit.
 
Last edited:
For some reasons, only the Minimap border shows. In this example I tried to use the related frame as the parent, but if I chose ConsoleUI instead, it does not make any difference.
Frames can't have SimpleFrames as Parent and SimpleFrames can not have Frames as parent. But for some reasons the game helps you out when creating SimpleFrames as child of a Frame with a valid substitute parent.
Most of the game UI is SimpleFrame except for some.
ConsoleUI, ResourceBarFrame are SimpleFrames. BACKDROP belongs to Frames, therefore the creation breaks the rules.
I will keep reading your tutorials, and then make a custom HP/Mana Frame with text and textures, that will update everytime a new unit is added to localplayer selection. I think it should work as the latest value that will be read will definitely be the one of the latest selected unit.
Without Group selection it will work, but as soon group selection is a thing it becomes almost undoable. Changing the mainUnit will not trigger a selection event.
Edit:
For some reason this Portrait Text Frames pos themself correctly only with FRAMEPOINT_CENTER.
Example Lua code to pos Hp and Mp Text below the Day Time Clock:
Lua:
do
    local real = MarkGameStarted
  function MarkGameStarted()
        real()
    local unit = CreateUnit(Player(0), FourCC("hfoo"), 0, 0, 0)
    SelectUnitSingle(unit)
    TimerStart(CreateTimer(), 0.3, false, function()   
        RemoveUnit(unit)
        local hpFrame = BlzGetOriginFrame(ORIGIN_FRAME_PORTRAIT_HP_TEXT, 0)
        BlzFrameClearAllPoints(hpFrame)
        BlzFrameSetAbsPoint(hpFrame, FRAMEPOINT_CENTER, 0.4, 0.55)
        local mpFrame = BlzGetOriginFrame(ORIGIN_FRAME_PORTRAIT_MANA_TEXT, 0)
        BlzFrameClearAllPoints(mpFrame)
        BlzFrameSetAbsPoint(mpFrame, FRAMEPOINT_CENTER, 0.4, 0.54)
        print("done")
        DestroyTimer(GetExpiredTimer())
    end)
    print("done")
  end
end
Edited: Replaced selfexecution with a less problematic approach
 
Last edited:
Level 12
Joined
Jan 30, 2020
Messages
875
Oh I see, now I have a better understanding of these substitute parents you mentioned.
So I used this :
JASS:
    // Minimap border
    set fh=BlzCreateFrameByType("BACKDROP", "MinimapBorder", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0)
    call BlzFrameSetAbsPoint(fh, FRAMEPOINT_TOPLEFT, 0.0, 0.60)
    call BlzFrameSetAbsPoint(fh, FRAMEPOINT_BOTTOMRIGHT, 0.14, 0.46)
    call BlzFrameSetTexture(fh, "ui\\minimap-border.blp",0, true)

    // Resources bar border
    set fh=BlzCreateFrameByType("BACKDROP", "ResourcesBorder", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0)
    call BlzFrameSetAbsPoint(fh, FRAMEPOINT_TOPLEFT, 0.15, 0.60)
    call BlzFrameSetTexture(fh, "ui\\resourcesbar-border.blp",0, true)
But no more success, only the minimap border is shown. I hope I am not doing anything dumb.
I try to read as many of your tutorials, but I admit I don't retain everything on first read.
They are precious sources of information, but there are so many aspects of this UI API that it definitely feels overwhelming when you start to learn using it ^^


As for your point with multiple selections and then selecting one of the units in the list, you are totally right, I had not thought of this.
I think I will go back to your original advice.
So what I do is try to access the Frame once player Heroes have been selected.
But if I try to sync selections it crashes the thread, so I had to comment it out :
JASS:
    ....... code creating heroes for each player and adding them to the corresponding player selection with  the help of GetLocalPlayer()
    // Show HP Text
    // call SyncSelections() // Thread crash when used
    set fh=BlzGetOriginFrame(ORIGIN_FRAME_PORTRAIT_HP_TEXT, 0)
    call BlzFrameSetVisible(fh, true)
    call BlzFrameClearAllPoints(fh)
    call BlzFrameSetAbsPoint(fh, FRAMEPOINT_BOTTOMLEFT, 0.0, 0.12)
Fun enough setting visibility to true does not crash the thread.
But then of course it does not work. Should I add a short timer to let selections sync themselves ?
Or should I select one of the heroes directly, then manage the frame and remove it from selection?
 
So what I do is try to access the Frame once player Heroes have been selected.
But if I try to sync selections it crashes the thread, so I had to comment it out :
you don't have to force a Sync it is just my talking for, it can not be done right after the selection was forced. Checkout my Lua example. At 0s the unit is selected, by code. Then at 0.3s (after a short delay) the frames are moved.
You have to do that only once, at the beginning of the game.

But no more success, only the minimap border is shown. I hope I am not doing anything dumb.
in your code the resourcebar Backdrop does not have a size nor a second point. One of them is required to give the Frame a part of the screen.
 
Level 12
Joined
Jan 30, 2020
Messages
875
Thanks !!!!!
Thats what I suspected, It needed a delay.
I have found a perfect way : I have some units owned by the computer, called Protectors, created at map init.
So I will use this :
JASS:
    // Portrait HP Text
    call SelectUnit(Protector[1], true)
   ** start a 0.3s timer
   ** On timer expiration I will use this :  
    set fh=BlzGetOriginFrame(ORIGIN_FRAME_PORTRAIT_HP_TEXT, 0)
    call BlzFrameSetVisible(fh, true)
    call BlzFrameClearAllPoints(fh)
    call BlzFrameSetAbsPoint(fh, FRAMEPOINT_BOTTOMLEFT, 0.0, 0.12)
    call SelectUnit(Protector[1], false)

Thanks for pointing out the missing size or second framepoint, will fix that and see if it solves the issue.

While I 'm at it, I came back to your Origin Frames Tutorial, and I missed that line about PORTRAIT_HP-TEXT :
"Does only pos itself correctly with
FRAMEPOINT_CENTER."

Is this still true ?
Sorry again for all these repeating questions and worse the times I make stupid mistakes, as it makes you waste your time repeating info you already have given most of the time. Seems like there are still many dark points in my understanding of certain Frames mechanics. Thats a first, It was a bit messy and I probably shouldn't have started on my map directly but test your sample maps in your tutorials first.

I really do appreciate the fact that you keep replying to my endless questions, your patience is outstanding.
Although I am not sure how or in what circumstance it could happen, but if you ever need help with anything, please never hesitate to ask.
 
While I 'm at it, I came back to your Origin Frames Tutorial, and I missed that line about PORTRAIT_HP-TEXT :
"Does only pos itself correctly with
FRAMEPOINT_CENTER."

Is this still true ?
Yes, That post was updated and that line was added some minutes ago, additional to some images for originframes which were added in 1.32.x and the hint that moving command/item buttons can glitch.
 
Level 12
Joined
Jan 30, 2020
Messages
875
Nearly there :)

Oh by the way, I misunderstood you earlier because I did not see your edit when you added a Lua example for HP and Mana bar.

First things first, as expected, with your wisdom to the rescue now the borders work like a charm ^^
Not 100% sure the bottom ones are a visual improvement, but it might just be the poor border I made ^^

I noticed a small issue with the timer dialog when switching back to windows desktop and back :

WC3ScrnShot_041120_124324_001.png


As you can see its height gets messed up, pushing the multiboard off screen.
I also suppose switching to and back from cinematic mode or even changing the resolution of the screen are the 2 other things that can mess things up.

I half-fixed it by setting the size and the position of the dialog everytime I start the timer rather than when I saved the frame.
This way, everytime the timer is started, the problem gets fixed :)

Now I am a bit puzzled. The attempt I did on the HP bar is quite similar to yours, but does not work.
At first I suspected the visibility fog to mess up the selection, so I made sure it was only enabled after.
Here is my current code :
JASS:
function ShowPortraitHPText takes nothing returns nothing
    local framehandle fh=null

    set fh=BlzGetOriginFrame(ORIGIN_FRAME_PORTRAIT_HP_TEXT, 0)
    // call BlzFrameSetVisible(fh, true) // seems unnecessary as you don't use it in your Lua example
    call BlzFrameClearAllPoints(fh)
    call BlzFrameSetAbsPoint(fh, FRAMEPOINT_CENTER, 0.13, 0.13)
    call SelectUnit(Protector[1], false)
    call FogEnable(true)
endfunction


function UISetup takes nothing returns nothing

***** all my other worling UI settings *****

    // Portrait HP Text
    call ClearSelection()
    call SelectUnit(Protector[1], true)
    call TimerStart(SelectionTimer, 0.30, false, function ShowPortraitHPText)
endfunction
Your working example creates a footman, starts a 0.3s timer then removes the footman and accesses the frame just after that.
This surprised me, does it mean the selection is still very briefly there even if the unit is removed?
As for my case I am unsure. Could the fact that the unit I select belongs to an enemy player mess anything up?
Or maybe some other action executing while the 0.3s timer is running does something wrong.

Note that I call my UISetup function on the first line of my "After Init" function, that is called by a 0.00 timer expiration started in Map Init trigger.

Anyways, best thing I should do is do an exact replica of your method (will make a special dummy unit with my empty model, I don't like footmen on my Ball game playground, even for 0.3s :D

This way I will be certain to get the expected result.

Once this last bit is done, I will at last be able to take a break and read every UI tutorial you wrote I might have missed.
Being able to fully understand this API and knowing most of the arbitrary strange behaviors like you do brings a lot of potential on the table.

Even this way painful (I guess it also was for you!), this is really promising and exiting !

Keep up your amazing investigation work on these Frames !!!!

EDIT :
No luck.
Your method didn't work in my map.
this leads me to believe that there is definitely something creating a conflict with it in my map.
Will start investigations :)

EDIT 2:
Thats really worrying.
I tried everything.
Latest attempt was trying to get the HP frame when the first level started, so 40 seconds after heroes are created and added to their owner selection.

Also I noticed that trying to set the frame visible crashes the game as you mentioned.
But I was thinking... how is the frame supposed to be visible if we can't set it visible and we have used native BlzHideOriginFrames takes boolean enable returns nothing at Map Init ???

EDIT 3:
Just tried to set the parent visible instead with call BlzFrameSetVisible(BlzFrameGetParent(fh), true) and it still crashes the game...

Then I tried to get the parent name, it also crashes the game.
It seems the frame has no parent.

Next I tried to get the frame name and display it... and the frame name was "null"
 
Last edited:
  • Like
Reactions: pyf
Also I noticed that trying to set the frame visible crashes the game as you mentioned.
But I was thinking... how is the frame supposed to be visible if we can't set it visible and we have used
native BlzHideOriginFrames takes boolean enable returns nothing
at Map Init ???
I suggest the other way not using BlzHideOriginFrames, instead moving the bottom of ConsoleUI out of the screen at map init. After having done that move in all the frames you wana use does not require any hiding/showing.

Next I tried to get the frame name and display it... and the frame name was "null"
From what I know is that Get Frame Name is not working for any SimpleFrame type.
 
Level 12
Joined
Jan 30, 2020
Messages
875
Ok I will try that. I remember that trying to hide parts of the UI rather than showing them was my initial idea and that i failed to hide quite a few frames.
But of course by then I had not considered moving the Console UI off-screen ^^

Also, this is precious information about Simple Frames and the get name native.

Now, there might still be something wrong elsewhere in my map as this HP text is the only thing I didn't manage to show.
Tell me, in the example you posted in this thread in Lua, did you use the off-screen Console UI method ?

Anyways, at the moment I am battling against Lua as the conversion of my map is, as expected, a complete nightmare as Lua is the least verbose language I have ever tried when it comes to errors. I have not yet been faced with the warning you gave me about object comparisons, because I have already hit several walls and only managed to overcome a few for the moment. I have the feeling the task will be huge.

But I guess it's the best way to learn, just like I start to scratch the surface of really understanding how this UI API really works.
I have read some more of your tutorials, and I have decided to test them extensively as soon as my map will work in Lua.

Fact is, once I have made the UI work as I want, I have other plans for a new map with the same thematic but that won't be a real TD this time, and I will need more advanced custom UI features, and this means working hard to understand everything !

Right, time to go back to my war versus Lua, and thank you, again, for all the time you spend saving my UI days :)
 
Now, there might still be something wrong elsewhere in my map as this HP text is the only thing I didn't manage to show.
Tell me, in the example you posted in this thread in Lua, did you use the off-screen Console UI method ?
In the example nothing else is hidden or moved, only the Frames displaying Hitpoints Mana are moved below the daytime clock.
 
Level 12
Joined
Jan 30, 2020
Messages
875
I see, this might confirm the problem with showing HP/MANA text frames when hiding origin frames.

Not sure Blizzard devs have tested their own API, considering the amount of things not working as one's intuition would expect.
 
  • Haha
Reactions: pyf
Level 12
Joined
Jan 30, 2020
Messages
875
Update :
Sorry to bother you, @Tasyen :
In the process of my map's conversion to Lua, I followed your advice and indeed the HP Text works perfectly.
Also, moving the ConsoleUI off screen makes hiding the backdrop useless. Thats quite nice.

The problem, though is that I don't know how to get rid of the Day/Night model and the border of the upperbuttons :

WC3ScrnShot_041520_130933_001.png


Is there any way to remove this with the natives, or am I condemned to chose between the HP Text and these remaining frames ?
I know I can use the Game interface in the advanced WE menu, but If i know where to replace the upper buttons border, I have not found (or maybe I have missed it?) an entry to change the Time OF the Day ring and its border.

Have you had any success trying to remove them ?

Thanks again for all the help, and please take care.

small edit :
I suppose it can't be accessed, but just in case : what about the flashing of the quest dialog button ?
Can we move it with the button like the Hero icon's flashing or is it another missing feature from the API ?
I am asking because that highlight texture does not follow the button when I move it, so it stays hidden behind the minimap.
 
Last edited:
Right now you have to choose like you say it.

There are multiple ways to get rid of the background textures of the UpperButtonBar and ResourceBar.
  • you could move the TOP of ConsoleUI a little bit up (then everything attached to top moves up aswell) like you did with BOTTOM
  • One can import a alpha only image and set the used texture to that imported image in game interface for ConsoleTexture01, ConsoleTexture02, ConsoleTexture03, ConsoleTexture04. The same thing can be done for the day time clock although the space it takes will not be clickable with that. There is a model and Texture for the Day Time Clock.
  • Or new since Reforged one can load in a own version of ConsoleUI (over a fdf and toc) with named Textures which than can be moved around manipulated as one pleases (the loading has to be done inside function config or in the Lua root)
Can we move it with the button like the Hero icon's flashing or is it another missing feature from the API ?
That flashing would be an own SPRITE/MODEL Frame, if it not follows then it is a missing feature and bad setuped by Blizzard.
 
Last edited:
Level 12
Joined
Jan 30, 2020
Messages
875
Hello there.

Precious information again. This is a bit disappointing, and I would be surprised if they changed the API in the near future.

Now to stay with positive thinking, at least we have a UI API.

I will tinker with the advices you gave. Especially with this idea of a custom ConsoluUI. I am not yet familiar with the function config or Lua root. All I know so far is that it seems we can replace/override functions, maybe even replace natives (maybe rather wrap them, because replacing them doesn't make sense for most of them).

I might also explore another possibility, coming back to what you said about multiple selection units. For some reason, when i try to select a single unit from the group, and instead of what it does in melee maps, it selects the unit and "cancels" the group. In such circumstances, custom health bars would work. That might be interesting if I want a more fancy HP Bar.

But I still want to explore your suggestions first.

About the highlight texture, thats what I feared, anyways at least I won't be searching for hours :)

Thank you and take care !

EDIT :

This is nearly a complete success :

WC3ScrnShot_041620_130922_001.png



In the end, I hardly need to do anything at map init :
Lua:
    -- Hide standard UI
    -- BlzHideOriginFrames(true)
    BlzEnableUIAutoPosition(false)
    BlzFrameSetAbsPoint(BlzGetFrameByName("ConsoleUI", 0), FRAMEPOINT_BOTTOM, 0.0, -0.18)
    --BlzFrameSetVisible(BlzGetFrameByName("ConsoleUIBackdrop", 0), false)

Bottom of Console UI unfortunately still needs to be moved to hide the unclickable area.
Not even sure the disabling of auto position is useful anymore, though...

So here is what I simply did to make this happen :

In Advanced WE Menu, Game Interface, I replaced all 4 console textures with an empty (rather a 4x4 transparent texture), then the Time Of the Day model with my empty model.
Then I had these extra borders i removed with importing my empty texture twice, giving them these paths in the Asset Manager :

ui\console\human\humanuitile05.blp
ui\console\human\humanuitile06.blp

And thats it basically.

Now the last issue is these backgrounds I added to my border frames.

The display on top of the infopanel, commandbar and ressourcebar.

I tried changing by background-borders parent as the world frame, as I believe it is on a deeper level, as in this example :
Lua:
    -- Resources bar border
    fh=BlzCreateFrameByType("BACKDROP", "ResourcesBorder", miniMap, "", 0)
    BlzFrameSetParent(fh, BlzGetOriginFrame(ORIGIN_FRAME_WORLD_FRAME, 0))
    BlzFrameSetSize(fh, 0.33828125, 0.0218)
    BlzFrameSetAbsPoint(fh, FRAMEPOINT_TOPLEFT, 0.15, 0.60)
    BlzFrameSetTexture(fh, "ui\\resourcesbar-border.blp",0, true)

Note : the background is just a modified version of the tooltips background to fit my border textures.

Unfortunately that does not work. Going back to your tutorial, I found that I missed these lines :
"Backdrops can not have frameevents.
Backdrops are above simpleframes, hiding them."

In other words, backdrops are not suitable for what I am trying to achieve.
Hence my questions :

- What kind of frame can I create to achieve this ?
- Can it be done without .toc and .fdf imports ?


Note they don't need to be able to move outise of the 4/3 screen.
 
Last edited:
Level 12
Joined
Jan 30, 2020
Messages
875
UPDATE :

If anyone is seeking answer to the same questions as myself, I have found the problem.

The mistake I did in the above post was first setting the minimap frame as parent, and forgot about it later on.

I set all border-background frames with the same parent, in case I'd need to hide them all at once.

In the end changing the parent afterwards bugged out, but if I choose the world frame as owner like there :
Lua:
    local world=BlzGetOriginFrame(ORIGIN_FRAME_WORLD_FRAME, 0)

---------------- other UI settins

    -- Resources bar border
    fh=BlzCreateFrameByType("BACKDROP", "ResourcesBorder", world, "", 0)
    BlzFrameSetSize(fh, 0.33828125, 0.0218)
    BlzFrameSetAbsPoint(fh, FRAMEPOINT_TOPLEFT, 0.15, 0.60)
    BlzFrameSetTexture(fh, "ui\\resourcesbar-border.blp",0, true)

And here is the final result :

WC3ScrnShot_041720_073648_001.png

Now all I need to do before my Custom simple UI to be finished is somewhat replace my "Levels" Icon on the top right of the resources bar, create a custom HP bar thanks to @Tasyen 's tutorial, here : [JASS/AI] - UI: Creating a Bar and place it where I currently have the HP Text.

I suppose if the bar has the same length as the portrait, I won't even need to create a border for the portrait.

Maybe also make the backgrounds a bit less transparent too...


Anyways I think I have reached the end or at least nearly the end of that long UI quest that would have failed without the help of The Hive community's help, especially our UI expert, @Tasyen !!! Again, thank you !!!
 
  • Like
Reactions: pyf
Level 17
Joined
Oct 10, 2011
Messages
462
Hello I have problems with resources UI I want to display only the gold section with the icon.

But it seems that we can only get the inner text of the window and not the full cell.

When I do a "BlzFrameGetChild" of the "ResourceBarFrame" I only get the events on hoover.
Does anyone has a solution?
 
The Resource Texts String-SimpleFrames can be accessed with their name. But the Icons Texture-SimpleFrames can not. BlzFrameGetChild ignores String/Textures.
I would suggest you set the icons for lumber and food in game interface to UI\Widgets\EscMenu\Human\blank-background.blp and move the texts away, or change their font.

BlzGetFrameByName("ResourceBarGoldText", 0)
BlzGetFrameByName("ResourceBarLumberText", 0)
BlzGetFrameByName("ResourceBarSupplyText", 0)
BlzGetFrameByName("ResourceBarUpkeepText", 0)
 
Status
Not open for further replies.
Top