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

dialog wont show

Status
Not open for further replies.

Kazeon

Hosted Project: EC
Level 33
Joined
Oct 12, 2011
Messages
3,449
guys, I have a very strange situation here.. I have function

JASS:
function ShowMenu takes nothing returns nothing
    call DialogClear(dia)
    call DialogSetMessage(dia, "Menu" )
    set but[1] = DialogAddButton( dia, "Play", 0 )
    set but[2] = DialogAddButton( dia, "High Score", 1 )
    set but[3] = DialogAddButton( dia, "Statistic", 2 )
    set but[4] = DialogAddButton( dia, "Achievments", 3 )
    set but[5] = DialogAddButton( dia, "Quit Game", 4 )
    call DialogDisplay(Player(0), dia, true)
endfunction

and then call it
  • Open
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Custom script: call ShowMenu()
dia is a dialog variable that I have initialized using text macro.. but the problem is the dialog won't be opened/shown.. what the hell is going on? :ogre_rage:

answer
JASS:
set dia = DialogCreate()
 
Last edited:
JASS:
function ShowMenu takes nothing returns nothing
    set dia = DialogCreate()
    call DialogClear(dia)
    call DialogSetMessage(dia, "Menu" )
    set but[1] = DialogAddButton( dia, "Play", 0 )
    set but[2] = DialogAddButton( dia, "High Score", 1 )
    set but[3] = DialogAddButton( dia, "Statistic", 2 )
    set but[4] = DialogAddButton( dia, "Achievments", 3 )
    set but[5] = DialogAddButton( dia, "Quit Game", 4 )
    call DialogDisplay(Player(0), dia, true)
endfunction
 
Status
Not open for further replies.
Top