diff options
Diffstat (limited to 'src/editor.cpp')
| -rw-r--r-- | src/editor.cpp | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/editor.cpp b/src/editor.cpp index 6d7e0d6..5b656c9 100644 --- a/src/editor.cpp +++ b/src/editor.cpp @@ -119,6 +119,36 @@ namespace silly::editor { } } + void Editor::showAboutWindow(const sf::RenderWindow &window) { + sf::Vector2u windowSize = window.getSize(); + + ImGui::SetNextWindowPos( + ImVec2(windowSize.x / 2.0f - 160, windowSize.y / 2.0f - 70)); + ImGui::SetNextWindowSize(ImVec2(320, 140)); + ImGui::Begin("About sillyeditor", NULL, + ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize); + + ImGui::BeginChild("about_info"); + + ImGui::Text("Thanks for using sillyeditor!"); + ImGui::Text("Developed by ilotterytea"); + ImGui::Text("v0.1.0"); + + ImGui::Dummy(ImVec2(0, ImGui::GetContentRegionAvail().y - 32.0f)); + + ImGui::TextLinkOpenURL("Found bug?", + "https://github.com/ilotterytea/sillyeditor/issues"); + + ImGui::EndChild(); + + if (ImGui::IsWindowCollapsed()) { + ImGui::SetWindowCollapsed(false); + this->aboutState = false; + } + + ImGui::End(); + } + void Editor::createSavePackageWindow(const sf::RenderWindow &window) { sf::Vector2u windowSize = window.getSize(); @@ -394,6 +424,14 @@ namespace silly::editor { } } + if (ImGui::BeginMenu("Help")) { + if (ImGui::MenuItem("About sillyeditor")) { + this->aboutState = true; + } + + ImGui::EndMenu(); + } + ImGui::SameLine(ImGui::GetContentRegionAvail().x - 200); // Current level and floor info @@ -569,6 +607,10 @@ namespace silly::editor { ImGui::End(); + if (this->aboutState) { + this->showAboutWindow(window); + } + if (package.get_name().empty() || this->newPackageState.has_value()) { this->createNewPackage(window); return; |
