From 46ebeaa7223c615fb7127e9435592cb794812f8c Mon Sep 17 00:00:00 2001 From: Eric Wald Date: Thu, 6 Nov 2014 22:22:02 -0700 Subject: [PATCH] Adding Shift-Up to the fast-trade tweak. --- plugins/tweak/tweaks/fast-trade.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/plugins/tweak/tweaks/fast-trade.h b/plugins/tweak/tweaks/fast-trade.h index a74b7ac81..85d99c8a8 100644 --- a/plugins/tweak/tweaks/fast-trade.h +++ b/plugins/tweak/tweaks/fast-trade.h @@ -12,6 +12,13 @@ struct fast_trade_assign_hook : df::viewscreen_layer_assigntradest { tmp.clear(); tmp.insert(interface_key::STANDARDSCROLL_DOWN); INTERPOSE_NEXT(feed)(&tmp); } + else if (layer_objects[1]->active && input->count(interface_key::CURSOR_UP_FAST)) + { + set tmp; tmp.insert(interface_key::SELECT); + INTERPOSE_NEXT(feed)(&tmp); + tmp.clear(); tmp.insert(interface_key::STANDARDSCROLL_UP); + INTERPOSE_NEXT(feed)(&tmp); + } else INTERPOSE_NEXT(feed)(input); } @@ -25,13 +32,18 @@ struct fast_trade_select_hook : df::viewscreen_tradegoodsst { DEFINE_VMETHOD_INTERPOSE(void, feed, (set *input)) { if (!(is_unloading || !has_traders || in_edit_count) - && input->count(interface_key::CURSOR_DOWN_FAST)) + && (input->count(interface_key::CURSOR_DOWN_FAST) || input->count(interface_key::CURSOR_UP_FAST))) { set tmp; tmp.insert(interface_key::SELECT); INTERPOSE_NEXT(feed)(&tmp); if (in_edit_count) INTERPOSE_NEXT(feed)(&tmp); - tmp.clear(); tmp.insert(interface_key::STANDARDSCROLL_DOWN); + tmp.clear(); + if (input->count(interface_key::CURSOR_DOWN_FAST)) { + tmp.insert(interface_key::STANDARDSCROLL_DOWN); + } else if (input->count(interface_key::CURSOR_UP_FAST)) { + tmp.insert(interface_key::STANDARDSCROLL_UP); + } INTERPOSE_NEXT(feed)(&tmp); } else