Merge branch 'master' of https://github.com/tildearrow/furnace into k053260

This commit is contained in:
cam900 2023-04-03 06:43:23 +09:00
commit e8203f453b
6 changed files with 13 additions and 3 deletions

View file

@ -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

View file

@ -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);

View file

@ -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 {

View file

@ -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,

View file

@ -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),

View file

@ -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);