diff --git a/docs/changelog.txt b/docs/changelog.txt index 325070526..b2ef0e90a 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -41,6 +41,7 @@ changelog.txt uses a syntax similar to RST, with a few special sequences: - ``widgets.CycleHotkeyLabel``: allow initial option values to be specified as an index instead of an option value ## Misc Improvements +- `confirm`: added a confirmation dialog for removing manager orders - `dfhack-examples-guide`: refine food preparation orders and fix conditions for making jugs and pots in the ``basic`` manager orders ## Documentation diff --git a/plugins/confirm.cpp b/plugins/confirm.cpp index a57ec45dd..6a2798cb4 100644 --- a/plugins/confirm.cpp +++ b/plugins/confirm.cpp @@ -18,6 +18,7 @@ #include "df/general_ref.h" #include "df/general_ref_contained_in_itemst.h" #include "df/viewscreen_dwarfmodest.h" +#include "df/viewscreen_jobmanagementst.h" #include "df/viewscreen_justicest.h" #include "df/viewscreen_layer_militaryst.h" #include "df/viewscreen_locationsst.h" @@ -481,6 +482,7 @@ DEFINE_CONFIRMATION(note_delete, viewscreen_dwarfmodest); DEFINE_CONFIRMATION(route_delete, viewscreen_dwarfmodest); DEFINE_CONFIRMATION(location_retire, viewscreen_locationsst); DEFINE_CONFIRMATION(convict, viewscreen_justicest); +DEFINE_CONFIRMATION(order_remove, viewscreen_jobmanagementst); DFhackCExport command_result plugin_init (color_ostream &out, vector &commands) { diff --git a/plugins/lua/confirm.lua b/plugins/lua/confirm.lua index 13b28962a..e36a4fb86 100644 --- a/plugins/lua/confirm.lua +++ b/plugins/lua/confirm.lua @@ -219,6 +219,14 @@ function convict.get_message() "This action is irreversible." end +order_remove = defconf('order-remove') +function order_remove.intercept_key(key) + return key == keys.MANAGER_REMOVE and + not screen.in_max_workshops +end +order_remove.title = "Remove manager order" +order_remove.message = "Are you sure you want to remove this order?" + -- End of confirmation definitions function check()