UI v1.3

This bundle is marked as approved. It works and satisfies the submission rules.
uilogo-png.394060


ui-png.394058

intro-png.394057

UI is, well, a new minimal, unit focused UI for the game. The idea behind it is to hide most UI elements of the screen and allow the players to see more of the game itself, while still providing the most important functionalities for a unit focused map. This being my first UI design ever you might find a bug at some point, so please, if this happen let me know right away. UI requires patch 1.32+.

importing-png.394056

Importing UI is pretty simple, first you must import all 6 assets in the test map to yours and set their paths to exactly like in the test map:

uiassets-png.394059

After that go to the Trigger Editor and copy the UI library over to your map as well. UI requires the RegisterPlayerUnitEvent and GetMainSelectedUit libraries (vJASS and Lua) and onInit library as well (Lua only), so if you do not have them already, copy them as well. That's it, you done.

VERY IMPORTANT:
UI requires you to have the default game UI enabled, so if you are using mods like the Quenching Interface that alters the default game UI elements, disable them. UI also requires you to use only specific position of the Command Card. By default the Attack, Move, Hold, Stop and Patrol buttons are hidden (You can still use them through hotkeys) so only the other 7 buttons are visible. For Hero units who can learn abilities this is very important because you will need to change the Research(X,Y) positions of the abilities that can be learned.

grid-jpg.394055


uiposition-png.394061

The order of the visible buttons of the Command Card, from left to right are: (3,1) (0,2) (1,2) (2,2) (3,2) (1,1) (2,1).
I tested this using 2 clients over a local area network so this should be desync safe.

KNOWN BUGS
  • Starting the game while it is minimized bug the original UI for the player with the game minimized.

credits-png.394054

  • Tasyen

(v1.0)
  • Release
(v1.1)
  • Included the GetMainSelectedUnit library
  • fixed a bug of the Health/Mana persisting after player not owned unit is deselected
  • 2 new global configuration variables:
    • GOLD_ICON: When different than an empty string will overwrite the gold icon
    • LUMBER_ICON: When different than an empty string will overwrite the lumber icon
(v1.2)
  • Fixed the bonus stats of a hero not showing up.
(v1.3)
  • Included a configuration to show the Shop Items/Units
  • Checking the Top Right check box will also show Food and Upkeep values
Contents

UI (Map)

UI (Map)

Reviews
MyPad
Are you tired of designing your maps with the old game UI? Do the large-scale battles feel too cluttery for you to enjoy? Don't look any further, this is the right UI for you. With an interesting re-arrangement of what you can get from old game UI...
Level 3
Joined
Jun 4, 2019
Messages
27
Maybe an optional feature: Gold and Lumber Symbols can be set per path (currently they are fixed in the UI) because most RPG maps use lumber as talent point or something else :grin:
 
Level 18
Joined
May 16, 2012
Messages
604
Does the health bar show 0/340 when not selecting own units?
Fixed with the inclusion of the GetMainSelectedUnit library.

Maybe an optional feature: Gold and Lumber Symbols can be set per path (currently they are fixed in the UI) because most RPG maps use lumber as talent point or something else :grin:
Added.
 
This is amazing. I've been waiting for this ever since I saw this project while browsing the pastebin randomly.
On another note, can you release the UI textures as .PSD or uncompressed .TGA? 🙂

Edit (more to add):
  • In your RegisterPlayerUnitEvent library, "local integer k = 15" still uses the old number of player slots (16). It should be updated to something like "local integer k = bj_MAX_PLAYER_SLOTS - 1". Don't know if the number 16 in the "local integer i = 16 * GetHandleId(p) + GetPlayerId(pl)" line has something to do with 16 player slots, though.
 
Last edited:
Level 18
Joined
May 16, 2012
Messages
604
This is amazing. I've been waiting for this ever since I saw this project while browsing the pastebin randomly.
On another note, can you release the UI textures as .PSD or uncompressed .TGA? 🙂
Yeah sure. When i get home I'll upload them.

In your RegisterPlayerUnitEvent library, "local integer k = 15" still uses the old number of player slots (16). It should be updated to something like "local integer k = bj_MAX_PLAYER_SLOTS - 1". Don't know if the number 16 in the "local integer i = 16 *
RegisterPlayerUnitEvent is not my library, it's Magtheridon96. I'l update it in my resources since he seems not to be keeping it.
 
