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

Altering Existing UI

Status
Not open for further replies.
Can you alter UI already in the game?

My case is that I want to add an icon and a number to the 'hover-over' tooltip of certain units. Specifically, I want a 'Population' counter, plus icon, under the name when hovering over cities.

And similarly, a 'Resource' icon and how much resource a structure generates under the name of structures generating resources over time.


Also, custom resource icons and costs, special requirements, ect. When building structures and training units.
 

Wrda

Spell Reviewer
Level 25
Joined
Nov 18, 2012
Messages
1,870
You might want to consult Taysen for this, he's the one who knows most of this UI stuff.
One thing is altering the existing UI, like moving it to somewhere else, another thing is to create UI (already in game or not) for your specific uses. You'll need to make .toc and .fdf files, which I suck at. You can also read his tutorials.
That's all I can say for now :)
 
No simple clean builtin solution available. But one could flick it together with a lot of work

With hover you mean with the mouse pointing at a unit?


Then:

Your wanted Goals are currently (or for my knowlage about frames) complicated to be done.

Reasons:

The hover info nor the Ubertooltip can directly be written or read, nor can the hoverInfo be used as relative Point. One can place Text and Icons above the UberTooltip and convert the Position on the current view cam Point into a on screen pos.

The unit currently hovered can be gained with BlzGetMouseFocusUnit(), which is different for each Player.

It is difficult to identfy the commandbutton hovered (cause of this Frame that eats up the mouse Events at the Default positon of the command Card, I wasn't able to Isolate this Frame which makes the disabling have many sidefffects), if one does not need the default Background, Then one moves ConsoleUI,0 bottomright lower or to the Right then one can attach Buttons to the commandbuttons which have mouse enter Events which allows to know when an Player hovers a command button. If one would know which Frame exactly eats the mouse Events then this point could be done cleaner without so many sideeffects.


Further Problem with command Buttons is even when you know the button beeing hovered you do not know for what this button is used, if there are coliding button Position usages.
^^
If you have multiselection one needs to know which unit is currently the main unit (I wrote a Lua System doing that as long the user does not change the main unit using left click).

Adding an custom RessourceField is doable and I published an resource into the spellsection there is MyResourceBar (substandart) and MyResourceField they both Show Icons and text and fit to the Default resource bars (although I should do a small bug fix Setting FrameLevel to 2 or higher).

Remains to add the custom Icon and Text to the Tooltip when hovering Training options. Cause one can not write UBERTOOLTIP one adds TEXT and BACKDROP Frames onto UBERTOOLTIP at the wanted postions relative to the top of it (didn't do that yet so one would have to test he values).
 
Status
Not open for further replies.
Top