Merge pull request #3974 from robob27/trackstop-focus

Add trap type to focus string
develop
Myk 2023-11-06 22:38:52 -08:00 committed by GitHub
commit aa59cab932
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

@ -83,6 +83,7 @@ Template for new versions:
- ``Units::getReadableName``: now returns the *untranslated* name - ``Units::getReadableName``: now returns the *untranslated* name
- ``Burrows::setAssignedUnit``: now properly handles inactive burrows - ``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::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 ## Lua
- ``dfhack.gui.revealInDwarfmodeMap``: gained ``highlight`` parameter to control setting the tile highlight on the zoom target - ``dfhack.gui.revealInDwarfmodeMap``: gained ``highlight`` parameter to control setting the tile highlight on the zoom target

@ -380,8 +380,13 @@ DEFINE_GET_FOCUS_STRING_HANDLER(dwarfmode)
case df::view_sheet_type::BUILDING: case df::view_sheet_type::BUILDING:
if (game->main_interface.view_sheets.linking_lever) if (game->main_interface.view_sheets.linking_lever)
newFocusString = baseFocus + "/LinkingLever"; newFocusString = baseFocus + "/LinkingLever";
else if (auto bld = df::building::find(game->main_interface.view_sheets.viewing_bldid)) else if (auto bld = df::building::find(game->main_interface.view_sheets.viewing_bldid)) {
newFocusString += '/' + enum_item_key(bld->getType()); newFocusString += '/' + enum_item_key(bld->getType());
if (bld->getType() == df::enums::building_type::Trap) {
df::building_trapst* trap = strict_virtual_cast<df::building_trapst>(bld);
newFocusString += '/' + enum_item_key(trap->trap_type);
}
}
break; break;
default: default:
break; break;