From 40ed604986f41cee55ce1a85ffe28e8238ae3894 Mon Sep 17 00:00:00 2001 From: Aldrik Ramaekers Date: Mon, 16 Mar 2020 17:14:32 +0100 Subject: notifications --- data/translations/en-English.mo | Bin 2164 -> 2238 bytes data/translations/nl-Dutch.mo | Bin 2295 -> 2375 bytes src/config.h | 2 +- src/mo_edit.c | 2 ++ src/project_base.h | 2 ++ src/save.c | 10 ++++++++-- 6 files changed, 13 insertions(+), 3 deletions(-) diff --git a/data/translations/en-English.mo b/data/translations/en-English.mo index 2da21f9..7e37574 100644 Binary files a/data/translations/en-English.mo and b/data/translations/en-English.mo differ diff --git a/data/translations/nl-Dutch.mo b/data/translations/nl-Dutch.mo index e9e1b26..dfce29e 100644 Binary files a/data/translations/nl-Dutch.mo and b/data/translations/nl-Dutch.mo differ diff --git a/src/config.h b/src/config.h index 4bd9e8b..150919d 100644 --- a/src/config.h +++ b/src/config.h @@ -7,7 +7,7 @@ #ifndef INCLUDE_CONFIG #define INCLUDE_CONFIG -#define TARGET_FRAMERATE 1000/24.0 +#define TARGET_FRAMERATE (1000/24.0) #define SCROLL_SPEED 50 #define FILE_RESERVE_COUNT 500 diff --git a/src/mo_edit.c b/src/mo_edit.c index d0215d7..a3005c4 100644 --- a/src/mo_edit.c +++ b/src/mo_edit.c @@ -957,6 +957,8 @@ int main(int argc, char **argv) ui_end(); // end ui + update_render_notifications(); + assets_do_post_process(); platform_window_swap_buffers(&window); diff --git a/src/project_base.h b/src/project_base.h index 16e4e29..d6ad537 100644 --- a/src/project_base.h +++ b/src/project_base.h @@ -78,6 +78,7 @@ #include "../../project-base/src/render.h" #include "../../project-base/src/camera.h" #include "../../project-base/src/ui.h" +#include "../../project-base/src/notification.h" #include "../../project-base/src/string_utils.h" #include "../../project-base/src/settings_config.h" #include "../../project-base/src/localization.h" @@ -106,6 +107,7 @@ #include "../../project-base/src/render.c" #include "../../project-base/src/camera.c" #include "../../project-base/src/ui.c" +#include "../../project-base/src/notification.c" #include "../../project-base/src/string_utils.c" #include "../../project-base/src/settings_config.c" #include "../../project-base/src/localization.c" diff --git a/src/save.c b/src/save.c index 4de31a8..2453c98 100644 --- a/src/save.c +++ b/src/save.c @@ -75,6 +75,8 @@ s32 write_mo_file(char *buffer, s32 buffer_size, s32 language_id) void save_project_to_folder(char *path_buf) { + push_notification(localize("project_saved")); + for (s32 i = 0; i < current_project->languages.length; i++) { language *lang = array_at(¤t_project->languages, i); @@ -193,14 +195,18 @@ bool read_mo_file(char *buffer, s32 buffer_size, s32 language_id) void load_project_from_folder(char *path_buf) { - string_copyn(project_path, path_buf, MAX_INPUT_LENGTH); - if (!platform_directory_exists(path_buf)) { platform_show_message(main_window, localize("error_loading_project"), localize("project_directory_does_not_exist")); return; } + char notification_buf[MAX_INPUT_LENGTH]; + sprintf(notification_buf, "%s: %s", localize("loaded"), path_buf); + push_notification(notification_buf); + + string_copyn(project_path, path_buf, MAX_INPUT_LENGTH); + if (!string_equals(project_path, "")) { add_recent_project_path(project_path); -- cgit v1.2.3-70-g09d2