Baradé's Queue UI 1.0

This bundle is marked as pending. It has not been reviewed by a staff member yet.
Motivation
We have queue UIs for trained units, researches, upgrades and constructions etc. in other RTS games like Age of Empires II: DE.
This system adds a simple UI for such queues to Warcraft III.

Features
  • Simple UI to show unit train/research/construction/upgrade and hero revival queues.
  • Selecting the icons will automatically select the corresponding building and pan the camera to its location.
  • Shows the number of queue items per ID.
  • Checkbox to hide the queue.
  • Options to enable/disable it per player.
  • Optional library QueueUIResearches allows registering custom names and icons for research IDs which supports research levels higher than 0.

Design
The library Queue simply stores queues per player.
The queues are disabled for Computer players by default to improve the performance but can be enabled at any time.
The library QueueUI adds the UI for the queues.
The library HeroReviveEvents is required for fixes with native events since we need to retrieve the corresponding reviving altar. It relies on HeroReviveCancelEvent v1.1 to detect cancel orders.

Future Work
  • Allow defining which types are detected in a queue and which are not.
  • Include allied units if control is shared.
  • If there would be some way to detect the times, one could add some cooldown/progress effect to the icons. Knowing the actual time, the icons could be ordered by time.
Contents

Baradé's Queue UI 1.0 (Map)

Reviews
Antares
No reply from author. Awaiting Update
Level 28
Joined
Feb 2, 2006
Messages
1,630
Hi, thx.

Update:
  • Do not recognize summoned units, learned hero skills or sold items anymore. The system checks for the unit classification structure and certain abilities (Sell Item etc.).
  • Support hero revivals.
  • Fix a bug for cancelling upgrades (Guard Tower etc.).
  • Revise UI layout: The UI is next to the idle worker button now which seems more convenient.
  • The option PAN_CAMERA to enable/disable camera pans on button clicks.
 
Last edited:
Level 2
Joined
Jan 12, 2024
Messages
3
New observation. The queue does not consider the name or icon of a research with levels.
Suggestion. A function could be implemented so that with the right click you can cancel an order from the queue.

🫡
 
Level 28
Joined
Feb 2, 2006
Messages
1,630
thx for the useful feedback!
I really like the idea of cancelling.

I can get the current level of a research with
JASS:
GetPlayerTechCount
and the tooltip with
JASS:
BlzGetAbilityTooltip
but since abilities have no different names and icons for levels and there is no native for researches, I don't know how to get the correct name or icon.
In the worst case, the user has to define the icons for research levels again.

There is no order issued when you cancel one of the queued items.
I printed all order IDs issued and did not see any order when cancelling some item.
You might detect getting resources back or something but I don't know how to order cancelling it.
I think you can only cancel the whole queue for a building with the cancel button?


edit:
A small update to support multiple levels of researches:
  • Added optional library QueueUIConfig which registers names and icons for researches with level higher than 0.
  • Remove unnecessary library FrameSaver.


I have added the data for Human researches in the example map:

JASS:
private function Init takes nothing returns nothing
    // Human
    call AddTech('Rhme', "Steel Forged Swords", "ReplaceableTextures\\CommandButtons\\BTNThoriumMelee.blp")
    call AddTech('Rhme', "Mithril Forged Swords", "ReplaceableTextures\\CommandButtons\\BTNArcaniteMelee.blp")
    call AddTech('Rhra', "Refined Gunpowder", "ReplaceableTextures\\CommandButtons\\BTNHumanMissileUpTwo.blp")
    call AddTech('Rhra', "Imbued Gunpowder", "ReplaceableTextures\\CommandButtons\\BTNHumanMissileUpThree.blp")
    call AddTech('Rhla', "Reinforced Leather Armor", "ReplaceableTextures\\CommandButtons\\BTNLeatherUpgradeTwo.blp")
    call AddTech('Rhla', "Dragonhide Armor", "ReplaceableTextures\\CommandButtons\\BTNLeatherUpgradeThree.blp")
    call AddTech('Rhar', "Steel Plating", "ReplaceableTextures\\CommandButtons\\BTNHumanArmorUpTwo.blp")
    call AddTech('Rhar', "Mithril Plating", "ReplaceableTextures\\CommandButtons\\BTNHumanArmorUpThree.blp")
    call AddTech('Rhlh', "Advanced Lumber Harvesting", "ReplaceableTextures\\CommandButtons\\BTNHumanLumberUpgrade2.blp")
    call AddTech('Rhac', "Advanced Masonry", "ReplaceableTextures\\CommandButtons\\BTNArcaniteArchitecture.blp")
    call AddTech('Rhac', "Imbued Masonry", "ReplaceableTextures\\CommandButtons\\BTNImbuedMasonry.blp")
    call AddTech('Rhpt', "Priest Master Training", "ReplaceableTextures\\CommandButtons\\BTNPriestMaster.blp")
    call AddTech('Rhst', "Sorceress Master Training", "ReplaceableTextures\\CommandButtons\\BTNSorceressMaster.blp")
endfunction

edit2:
- Ignore buildings with ability "Select Hero".
 
Last edited:
You have script called "Config", but you have config options sprinkled throughout the other scripts. They should all be put into the config section. The API functions that the user can use are not listed anywhere. To be honest, these are reasons why this library should probably be consolidated into one file. As far as I can tell, there's no reason to use one withouth the other, so splitting them just makes stuff harder to find. In addition, now you have to set functions to public because the other libraries need to be able to see them and you end up with this weird mix of private, normal, and public functions and it is unclear which functions are actually meant to be called by the user.

If I do HideQueueUI(), new items added to the list are still shown.

Apart from these issues, this is a fantastic system. I plan to annoy my friends who are making RTS maps as long as it takes to get them to implement it.
 
Level 28
Joined
Feb 2, 2006
Messages
1,630
Small update:
  • Make "Show" and "Hide" strings translatable.
  • Heroes are ignored for queue orders because I had a building/structure hero in my map which led to issues. Besides, the first reply here mentioned that I should ignore learning hero skill orders which is ignored now as well if the hero is a structure since non-structures are ignored anyway.
  • Hopefully fixed the mentioned bug of the Queue UI becoming visible again after calling HideQueueUI.
  • Remove boolean static config for hero revival and simply check for the library HeroReviveEvents instead.
  • Mention that EMPTY_STRING has to be the same for all locales to avoid desyncs. If this is not the case maybe I can get something with GetLocalizedString.
  • Refactor QueueUIResearches by renaming stuff.
  • The tooltips are a bit closer to the buttons now.
  • Added more constants to QueueUI to configure the UI.
  • Added research levels greater than 1 for all standard races including Naga.
  • Use GetCameraTargetPositionX and GetCameraTargetPositionY instead of GetCameraTargetPositionLoc in SmartCameraPanToUnit.
  • Units can be ignored with IgnoreQueueUnit now.
  • Some minor refactoring.

The reason I made QueueUIResearches and QueueUI separate is that I want the user to be able to disable them separately. QueueUIResearches is optional and will add a hashtable to the game. It requires you to register lots of researches manually for your map since there is no native. Hence, I made it a separate library.

I added the default researches for all standard Warcraft III races including Nagai. Too bad I do not have any native to get research icons and names for different levels. I found the translated strings in files like Units/HumanUpgradeStrings.txt but would not know how to extract them.


About hiding it during cinematics: You can easily do that manually in every cinematic or write some helper function and call it before enabling the cinematic and after disabling/skipping it. I did the same in my map. Hooking the cinematic mode function by default could be annoying and not what the user actually wants. Maybe he/she wants to hide it even when fading etc.
 
Last edited:
Top