Is there a dialog starts/ends eventhandler or some similar?

  • #1, by PanSThursday, 11. March 2021, 15:34 3 years ago
    I am searching in the forum and used google, but cant find anything like a dialog starts/ ends eventhandler.

    I want to fade out (parts of) my interface everytime a dialog starts and fade in when a dialog ends. Yes, I could do that everytime I start a dialog manually, but thats not the way I want to do that.

    How I could check if a dialog starts (or the Dialog Box is shown)?

    Sry, there where an answer anywhere, but I coulnd't found it.

    Newbie

    73 Posts


  • #2, by SimonSMonday, 15. March 2021, 11:36 3 years ago
    There's no eventhandler but you can check for game.Dialog, if there's an object the dialog is shown.

    Thread Captain

    1580 Posts

  • #3, by PanSTuesday, 16. March 2021, 11:46 3 years ago
    Thx. "if game.Dialog == emptyObject then" in MainLoop works so far. Could that become a problem somehow?

    Newbie

    73 Posts

  • #4, by afrlmeTuesday, 16. March 2021, 11:50 3 years ago
    No, that's what he meant. You could also use:

    if game.Dialog:isEmpty() then

    Imperator

    7278 Posts

  • #5, by PanSTuesday, 16. March 2021, 13:23 3 years ago
    Thx. Works fine so far:
      if game.Dialog == emptyObject then
        if dialogStart == true then
          Interfaces.int_interactions.Visibility = 100
          --Interfaces.int_interactions.TimeToDestVisibility = 250
          --Interfaces.int_interactions.DestVisibility = 100
          dialogStart = false
          print("fadein interface - dialogend")
        end
      else
        if dialogStart == false then
          Interfaces.int_interactions.Visibility = 0
          --Interfaces.int_interactions.TimeToDestVisibility = 250
          --Interfaces.int_interactions.DestVisibility = 0
          dialogStart = true
          print("fadeout interface - dialogstart")
        end
    
      end

    Newbie

    73 Posts