From f59be2a9a07cc38d922f8a4bf701d44fd705c667 Mon Sep 17 00:00:00 2001 From: lethosor Date: Sat, 27 May 2017 00:56:40 -0400 Subject: [PATCH] Expand focus strings for jobmanagement and workquota_condition viewscreens --- dfhack.init-example | 2 +- library/modules/Gui.cpp | 14 ++++++++++++++ scripts | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/dfhack.init-example b/dfhack.init-example index 19bef37e6..bc6c5a915 100644 --- a/dfhack.init-example +++ b/dfhack.init-example @@ -53,7 +53,7 @@ keybinding add Alt-S@title gui/settings-manager keybinding add Alt-S@dwarfmode/Default gui/settings-manager # change quantity of manager orders -keybinding add Alt-Q@jobmanagement gui/manager-quantity +keybinding add Alt-Q@jobmanagement/Main gui/manager-quantity ############################## # Generic adv mode bindings # diff --git a/library/modules/Gui.cpp b/library/modules/Gui.cpp index 5ad569c5a..a8e54d27e 100644 --- a/library/modules/Gui.cpp +++ b/library/modules/Gui.cpp @@ -53,6 +53,7 @@ using namespace DFHack; #include "df/viewscreen_dungeon_monsterstatusst.h" #include "df/viewscreen_jobst.h" #include "df/viewscreen_joblistst.h" +#include "df/viewscreen_jobmanagementst.h" #include "df/viewscreen_unitlistst.h" #include "df/viewscreen_buildinglistst.h" #include "df/viewscreen_itemst.h" @@ -66,6 +67,7 @@ using namespace DFHack; #include "df/viewscreen_petst.h" #include "df/viewscreen_tradegoodsst.h" #include "df/viewscreen_storesst.h" +#include "df/viewscreen_workquota_conditionst.h" #include "df/viewscreen_workshop_profilest.h" #include "df/ui_unit_view_mode.h" #include "df/ui_sidebar_menus.h" @@ -557,6 +559,18 @@ DEFINE_GET_FOCUS_STRING_HANDLER(locations) focus += "/" + enum_item_key(screen->menu); } +DEFINE_GET_FOCUS_STRING_HANDLER(jobmanagement) +{ + focus += (screen->in_max_workshops ? "/MaxWorkshops" : "/Main"); +} + +DEFINE_GET_FOCUS_STRING_HANDLER(workquota_condition) +{ + focus += "/" + enum_item_key(screen->mode); + if (screen->item_count_edit) + focus += "/EditCount"; +} + std::string Gui::getFocusString(df::viewscreen *top) { if (!top) diff --git a/scripts b/scripts index f6862e8c4..c4f6877a6 160000 --- a/scripts +++ b/scripts @@ -1 +1 @@ -Subproject commit f6862e8c4351bc2e319df3e2b925c9b65eb7f1bb +Subproject commit c4f6877a69ac1c69a405d122dd6e75c5605fe782