From 38051a5a4848b85db4d505d096b9a5afe1d2b06e Mon Sep 17 00:00:00 2001 From: lethosor Date: Wed, 11 May 2016 17:51:57 -0400 Subject: [PATCH] remove tweak manager-quantity --- NEWS.rst | 4 ++ docs/Plugins.rst | 1 - library/xml | 2 +- plugins/tweak/tweak.cpp | 5 --- plugins/tweak/tweaks/manager-quantity.h | 53 ------------------------- 5 files changed, 5 insertions(+), 60 deletions(-) delete mode 100644 plugins/tweak/tweaks/manager-quantity.h diff --git a/NEWS.rst b/NEWS.rst index 240e0ffc4..49b71e477 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -53,6 +53,10 @@ Misc Improvements - `fix/diplomats`: replaces ``fixdiplomats`` - `fix/merchants`: replaces ``fixmerchants`` +Removed +------- +- `tweak` manager-quantity: no longer needed + DFHack 0.42.06-r1 ================= diff --git a/docs/Plugins.rst b/docs/Plugins.rst index 0c4a3237b..75d2d988d 100644 --- a/docs/Plugins.rst +++ b/docs/Plugins.rst @@ -290,7 +290,6 @@ Subcommands that persist until disabled or DF quits: :kitchen-keys: Fixes DF kitchen meal keybindings (:bug:`614`) :kitchen-prefs-color: Changes color of enabled items to green in kitchen preferences :kitchen-prefs-empty: Fixes a layout issue with empty kitchen tabs (:bug:`9000`) -:manager-quantity: Removes the limit of 30 jobs per manager order :max-wheelbarrow: Allows assigning more than 3 wheelbarrows to a stockpile :military-color-assigned: Color squad candidates already assigned to other squads in yellow/green diff --git a/library/xml b/library/xml index fc53068ec..fbf9e118d 160000 --- a/library/xml +++ b/library/xml @@ -1 +1 @@ -Subproject commit fc53068ec4dc7b9d5544a50176f7755c48333c2d +Subproject commit fbf9e118d53e357a7225fa0d83faa7b49149335f diff --git a/plugins/tweak/tweak.cpp b/plugins/tweak/tweak.cpp index 3b17d9fa0..88c57fb62 100644 --- a/plugins/tweak/tweak.cpp +++ b/plugins/tweak/tweak.cpp @@ -93,7 +93,6 @@ #include "tweaks/kitchen-keys.h" #include "tweaks/kitchen-prefs-color.h" #include "tweaks/kitchen-prefs-empty.h" -#include "tweaks/manager-quantity.h" #include "tweaks/max-wheelbarrow.h" #include "tweaks/military-assign.h" #include "tweaks/nestbox-color.h" @@ -212,8 +211,6 @@ DFhackCExport command_result plugin_init (color_ostream &out, std::vector - -#include "df/viewscreen_createquotast.h" -#include "df/manager_order.h" - -using df::global::world; - -struct manager_quantity_hook : df::viewscreen_createquotast { - typedef df::viewscreen_createquotast interpose_base; - DEFINE_VMETHOD_INTERPOSE(void, feed, (std::set* input)) - { - bool cancel = false; - bool wanted_quantity = want_quantity; - if (want_quantity) - { - for (auto it = input->begin(); it != input->end(); ++it) - { - char c = DFHack::Screen::keyToChar(*it); - if (c >= '0' && c <= '9') - { - cancel = true; - size_t len = strlen(str_filter); - if (len < 5) - { - str_filter[len] = c; - str_filter[len + 1] = '\0'; - } - } - } - } - if (cancel) - return; - // Native feed() adds manager order, updates want_quantity, and removes SELECT from input - int select = input->count(df::interface_key::SELECT); - INTERPOSE_NEXT(feed)(input); - if (wanted_quantity && select && strlen(str_filter) > 0) - { - df::manager_order* order = world->manager_orders[world->manager_orders.size() - 1]; - int16_t count = 1; - try - { - count = std::stoi(str_filter); - } - catch (...) { } - if (count < 1) - count = 1; - order->amount_total = count; - order->amount_left = count; - } - } -}; - -IMPLEMENT_VMETHOD_INTERPOSE(manager_quantity_hook, feed);