• 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.

[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