diff --git a/src/engine/engine.h b/src/engine/engine.h index 0f5c40901..76614a847 100644 --- a/src/engine/engine.h +++ b/src/engine/engine.h @@ -53,8 +53,8 @@ #define EXTERN_BUSY_BEGIN_SOFT e->softLocked=true; e->isBusy.lock(); #define EXTERN_BUSY_END e->isBusy.unlock(); e->softLocked=false; -#define DIV_VERSION "dev145" -#define DIV_ENGINE_VERSION 145 +#define DIV_VERSION "dev147" +#define DIV_ENGINE_VERSION 147 // for imports #define DIV_VERSION_MOD 0xff01 #define DIV_VERSION_FC 0xff02 diff --git a/src/gui/doAction.cpp b/src/gui/doAction.cpp index 475798643..ff67818b9 100644 --- a/src/gui/doAction.cpp +++ b/src/gui/doAction.cpp @@ -32,6 +32,13 @@ const unsigned char avRequest[15]={ void FurnaceGUI::doAction(int what) { switch (what) { + case GUI_ACTION_NEW: + if (modified) { + showWarning("Unsaved changes! Save changes before creating a new song?",GUI_WARN_NEW); + } else { + displayNew=true; + } + break; case GUI_ACTION_OPEN: if (modified) { showWarning("Unsaved changes! Save changes before opening another file?",GUI_WARN_OPEN); diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 7c23114ad..6213bdfde 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -3581,7 +3581,7 @@ bool FurnaceGUI::loop() { if (!mobileUI) { ImGui::BeginMainMenuBar(); if (ImGui::BeginMenu("file")) { - if (ImGui::MenuItem("new...")) { + if (ImGui::MenuItem("new...",BIND_FOR(GUI_ACTION_NEW))) { if (modified) { showWarning("Unsaved changes! Save changes before creating a new song?",GUI_WARN_NEW); } else { diff --git a/src/gui/gui.h b/src/gui/gui.h index 9fcabf6c7..3433527e3 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -417,6 +417,7 @@ enum FurnaceGUIFMAlgs { enum FurnaceGUIActions { GUI_ACTION_GLOBAL_MIN=0, + GUI_ACTION_NEW, GUI_ACTION_OPEN, GUI_ACTION_OPEN_BACKUP, GUI_ACTION_SAVE, diff --git a/src/gui/guiConst.cpp b/src/gui/guiConst.cpp index 15b4e8c7f..b8bdb6b94 100644 --- a/src/gui/guiConst.cpp +++ b/src/gui/guiConst.cpp @@ -463,6 +463,7 @@ const FurnaceGUIColors fxColors[256]={ // format: ("ACTION_ENUM", "Action name", defaultBind) const FurnaceGUIActionDef guiActions[GUI_ACTION_MAX]={ D("GLOBAL_MIN", "---Global", NOT_AN_ACTION), + D("NEW", "New", FURKMOD_CMD|SDLK_n), D("OPEN", "Open file", FURKMOD_CMD|SDLK_o), D("OPEN_BACKUP", "Restore backup", 0), D("SAVE", "Save file", FURKMOD_CMD|SDLK_s), diff --git a/src/gui/settings.cpp b/src/gui/settings.cpp index 7edaeb0fa..26bed2803 100644 --- a/src/gui/settings.cpp +++ b/src/gui/settings.cpp @@ -2093,6 +2093,7 @@ void FurnaceGUI::drawSettings() { if (ImGui::TreeNode("Global hotkeys")) { KEYBIND_CONFIG_BEGIN("keysGlobal"); + UI_KEYBIND_CONFIG(GUI_ACTION_NEW); UI_KEYBIND_CONFIG(GUI_ACTION_OPEN); UI_KEYBIND_CONFIG(GUI_ACTION_OPEN_BACKUP); UI_KEYBIND_CONFIG(GUI_ACTION_SAVE);