Removing new trade hotkeys while a counteroffer is displayed.

Fixes http://www.bay12forums.com/smf/index.php?topic=126076.1140
It's tempting to use has_offer for this effect, but that flag remains true after hitting Enter to consider the offer.
Relies on a structure update: https://github.com/DFHack/df-structures/pull/18
develop
Eric Wald 2014-09-04 21:08:46 -06:00
parent 6d9d616fff
commit aaa8a829d1
2 changed files with 23 additions and 0 deletions

@ -481,6 +481,13 @@ struct tradeview_hook : public df::viewscreen_tradegoodsst
{
INTERPOSE_NEXT(render)();
if (counteroffer.size() > 0)
{
// The merchant is proposing a counteroffer,
// so there is nothing to mark.
return;
}
// Insert into the blank line between trade items and standard keys.
// The blank line at the bottom is taken by the search plugin.
auto dim = Screen::getWindowSize();

@ -1074,6 +1074,14 @@ class trade_search_merc : public trade_search_base
public:
virtual void render() const
{
if (viewscreen->counteroffer.size() > 0)
{
// The merchant is proposing a counteroffer.
// Not only is there nothing to search,
// but the native hotkeys are where we normally write.
return;
}
print_search_option(2, -1);
if (!search_string.empty())
@ -1116,6 +1124,14 @@ class trade_search_fort : public trade_search_base
public:
virtual void render() const
{
if (viewscreen->counteroffer.size() > 0)
{
// The merchant is proposing a counteroffer.
// Not only is there nothing to search,
// but the native hotkeys are where we normally write.
return;
}
print_search_option(42, -1);
if (!search_string.empty())