|
6 | 6 | #include <Geode/binding/GJDropDownLayer.hpp> |
7 | 7 | #include <Geode/ui/Layout.hpp> |
8 | 8 | #include <Geode/ui/SimpleAxisLayout.hpp> |
| 9 | +#include "../fonts/FeatherIcons.hpp" |
9 | 10 |
|
10 | 11 | void drawRowAxisArrow( |
11 | 12 | ImDrawList& foreground, |
@@ -384,7 +385,48 @@ void DevTools::drawGD(GLRenderCtx* gdCtx) { |
384 | 385 | "Geometry Dash ({}x{})###devtools/geometry-dash", |
385 | 386 | winSize.width, winSize.height |
386 | 387 | ); |
387 | | - if (ImGui::Begin(title.c_str())) { |
| 388 | + bool gameStayAlive = true; |
| 389 | + if (ImGui::Begin(title.c_str(), &gameStayAlive, ImGuiWindowFlags_MenuBar)) { |
| 390 | + |
| 391 | + if (!gameStayAlive) game::exit(true); |
| 392 | + |
| 393 | + if (ImGui::BeginMenuBar()) { |
| 394 | + if (ImGui::MenuItem(U8STR(FEATHER_SAVE " Save"))) { |
| 395 | + AppDelegate::get()->trySaveGame(0); |
| 396 | + } |
| 397 | + |
| 398 | + ImGui::SameLine(); |
| 399 | + |
| 400 | + static float time; |
| 401 | + auto currentTime = CCDirector::get()->getScheduler()->getTimeScale(); |
| 402 | + time = currentTime > 0 ? currentTime : time; |
| 403 | + |
| 404 | + if (ImGui::MenuItem(U8STR( |
| 405 | + m_pauseGame ? FEATHER_LOCK " Resume" : FEATHER_UNLOCK " Pause" |
| 406 | + ))) { |
| 407 | + m_pauseGame ^= 1; |
| 408 | + if (m_pauseGame) { |
| 409 | + FMODAudioEngine::sharedEngine()->pauseAllAudio(); |
| 410 | + CCDirector::get()->getScheduler()->setTimeScale(0.0f); |
| 411 | + } |
| 412 | + else { |
| 413 | + FMODAudioEngine::sharedEngine()->resumeAllAudio(); |
| 414 | + CCDirector::get()->getScheduler()->setTimeScale(time); |
| 415 | + } |
| 416 | + } |
| 417 | + |
| 418 | + ImGui::SameLine(); |
| 419 | + if (ImGui::MenuItem(U8STR(FEATHER_PACKAGE " Reload"))) { |
| 420 | + GameManager::get()->reloadAll(0, 0, 0); |
| 421 | + } |
| 422 | + |
| 423 | + ImGui::SameLine(); |
| 424 | + if (ImGui::MenuItem(U8STR(FEATHER_REFRESH_CW " Restart"))) { |
| 425 | + game::restart(true); |
| 426 | + } |
| 427 | + } |
| 428 | + ImGui::EndMenuBar(); |
| 429 | + |
388 | 430 | auto list = ImGui::GetWindowDrawList(); |
389 | 431 | auto ratio = gdCtx->size().x / gdCtx->size().y; |
390 | 432 |
|
|
0 commit comments