-
-
Notifications
You must be signed in to change notification settings - Fork 106
Expand file tree
/
Copy pathconfirmation.lua
More file actions
39 lines (36 loc) · 920 Bytes
/
Copy pathconfirmation.lua
File metadata and controls
39 lines (36 loc) · 920 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
function G.UIDEF.confirmation_dialog()
return create_UIBox_generic_options({
back_func = "options",
contents = {
MP.UI.UTILS.create_row({ align = "cm", padding = 0 }, {
MP.UI.UTILS.create_row({ align = "cm", padding = 0.5 }, {
MP.UI.UTILS.create_text_node(localize("k_are_you_sure"), {
scale = 0.6,
colour = G.C.UI.TEXT_LIGHT,
}),
}),
UIBox_button({
label = { localize("k_yes") },
button = "confirmation_dialog_yes",
minw = 5,
}),
}),
},
})
end
do
local confirm_selection_callback = nil
function G.FUNCS.confirm_selection(callback)
confirm_selection_callback = callback
G.FUNCS.overlay_menu({
definition = G.UIDEF.confirmation_dialog(),
})
end
function G.FUNCS.confirmation_dialog_yes()
G.FUNCS.exit_overlay_menu()
if confirm_selection_callback then
confirm_selection_callback()
confirm_selection_callback = nil
end
end
end