add detailed focus strings for setupdwarfgame

develop
Myk Taylor 2023-09-26 03:45:15 -07:00 committed by Najeeb Al-Shabibi
parent 73fed1e833
commit 6ad724b483
1 changed files with 40 additions and 0 deletions

@ -87,6 +87,7 @@ using namespace DFHack;
#include "df/viewscreen_dwarfmodest.h"
#include "df/viewscreen_legendsst.h"
#include "df/viewscreen_new_regionst.h"
#include "df/viewscreen_setupdwarfgamest.h"
#include "df/viewscreen_titlest.h"
#include "df/world.h"
@ -174,6 +175,45 @@ DEFINE_GET_FOCUS_STRING_HANDLER(new_region)
focusStrings.push_back(baseFocus);
}
DEFINE_GET_FOCUS_STRING_HANDLER(setupdwarfgame)
{
if (screen->doing_custom_settings)
focusStrings.push_back(baseFocus + "/CustomSettings");
else if (game->main_interface.options.open)
focusStrings.push_back(baseFocus + "/Abort");
else if (screen->initial_selection == 1)
focusStrings.push_back(baseFocus + "/Default");
else if (game->main_interface.name_creator.open) {
switch (game->main_interface.name_creator.context) {
case df::name_creator_context_type::EMBARK_FORT_NAME:
focusStrings.push_back(baseFocus + "/FortName");
break;
case df::name_creator_context_type::EMBARK_GROUP_NAME:
focusStrings.push_back(baseFocus + "/GroupName");
break;
default:
break;
}
}
else if (game->main_interface.image_creator.open) {
focusStrings.push_back(baseFocus + "/GroupSymbol");
}
else if (screen->viewing_objections != 0)
focusStrings.push_back(baseFocus + "/Objections");
else {
switch (screen->mode) {
case 0: focusStrings.push_back(baseFocus + "/Dwarves"); break;
case 1: focusStrings.push_back(baseFocus + "/Items"); break;
case 2: focusStrings.push_back(baseFocus + "/Animals"); break;
default:
break;
}
}
if (focusStrings.empty())
focusStrings.push_back(baseFocus + "/Default");
}
DEFINE_GET_FOCUS_STRING_HANDLER(legends)
{
if (screen->init_stage != -1)