Add a location retirement confirmation

develop
lethosor 2015-12-25 11:18:55 -05:00
parent 64d861bf6b
commit a9ad2f40f1
3 changed files with 14 additions and 0 deletions

@ -34,6 +34,7 @@ DFHack future
New Features
------------
- `confirm`: Added a confirmation for retiring locations
- `search-plugin`: Support for the location occupation assignment menu
Fixes

@ -19,6 +19,7 @@
#include "df/general_ref_contained_in_itemst.h"
#include "df/viewscreen_dwarfmodest.h"
#include "df/viewscreen_layer_militaryst.h"
#include "df/viewscreen_locationsst.h"
#include "df/viewscreen_tradegoodsst.h"
using namespace DFHack;
@ -453,6 +454,7 @@ DEFINE_CONFIRMATION(squad_disband, viewscreen_layer_militaryst, 0);
DEFINE_CONFIRMATION(uniform_delete, viewscreen_layer_militaryst, 0);
DEFINE_CONFIRMATION(note_delete, viewscreen_dwarfmodest, 0);
DEFINE_CONFIRMATION(route_delete, viewscreen_dwarfmodest, 0);
DEFINE_CONFIRMATION(location_retire, viewscreen_locationsst, 0);
DFhackCExport command_result plugin_init (color_ostream &out, vector <PluginCommand> &commands)
{

@ -192,6 +192,17 @@ end
route_delete.title = "Delete route"
route_delete.message = "Are you sure you want to delete this route?"
location_retire = defconf('location-retire')
function location_retire.intercept_key(key)
return key == keys.LOCATION_RETIRE and
(screen.menu == df.viewscreen_locationsst.T_menu.Locations or
screen.menu == df.viewscreen_locationsst.T_menu.Occupations) and
screen.in_edit == df.viewscreen_locationsst.T_in_edit.None and
screen.locations[screen.location_idx]
end
location_retire.title = "Retire location"
location_retire.message = "Are you sure you want to retire this location?"
-- End of confirmation definitions
function check()