add title screen focus string detection

develop
Myk Taylor 2023-04-24 08:03:11 -07:00
parent b5459faffe
commit 6203894c99
No known key found for this signature in database
GPG Key ID: 8A39CA0FA0C16E78
1 changed files with 12 additions and 0 deletions

@ -84,6 +84,7 @@ using namespace DFHack;
#include "df/unit.h"
#include "df/unit_inventory_item.h"
#include "df/viewscreen_dwarfmodest.h"
#include "df/viewscreen_titlest.h"
#include "df/world.h"
const size_t MAX_REPORTS_SIZE = 3000; // DF clears old reports to maintain this vector size
@ -144,6 +145,17 @@ static std::map<virtual_identity*, getFocusStringsHandler> getFocusStringsHandle
); \
static void getFocusStrings_##screen_type(std::string &baseFocus, std::vector<std::string> &focusStrings, VIEWSCREEN(screen_type) *screen)
DEFINE_GET_FOCUS_STRING_HANDLER(title)
{
if (screen->managing_mods)
focusStrings.push_back(baseFocus + "/Mods");
else if (game->main_interface.settings.open)
focusStrings.push_back(baseFocus + "/Settings");
if (focusStrings.empty())
focusStrings.push_back(baseFocus + "/Default");
}
DEFINE_GET_FOCUS_STRING_HANDLER(dwarfmode)
{
std::string newFocusString;