Merge pull request #289 from eswald/trade-search

Moving trade screen search lines
develop
Quietust 2014-08-28 14:54:00 -05:00
commit f0c52a9a73
2 changed files with 17 additions and 13 deletions

@ -489,15 +489,19 @@ struct tradeview_hook : public df::viewscreen_tradegoodsst
DEFINE_VMETHOD_INTERPOSE(void, render, ())
{
INTERPOSE_NEXT(render)();
// 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();
int y = dim.y - 5;
int x = 2;
int y = 27;
OutputHotkeyString(x, y, "Mark all", "m", true, 2);
OutputHotkeyString(x, y, "Unmark all", "u");
OutputHotkeyString(x, y, "Mark all, ", "m", false, x, COLOR_WHITE, COLOR_LIGHTRED);
OutputHotkeyString(x, y, "Unmark all", "u", false, x, COLOR_WHITE, COLOR_LIGHTRED);
x = 42;
y = 27;
OutputHotkeyString(x, y, "Mark all", "Shift-m", true, 42);
OutputHotkeyString(x, y, "Unmark all", "Shift-u");
OutputHotkeyString(x, y, "Mark all, ", "M", false, x, COLOR_WHITE, COLOR_LIGHTRED);
OutputHotkeyString(x, y, "Unmark all", "U", false, x, COLOR_WHITE, COLOR_LIGHTRED);
}
};

@ -693,10 +693,10 @@ template <class T, class V, int D> V generic_search_hook<T, V, D> ::module;
// Hook definition helpers
#define IMPLEMENT_HOOKS_WITH_ID(screen, module, id) \
#define IMPLEMENT_HOOKS_WITH_ID(screen, module, id, prio) \
typedef generic_search_hook<screen, module, id> module##_hook; \
template<> IMPLEMENT_VMETHOD_INTERPOSE(module##_hook, feed); \
template<> IMPLEMENT_VMETHOD_INTERPOSE(module##_hook, render)
template<> IMPLEMENT_VMETHOD_INTERPOSE_PRIO(module##_hook, feed, prio); \
template<> IMPLEMENT_VMETHOD_INTERPOSE_PRIO(module##_hook, render, prio)
#define IMPLEMENT_HOOKS(screen, module) \
typedef generic_search_hook<screen, module> module##_hook; \
@ -1074,7 +1074,7 @@ class trade_search_merc : public trade_search_base
public:
virtual void render() const
{
print_search_option(2, 26);
print_search_option(2, -1);
if (!search_string.empty())
{
@ -1108,7 +1108,7 @@ private:
}
};
IMPLEMENT_HOOKS_WITH_ID(df::viewscreen_tradegoodsst, trade_search_merc, 1);
IMPLEMENT_HOOKS_WITH_ID(df::viewscreen_tradegoodsst, trade_search_merc, 1, 100);
class trade_search_fort : public trade_search_base
@ -1116,7 +1116,7 @@ class trade_search_fort : public trade_search_base
public:
virtual void render() const
{
print_search_option(42, 26);
print_search_option(42, -1);
if (!search_string.empty())
{
@ -1150,7 +1150,7 @@ private:
}
};
IMPLEMENT_HOOKS_WITH_ID(df::viewscreen_tradegoodsst, trade_search_fort, 2);
IMPLEMENT_HOOKS_WITH_ID(df::viewscreen_tradegoodsst, trade_search_fort, 2, 100);
//
// END: Trade screen search