Merge pull request #3815 from myk002/myk_focus

add detailed focus strings for setupdwarfgame
develop
Myk 2023-09-26 19:08:58 -07:00 committed by GitHub
commit e48c8d57b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 40 additions and 0 deletions

@ -87,6 +87,7 @@ using namespace DFHack;
#include "df/viewscreen_dwarfmodest.h" #include "df/viewscreen_dwarfmodest.h"
#include "df/viewscreen_legendsst.h" #include "df/viewscreen_legendsst.h"
#include "df/viewscreen_new_regionst.h" #include "df/viewscreen_new_regionst.h"
#include "df/viewscreen_setupdwarfgamest.h"
#include "df/viewscreen_titlest.h" #include "df/viewscreen_titlest.h"
#include "df/world.h" #include "df/world.h"
@ -174,6 +175,45 @@ DEFINE_GET_FOCUS_STRING_HANDLER(new_region)
focusStrings.push_back(baseFocus); 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) DEFINE_GET_FOCUS_STRING_HANDLER(legends)
{ {
if (screen->init_stage != -1) if (screen->init_stage != -1)