diff --git a/docs/plugins/autodump-destroy-here.rst b/docs/plugins/autodump-destroy-here.rst new file mode 100644 index 000000000..375a799c0 --- /dev/null +++ b/docs/plugins/autodump-destroy-here.rst @@ -0,0 +1,10 @@ +autodump-destroy-here +===================== + +Destroy items marked for dumping under cursor. If called again before the game +is resumed, cancels destruction of the items. This is an alias for the +`autodump` command ``autodump destroy-here``, intended for use as a keybinding. + +Usage:: + + autodump-destroy-here diff --git a/docs/plugins/autodump-destroy-item.rst b/docs/plugins/autodump-destroy-item.rst new file mode 100644 index 000000000..a9f3554c3 --- /dev/null +++ b/docs/plugins/autodump-destroy-item.rst @@ -0,0 +1,13 @@ +autodump-destroy-item +===================== + +Destroy the selected item. The item may be selected in the :kbd:`k` list or in +the container item list. If called again before the game is resumed, cancels +destruction of the item. + +This command is intended for use as a keybinding. See the `autodump` command +for other dumping/destroying options. + +Usage:: + + autodump-destroy-item diff --git a/docs/plugins/autodump.rst b/docs/plugins/autodump.rst index 9bd74cff7..8064583ea 100644 --- a/docs/plugins/autodump.rst +++ b/docs/plugins/autodump.rst @@ -1,29 +1,82 @@ autodump ======== -This plugin adds an option to the :kbd:`q` menu for stckpiles when `enabled `. -When autodump is enabled for a stockpile, any items placed in the stockpile will + +Quickly designate or teleport items to be dumped. When `enabled `, this +plugin adds an option to the :kbd:`q` menu for stockpiles. When the ``autodump`` +option is selected for the stockpile, any items placed in the stockpile will automatically be designated to be dumped. -Alternatively, you can use it to quickly move all items designated to be dumped. -Items are instantly moved to the cursor position, the dump flag is unset, -and the forbid flag is set, as if it had been dumped normally. -Be aware that any active dump item tasks still point at the item. +When invoked as a command, it can instantly move all items designated to be +dumped to the tile under the cursor. After moving the items, the dump flag is +unset and the forbid flag is set, just as if it had been dumped normally. Be +aware that dwarves that are en route to pick up the item for dumping may still +come and move the item to your dump zone. + +The cursor must be placed on a floor tile so the items can be dumped there. + +Usage:: -Cursor must be placed on a floor tile so the items can be dumped there. + enable autodump + autodump [] Options: -:destroy: Destroy instead of dumping. Doesn't require a cursor. - If called again before the game is resumed, cancels destroy. -:destroy-here: As ``destroy``, but only the selected item in the :kbd:`k` list, - or inside a container. +- ``destroy`` + Destroy instead of dumping. Doesn't require a cursor. If ``autodump`` is + called again with this option before the game is resumed, it cancels + the destroy action. +- ``destroy-here`` + As ``destroy``, but only the selected item in the :kbd:`k` list, or inside a + container. +- ``visible`` + Only process items that are not hidden. +- ``hidden`` + Only process hidden items. +- ``forbidden`` + Only process forbidden items (default: only unforbidden). + +Examples: + +- ``autodump`` + Teleports all unforbidden items marked for dumping to the cursor position. +- ``autodump destroy`` + Destroys all unforbidden items marked for dumping + + Alias ``autodump-destroy-here``, for keybindings. :dfhack-keybind:`autodump-destroy-here` -:visible: Only process items that are not hidden. -:hidden: Only process hidden items. -:forbidden: Only process forbidden items (default: only unforbidden). ``autodump-destroy-item`` destroys the selected item, which may be selected in the :kbd:`k` list, or inside a container. If called again before the game is resumed, cancels destruction of the item. :dfhack-keybind:`autodump-destroy-item` + + + + commands.push_back(PluginCommand( + "autodump", "Teleport items marked for dumping to the cursor.", + df_autodump, false, + " This utility lets you quickly move all items designated to be dumped.\n" + " Items are instantly moved to the cursor position, the dump flag is unset,\n" + " and the forbid flag is set, as if it had been dumped normally.\n" + " Be aware that any active dump item tasks still point at the item.\n" + "Options:\n" + " destroy - instead of dumping, destroy the items instantly.\n" + " destroy-here - only affect the tile under cursor.\n" + " visible - only process items that are not hidden.\n" + " hidden - only process hidden items.\n" + " forbidden - only process forbidden items (default: only unforbidden).\n" + )); + commands.push_back(PluginCommand( + "autodump-destroy-here", "Destroy items marked for dumping under cursor.", + df_autodump_destroy_here, Gui::cursor_hotkey, + " Identical to autodump destroy-here, but intended for use as keybinding.\n" + )); + commands.push_back(PluginCommand( + "autodump-destroy-item", "Destroy the selected item.", + df_autodump_destroy_item, Gui::any_item_hotkey, + " Destroy the selected item. The item may be selected\n" + " in the 'k' list, or inside a container. If called\n" + " again before the game is resumed, cancels destroy.\n" + )); + return CR_OK; diff --git a/plugins/autodump.cpp b/plugins/autodump.cpp index 054d28f77..fb215c26b 100644 --- a/plugins/autodump.cpp +++ b/plugins/autodump.cpp @@ -275,31 +275,19 @@ command_result df_autodump_destroy_item(color_ostream &out, vector & pa DFhackCExport command_result plugin_init ( color_ostream &out, vector &commands) { commands.push_back(PluginCommand( - "autodump", "Teleport items marked for dumping to the cursor.", - df_autodump, false, - " This utility lets you quickly move all items designated to be dumped.\n" - " Items are instantly moved to the cursor position, the dump flag is unset,\n" - " and the forbid flag is set, as if it had been dumped normally.\n" - " Be aware that any active dump item tasks still point at the item.\n" - "Options:\n" - " destroy - instead of dumping, destroy the items instantly.\n" - " destroy-here - only affect the tile under cursor.\n" - " visible - only process items that are not hidden.\n" - " hidden - only process hidden items.\n" - " forbidden - only process forbidden items (default: only unforbidden).\n" - )); + "autodump", + "Teleport items marked for dumping to the cursor.", + df_autodump)); commands.push_back(PluginCommand( - "autodump-destroy-here", "Destroy items marked for dumping under cursor.", - df_autodump_destroy_here, Gui::cursor_hotkey, - " Identical to autodump destroy-here, but intended for use as keybinding.\n" - )); + "autodump-destroy-here", + "Destroy items marked for dumping under cursor.", + df_autodump_destroy_here, + Gui::cursor_hotkey)); commands.push_back(PluginCommand( - "autodump-destroy-item", "Destroy the selected item.", - df_autodump_destroy_item, Gui::any_item_hotkey, - " Destroy the selected item. The item may be selected\n" - " in the 'k' list, or inside a container. If called\n" - " again before the game is resumed, cancels destroy.\n" - )); + "autodump-destroy-item", + "Destroy the selected item.", + df_autodump_destroy_item, + Gui::any_item_hotkey)); return CR_OK; }