how to implement boolean variable to disable mouse input

In your game mode or character class on begin play you could call “set show mouse cursor” node I believe it’s called, and hide the cursor. I believe it’s a function of the player controller class. And on construction of your dialogue widget(assuming it’s widget based) do the same but show the mouse cursor. Then again on destruct hide cursor