mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
add gui.confirm(...)
This commit is contained in:
parent
e2f6c263e7
commit
7fce735ca1
6 changed files with 76 additions and 5 deletions
|
|
@ -50,11 +50,13 @@ void guiutil::alert(
|
|||
}
|
||||
|
||||
void guiutil::confirm(
|
||||
const std::shared_ptr<gui::Menu>& menu,
|
||||
const std::wstring& text,
|
||||
const runnable& on_confirm,
|
||||
std::wstring yestext,
|
||||
std::wstring notext) {
|
||||
const std::shared_ptr<gui::Menu>& menu,
|
||||
const std::wstring& text,
|
||||
const runnable& on_confirm,
|
||||
const runnable& on_deny,
|
||||
std::wstring yestext,
|
||||
std::wstring notext
|
||||
) {
|
||||
if (yestext.empty()) yestext = langs::get(L"Yes");
|
||||
if (notext.empty()) notext = langs::get(L"No");
|
||||
|
||||
|
|
@ -71,6 +73,8 @@ void guiutil::confirm(
|
|||
}));
|
||||
|
||||
subpanel->add(std::make_shared<Button>(notext, glm::vec4(8.f), [=](GUI*){
|
||||
if (on_deny)
|
||||
on_deny();
|
||||
menu->back();
|
||||
}));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue