Remove tweak kitchen-keys - DF bug 614 was fixed

develop
lethosor 2018-01-18 01:05:33 -05:00
parent 167fcd7578
commit f2890620d1
4 changed files with 0 additions and 76 deletions

@ -207,7 +207,6 @@ tweak civ-view-agreement
tweak eggs-fertile tweak eggs-fertile
tweak fps-min tweak fps-min
tweak hide-priority tweak hide-priority
tweak kitchen-keys
tweak kitchen-prefs-empty tweak kitchen-prefs-empty
tweak max-wheelbarrow tweak max-wheelbarrow
tweak shift-8-scroll tweak shift-8-scroll

@ -311,7 +311,6 @@ Subcommands that persist until disabled or DF quits:
:import-priority-category: :import-priority-category:
Allows changing the priority of all goods in a Allows changing the priority of all goods in a
category when discussing an import agreement with the liaison category when discussing an import agreement with the liaison
:kitchen-keys: Fixes DF kitchen meal keybindings (:bug:`614`)
:kitchen-prefs-color: Changes color of enabled items to green in kitchen preferences :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`) :kitchen-prefs-empty: Fixes a layout issue with empty kitchen tabs (:bug:`9000`)
:max-wheelbarrow: Allows assigning more than 3 wheelbarrows to a stockpile :max-wheelbarrow: Allows assigning more than 3 wheelbarrows to a stockpile

@ -94,7 +94,6 @@
#include "tweaks/hide-priority.h" #include "tweaks/hide-priority.h"
#include "tweaks/hotkey-clear.h" #include "tweaks/hotkey-clear.h"
#include "tweaks/import-priority-category.h" #include "tweaks/import-priority-category.h"
#include "tweaks/kitchen-keys.h"
#include "tweaks/kitchen-prefs-color.h" #include "tweaks/kitchen-prefs-color.h"
#include "tweaks/kitchen-prefs-empty.h" #include "tweaks/kitchen-prefs-empty.h"
#include "tweaks/max-wheelbarrow.h" #include "tweaks/max-wheelbarrow.h"
@ -218,8 +217,6 @@ DFhackCExport command_result plugin_init (color_ostream &out, std::vector <Plugi
" tweak import-priority-category [disable]\n" " tweak import-priority-category [disable]\n"
" When meeting with a liaison, makes Shift+Left/Right arrow adjust\n" " When meeting with a liaison, makes Shift+Left/Right arrow adjust\n"
" the priority of an entire category of imports.\n" " the priority of an entire category of imports.\n"
" tweak kitchen-keys [disable]\n"
" Fixes DF kitchen meal keybindings (bug 614)\n"
" tweak kitchen-prefs-color [disable]\n" " tweak kitchen-prefs-color [disable]\n"
" Changes color of enabled items to green in kitchen preferences\n" " Changes color of enabled items to green in kitchen preferences\n"
" tweak kitchen-prefs-empty [disable]\n" " tweak kitchen-prefs-empty [disable]\n"
@ -293,9 +290,6 @@ DFhackCExport command_result plugin_init (color_ostream &out, std::vector <Plugi
TWEAK_HOOK("import-priority-category", takerequest_hook, feed); TWEAK_HOOK("import-priority-category", takerequest_hook, feed);
TWEAK_HOOK("import-priority-category", takerequest_hook, render); TWEAK_HOOK("import-priority-category", takerequest_hook, render);
TWEAK_HOOK("kitchen-keys", kitchen_keys_hook, feed);
TWEAK_HOOK("kitchen-keys", kitchen_keys_hook, render);
TWEAK_HOOK("kitchen-prefs-color", kitchen_prefs_color_hook, render); TWEAK_HOOK("kitchen-prefs-color", kitchen_prefs_color_hook, render);
TWEAK_HOOK("kitchen-prefs-empty", kitchen_prefs_empty_hook, render); TWEAK_HOOK("kitchen-prefs-empty", kitchen_prefs_empty_hook, render);

@ -1,68 +0,0 @@
using namespace DFHack;
using namespace df::enums;
using df::global::ui_sidebar_menus;
using df::global::ui_workshop_in_add;
static df::interface_key kitchen_bindings[] = {
df::interface_key::HOTKEY_KITCHEN_COOK_2,
df::interface_key::HOTKEY_KITCHEN_COOK_3,
df::interface_key::HOTKEY_KITCHEN_COOK_4,
// DF uses CUSTOM_R for this reaction in the raws, so this key is recognized
// by this tweak but not displayed
df::interface_key::HOTKEY_KITCHEN_RENDER_FAT
};
struct kitchen_keys_hook : df::viewscreen_dwarfmodest {
typedef df::viewscreen_dwarfmodest interpose_base;
void draw_binding (int row, df::interface_key key)
{
std::string label = Screen::getKeyDisplay(key);
int x = Gui::getDwarfmodeViewDims().menu_x2 - 2 - label.size();
int y = row + 4;
OutputString(COLOR_GREY, x, y, "(");
OutputString(COLOR_LIGHTRED, x, y, label);
OutputString(COLOR_GREY, x, y, ")");
}
bool kitchen_in_add()
{
if (!*ui_workshop_in_add)
return false;
df::building_workshopst *ws = virtual_cast<df::building_workshopst>(world->selected_building);
if (!ws)
return false;
if (ws->type != workshop_type::Kitchen)
return false;
return true;
}
DEFINE_VMETHOD_INTERPOSE(void, feed, (std::set<df::interface_key> *input))
{
if (kitchen_in_add())
{
for (int i = 0; i < 4; i++)
{
if (input->count(kitchen_bindings[i]))
{
ui_sidebar_menus->workshop_job.cursor = i;
input->clear();
input->insert(df::interface_key::SELECT);
}
}
}
INTERPOSE_NEXT(feed)(input);
}
DEFINE_VMETHOD_INTERPOSE(void, render, ())
{
INTERPOSE_NEXT(render)();
if (kitchen_in_add())
for (int i = 0; i < 3; i++)
draw_binding(i, kitchen_bindings[i]);
}
};
IMPLEMENT_VMETHOD_INTERPOSE(kitchen_keys_hook, feed);
IMPLEMENT_VMETHOD_INTERPOSE(kitchen_keys_hook, render);