-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add loading message when launching game from editor
- Loading branch information
Showing
6 changed files
with
78 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#pragma once | ||
|
||
#include "Gui.hpp" | ||
#include "Interfaces/DialogInterfaces.hpp" | ||
|
||
import Memory; | ||
|
||
class [[nodiscard]] LoadingDialog final | ||
{ | ||
public: | ||
LoadingDialog(mem::Rc<Gui> gui) noexcept : gui(gui) {} | ||
|
||
public: | ||
void open(const std::string& text); | ||
void close(); | ||
|
||
private: | ||
mem::Rc<Gui> gui; | ||
constexpr static inline const char* DIALOG_ID = "LoadingDialog"; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#pragma once | ||
|
||
#include <Configs/Strings.hpp> | ||
#include <Dialogs/LoadingDialog.hpp> | ||
|
||
void LoadingDialog::open(const std::string& text) | ||
{ | ||
auto modal = gui->createNewChildWindow(Strings::Dialog::Title::LOADING); | ||
modal->setSize("50%", "20%"); | ||
modal->setPosition("25%", "40%"); | ||
modal->setPositionLocked(true); | ||
gui->addModal(modal, DIALOG_ID); | ||
|
||
auto label = tgui::Label::create(text); | ||
label->setSize({ "98%", "98%" }); | ||
label->setPosition({ "1%", "1%" }); | ||
label->setTextSize(Sizers::GetMenuBarTextHeight()); | ||
modal->add(label); | ||
} | ||
|
||
void LoadingDialog::close() | ||
{ | ||
gui->closeModal(DIALOG_ID); | ||
} |