Level 9
Joined
May 7, 2008
Messages
261
Very nice chopinski, I'm really into this idea.


However there seems to be an issue with displaying overall count of items in the shop if the value is above 6. If the item count in the shop is more than 6 it won't display the rest of them, aka item number 7 and so on.

As I can see from your original post this is intended, but it would be nice if you can make it so that it displays them all.

Or perhaps make a switchable button to go onto the next page for the shop (buttons)?
 
Last edited:

MyPad

Spell Reviewer
Level 23
Joined
May 9, 2014
Messages
1,697
This looks fantastic so far. The placement of the UI elements really gives the user a greater scope of the battlefield in just how large the armies actually are. The option to toggle the Hero list display, as well as the main menu options is a nice touch. That said, I may have found some issues:
  • Error messages (from the game) do not display.
  • The displayed amount of food used/produced is missing. This makes food resource management more difficult on the user's end.
  • In both testmaps, the UI elements are conflicting with the original unit command UI. This is how it looks on my end:
    1644563702896.png


    (Apologies for the cropped up picture)
    In the picture, the Hero Icons and the unit command UI are still visible.
Edit:
  • Corrections made.
    • Chat messages do display, while error messages still do not.
    • Both versions have the potential of exhibiting the same bug described above. Original game UI changed to original unit command UI.
 

Attachments

  • 1644563650328.png
    1644563650328.png
    2.2 MB · Views: 41
Last edited:
Level 18
Joined
May 16, 2012
Messages
604
This looks fantastic so far. The placement of the UI elements really gives the user a greater scope of the battlefield in just how large the armies actually are. The option to toggle the Hero list display, as well as the main menu options is a nice touch. That said, I may have found some issues:
  • Error messages (from the game) and chat messages do not display.
  • The displayed amount of food used/produced is missing. This makes food resource management more difficult on the user's end.
  • In the JASS version of the map, the UI elements are conflicting with the original game UI. This is how it looks on my end:
    View attachment 394922

    (Apologies for the cropped up picture)
    In the picture, the Hero Icons and the unit command UI are still visible.
Weird @MyPad , apart from the food resource, the other 2 issues you having shouldn't be happenning. Did yoo tested with 2 clients and alt+tabbing between them? If so that my be the reason, i remember in my Local Area Network tests with 2 players that if one of the clients started minimized the original bottom UI frame bugs out, which should not happen in real conditions because each player will have his own window focused.

From the picture it seems that the unit default command cards were not moved out of the screen as well (Move, Attack, etc...), so it might be some other problem, Which version of the game are you testing it on? UI requires patch 1.32+ because it uses the ConsoleUIBackdrop as a parent frame.

Regarding the Chat and Debug Messages, there is a method to reposition them:

vJASS:
private static method onChat takes nothing returns nothing
    set handle = BlzGetOriginFrame(ORIGIN_FRAME_CHAT_MSG, 0)
    call BlzFrameSetAbsPoint(handle, FRAMEPOINT_TOPLEFT, 0.000212200, 0.302800)
    call BlzFrameSetAbsPoint(handle, FRAMEPOINT_BOTTOMRIGHT, 0.400212, 0.100300)

    set handle = BlzGetOriginFrame(ORIGIN_FRAME_UNIT_MSG, 0)
    call BlzFrameSetAbsPoint(handle, FRAMEPOINT_TOPLEFT, 0.000212200, 0.302800)
    call BlzFrameSetAbsPoint(handle, FRAMEPOINT_BOTTOMRIGHT, 0.400212, 0.100300)

    set handle = null
endmethod

This posistion the chat message just above the Health bar, so you might not being able to see it because of the default UI showing up.

This line of code call BlzFrameSetAbsPoint(BlzGetFrameByName("ConsoleUI", 0), FRAMEPOINT_TOPLEFT, 0.0, 0.633) is responsible for removing most of the original UI elements and that includes the default bottom UI and the hero cards and as i said it uses the ConsoleUI frame, so it requires patch 1.32+.

Did you tested the Lua version as well? Did it worked as intended?
 

MyPad

Spell Reviewer
Level 23
Joined
May 9, 2014
Messages
1,697
After some more tests, I was able to reproduce the visual conflict bug successfully. Here are the steps I took:
  • Load the map.
  • Once the map starts loading, immediately switch to another process.
  • Wait until the map is finished loading, and proceed normally.
The steps above should reliably reproduce the bug.

