From e1bf878059b6248d926d0ab50f1918930ca3195d Mon Sep 17 00:00:00 2001 From: lethosor Date: Sat, 13 Jan 2018 16:50:53 -0500 Subject: [PATCH 01/15] Add some missing changelog entries --- NEWS.rst | 1 + docs/NEWS-dev.rst | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index abecc0900..ca9234d63 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -49,6 +49,7 @@ Fixes ----- - Fixed issues with the console output color affecting the prompt on Windows - `createitem`: stopped items from teleporting away in some forts +- `devel/inject-raws`: now recognizes spaces in reaction names - `gui/gm-unit`: can now edit mining skill - `gui/quickcmd`: stopped error from adding too many commands diff --git a/docs/NEWS-dev.rst b/docs/NEWS-dev.rst index 33ff4237a..4dd04ce43 100644 --- a/docs/NEWS-dev.rst +++ b/docs/NEWS-dev.rst @@ -40,6 +40,11 @@ Development Changelog DFHack 0.44.04-alpha1 ===================== +Fixes +----- +- `devel/inject-raws`: now recognizes spaces in reaction names +- `exportlegends`: fixed an error that could occur when exporting empty lists + Structures ---------- - ``artifact_record``: fixed layout (changed in 0.44.04) @@ -125,6 +130,11 @@ Other Changes ------------- - The console now provides suggestions for built-in commands - `devel/export-dt-ini`: avoid hardcoding flags +- `exportlegends`: + + - reordered some tags to match DF's order + - added progress indicators for exporting long lists + - `gui/gm-editor`: added enum names to enum edit dialogs - `gui/gm-unit`: made skill search case-insensitive - `gui/rename`: added "clear" and "special characters" options From dbe950d92df9c8246d1765a78dead8fb38415179 Mon Sep 17 00:00:00 2001 From: lethosor Date: Sat, 13 Jan 2018 16:51:03 -0500 Subject: [PATCH 02/15] Update submodules --- library/xml | 2 +- scripts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/library/xml b/library/xml index 72dd9b146..f38c8d325 160000 --- a/library/xml +++ b/library/xml @@ -1 +1 @@ -Subproject commit 72dd9b14633e448f5e882e27a8d9af22ea9fdd5a +Subproject commit f38c8d325297d0dc354ca3b9881989980f74013d diff --git a/scripts b/scripts index e4c6851a9..ba92c1604 160000 --- a/scripts +++ b/scripts @@ -1 +1 @@ -Subproject commit e4c6851a9e0b763bdf12442828c3c58ff0aec65d +Subproject commit ba92c16046dae453af22c1ccf31a30c09787b357 From ce1644d6552e7d3cdf0abfa6dc7a1583ff60c393 Mon Sep 17 00:00:00 2001 From: lethosor Date: Sun, 14 Jan 2018 18:09:18 -0500 Subject: [PATCH 03/15] Bump to 0.44.05-alpha1 and update submodules --- CMakeLists.txt | 2 +- docs/NEWS-dev.rst | 7 +++++++ library/xml | 2 +- scripts | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d84e8dfd1..6e92fc967 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -140,7 +140,7 @@ if (NOT EXISTS ${dfhack_SOURCE_DIR}/library/xml/codegen.pl OR NOT EXISTS ${dfhac endif() # set up versioning. -set(DF_VERSION "0.44.04") +set(DF_VERSION "0.44.05") set(DFHACK_RELEASE "alpha1") set(DFHACK_PRERELEASE TRUE) diff --git a/docs/NEWS-dev.rst b/docs/NEWS-dev.rst index 4dd04ce43..38fbe658d 100644 --- a/docs/NEWS-dev.rst +++ b/docs/NEWS-dev.rst @@ -37,6 +37,13 @@ Development Changelog .. contents:: :depth: 2 +DFHack 0.44.05-alpha1 +===================== + +Structures +---------- +- ``incident``: re-aligned again to match disassembly + DFHack 0.44.04-alpha1 ===================== diff --git a/library/xml b/library/xml index f38c8d325..3a9f401d1 160000 --- a/library/xml +++ b/library/xml @@ -1 +1 @@ -Subproject commit f38c8d325297d0dc354ca3b9881989980f74013d +Subproject commit 3a9f401d196ee8ebc53edb9e15a13bfcb0879b4e diff --git a/scripts b/scripts index ba92c1604..2d4093e61 160000 --- a/scripts +++ b/scripts @@ -1 +1 @@ -Subproject commit ba92c16046dae453af22c1ccf31a30c09787b357 +Subproject commit 2d4093e61ea2a02742a6bfbfd80e49eb6dcdd549 From c3bf14a300d86455fc087d9dbe0031bffac79e93 Mon Sep 17 00:00:00 2001 From: lethosor Date: Sun, 14 Jan 2018 22:56:35 -0500 Subject: [PATCH 04/15] Correct bad os-type attributes in symbols.xml --- library/Core.cpp | 14 +++++++++++++- library/VersionInfoFactory.cpp | 4 ++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/library/Core.cpp b/library/Core.cpp index 47bddbab8..5173a3ad9 100644 --- a/library/Core.cpp +++ b/library/Core.cpp @@ -640,7 +640,7 @@ static std::string sc_event_name (state_change_event id) { string getBuiltinCommand(std::string cmd) { std::string builtin = ""; - + // Check our list of builtin commands from the header if (built_in_commands.count(cmd)) builtin = cmd; @@ -1619,6 +1619,18 @@ bool Core::Init() } cerr << "Version: " << vinfo->getVersion() << endl; +#if defined(_WIN32) + const OSType expected = OS_WINDOWS; +#elif defined(_DARWIN) + const OSType expected = OS_APPLE; +#else + const OSType expected = OS_LINUX; +#endif + if (expected != vinfo->getOS()) { + cerr << "OS mismatch; resetting to " << int(expected) << endl; + vinfo->setOS(expected); + } + // Init global object pointers df::global::InitGlobals(); alias_mutex = new recursive_mutex(); diff --git a/library/VersionInfoFactory.cpp b/library/VersionInfoFactory.cpp index cdfdbf774..7033fd598 100644 --- a/library/VersionInfoFactory.cpp +++ b/library/VersionInfoFactory.cpp @@ -153,7 +153,7 @@ void VersionInfoFactory::ParseVersion (TiXmlElement* entry, VersionInfo* mem) else if (type == "md5-hash") { const char *cstr_value = pMemEntry->Attribute("value"); - fprintf(stderr, "%s: MD5: %s\n", cstr_name, cstr_value); + fprintf(stderr, "%s (%s): MD5: %s\n", cstr_name, cstr_os, cstr_value); if(!cstr_value) throw Error::SymbolsXmlUnderspecifiedEntry(cstr_name); mem->addMD5(cstr_value); @@ -161,7 +161,7 @@ void VersionInfoFactory::ParseVersion (TiXmlElement* entry, VersionInfo* mem) else if (type == "binary-timestamp") { const char *cstr_value = pMemEntry->Attribute("value"); - fprintf(stderr, "%s: PE: %s\n", cstr_name, cstr_value); + fprintf(stderr, "%s (%s): PE: %s\n", cstr_name, cstr_os, cstr_value); if(!cstr_value) throw Error::SymbolsXmlUnderspecifiedEntry(cstr_name); mem->addPE(strtol(cstr_value, 0, 16)); From 46bc26dfe2b4343adcd39034acb8447232d33973 Mon Sep 17 00:00:00 2001 From: lethosor Date: Sun, 14 Jan 2018 23:25:28 -0500 Subject: [PATCH 05/15] Update xml --- library/xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/xml b/library/xml index 3a9f401d1..352e23310 160000 --- a/library/xml +++ b/library/xml @@ -1 +1 @@ -Subproject commit 3a9f401d196ee8ebc53edb9e15a13bfcb0879b4e +Subproject commit 352e233105512a702875f48d82f922f0c9ca3905 From 167fcd757819211748fd130c1ac7871076e03202 Mon Sep 17 00:00:00 2001 From: lethosor Date: Mon, 15 Jan 2018 00:11:03 -0500 Subject: [PATCH 06/15] Add gui/liquids changes to changelog --- NEWS.rst | 1 + docs/NEWS-dev.rst | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index ca9234d63..a14bafa9f 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -64,6 +64,7 @@ Misc Improvements - `gui/gm-editor`: added enum names to enum edit dialogs - `gui/gm-unit`: made skill search case-insensitive +- `gui/liquids`: added more keybindings: 0-7 to change liquid level, P/B to cycle backwards - `gui/pathable`: added tile types to sidebar - `gui/rename`: added "clear" and "special characters" options - `modtools/skill-change`: diff --git a/docs/NEWS-dev.rst b/docs/NEWS-dev.rst index 38fbe658d..834282608 100644 --- a/docs/NEWS-dev.rst +++ b/docs/NEWS-dev.rst @@ -44,6 +44,10 @@ Structures ---------- - ``incident``: re-aligned again to match disassembly +Other Changes +------------- +- `gui/liquids`: added more keybindings: 0-7 to change liquid level, P/B to cycle backwards + DFHack 0.44.04-alpha1 ===================== From f2890620d1a0b9c3bd9616195f7e260d46ca5324 Mon Sep 17 00:00:00 2001 From: lethosor Date: Thu, 18 Jan 2018 01:05:33 -0500 Subject: [PATCH 07/15] Remove tweak kitchen-keys - DF bug 614 was fixed --- dfhack.init-example | 1 - docs/Plugins.rst | 1 - plugins/tweak/tweak.cpp | 6 --- plugins/tweak/tweaks/kitchen-keys.h | 68 ----------------------------- 4 files changed, 76 deletions(-) delete mode 100644 plugins/tweak/tweaks/kitchen-keys.h diff --git a/dfhack.init-example b/dfhack.init-example index 3542956ce..75552006e 100644 --- a/dfhack.init-example +++ b/dfhack.init-example @@ -207,7 +207,6 @@ tweak civ-view-agreement tweak eggs-fertile tweak fps-min tweak hide-priority -tweak kitchen-keys tweak kitchen-prefs-empty tweak max-wheelbarrow tweak shift-8-scroll diff --git a/docs/Plugins.rst b/docs/Plugins.rst index 0ed65c4a3..04f5df321 100644 --- a/docs/Plugins.rst +++ b/docs/Plugins.rst @@ -311,7 +311,6 @@ Subcommands that persist until disabled or DF quits: :import-priority-category: Allows changing the priority of all goods in a 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-empty: Fixes a layout issue with empty kitchen tabs (:bug:`9000`) :max-wheelbarrow: Allows assigning more than 3 wheelbarrows to a stockpile diff --git a/plugins/tweak/tweak.cpp b/plugins/tweak/tweak.cpp index 417784efb..252f4c738 100644 --- a/plugins/tweak/tweak.cpp +++ b/plugins/tweak/tweak.cpp @@ -94,7 +94,6 @@ #include "tweaks/hide-priority.h" #include "tweaks/hotkey-clear.h" #include "tweaks/import-priority-category.h" -#include "tweaks/kitchen-keys.h" #include "tweaks/kitchen-prefs-color.h" #include "tweaks/kitchen-prefs-empty.h" #include "tweaks/max-wheelbarrow.h" @@ -218,8 +217,6 @@ DFhackCExport command_result plugin_init (color_ostream &out, std::vector (world->selected_building); - if (!ws) - return false; - if (ws->type != workshop_type::Kitchen) - return false; - return true; - } - - DEFINE_VMETHOD_INTERPOSE(void, feed, (std::set *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); From 909776571e1f2730db61a4312f036cd8baad2c1c Mon Sep 17 00:00:00 2001 From: lethosor Date: Thu, 18 Jan 2018 01:06:03 -0500 Subject: [PATCH 08/15] dwarfmonitor: support getSelectedUnit --- plugins/dwarfmonitor.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/dwarfmonitor.cpp b/plugins/dwarfmonitor.cpp index 2ea811f38..1ee1c8db8 100644 --- a/plugins/dwarfmonitor.cpp +++ b/plugins/dwarfmonitor.cpp @@ -1543,6 +1543,11 @@ public: dwarf_column.setHighlight(0); } + df::unit *getSelectedUnit() override + { + return (selected_column == 1) ? dwarf_column.getFirstSelectedElem() : nullptr; + } + void feed(set *input) { bool key_processed = false; @@ -1574,7 +1579,7 @@ public: } else if (input->count(interface_key::CUSTOM_SHIFT_Z)) { - df::unit *selected_unit = (selected_column == 1) ? dwarf_column.getFirstSelectedElem() : nullptr; + df::unit *selected_unit = getSelectedUnit(); if (selected_unit) { input->clear(); From 4e2c6194ca33252a64dfb69c43d7cec28e654338 Mon Sep 17 00:00:00 2001 From: lethosor Date: Thu, 18 Jan 2018 01:06:55 -0500 Subject: [PATCH 09/15] dwarfmonitor: support poetic/musical/dance forms --- plugins/dwarfmonitor.cpp | 75 +++++++++++++++++++++++++++++++--------- 1 file changed, 58 insertions(+), 17 deletions(-) diff --git a/plugins/dwarfmonitor.cpp b/plugins/dwarfmonitor.cpp index 1ee1c8db8..18c7ac9b2 100644 --- a/plugins/dwarfmonitor.cpp +++ b/plugins/dwarfmonitor.cpp @@ -18,31 +18,34 @@ #include "modules/Translation.h" #include "modules/World.h" #include "modules/Maps.h" -#include "df/activity_event.h" + #include "df/activity_entry.h" -#include "df/unit_preference.h" -#include "df/unit_soul.h" +#include "df/activity_event.h" +#include "df/creature_raw.h" +#include "df/dance_form.h" +#include "df/descriptor_color.h" +#include "df/descriptor_shape.h" #include "df/item_type.h" - -#include "df/itemdef_weaponst.h" -#include "df/itemdef_trapcompst.h" -#include "df/itemdef_toyst.h" -#include "df/itemdef_toolst.h" -#include "df/itemdef_instrumentst.h" -#include "df/itemdef_armorst.h" #include "df/itemdef_ammost.h" -#include "df/itemdef_siegeammost.h" +#include "df/itemdef_armorst.h" +#include "df/itemdef_foodst.h" #include "df/itemdef_glovesst.h" -#include "df/itemdef_shoesst.h" -#include "df/itemdef_shieldst.h" #include "df/itemdef_helmst.h" +#include "df/itemdef_instrumentst.h" #include "df/itemdef_pantsst.h" -#include "df/itemdef_foodst.h" +#include "df/itemdef_shieldst.h" +#include "df/itemdef_shoesst.h" +#include "df/itemdef_siegeammost.h" +#include "df/itemdef_toolst.h" +#include "df/itemdef_toyst.h" +#include "df/itemdef_trapcompst.h" +#include "df/itemdef_weaponst.h" +#include "df/musical_form.h" +#include "df/poetic_form.h" #include "df/trapcomp_flags.h" -#include "df/creature_raw.h" +#include "df/unit_preference.h" +#include "df/unit_soul.h" #include "df/world_raws.h" -#include "df/descriptor_shape.h" -#include "df/descriptor_color.h" using std::deque; @@ -137,6 +140,14 @@ static string getUnitName(df::unit * unit) return label; } +template +static string getFormName(int32_t id, const string &default_ = "?") { + T *form = T::find(id); + if (form) + return Translation::TranslateName(&form->name); + return default_; +} + static void send_key(const df::interface_key &key) { set< df::interface_key > keys; @@ -1290,6 +1301,19 @@ struct preference_map case (T_type::LikeColor): label += "Color :" + raws.language.colors[pref.color_id]->name; break; + + case (T_type::LikePoeticForm): + label += "Poetry :" + getFormName(pref.poetic_form_id); + break; + + case (T_type::LikeMusicalForm): + label += "Music :" + getFormName(pref.musical_form_id); + break; + + case (T_type::LikeDanceForm): + label += "Dance :" + getFormName(pref.dance_form_id); + break; + } } }; @@ -1444,6 +1468,18 @@ public: return false; break; + case (T_type::LikePoeticForm): + return lhs.poetic_form_id == rhs.poetic_form_id; + break; + + case (T_type::LikeMusicalForm): + return lhs.musical_form_id == rhs.musical_form_id; + break; + + case (T_type::LikeDanceForm): + return lhs.dance_form_id == rhs.dance_form_id; + break; + default: return false; } @@ -1483,6 +1519,11 @@ public: case (T_type::LikeColor): return COLOR_BLUE; + case (T_type::LikePoeticForm): + case (T_type::LikeMusicalForm): + case (T_type::LikeDanceForm): + return COLOR_LIGHTCYAN; + default: return false; } From 5f588b376aee2503879629c9763205c0570d6c21 Mon Sep 17 00:00:00 2001 From: lethosor Date: Thu, 18 Jan 2018 01:07:20 -0500 Subject: [PATCH 10/15] dwarfmonitor: make handling of unrecognized preferences more obvious --- plugins/dwarfmonitor.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/dwarfmonitor.cpp b/plugins/dwarfmonitor.cpp index 18c7ac9b2..ef77d7ae3 100644 --- a/plugins/dwarfmonitor.cpp +++ b/plugins/dwarfmonitor.cpp @@ -1212,6 +1212,7 @@ struct preference_map break; default: + label = string("UNKNOWN ") + ENUM_ATTR_STR(item_type, caption, pref.item_type); break; } @@ -1314,6 +1315,9 @@ struct preference_map label += "Dance :" + getFormName(pref.dance_form_id); break; + default: + label += string("UNKNOWN ") + ENUM_KEY_STR(unit_preference::T_type, pref.type); + break; } } }; @@ -1525,7 +1529,7 @@ public: return COLOR_LIGHTCYAN; default: - return false; + return COLOR_LIGHTMAGENTA; } return true; From 9515a9e4f5fac41589849cbbe4ddf4a449ac509b Mon Sep 17 00:00:00 2001 From: lethosor Date: Thu, 18 Jan 2018 01:13:08 -0500 Subject: [PATCH 11/15] dwarfmonitor: use interface_key overload of OutputHotkeyString, grey out unit option --- plugins/dwarfmonitor.cpp | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/plugins/dwarfmonitor.cpp b/plugins/dwarfmonitor.cpp index ef77d7ae3..79211fabd 100644 --- a/plugins/dwarfmonitor.cpp +++ b/plugins/dwarfmonitor.cpp @@ -491,6 +491,8 @@ public: void render() { + using namespace df::enums::interface_key; + if (Screen::isDismissed(this)) return; @@ -504,18 +506,18 @@ public: int32_t y = gps->dimy - 4; int32_t x = 2; - OutputHotkeyString(x, y, "Leave", "Esc"); + OutputHotkeyString(x, y, "Leave", LEAVESCREEN); x += 13; string window_label = "Window Months: " + int_to_string(window_days / min_window); - OutputHotkeyString(x, y, window_label.c_str(), "*"); + OutputHotkeyString(x, y, window_label.c_str(), SECONDSCROLL_PAGEDOWN); ++y; x = 2; - OutputHotkeyString(x, y, "Fort Stats", "Shift-D"); + OutputHotkeyString(x, y, "Fort Stats", CUSTOM_SHIFT_D); x += 3; - OutputHotkeyString(x, y, "Zoom Unit", "Shift-Z"); + OutputHotkeyString(x, y, "Zoom Unit", CUSTOM_SHIFT_Z); } std::string getFocusString() { return "dwarfmonitor_dwarfstats"; } @@ -1099,6 +1101,8 @@ public: void render() { + using namespace df::enums::interface_key; + if (Screen::isDismissed(this)) return; @@ -1113,18 +1117,18 @@ public: int32_t y = gps->dimy - 4; int32_t x = 2; - OutputHotkeyString(x, y, "Leave", "Esc"); + OutputHotkeyString(x, y, "Leave", LEAVESCREEN); x += 13; string window_label = "Window Months: " + int_to_string(window_days / min_window); - OutputHotkeyString(x, y, window_label.c_str(), "*"); + OutputHotkeyString(x, y, window_label.c_str(), SECONDSCROLL_PAGEDOWN); ++y; x = 2; - OutputHotkeyString(x, y, "Dwarf Stats", "Shift-D"); + OutputHotkeyString(x, y, "Dwarf Stats", CUSTOM_SHIFT_D); x += 3; - OutputHotkeyString(x, y, "Zoom Unit", "Shift-Z"); + OutputHotkeyString(x, y, "Zoom Unit", CUSTOM_SHIFT_Z); } std::string getFocusString() { return "dwarfmonitor_fortstats"; } @@ -1660,6 +1664,8 @@ public: void render() { + using namespace df::enums::interface_key; + if (Screen::isDismissed(this)) return; @@ -1673,10 +1679,11 @@ public: int32_t y = gps->dimy - 3; int32_t x = 2; - OutputHotkeyString(x, y, "Leave", "Esc"); + OutputHotkeyString(x, y, "Leave", LEAVESCREEN); x += 2; - OutputHotkeyString(x, y, "Zoom Unit", "Shift-Z"); + OutputHotkeyString(x, y, "Zoom Unit", CUSTOM_SHIFT_Z, false, 0, + getSelectedUnit() ? COLOR_WHITE : COLOR_DARKGREY); } std::string getFocusString() { return "dwarfmonitor_preferences"; } From 7b16cf16199e1f4d3cc3c2334af688e598ad554e Mon Sep 17 00:00:00 2001 From: lethosor Date: Thu, 18 Jan 2018 09:54:33 -0500 Subject: [PATCH 12/15] dwarfmonitor: actually display creature names --- plugins/dwarfmonitor.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/plugins/dwarfmonitor.cpp b/plugins/dwarfmonitor.cpp index 79211fabd..b715f6351 100644 --- a/plugins/dwarfmonitor.cpp +++ b/plugins/dwarfmonitor.cpp @@ -1233,15 +1233,13 @@ struct preference_map { case (T_type::LikeCreature): { - label = "Creature :"; - Units::getRaceNamePluralById(pref.creature_id); + label = "Creature :" + Units::getRaceNamePluralById(pref.creature_id); break; } case (T_type::HateCreature): { - label = "Hates :"; - Units::getRaceNamePluralById(pref.creature_id); + label = "Hates :" + Units::getRaceNamePluralById(pref.creature_id); break; } From b035d9e53ad97fdf4a897a96a6c25e51d0995912 Mon Sep 17 00:00:00 2001 From: lethosor Date: Thu, 18 Jan 2018 10:05:31 -0500 Subject: [PATCH 13/15] ListColumn: only change items' foreground color in selected columns --- plugins/listcolumn.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/listcolumn.h b/plugins/listcolumn.h index 4e4815b69..f7747d96d 100644 --- a/plugins/listcolumn.h +++ b/plugins/listcolumn.h @@ -113,7 +113,7 @@ public: for (int i = display_start_offset; i < display_list.size() && i < last_index_able_to_display; i++) { ++y; - UIColor fg_color = (display_list[i]->selected) ? COLOR_SELECTED : display_list[i]->color; + UIColor fg_color = (is_selected_column && display_list[i]->selected) ? COLOR_SELECTED : display_list[i]->color; UIColor bg_color = (is_selected_column && i == highlighted_index) ? COLOR_HIGHLIGHTED : COLOR_BLACK; string item_label = display_list[i]->text; From 74aefddd75b3153c2ea215de82a29f2da9ba3208 Mon Sep 17 00:00:00 2001 From: lethosor Date: Thu, 18 Jan 2018 10:17:40 -0500 Subject: [PATCH 14/15] dwarfmonitor: Use a reasonable default for unhandled item types --- plugins/dwarfmonitor.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/plugins/dwarfmonitor.cpp b/plugins/dwarfmonitor.cpp index b715f6351..6f5481369 100644 --- a/plugins/dwarfmonitor.cpp +++ b/plugins/dwarfmonitor.cpp @@ -1216,7 +1216,18 @@ struct preference_map break; default: - label = string("UNKNOWN ") + ENUM_ATTR_STR(item_type, caption, pref.item_type); + label = ENUM_ATTR_STR(item_type, caption, pref.item_type); + if (label.size()) + { + if (label[label.size() - 1] == 's') + label += "es"; + else + label += "s"; + } + else + { + label = "UNKNOWN"; + } break; } From 1ed6c70663d4ada28538d56138ecbcee58ee47fe Mon Sep 17 00:00:00 2001 From: lethosor Date: Thu, 18 Jan 2018 10:17:54 -0500 Subject: [PATCH 15/15] dwarfmonitor: Add "view unit" option to prefs screen --- plugins/dwarfmonitor.cpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/plugins/dwarfmonitor.cpp b/plugins/dwarfmonitor.cpp index 6f5481369..7aed7188d 100644 --- a/plugins/dwarfmonitor.cpp +++ b/plugins/dwarfmonitor.cpp @@ -45,6 +45,7 @@ #include "df/trapcomp_flags.h" #include "df/unit_preference.h" #include "df/unit_soul.h" +#include "df/viewscreen_unitst.h" #include "df/world_raws.h" using std::deque; @@ -1345,14 +1346,14 @@ public: preferences_column.auto_select = true; preferences_column.setTitle("Preference"); preferences_column.bottom_margin = 3; - preferences_column.search_margin = 35; + preferences_column.search_margin = 50; dwarf_column.multiselect = false; dwarf_column.auto_select = true; dwarf_column.allow_null = true; dwarf_column.setTitle("Units with Preference"); dwarf_column.bottom_margin = 3; - dwarf_column.search_margin = 35; + dwarf_column.search_margin = 50; populatePreferencesColumn(); } @@ -1635,6 +1636,16 @@ public: Screen::dismiss(this); return; } + else if (input->count(interface_key::CUSTOM_SHIFT_V)) + { + df::unit *unit = getSelectedUnit(); + if (unit) + { + auto unitscr = df::allocate(); + unitscr->unit = unit; + Screen::show(unitscr); + } + } else if (input->count(interface_key::CUSTOM_SHIFT_Z)) { df::unit *selected_unit = getSelectedUnit(); @@ -1690,6 +1701,10 @@ public: int32_t x = 2; OutputHotkeyString(x, y, "Leave", LEAVESCREEN); + x += 2; + OutputHotkeyString(x, y, "View Unit", CUSTOM_SHIFT_V, false, 0, + getSelectedUnit() ? COLOR_WHITE : COLOR_DARKGREY); + x += 2; OutputHotkeyString(x, y, "Zoom Unit", CUSTOM_SHIFT_Z, false, 0, getSelectedUnit() ? COLOR_WHITE : COLOR_DARKGREY);