From 8d21dd0a23e8e7c75935fd8b32fa70e0cbe4d0ef Mon Sep 17 00:00:00 2001 From: lethosor Date: Fri, 26 Jun 2015 21:16:27 -0400 Subject: [PATCH] New tweak: kitchen-prefs-empty Fixes a layout issue on the kitchen prefs viewscreen with empty tabs http://www.bay12games.com/dwarves/mantisbt/view.php?id=9000 See #526 --- NEWS | 1 + Readme.rst | 1 + dfhack.init-example | 1 + plugins/tweak/tweak.cpp | 6 ++++ plugins/tweak/tweaks/kitchen-prefs-empty.h | 34 ++++++++++++++++++++++ 5 files changed, 43 insertions(+) create mode 100644 plugins/tweak/tweaks/kitchen-prefs-empty.h diff --git a/NEWS b/NEWS index e82aa5157..729e71087 100644 --- a/NEWS +++ b/NEWS @@ -16,6 +16,7 @@ DFHack Future item-descriptions: holds a default description for every item type and subtype warn-starving: check for starving, thirsty, or very drowsy units and pause with warning if any are found New tweaks + kitchen-prefs-empty: Fixes a layout issue with empty kitchen tabs Fixes Plugins with vmethod hooks can now be reloaded on OS X Lua's os.system() now works on OS X diff --git a/Readme.rst b/Readme.rst index 21f41e708..1c4f4dc6a 100644 --- a/Readme.rst +++ b/Readme.rst @@ -1313,6 +1313,7 @@ Subcommands that persist until disabled or DF quits: :fps-min: Fixes the in-game minimum FPS setting :import-priority-category: Allows changing the priority of all goods in a category when discussing an import agreement with the liaison +: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/dfhack.init-example b/dfhack.init-example index 7fb937a3b..c6e8ba309 100644 --- a/dfhack.init-example +++ b/dfhack.init-example @@ -181,6 +181,7 @@ tweak import-priority-category # Misc. UI tweaks tweak civ-view-agreement tweak fps-min +tweak kitchen-prefs-empty tweak max-wheelbarrow tweak shift-8-scroll tweak tradereq-pet-gender diff --git a/plugins/tweak/tweak.cpp b/plugins/tweak/tweak.cpp index 1a0249c5e..c43709144 100644 --- a/plugins/tweak/tweak.cpp +++ b/plugins/tweak/tweak.cpp @@ -34,6 +34,7 @@ #include "df/crime.h" #include "df/unit_inventory_item.h" #include "df/viewscreen_dwarfmodest.h" +#include "df/viewscreen_kitchenprefst.h" #include "df/viewscreen_layer_unit_actionst.h" #include "df/squad_order_trainst.h" #include "df/ui_build_selector.h" @@ -83,6 +84,7 @@ #include "tweaks/fast-trade.h" #include "tweaks/fps-min.h" #include "tweaks/import-priority-category.h" +#include "tweaks/kitchen-prefs-empty.h" #include "tweaks/manager-quantity.h" #include "tweaks/max-wheelbarrow.h" #include "tweaks/military-assign.h" @@ -184,6 +186,8 @@ DFhackCExport command_result plugin_init (color_ostream &out, std::vector dimx - 2; x++) + Screen::paintTile(pen, x, 2); + for (int i = 0; i < 4; i++) + { + pen.bold = (page == i); + Screen::paintString(pen, tab_x[i], 2, state_names[i]); + } + if (!item_type[page].size()) + { + pen.bold = true; + Screen::paintString(pen, 2, 4, "You have no appropriate ingredients."); + } + } +}; + +IMPLEMENT_VMETHOD_INTERPOSE(kitchen_prefs_empty_hook, render);