name ui_look_list union

update scripts and structures
develop
Ben Lubar 2020-03-06 16:06:27 -06:00
parent fa574cfbec
commit 635e709d95
No known key found for this signature in database
GPG Key ID: 92939677AB59EDA4
5 changed files with 14 additions and 14 deletions

@ -1162,7 +1162,7 @@ bool Buildings::deconstruct(df::building *bld)
{
auto item = ui_look_list->items[i];
if (item->type == df::ui_look_list::T_items::Building &&
item->building == bld)
item->data.Building == bld)
{
vector_erase_at(ui_look_list->items, i);
delete item;

@ -1064,12 +1064,12 @@ df::unit *Gui::getAnyUnit(df::viewscreen *top)
if (auto item = vector_get(ui_look_list->items, *ui_look_cursor))
{
if (item->type == df::ui_look_list::T_items::Unit)
return item->unit;
return item->data.Unit;
else if (item->type == df::ui_look_list::T_items::Item)
{
if (VIRTUAL_CAST_VAR(corpse, df::item_corpsest, item->item))
if (VIRTUAL_CAST_VAR(corpse, df::item_corpsest, item->data.Item))
return df::unit::find(corpse->unit_id); // loo(k) at corpse
else if (VIRTUAL_CAST_VAR(corpsepiece, df::item_corpsepiecest, item->item))
else if (VIRTUAL_CAST_VAR(corpsepiece, df::item_corpsepiecest, item->data.Item))
return df::unit::find(corpsepiece->unit_id); // loo(k) at corpse piece
}
else if (item->type == df::ui_look_list::T_items::Spatter)
@ -1201,7 +1201,7 @@ df::item *Gui::getAnyItem(df::viewscreen *top)
auto item = vector_get(ui_look_list->items, *ui_look_cursor);
if (item && item->type == df::ui_look_list::T_items::Item)
return item->item;
return item->data.Item;
else
return NULL;
}
@ -1266,7 +1266,7 @@ df::building *Gui::getAnyBuilding(df::viewscreen *top)
auto item = vector_get(ui_look_list->items, *ui_look_cursor);
if (item && item->type == df::ui_look_list::T_items::Building)
return item->building;
return item->data.Building;
else
return NULL;
}

@ -1 +1 @@
Subproject commit 167d54bf7c0e01a71ffb2de548701adc93da9dad
Subproject commit 23e66dc0d44287a63fd918bbb81681510850c37d

@ -1822,16 +1822,16 @@ public:
switch (element->type)
{
case elt_type::Item:
if (element->item)
desc = Items::getDescription(element->item, 0, true);
if (element->data.Item)
desc = Items::getDescription(element->data.Item, 0, true);
break;
case elt_type::Unit:
if (element->unit)
desc = get_unit_description(element->unit);
if (element->data.Unit)
desc = get_unit_description(element->data.Unit);
break;
case elt_type::Building:
if (element->building)
element->building->getName(&desc);
if (element->data.Building)
element->data.Building->getName(&desc);
break;
default:
break;

@ -1 +1 @@
Subproject commit 7bab11642bee7a3aa05d69332466f2ea5eaa1a2d
Subproject commit f19655a4fc7cb89391cb484d04ba1dff81a11d6d