trying to fix weird derailing

This commit is contained in:
CocoSimone
2022-08-28 23:48:08 +02:00
parent b4812cd442
commit 87ad20b519
29 changed files with 86 additions and 621 deletions

View File

@@ -140,6 +140,37 @@ ImDrawData* Window::Present(n64::Core& core) {
}
void Window::Render(n64::Core& core) {
MainMenuBar(core);
DebuggerWindow(core);
ImGui::PushFont(uiFont);
if(windowID == SDL_GetWindowID(SDL_GetMouseFocus())) {
ImGui::BeginMainMenuBar();
if (ImGui::BeginMenu("File")) {
if (ImGui::MenuItem("Open", "O")) {
nfdchar_t *outpath;
const nfdu8filteritem_t filter{"Nintendo 64 roms", "n64,z64,v64,N64,Z64,V64"};
nfdresult_t result = NFD_OpenDialog(&outpath, &filter, 1, nullptr);
if (result == NFD_OKAY) {
core.LoadROM(outpath);
NFD_FreePath(outpath);
}
}
if (ImGui::MenuItem("Exit")) {
core.done = true;
}
ImGui::EndMenu();
}
if (ImGui::BeginMenu("Emulation")) {
if (ImGui::MenuItem("Reset")) {
core.Reset();
}
if (ImGui::MenuItem("Stop")) {
core.Stop();
}
if (ImGui::MenuItem(core.pause ? "Resume" : "Pause", nullptr, false, core.romLoaded)) {
core.TogglePause();
}
ImGui::EndMenu();
}
ImGui::EndMainMenuBar();
}
ImGui::PopFont();
}