Merge pull request #3647 from myk002/myk_legends

add focus string support for legends mode
develop
Myk 2023-08-07 10:44:18 -07:00 committed by GitHub
commit 1b04eca66a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 0 deletions

@ -69,6 +69,7 @@ using namespace DFHack;
#include "df/item_corpsepiecest.h"
#include "df/item_corpsest.h"
#include "df/job.h"
#include "df/legend_pagest.h"
#include "df/occupation.h"
#include "df/plant.h"
#include "df/popup_message.h"
@ -84,6 +85,7 @@ using namespace DFHack;
#include "df/unit.h"
#include "df/unit_inventory_item.h"
#include "df/viewscreen_dwarfmodest.h"
#include "df/viewscreen_legendsst.h"
#include "df/viewscreen_new_regionst.h"
#include "df/viewscreen_titlest.h"
#include "df/world.h"
@ -170,6 +172,16 @@ DEFINE_GET_FOCUS_STRING_HANDLER(new_region)
focusStrings.push_back(baseFocus);
}
DEFINE_GET_FOCUS_STRING_HANDLER(legends)
{
if (screen->init_stage != -1)
focusStrings.push_back(baseFocus + "/Loading");
else if (screen->page.size() <= 1)
focusStrings.push_back(baseFocus + "/Default");
else
focusStrings.push_back(baseFocus + '/' + screen->page[screen->active_page_index]->header);
}
DEFINE_GET_FOCUS_STRING_HANDLER(dwarfmode)
{
std::string newFocusString;