VRSQ + VNAND + fix "Paused" in window title

This commit is contained in:
Simone Coco
2022-10-05 17:21:03 +02:00
parent 4757cbb8ef
commit 89daa969eb
5 changed files with 46 additions and 7 deletions

View File

@@ -168,6 +168,7 @@ void Window::LoadROM(n64::Core& core, const std::string &path) {
void Window::Render(n64::Core& core) {
ImGui::PushFont(uiFont);
static bool showSettings = false;
static std::string windowTitleCache = windowTitle;
bool showMainMenuBar = windowID == SDL_GetWindowID(SDL_GetMouseFocus());
if(showMainMenuBar) {
ImGui::BeginMainMenuBar();
@@ -197,14 +198,12 @@ void Window::Render(n64::Core& core) {
}
if (ImGui::MenuItem(core.pause ? "Resume" : "Pause", nullptr, false, core.romLoaded)) {
core.TogglePause();
std::string paused = "| Paused";
std::string paused = " | Paused";
if(core.pause) {
windowTitleCache = windowTitle;
windowTitle += paused;
} else {
auto pausedPos = windowTitle.find_first_of(paused);
if(pausedPos != std::string::npos) {
windowTitle.erase(pausedPos, paused.length());
}
windowTitle = windowTitleCache;
}
SDL_SetWindowTitle(window, windowTitle.c_str());
}