Switching fast-trade Shift-Up to move before marking

This makes it undo Shift-Down, instead of mirroring it, which works much better when you've gone too far down the list.
develop
Eric Wald 2014-11-06 23:06:17 -07:00
parent 308e95defe
commit 8ac9748700
1 changed files with 14 additions and 9 deletions

@ -14,9 +14,9 @@ struct fast_trade_assign_hook : df::viewscreen_layer_assigntradest {
} }
else if (layer_objects[1]->active && input->count(interface_key::CURSOR_UP_FAST)) else if (layer_objects[1]->active && input->count(interface_key::CURSOR_UP_FAST))
{ {
set<df::interface_key> tmp; tmp.insert(interface_key::SELECT); set<df::interface_key> tmp; tmp.insert(interface_key::STANDARDSCROLL_UP);
INTERPOSE_NEXT(feed)(&tmp); INTERPOSE_NEXT(feed)(&tmp);
tmp.clear(); tmp.insert(interface_key::STANDARDSCROLL_UP); tmp.clear(); tmp.insert(interface_key::SELECT);
INTERPOSE_NEXT(feed)(&tmp); INTERPOSE_NEXT(feed)(&tmp);
} }
else else
@ -32,18 +32,23 @@ struct fast_trade_select_hook : df::viewscreen_tradegoodsst {
DEFINE_VMETHOD_INTERPOSE(void, feed, (set<df::interface_key> *input)) DEFINE_VMETHOD_INTERPOSE(void, feed, (set<df::interface_key> *input))
{ {
if (!(is_unloading || !has_traders || in_edit_count) if (!(is_unloading || !has_traders || in_edit_count)
&& (input->count(interface_key::CURSOR_DOWN_FAST) || input->count(interface_key::CURSOR_UP_FAST))) && input->count(interface_key::CURSOR_DOWN_FAST))
{ {
set<df::interface_key> tmp; tmp.insert(interface_key::SELECT); set<df::interface_key> tmp; tmp.insert(interface_key::SELECT);
INTERPOSE_NEXT(feed)(&tmp); INTERPOSE_NEXT(feed)(&tmp);
if (in_edit_count) if (in_edit_count)
INTERPOSE_NEXT(feed)(&tmp); INTERPOSE_NEXT(feed)(&tmp);
tmp.clear(); tmp.clear(); tmp.insert(interface_key::STANDARDSCROLL_DOWN);
if (input->count(interface_key::CURSOR_DOWN_FAST)) { INTERPOSE_NEXT(feed)(&tmp);
tmp.insert(interface_key::STANDARDSCROLL_DOWN);
} else if (input->count(interface_key::CURSOR_UP_FAST)) {
tmp.insert(interface_key::STANDARDSCROLL_UP);
} }
else if (!(is_unloading || !has_traders || in_edit_count)
&& input->count(interface_key::CURSOR_UP_FAST))
{
set<df::interface_key> tmp; tmp.insert(interface_key::STANDARDSCROLL_UP);
INTERPOSE_NEXT(feed)(&tmp);
tmp.clear(); tmp.insert(interface_key::SELECT);
INTERPOSE_NEXT(feed)(&tmp);
if (in_edit_count)
INTERPOSE_NEXT(feed)(&tmp); INTERPOSE_NEXT(feed)(&tmp);
} }
else else