Update tweak condition-material with new field names

dfhack/df-structures#236
develop
lethosor 2018-01-10 19:52:35 -05:00
parent e35e2d389c
commit 2782008b42
2 changed files with 11 additions and 11 deletions

@ -1 +1 @@
Subproject commit 7e23a328fd81e3d6db794c0c18b8b2e7bd235649 Subproject commit 15a89230cace8f7cc1b90de63c7f2b44a9c77481

@ -8,8 +8,8 @@ struct condition_material_hook : df::viewscreen_workquota_conditionst {
struct T_order_mat_data { struct T_order_mat_data {
std::vector<std::string*> list_entries; std::vector<std::string*> list_entries;
std::vector<int16_t> list_unk1; std::vector<int16_t> mat_types;
std::vector<int32_t> list_unk2; std::vector<int32_t> mat_indices;
std::vector<int16_t> list_unk3; std::vector<int16_t> list_unk3;
std::vector<int16_t> list_visible; std::vector<int16_t> list_visible;
}; };
@ -24,8 +24,8 @@ struct condition_material_hook : df::viewscreen_workquota_conditionst {
} }
auto data = new T_order_mat_data; auto data = new T_order_mat_data;
data->list_entries = scr->list_entries; data->list_entries = scr->list_entries;
data->list_unk1 = scr->list_unk1; data->mat_types = scr->mat_types;
data->list_unk2 = scr->list_unk2; data->mat_indices = scr->mat_indices;
data->list_unk3 = scr->list_unk3; data->list_unk3 = scr->list_unk3;
data->list_visible = scr->list_visible; data->list_visible = scr->list_visible;
order_mat_data[scr] = data; order_mat_data[scr] = data;
@ -37,8 +37,8 @@ struct condition_material_hook : df::viewscreen_workquota_conditionst {
{ {
T_order_mat_data *data = order_mat_data[scr]; T_order_mat_data *data = order_mat_data[scr];
scr->list_entries = data->list_entries; scr->list_entries = data->list_entries;
scr->list_unk1 = data->list_unk1; scr->mat_types = data->mat_types;
scr->list_unk2 = data->list_unk2; scr->mat_indices = data->mat_indices;
scr->list_unk3 = data->list_unk3; scr->list_unk3 = data->list_unk3;
scr->list_visible = data->list_visible; scr->list_visible = data->list_visible;
delete data; delete data;
@ -55,8 +55,8 @@ struct condition_material_hook : df::viewscreen_workquota_conditionst {
// keep the first item ("no material") around, because attempts to delete it // keep the first item ("no material") around, because attempts to delete it
// result in it still being displayed first, regardless of list_entries[0] // result in it still being displayed first, regardless of list_entries[0]
list_entries.resize(1); list_entries.resize(1);
list_unk1.resize(1); mat_types.resize(1);
list_unk2.resize(1); mat_indices.resize(1);
list_unk3.resize(1); list_unk3.resize(1);
list_visible.resize(1); list_visible.resize(1);
// skip "no material" here // skip "no material" here
@ -71,8 +71,8 @@ struct condition_material_hook : df::viewscreen_workquota_conditionst {
if (s->find(filter) != std::string::npos) if (s->find(filter) != std::string::npos)
{ {
list_entries.push_back(data->list_entries[i]); list_entries.push_back(data->list_entries[i]);
list_unk1.push_back(data->list_unk1[i]); mat_types.push_back(data->mat_types[i]);
list_unk2.push_back(data->list_unk2[i]); mat_indices.push_back(data->mat_indices[i]);
list_unk3.push_back(data->list_unk3[i]); list_unk3.push_back(data->list_unk3[i]);
// this should be small enough to fit in an int16_t // this should be small enough to fit in an int16_t
list_visible.push_back(int16_t(list_entries.size() - 1)); list_visible.push_back(int16_t(list_entries.size() - 1));