2014-09-26 16:40:19 -06:00
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
struct fast_trade_assign_hook : df::viewscreen_layer_assigntradest {
|
|
|
|
typedef df::viewscreen_layer_assigntradest interpose_base;
|
|
|
|
|
|
|
|
DEFINE_VMETHOD_INTERPOSE(void, feed, (set<df::interface_key> *input))
|
|
|
|
{
|
2014-11-06 22:14:00 -07:00
|
|
|
if (layer_objects[1]->active && input->count(interface_key::CURSOR_DOWN_FAST))
|
2014-09-26 16:40:19 -06:00
|
|
|
{
|
|
|
|
set<df::interface_key> tmp; tmp.insert(interface_key::SELECT);
|
|
|
|
INTERPOSE_NEXT(feed)(&tmp);
|
|
|
|
tmp.clear(); tmp.insert(interface_key::STANDARDSCROLL_DOWN);
|
|
|
|
INTERPOSE_NEXT(feed)(&tmp);
|
|
|
|
}
|
2014-11-06 22:22:02 -07:00
|
|
|
else if (layer_objects[1]->active && input->count(interface_key::CURSOR_UP_FAST))
|
|
|
|
{
|
2014-11-06 23:06:17 -07:00
|
|
|
set<df::interface_key> tmp; tmp.insert(interface_key::STANDARDSCROLL_UP);
|
2014-11-06 22:22:02 -07:00
|
|
|
INTERPOSE_NEXT(feed)(&tmp);
|
2014-11-06 23:06:17 -07:00
|
|
|
tmp.clear(); tmp.insert(interface_key::SELECT);
|
2014-11-06 22:22:02 -07:00
|
|
|
INTERPOSE_NEXT(feed)(&tmp);
|
|
|
|
}
|
2014-09-26 16:40:19 -06:00
|
|
|
else
|
|
|
|
INTERPOSE_NEXT(feed)(input);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
IMPLEMENT_VMETHOD_INTERPOSE(fast_trade_assign_hook, feed);
|
|
|
|
|
|
|
|
struct fast_trade_select_hook : df::viewscreen_tradegoodsst {
|
|
|
|
typedef df::viewscreen_tradegoodsst interpose_base;
|
|
|
|
|
|
|
|
DEFINE_VMETHOD_INTERPOSE(void, feed, (set<df::interface_key> *input))
|
|
|
|
{
|
|
|
|
if (!(is_unloading || !has_traders || in_edit_count)
|
2014-11-06 23:06:17 -07:00
|
|
|
&& input->count(interface_key::CURSOR_DOWN_FAST))
|
2014-09-26 16:40:19 -06:00
|
|
|
{
|
|
|
|
set<df::interface_key> tmp; tmp.insert(interface_key::SELECT);
|
|
|
|
INTERPOSE_NEXT(feed)(&tmp);
|
|
|
|
if (in_edit_count)
|
|
|
|
INTERPOSE_NEXT(feed)(&tmp);
|
2014-11-06 23:06:17 -07:00
|
|
|
tmp.clear(); tmp.insert(interface_key::STANDARDSCROLL_DOWN);
|
|
|
|
INTERPOSE_NEXT(feed)(&tmp);
|
|
|
|
}
|
|
|
|
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);
|
2014-09-26 16:40:19 -06:00
|
|
|
INTERPOSE_NEXT(feed)(&tmp);
|
2014-11-06 23:06:17 -07:00
|
|
|
if (in_edit_count)
|
|
|
|
INTERPOSE_NEXT(feed)(&tmp);
|
2014-09-26 16:40:19 -06:00
|
|
|
}
|
|
|
|
else
|
|
|
|
INTERPOSE_NEXT(feed)(input);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
IMPLEMENT_VMETHOD_INTERPOSE(fast_trade_select_hook, feed);
|