diff --git a/src/app/editor/master_editor.cc b/src/app/editor/master_editor.cc index f0ef573f..9cb76bc4 100644 --- a/src/app/editor/master_editor.cc +++ b/src/app/editor/master_editor.cc @@ -42,6 +42,7 @@ namespace editor { using ImGui::BeginMenu; using ImGui::BulletText; using ImGui::Checkbox; +using ImGui::IsKeyDown; using ImGui::MenuItem; using ImGui::SameLine; using ImGui::Separator; @@ -275,9 +276,10 @@ void MasterEditor::ManageActiveEditors() { } void MasterEditor::ManageKeyboardShortcuts() { + bool ctrl_or_super = (ImGui::GetIO().KeyCtrl || ImGui::GetIO().KeySuper); + // If CMD + R is pressed, reload the top result of recent files - if (ImGui::IsKeyDown(ImGuiKey_R) && - (ImGui::GetIO().KeyCtrl || ImGui::GetIO().KeySuper)) { + if (IsKeyDown(ImGuiKey_R) && ctrl_or_super) { static RecentFilesManager manager("recent_files.txt"); manager.Load(); if (!manager.GetRecentFiles().empty()) { @@ -287,55 +289,46 @@ void MasterEditor::ManageKeyboardShortcuts() { } } - if (ImGui::IsKeyDown(ImGuiKey_F1)) { + if (IsKeyDown(ImGuiKey_F1)) { about_ = true; } // If CMD + Q is pressed, quit the application - if (ImGui::IsKeyDown(ImGuiKey_Q) && - (ImGui::GetIO().KeyCtrl || ImGui::GetIO().KeySuper)) { + if (IsKeyDown(ImGuiKey_Q) && ctrl_or_super) { quit_ = true; } // If CMD + O is pressed, open a file dialog - if (ImGui::IsKeyDown(ImGuiKey_O) && - (ImGui::GetIO().KeyCtrl || ImGui::GetIO().KeySuper)) { + if (IsKeyDown(ImGuiKey_O) && ctrl_or_super) { LoadRom(); } // If CMD + S is pressed, save the current ROM - if (ImGui::IsKeyDown(ImGuiKey_S) && - (ImGui::GetIO().KeyCtrl || ImGui::GetIO().KeySuper)) { + if (IsKeyDown(ImGuiKey_S) && ctrl_or_super) { SaveRom(); } - if (ImGui::IsKeyDown(ImGuiKey_X) && - (ImGui::GetIO().KeyCtrl || ImGui::GetIO().KeySuper)) { + if (IsKeyDown(ImGuiKey_X) && ctrl_or_super) { status_ = current_editor_->Cut(); } - if (ImGui::IsKeyDown(ImGuiKey_C) && - (ImGui::GetIO().KeyCtrl || ImGui::GetIO().KeySuper)) { + if (IsKeyDown(ImGuiKey_C) && ctrl_or_super) { status_ = current_editor_->Copy(); } - if (ImGui::IsKeyDown(ImGuiKey_V) && - (ImGui::GetIO().KeyCtrl || ImGui::GetIO().KeySuper)) { + if (IsKeyDown(ImGuiKey_V) && ctrl_or_super) { status_ = current_editor_->Paste(); } - if (ImGui::IsKeyDown(ImGuiKey_Z) && - (ImGui::GetIO().KeyCtrl || ImGui::GetIO().KeySuper)) { + if (IsKeyDown(ImGuiKey_Z) && ctrl_or_super) { status_ = current_editor_->Undo(); } - if (ImGui::IsKeyDown(ImGuiKey_Y) && - (ImGui::GetIO().KeyCtrl || ImGui::GetIO().KeySuper)) { + if (IsKeyDown(ImGuiKey_Y) && ctrl_or_super) { status_ = current_editor_->Redo(); } - if (ImGui::IsKeyDown(ImGuiKey_F) && - (ImGui::GetIO().KeyCtrl || ImGui::GetIO().KeySuper)) { + if (IsKeyDown(ImGuiKey_F) && ctrl_or_super) { status_ = current_editor_->Find(); } } diff --git a/src/app/gfx/snes_palette.h b/src/app/gfx/snes_palette.h index 0403f999..503287f2 100644 --- a/src/app/gfx/snes_palette.h +++ b/src/app/gfx/snes_palette.h @@ -69,11 +69,11 @@ constexpr int kArmorPalettes = 0xDD308; constexpr int kSpritesPalettesAux1 = 0xDD39E; // 7 colors each constexpr int kSpritesPalettesAux2 = 0xDD446; // 7 colors each constexpr int kSpritesPalettesAux3 = 0xDD4E0; // 7 colors each -constexpr int kSwordPalettes = 0xDD630; // 3 colors each - 4 entries -constexpr int kShieldPalettes = 0xDD648; // 4 colors each - 3 entries +constexpr int kSwordPalettes = 0xDD630; // 3 colors each - 4 entries +constexpr int kShieldPalettes = 0xDD648; // 4 colors each - 3 entries constexpr int kHudPalettes = 0xDD660; constexpr int dungeonMapPalettes = 0xDD70A; // 21 colors -constexpr int kDungeonMainPalettes = 0xDD734; //(15*6) colors each - 20 entries +constexpr int kDungeonMainPalettes = 0xDD734; //(15*6) colors each - 20 entries constexpr int dungeonMapBgPalettes = 0xDE544; // 16*6 // Mirrored Value at 0x75645 : 0x75625 constexpr int kHardcodedGrassLW = 0x5FEA9; diff --git a/src/lib/imgui b/src/lib/imgui index f9cda1fa..fe09ebbe 160000 --- a/src/lib/imgui +++ b/src/lib/imgui @@ -1 +1 @@ -Subproject commit f9cda1fa245b361a0e98428d88470eebaa187e5b +Subproject commit fe09ebbe0a1c8bb5f39f326658faa6bde75bb568