Confirmation dialog for removing manager orders (#2163)

develop
Myk 2022-05-23 21:17:52 -07:00 committed by GitHub
parent c4febc789a
commit 77d045488b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 0 deletions

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

@ -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 <PluginCommand> &commands)
{

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