diff --git a/include/Cubed/dev_panel.hpp b/include/Cubed/dev_panel.hpp index 3d98bcb..e7eded5 100644 --- a/include/Cubed/dev_panel.hpp +++ b/include/Cubed/dev_panel.hpp @@ -53,7 +53,6 @@ private: int m_samples_idx = 1; int m_threads = 1; int m_chunk_style = 0; - void show_about_table_bar(); void show_biome_table_bar(); void show_time_table_bar(); void show_cave_table_bar(); diff --git a/include/Cubed/ui/credits_ui.hpp b/include/Cubed/ui/credits_ui.hpp index 46d9e20..ed9b7dc 100644 --- a/include/Cubed/ui/credits_ui.hpp +++ b/include/Cubed/ui/credits_ui.hpp @@ -11,6 +11,7 @@ public: void init() override; private: + bool handle_key_event(const KeyEvent& e) override; CreditsScene& m_scene; }; } // namespace Cubed \ No newline at end of file diff --git a/src/dev_panel.cpp b/src/dev_panel.cpp index 360c5fa..0e51534 100644 --- a/src/dev_panel.cpp +++ b/src/dev_panel.cpp @@ -80,7 +80,6 @@ void DevPanel::render() { show_player_tab_item(); show_items_tab_item(); show_shader_tab_item(); - show_about_table_bar(); ImGui::EndTabBar(); } @@ -89,40 +88,6 @@ void DevPanel::render() { ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData()); } -void DevPanel::show_about_table_bar() { - if (ImGui::BeginTabItem("about")) { - ImGui::Text( - "Cubed - A cube game like Minecraft, using C++ and OpenGL."); - ImGui::Text("Author: zhenyan121"); - ImGui::Separator(); - ImGui::Text("Libraries Used"); - ImGui::Text("glad"); - ImGui::Text("GLFW"); - ImGui::Text("SOIL2"); - ImGui::Text("GLM"); - ImGui::Text("FreeType"); - ImGui::Text("toml++"); - ImGui::Text("Dear ImGui"); - ImGui::Text("Tbb"); - ImGui::Text("Asio"); - ImGui::Text("protobuf"); - ImGui::Text("zstd"); - ImGui::Text("OpenAl Soft"); - ImGui::Text("dr_libs"); - ImGui::Separator(); - ImGui::Text("Music"); - ImGui::Text("'Find a Peaceful Place' by ROZKOL (Free Music Archive), " - "CC BY 4.0."); - ImGui::Separator(); - ImGui::Text("Special Thanks"); - ImGui::Text("TANGERIME"); - ImGui::Text("SkyOnPole"); - ImGui::Text("free_w_cloud"); - ImGui::Text("Last but not least, thanks to you"); - ImGui::EndTabItem(); - } -} - void DevPanel::show_biome_table_bar() { if (ImGui::BeginTabBar("Biome")) { diff --git a/src/ui/credits_ui.cpp b/src/ui/credits_ui.cpp index 8bd2703..aa74988 100644 --- a/src/ui/credits_ui.cpp +++ b/src/ui/credits_ui.cpp @@ -74,4 +74,12 @@ void CreditsUI::init() { m_root_widget = std::move(image); } +bool CreditsUI::handle_key_event(const KeyEvent& e) { + if (e.key == Key::ESCAPE && e.action == KeyAction::PRESS) { + m_scene.scene_manager().request_pop(); + return true; + } + return UIManager::handle_key_event(e); +} + } // namespace Cubed \ No newline at end of file