diff --git a/docs/plugins/changeitem.rst b/docs/plugins/changeitem.rst index c6da2516f..0a841511c 100644 --- a/docs/plugins/changeitem.rst +++ b/docs/plugins/changeitem.rst @@ -1,26 +1,43 @@ changeitem ========== -Allows changing item material and base quality. By default the item currently -selected in the UI will be changed (you can select items in the 'k' list -or inside containers/inventory). By default change is only allowed if materials -is of the same subtype (for example wood<->wood, stone<->stone etc). But since -some transformations work pretty well and may be desired you can override this -with 'force'. Note that some attributes will not be touched, possibly resulting -in weirdness. To get an idea how the RAW id should look like, check some items -with 'info'. Using 'force' might create items which are not touched by -crafters/haulers. - -Options: - -:info: Don't change anything, print some info instead. -:here: Change all items at the cursor position. Requires in-game cursor. -:material, m: Change material. Must be followed by valid material RAW id. -:quality, q: Change base quality. Must be followed by number (0-5). -:force: Ignore subtypes, force change to new material. - -Examples: - -``changeitem m INORGANIC:GRANITE here`` - Change material of all items under the cursor to granite. + +Tags: +:dfhack-keybind: + +Allows changing item material and base quality. By default, a change is only +allowed if the existing and desired item materials are of the same subtype +(for example wood -> wood, stone -> stone, etc). But since some transformations +work pretty well and may be desired you can override this with ``force``. Note +that forced changes can possibly result in items that crafters and haulers +refuse to touch. + +Usage: + +- ``changeitem info`` + Show details about the selected item. Does not change the item. You can use + this command to discover RAW ids for existing items. +- ``changeitem []`` + Change the item selected in the ``k`` list or inside a container/inventory. +- ``changeitem here []`` + Change all items at the cursor position. Requires in-game cursor. + +Options +------- + +- ``m``, ``material `` + Change material. Must be followed by valid material RAW id. +- ``s``, ``subtype `` + Change subtype. Must be followed by a valid subtype RAW id." +- ``q``, ``quality `` + Change base quality. Must be followed by number (0-5) with 0 being no quality + and 5 being masterpiece quality. +- ``force`` + Ignore subtypes and force the change to the new material. + +Examples +-------- + +``changeitem here m INORGANIC:GRANITE`` + Change material of all stone items under the cursor to granite. ``changeitem q 5`` Change currently selected item to masterpiece quality. diff --git a/plugins/changeitem.cpp b/plugins/changeitem.cpp index 52d9e7ab9..49feaec79 100644 --- a/plugins/changeitem.cpp +++ b/plugins/changeitem.cpp @@ -37,37 +37,12 @@ REQUIRE_GLOBAL(world); command_result df_changeitem(color_ostream &out, vector & parameters); -const string changeitem_help = - "Changeitem allows to change some item attributes.\n" - "By default the item currently selected in the UI will be changed\n" - "(you can select items in the 'k' list or inside containers/inventory).\n" - "By default change is only allowed if materials is of the same subtype\n" - "(for example wood<->wood, stone<->stone etc). But since some transformations\n" - "work pretty well and may be desired you can override this with 'force'.\n" - "Note that some attributes will not be touched, possibly resulting in weirdness.\n" - "To get an idea how the RAW id should look like, check some items with 'info'.\n" - "Using 'force' might create items which are not touched by crafters/haulers.\n" - "Options:\n" - " info - don't change anything, print some item info instead\n" - " here - change all items at cursor position\n" - " material, m - change material. must be followed by material RAW id\n" - " subtype, s - change subtype. must be followed by correct RAW id\n" - " quality, q - change base quality. must be followed by number (0-5)\n" - " force - ignore subtypes, force change to new material.\n" - "Example:\n" - " changeitem m INORGANIC:GRANITE here\n" - " change material of all items under the cursor to granite\n" - " changeitem q 5\n" - " change currently selected item to masterpiece quality\n"; - - DFhackCExport command_result plugin_init ( color_ostream &out, vector &commands) { commands.push_back(PluginCommand( - "changeitem", "Change item attributes (material, quality).", - df_changeitem, false, - changeitem_help.c_str() - )); + "changeitem", + "Change item attributes (material, quality).", + df_changeitem)); return CR_OK; } @@ -130,8 +105,7 @@ command_result df_changeitem(color_ostream &out, vector & parameters) if (p == "help" || p == "?") { - out << changeitem_help << endl; - return CR_OK; + return CR_WRONG_USAGE; } else if (p == "here") {