add pack.request_writeable(...) & update gui.confirm screen
This commit is contained in:
@@ -35,6 +35,7 @@ GUI::GUI()
|
||||
|
||||
menu = std::make_shared<Menu>();
|
||||
menu->setId("menu");
|
||||
menu->setZIndex(10);
|
||||
container->add(menu);
|
||||
container->setScrollable(false);
|
||||
|
||||
|
||||
@@ -91,7 +91,11 @@ void guiutil::confirm(
|
||||
if (yestext.empty()) yestext = langs::get(L"Yes");
|
||||
if (notext.empty()) notext = langs::get(L"No");
|
||||
|
||||
auto container = std::make_shared<Container>(glm::vec2(5000, 5000));
|
||||
container->setColor(glm::vec4(0.05f, 0.05f, 0.05f, 0.7f));
|
||||
auto panel = std::make_shared<Panel>(glm::vec2(600, 200), glm::vec4(8.0f), 8.0f);
|
||||
panel->setGravity(Gravity::center_center);
|
||||
container->add(panel);
|
||||
panel->setColor(glm::vec4(0.0f, 0.0f, 0.0f, 0.5f));
|
||||
panel->add(std::make_shared<Label>(text));
|
||||
auto subpanel = std::make_shared<Panel>(glm::vec2(600, 53));
|
||||
@@ -103,8 +107,8 @@ void guiutil::confirm(
|
||||
menu->removePage("<confirm>");
|
||||
if (on_confirm) {
|
||||
on_confirm();
|
||||
} else {
|
||||
menu->back();
|
||||
} else if (!menu->back()) {
|
||||
menu->reset();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -112,8 +116,8 @@ void guiutil::confirm(
|
||||
menu->removePage("<confirm>");
|
||||
if (on_deny) {
|
||||
on_deny();
|
||||
} else {
|
||||
menu->back();
|
||||
} else if (!menu->back()) {
|
||||
menu->reset();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -136,7 +140,7 @@ void guiutil::confirm(
|
||||
}));
|
||||
|
||||
panel->refresh();
|
||||
menu->addPage("<confirm>", panel, true);
|
||||
menu->addPage("<confirm>", container, true);
|
||||
menu->setPage("<confirm>");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user