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]; auto item = ui_look_list->items[i];
if (item->type == df::ui_look_list::T_items::Building && 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); vector_erase_at(ui_look_list->items, i);
delete item; 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 (auto item = vector_get(ui_look_list->items, *ui_look_cursor))
{ {
if (item->type == df::ui_look_list::T_items::Unit) 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) 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 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 return df::unit::find(corpsepiece->unit_id); // loo(k) at corpse piece
} }
else if (item->type == df::ui_look_list::T_items::Spatter) 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); auto item = vector_get(ui_look_list->items, *ui_look_cursor);
if (item && item->type == df::ui_look_list::T_items::Item) if (item && item->type == df::ui_look_list::T_items::Item)
return item->item; return item->data.Item;
else else
return NULL; return NULL;
} }
@ -1266,7 +1266,7 @@ df::building *Gui::getAnyBuilding(df::viewscreen *top)
auto item = vector_get(ui_look_list->items, *ui_look_cursor); auto item = vector_get(ui_look_list->items, *ui_look_cursor);
if (item && item->type == df::ui_look_list::T_items::Building) if (item && item->type == df::ui_look_list::T_items::Building)
return item->building; return item->data.Building;
else else
return NULL; return NULL;
} }

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

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

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