From 7a74088287ed94517b30e6e9eadfef908da20043 Mon Sep 17 00:00:00 2001 From: Alexander Gavrilov Date: Sat, 29 Sep 2012 13:01:11 +0400 Subject: [PATCH] Make backspace seek to top left corner in manipulator. --- plugins/manipulator.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/plugins/manipulator.cpp b/plugins/manipulator.cpp index feceb08ec..164b13dd7 100644 --- a/plugins/manipulator.cpp +++ b/plugins/manipulator.cpp @@ -385,7 +385,11 @@ viewscreen_unitlaborsst::viewscreen_unitlaborsst(vector &src, int cur { df::unit *unit = src[i]; if (!unit) + { + if (cursor_pos > i) + cursor_pos--; continue; + } UnitInfo *cur = new UnitInfo; @@ -628,6 +632,9 @@ void viewscreen_unitlaborsst::feed(set *events) sel_row = units.size() - 1; } + if (events->count(interface_key::STRING_A000)) + sel_row = 0; + if (sel_row < first_row) first_row = sel_row; if (first_row < sel_row - num_rows + 1) @@ -661,6 +668,9 @@ void viewscreen_unitlaborsst::feed(set *events) sel_column = next; } + if (events->count(interface_key::STRING_A000)) + sel_column = 0; + if (sel_column < 0) sel_column = 0; if (sel_column > NUM_COLUMNS - 1)