page 404
This commit is contained in:
@@ -248,7 +248,7 @@ Orientation Panel::getOrientation() const {
|
||||
PagesControl::PagesControl() : Container(glm::vec2(1)){
|
||||
}
|
||||
|
||||
bool PagesControl::has(std::string name) {
|
||||
bool PagesControl::has(const std::string& name) {
|
||||
return pages.find(name) != pages.end();
|
||||
}
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ namespace gui {
|
||||
public:
|
||||
PagesControl();
|
||||
|
||||
bool has(std::string name);
|
||||
bool has(const std::string& name);
|
||||
void setPage(std::string name, bool history=true);
|
||||
void addPage(std::string name, std::shared_ptr<UINode> panel);
|
||||
void back();
|
||||
|
||||
@@ -24,7 +24,11 @@ std::shared_ptr<Button> guiutil::gotoButton(
|
||||
) {
|
||||
text = langs::get(text, L"menu");
|
||||
return std::make_shared<Button>(text, glm::vec4(10.f), [=](GUI* gui) {
|
||||
menu->setPage(page);
|
||||
if (menu->has(page)) {
|
||||
menu->setPage(page);
|
||||
} else {
|
||||
menu->setPage("404");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user