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

[Lua] Another Dialog button doesn`t work thread

Status
Not open for further replies.
Level 1
Joined
Jun 21, 2019
Messages
4
1650880407010.png

Code:
function zoomObserverDialog()
BJDebugMsg('zoomObserverDialog')
  local d = nil
  local b = nil
  local t = CreateTrigger()
  bzoom = {}
  for i = 0, bj_MAX_PLAYERS do
    if not IsPlayerObserver(Player(i)) then
BJDebugMsg('Observer detected')
      d = DialogCreate()
      DialogSetMessage(d, 'Select zoom')
      b=DialogAddButton(d, "Default", 0)
      TriggerRegisterDialogButtonEvent(t, b)
      bzoom[b] = 1650
      b=DialogAddButton(d, "Medium", 1)
      TriggerRegisterDialogButtonEvent(t, b)
      bzoom[b] = 2075
      b=DialogAddButton(d, "High", 2)
      TriggerRegisterDialogButtonEvent(t, b)
      bzoom[b] = 2500
      b=DialogAddButton(d, "Very High", 3)
      TriggerRegisterDialogButtonEvent(t, b)
      bzoom[b] = 3000
      TriggerRegisterDialogEvent(t, d)
      DialogDisplay ( Player(i), d, true) 
BJDebugMsg('Dialogshouldbeseen for '..GetPlayerName(Player(i)))
    end
  end
  
  TriggerAddAction(t, ObsButtonAction)  

  
  b = nil
  d = nil
  t=nil
BJDebugMsg('zoomObserverDialog Complete')
end

1650880426528.png


It never writes "OBA". Where did I mess it?
It shows dialog, it hides dialog on clicking button but never executes ObsButtonAction script
 
Last edited:
Level 1
Joined
Jun 21, 2019
Messages
4
there were typos it seems. Also TriggerRegisterDialogButtonEvent doesn`t seems to give result i want but dialog event works better.
Delete or disapprove it plz
 
Status
Not open for further replies.
Top