I found out that it is independent of the number of active sessions of the game. I've also done a bit of investigating on the nature of this bug and it seems to be related to the amount of time spent rendering the UI, so to speak. When the game is out of focus while the map is loading, the UI is likely not rendered. At the point when the map finishes loading for everyone, if the UI isn't rendered at this point, the game will forcibly render it, likely auto-positioning it as well. At this point, the initializer used by this system is already done, so it is highly unlikely that the changes made will carry over to the newly rendered UI.

I think this "bug" might have the potential to become useful to a select few for determining whether the game was out of focus or not when the map was still loading. However, that potential is unlikely to be realized.
 
Level 18
Joined
May 16, 2012
Messages
604
After some more tests, I was able to reproduce the visual conflict bug successfully. Here are the steps I took:
  • Load the map.
  • Once the map starts loading, immediately switch to another process.
  • Wait until the map is finished loading, and proceed normally.
The steps above should reliably reproduce the bug.

I found out that it is independent of the number of active sessions of the game. I've also done a bit of investigating on the nature of this bug and it seems to be related to the amount of time spent rendering the UI, so to speak. When the game is out of focus while the map is loading, the UI is likely not rendered. At the point when the map finishes loading for everyone, if the UI isn't rendered at this point, the game will forcibly render it, likely auto-positioning it as well. At this point, the initializer used by this system is already done, so it is highly unlikely that the changes made will carry over to the newly rendered UI.

I think this "bug" might have the potential to become useful to a select few for determining whether the game was out of focus or not when the map was still loading. However, that potential is unlikely to be realized.
Hmmm, interesting...

To solve that issue i think that running the code inside onInit after a small time might do the job, need to test though.

EDIT:
@MyPad not even delaying the execution of onInit functions solve the problem, this might actually be unsolvable. Maybe @Tasyen can save our souls with this issue?
 
Last edited:
Level 18
Joined
May 16, 2012
Messages
604
@Crusher shop handling added.
@MyPad included the Food and Upkeep display by checking the top right check box. Also when the UI don't bug like we discussed you should be able to see debug messages and chat messages. For now I have no idea how to solve or even if it is possible to solve the Original UI bug showing up when the game is started minimized, so for now I added a Know Bugs in the presentation.
 
Level 9
Joined
May 7, 2008
Messages
261
@Crusher shop handling added.
@MyPad included the Food and Upkeep display by checking the top right check box. Also when the UI don't bug like we discussed you should be able to see debug messages and chat messages. For now I have no idea how to solve or even if it is possible to solve the Original UI bug showing up when the game is started minimized, so for now I added a Know Bugs in the presentation.

I'm glad you've liked my idea, happy to help! I'll check it out today.


Regarding the Ui bug, I can give you some ideas, but Im no expert on coding so here goes:

1) Perhaps loading the UI and then disabling / enabling it after a short period can help?

2) Add wait before loading the UI?

3) Is it possible to change something in the Ui after it is loaded (like an image) and then revert that image via triggers in hopes to fix the bug?
 
Last edited:
Level 18
Joined
May 16, 2012
Messages
604
I'm glad you've liked my idea, happy to help! I'll check it out today.


Regarding the Ui bug, I can give you some ideas, but Im no expert on coding so here goes:

1) Perhaps loading the UI and then disabling / enabling it after a short period can help?

2) Add wait before loading the UI?

3) Is it possible to change something in the Ui after it is loaded (like an image) and then revert that image via triggers in hopes to fix the bug?
I tried all those things without success.
 

MyPad

Spell Reviewer
Level 23
Joined
May 9, 2014
Messages
1,697
Are you tired of designing your maps with the old game UI? Do the large-scale battles feel too cluttery for you to enjoy? Don't look any further, this is the right UI for you. With an interesting re-arrangement of what you can get from old game UI, you'll get a new and liberating experience from the aesthetic clutter that you've grown accustomed to. Works in Reforged only.

Caution: Take note of the icon positions when designing your map. Otherwise, you'll get the (0, -11) treatment with some of the icons.

Approved

 
Level 18
Joined
May 16, 2012
Messages
604
Hey Chopinski, I was wondering about this particular piece of information, do you have any updates on it?
Nope, seems to be an unavoidable problem from the code stand point. Tasyen has told me that this could be corrected by setting the textures of the original UI elements to a blank tranparent texture but i haven't had time to try it yet.
 
Top