• Check out the results of the Techtree Contest #19!
  • Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Better Dialog v1.1

A recreation of the Blizzard dialogs with custom frames, adding additional features such as tooltips and cycling buttons.

How often does it happen that, in a map you're playing, you are supposed to choose between different options from a dialog, often as the game host at the start of the game, but you have no idea what the different buttons are doing? The mapper doesn't tell you, and how could he? There's no room for any additional information anywhere.

This is where Better Dialogs comes in by giving the mapper the ability to add necessary information in the tooltips for the different buttons of a dialog.

Both Lua and vJASS versions available.

Version 1.1
  • Removed BlzDestroyFrame calls to avoid potential desyncs.
Contents

Better Dialogs Lua v1.1 (Map)

Better Dialogs vJASS v1.1 (Map)

Reviews
Wrda
I like your use of emmy annotation ;) CreateBetterDialogForForce whichForce can be either a table or a force, you can use "|" to mean "or": ---@param whichForce table | force ---@param dialogTitle string ---@param buttonData table function...
I like your use of emmy annotation ;)

CreateBetterDialogForForce whichForce can be either a table or a force, you can use "|" to mean "or":
Lua:
---@param whichForce table | force
---@param dialogTitle string
---@param buttonData table
function CreateBetterDialogForForce(whichForce, dialogTitle, buttonData)
Can also apply it to the ButtonsData case.

PlayButtonClickForPlayer could be local since it's not part of the API.

Otherwise, this is pretty good, very useful for host or players to get more detailed information about what a certain button does. Users can now blame the map maker for not doing this!

Approved
 
Hooray! I'll give this a test and integrate it into my map when I get a chance. Will let you know if I find any bugs :thumbs_up:
Thanks, please do! I had to restructure it quite a bit for the translation (back to the good ol' hashtable chains).
 
Works well after the most recent JASS changes

Also, here's and additional function that I found useful

JASS:
    function CloseOpenDialogForAll takes nothing returns nothing
        local integer i = 0
        loop
            exitwhen i > 23
            if GetPlayerSlotState(Player(i)) == PLAYER_SLOT_STATE_PLAYING and GetPlayerController(Player(i)) == MAP_CONTROL_USER then
                call CloseDialog(CurrentlyOpenDialog[GetPlayerId(Player(i))])
            endif
            set i = i + 1
        endloop
    endfunction
 
Last edited:
Thanks, that's a good function to add! You can simplify the condition though: :psmile:

JASS:
    function CloseOpenDialogForAll takes nothing returns nothing
        local integer i = 0
        loop
            exitwhen i > 23
            if CurrentlyOpenDialog[i] != null then
                call CloseDialog(CurrentlyOpenDialog[i])
            endif
            set i = i + 1
        endloop
    endfunction

Works well after the most recent JASS changes
What did I change again? :plol:
 
1. Easy to use and modify. Recommended if you have 3+ options per button.

2. Can be used to save settings for maps and custom campaigns, although it seems to require script coding exclusively (not much of a problem for me).

3. In the library description probably should add a note that Config is in the library itself - I spent a few minutes checking the imported files.

4. I'm not sure if it is possible to register pressing these dialog buttons via GUI.

5. In placement (X,Y) should mention that (0,0) is at the bottom left corner. I expected it to be in top left.

6. Not sure for Lua, but for Jass should mention that this requires enabling the JassHelper - I did not have it enabled before this, and spent some time figuring out why these triggers were constantly disabling in my map.

7. Question: Can I rename the triggers ('better dialogs', 'test'), and if yes, what do I have to change in the code to keep it from breaking?
 
Thank you for your feedback!

3. It's probably not ideal that there the documentation is above the config; that's not how I would do it today, but there's only one script file that you need to import, so I don't really see this as a big issue.
4. There's no GUI version right now.
5. Yes, I can add that.
6. Sure.
7. The name of script files in your map is of no relevance.
 
Can you add GUI implementation please?
Sorry, I have too many resources to attend to and I always feel like my GUI translations are terrible. Maybe someone who is currently working with this system can do a translation? I would add it here and give credit, of course. @Yevhen Snizhko @Regno @DarkePacific
 
Found an interesting problem when HUD is scaled down.

What happens if I reduce HUD scale in Reforged 2.0.1 during gameplay:
1741784885318.png



Image 2:What happens if HUD is set to 0% in Reforged 2.0.1 when level starts:
1741784771312.png


All buttons work properly, but they have issues with scaling.

I'll just put a note for my campaign that users shouldn't open settings with downscaled HUD.
 
I updated the system by removing BlzDestroyFrame as it can cause desyncs. If you're using the previous version, I recommend updating it or simply replacing the BlzDestroyFrame calls with BlzFrameSetVisible(..., false) manually.

Thank you to @KenArok for the bug report.
 
Back
Top