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

[JASS] dialog with local variables

Status
Not open for further replies.
Level 4
Joined
Jul 24, 2008
Messages
108
Hey, is it possible to create a dialog button for choosing difficulty or what not without using gui/global variables. I have tried creating a dialog using locals but it didn't work. What functions should i be using to acomplish this--all the turorials ive looked for are only gui. Here is what i have come up with so far, but it doesn't work

JASS:
function difficultydiag takes nothing returns nothing
    local button easy
    local button medium
    local button hard
    local dialog difficulty
    call DialogSetMessageBJ( difficulty, "Select a difficulty" )
    call DialogAddButtonBJ( difficulty, "easy" )
    set easy = GetLastCreatedButtonBJ()
    call DialogAddButtonBJ( difficulty, "medium" )
    set medium = GetLastCreatedButtonBJ()
    call DialogAddButtonBJ( difficulty, "hard" )
    set hard = GetLastCreatedButtonBJ()
    call DialogDisplayBJ( true, difficulty, Player(0) )
    call DisplayTimedTextToForce( GetPlayersAll(), 10.00, "Please wait while host chooses a difficulty" )
    call TriggerSleepAction( 30.00 )
    call DialogDisplayBJ( false, difficulty, Player(0) )
endfunction
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
Why are you using so many BJs?

JASS:
function difficultydiag takes nothing returns nothing
    local dialog difficulty = DialogCreate()
    call DialogAddButton(difficulty,"easy",0)//Or you can replace 0 with a hotkey if you want one
    call DialogAddButton(difficulty,"medium",0)
    call DialogAddButton(difficulty,"hard",0)
    call DialogSetMessage(difficulty,"Select a difficulty")
    call DialogDisplay(Player(0),dialog,true)
    call DisplayTimedTextToPlayer(GetLocalPlayer(),0,0,10.,"Please wait while host chooses a difficulty")
    call TriggerSleepAction(30)
    call DialogDisplay(Player(0),difficulty,false)
    call DialogDestroy(difficulty)
endfunction
 
Status
Not open for further replies.
Top