diff --git a/docs/changelog.txt b/docs/changelog.txt index 6f2e0d8f7..2dc0bc520 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -83,6 +83,7 @@ Template for new versions: - ``Units::getReadableName``: now returns the *untranslated* name - ``Burrows::setAssignedUnit``: now properly handles inactive burrows - ``Gui::getMousePos``: now takes an optional ``allow_out_of_bounds`` parameter so coordinates can be returned for mouse positions outside of the game map (i.e. in the blank space around the map) +- Gui focus strings will now include the trap type for traps (e.g. dwarfmode/ViewSheets/BUILDING/Trap/StoneFallTrap) ## Lua - ``dfhack.gui.revealInDwarfmodeMap``: gained ``highlight`` parameter to control setting the tile highlight on the zoom target diff --git a/library/modules/Gui.cpp b/library/modules/Gui.cpp index 475ac5728..992913e10 100644 --- a/library/modules/Gui.cpp +++ b/library/modules/Gui.cpp @@ -380,8 +380,14 @@ DEFINE_GET_FOCUS_STRING_HANDLER(dwarfmode) case df::view_sheet_type::BUILDING: if (game->main_interface.view_sheets.linking_lever) newFocusString = baseFocus + "/LinkingLever"; - else if (auto bld = df::building::find(game->main_interface.view_sheets.viewing_bldid)) - newFocusString += '/' + enum_item_key(bld->getType()); + else if (auto bld = df::building::find(game->main_interface.view_sheets.viewing_bldid)) { + std::string buildingType = enum_item_key(bld->getType()); + newFocusString += '/' + buildingType; + if (buildingType == "Trap") { + df::building_trapst* trap = strict_virtual_cast(bld); + newFocusString += '/' + enum_item_key(trap->trap_type); + } + } break; default: break;