Alright I am working on a few menus for a map and I have a problem. I want to use the M key on the keyboard to open AND close the menu. I want the menu to close if it is already open (hide dialog) or open if it is closed (show dialog). Now I know how to hide/show dialogs but I have a problem with the variable that determines whether the menu is closed or open. I use a boolean, basically event: if M is pressed, condition: main menu toggle== false, action: show dialog, set main menu toggle ==true. Now I also have a trigger that does the exact same thing, except the condition is main menu toggle==true, action: hide dialog, set main menu toggle == false. Now if I press M the dialog does not show up. If I remove the hide trigger it does show up but I cannot hide the dialog. The other way around works aswell, if I let a different trigger open the dialog I can use M to close it. Anyone knows how to prevent this from happening? It seems as if it opens, then changes the variable.. then runs the other trigger aswell and closes it immediately. Perhaps I'm wrong on that.
It's most likely because one trigger is being executed after the other, and so it unhides, hides the window.
Condense the trigger to a simple "If hidden, unhide, else hide"
Alright I am working on a few menus for a map and I have a problem. I want to use the M key on the keyboard to open AND close the menu. I want the menu to close if it is already open (hide dialog) or open if it is closed (show dialog). Now I know how to hide/show dialogs but I have a problem with the variable that determines whether the menu is closed or open. I use a boolean, basically event: if M is pressed, condition: main menu toggle== false, action: show dialog, set main menu toggle ==true. Now I also have a trigger that does the exact same thing, except the condition is main menu toggle==true, action: hide dialog, set main menu toggle == false. Now if I press M the dialog does not show up. If I remove the hide trigger it does show up but I cannot hide the dialog. The other way around works aswell, if I let a different trigger open the dialog I can use M to close it. Anyone knows how to prevent this from happening? It seems as if it opens, then changes the variable.. then runs the other trigger aswell and closes it immediately. Perhaps I'm wrong on that.
It's most likely because one trigger is being executed after the other, and so it unhides, hides the window. Condense the trigger to a simple "If hidden, unhide, else hide"
Going to give it a try now ty for the reply.
Worked like a charm, tyvm.