diff --git a/changelog.txt b/changelog.txt index 97c2325da..44bb9711e 100644 --- a/changelog.txt +++ b/changelog.txt @@ -35,6 +35,7 @@ Template for new versions: - `gui/settings-manager`: standing orders save/load now includes the reserved barrels setting - `gui/rename`: add overlay to worldgen screen allowing you to rename the world before the new world is saved - `gui/rename`: add overlay to the "Prepare carefully" embark screen that transparently fixes a DF bug where you can't give units nicknames or custom professions +- `gui/notify`: new notification type: save reminder; appears 15 minutes after a save is created or loaded, click to be asked to quicksave ## Fixes - `fix/dry-buckets`: don't empty buckets for wells that are actively in use diff --git a/internal/notify/notifications.lua b/internal/notify/notifications.lua index 0d312769d..a527b4354 100644 --- a/internal/notify/notifications.lua +++ b/internal/notify/notifications.lua @@ -524,6 +524,23 @@ NOTIFICATIONS_BY_IDX = { adv_fn=curry(get_bar, get_blood, get_max_blood, "Blood", COLOR_RED), on_click=nil, }, + { + name='save-reminder', + desc='Shows a reminder if it has been more than 15 minutes since your last save.', + default=true, + dwarf_fn=function () + local minsSinceSave = dfhack.persistent.getUnsavedSeconds()//60 + if minsSinceSave >= 15 then + return "Last save: ".. (dfhack.formatInt(minsSinceSave)) ..' mins ago' + end + end, + on_click=function() + local minsSinceSave = dfhack.persistent.getUnsavedSeconds()//60 + local message = 'It has been ' .. dfhack.formatInt(minsSinceSave) .. ' minutes since your last save. \n\nWould you like to save now? ' .. + '(Note: You can also close this reminder and save manually)' + dlg.showYesNoPrompt('Save now?', message, nil, function() dfhack.run_script('quicksave') end) + end, + }, } NOTIFICATIONS_BY_NAME = {}