From a14f31fbfe0b61a6a91fbc3d8aec44ff3ae2ee50 Mon Sep 17 00:00:00 2001 From: Anuradha Dissanayake Date: Sat, 3 May 2014 11:44:35 +1200 Subject: [PATCH] Show box select dimensions in Automaterial --- plugins/automaterial.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/plugins/automaterial.cpp b/plugins/automaterial.cpp index 825e69b01..b8021aaf2 100644 --- a/plugins/automaterial.cpp +++ b/plugins/automaterial.cpp @@ -735,7 +735,7 @@ struct jobutils_hook : public df::viewscreen_dwarfmodest MaterialDescriptor material = get_material_in_list(ui_build_selector->sel_index); if (material.valid) { - if (input->count(interface_key::SELECT) || input->count(interface_key::SEC_SELECT)) + if (input->count(interface_key::SELECT) || input->count(interface_key::SELECT_ALL)) { if (get_last_moved_material().matches(material)) last_used_moved = false; //Keep selected material on top @@ -749,7 +749,7 @@ struct jobutils_hook : public df::viewscreen_dwarfmodest gen_material.push_back(get_material_in_list(curr_index)); box_select_materials.clear(); // Populate material list with selected material - populate_box_materials(gen_material, ((input->count(interface_key::SEC_SELECT) && ui_build_selector->is_grouped) ? -1 : 1)); + populate_box_materials(gen_material, ((input->count(interface_key::SELECT_ALL) && ui_build_selector->is_grouped) ? -1 : 1)); input->clear(); // Let the apply_box_selection routine allocate the construction input->insert(interface_key::LEAVESCREEN); @@ -1162,6 +1162,15 @@ struct jobutils_hook : public df::viewscreen_dwarfmodest case SELECT_SECOND: OutputString(COLOR_GREEN, x, y, "Choose second corner", true, left_margin); + + int32_t curr_x, curr_y, curr_z; + Gui::getCursorCoords(curr_x, curr_y, curr_z); + int dX = abs(box_first.x - curr_x) + 1; + int dY = abs(box_first.y - curr_y) + 1; + stringstream label; + label << "Selection: " << dX << "x" << dY; + OutputString(COLOR_WHITE, x, ++y, label.str(), true, left_margin); + int cx = box_first.x; int cy = box_first.y; OutputString(COLOR_BROWN, cx, cy, "X");