Gui::getAnyItem: support viewscreen_assign_display_itemst

develop
lethosor 2017-12-28 16:19:45 -05:00
parent a3a0ed03a3
commit fde1e284f4
2 changed files with 11 additions and 1 deletions

@ -74,6 +74,7 @@ using namespace DFHack;
#include "df/ui_unit_view_mode.h"
#include "df/unit.h"
#include "df/unit_inventory_item.h"
#include "df/viewscreen_assign_display_itemst.h"
#include "df/viewscreen_buildinglistst.h"
#include "df/viewscreen_dungeon_monsterstatusst.h"
#include "df/viewscreen_dungeonmodest.h"
@ -1042,6 +1043,15 @@ df::item *Gui::getAnyItem(df::viewscreen *top)
return NULL;
}
if (VIRTUAL_CAST_VAR(screen, df::viewscreen_assign_display_itemst, top))
{
if (screen->sel_column == df::viewscreen_assign_display_itemst::T_sel_column::Items)
return vector_get(screen->items[screen->item_type[screen->sel_type]],
screen->sel_item);
return NULL;
}
if (auto dfscreen = dfhack_viewscreen::try_cast(top))
return dfscreen->getSelectedItem();

@ -1 +1 @@
Subproject commit 301807985eefb4db88416a0f5a7f7b94aadfb667
Subproject commit 1297be0141c7116e677e19a9ddcad296ae31de7d