| 1683 | } |
| 1684 | |
| 1685 | df::plant *Gui::getAnyPlant(df::viewscreen *top) |
| 1686 | { |
| 1687 | using df::global::cursor; |
| 1688 | |
| 1689 | if (auto dfscreen = dfhack_viewscreen::try_cast(top)) |
| 1690 | return dfscreen->getSelectedPlant(); |
| 1691 | |
| 1692 | if (Gui::dwarfmode_hotkey(top) && has_cursor()) |
| 1693 | { |
| 1694 | if (!cursor || !plotinfo || !world) |
| 1695 | return nullptr; |
| 1696 | |
| 1697 | return Maps::getPlantAtTile(cursor->x, cursor->y, cursor->z); |
| 1698 | } |
| 1699 | |
| 1700 | return nullptr; |
| 1701 | } |
| 1702 | |
| 1703 | bool Gui::any_plant_hotkey(df::viewscreen *top) |
| 1704 | { |
nothing calls this directly
no test coverage detected