dwarfmonitor: support getSelectedUnit

develop
lethosor 2018-01-18 01:06:03 -05:00
parent f2890620d1
commit 909776571e
1 changed files with 6 additions and 1 deletions

@ -1543,6 +1543,11 @@ public:
dwarf_column.setHighlight(0); dwarf_column.setHighlight(0);
} }
df::unit *getSelectedUnit() override
{
return (selected_column == 1) ? dwarf_column.getFirstSelectedElem() : nullptr;
}
void feed(set<df::interface_key> *input) void feed(set<df::interface_key> *input)
{ {
bool key_processed = false; bool key_processed = false;
@ -1574,7 +1579,7 @@ public:
} }
else if (input->count(interface_key::CUSTOM_SHIFT_Z)) else if (input->count(interface_key::CUSTOM_SHIFT_Z))
{ {
df::unit *selected_unit = (selected_column == 1) ? dwarf_column.getFirstSelectedElem() : nullptr; df::unit *selected_unit = getSelectedUnit();
if (selected_unit) if (selected_unit)
{ {
input->clear(); input->clear();