MCPcopy Create free account
hub / github.com/DFHack/dfhack / getAnyPlant

Method getAnyPlant

library/modules/Gui.cpp:1685–1701  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1683}
1684
1685df::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
1703bool Gui::any_plant_hotkey(df::viewscreen *top)
1704{

Callers

nothing calls this directly

Calls 3

has_cursorFunction · 0.85
getPlantAtTileFunction · 0.85
getSelectedPlantMethod · 0.45

Tested by

no test coverage detected