remove tweak manager-quantity

develop
lethosor 2016-05-11 17:51:57 -04:00
parent e0a0a26739
commit 38051a5a48
5 changed files with 5 additions and 60 deletions

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

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

@ -1 +1 @@
Subproject commit fc53068ec4dc7b9d5544a50176f7755c48333c2d
Subproject commit fbf9e118d53e357a7225fa0d83faa7b49149335f

@ -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 <Plugi
" Changes color of enabled items to green in kitchen preferences\n"
" tweak kitchen-prefs-empty [disable]\n"
" Fixes a layout issue with empty kitchen tabs (bug 9000)\n"
" tweak manager-quantity [disable]\n"
" Removes the limit of 30 jobs per manager order\n"
" tweak max-wheelbarrow [disable]\n"
" Allows assigning more than 3 wheelbarrows to a stockpile\n"
" tweak nestbox-color [disable]\n"
@ -280,8 +277,6 @@ DFhackCExport command_result plugin_init (color_ostream &out, std::vector <Plugi
TWEAK_HOOK("kitchen-prefs-empty", kitchen_prefs_empty_hook, render);
TWEAK_HOOK("manager-quantity", manager_quantity_hook, feed);
TWEAK_HOOK("max-wheelbarrow", max_wheelbarrow_hook, render);
TWEAK_HOOK("max-wheelbarrow", max_wheelbarrow_hook, feed);

@ -1,53 +0,0 @@
#include <stdexcept>
#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<df::interface_key>* 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);