Use Confirm Alert everywhere
Last updated
Last updated
First of all open the settings menu widget of the theme that your are using.
In its Design tab, copy the Confirm Alert widget (select it and Ctrl+C) and then delete the Confirm alert widget:
Now you need to open another UI widget where you know that it is also visible everywhere where you want to use the Confirm Alert. If it's only placed (as default) in the Settings Menu widget, it's also only available when you have the settings menu open. But if you place it in your personal Game UI widget it will also be available outside the Settings Menu widget.
Paste the Confrim alert widget that you copied in step 2 inside your Game UI. For this guide it's pasted inside the Pause Menu widget. In case you lost the clipboard you can also add a new confirm alert in your theme from the Palette.
Open WB_Master_ConfirmAlert and in the Graph tab select the OnUpdated event dispatcher. There add a new variable to the event dispatcher and call it NormalModeShowConfirmAlert with the Type Name:
Compile the blueprint. If you see some errors go to these nodes and right click on them and click Refresh Nodes. Then the errors should go away. If not, just restart your project.
Adjust the Show And Update function as follows:
Open AC_PC_NiceSettingsComponent and adjust the Show Confirm Alert function as follows (you also need to delte parts as you can see on the image):
Open WB_Master_NSM_Button and a new variable called NormalModeShowConfirmAlert with the Type Name. Also make sure to set Instance Editable is set to true for this variable:
Adjust the ExecuteAction function as follows. Make sure the variable you just created is connected with the Show Confirm Alert node:
Now open the Confirm Alert widget of the theme that you're using. For this guide it's WB_T1_ConfirmAlert. In the Event Graph add something like this, there is already one name added to the switch that should handle the Quit question (example, you can add more or other pins to the switch node):
The name connection comes from the Updated custom event a bith further to the left
Let's also determine what should be excuted when pressing the Yes button. For that open WB_Master_NSM_Button and in the ExecuteAction function you can add something like this (it's for the quit example but you can add more or other pins to the switch here):
Here is the example implementation for the Quit button. Set Show Confirm Alert to true and set the NormalModeShowConfirmAlert value: