resume: use uicommon and draw to map

develop
lethosor 2017-06-01 16:19:11 -04:00
parent d41ff4e836
commit 044b3a0789
1 changed files with 3 additions and 25 deletions

@ -27,6 +27,8 @@
#include "modules/World.h"
#include "uicommon.h"
using std::map;
using std::string;
using std::vector;
@ -50,30 +52,6 @@ DFhackCExport command_result plugin_shutdown ( color_ostream &out )
return CR_OK;
}
template <class T, typename Fn>
static void for_each_(vector<T> &v, Fn func)
{
for_each(v.begin(), v.end(), func);
}
template <class T, class V, typename Fn>
static void transform_(vector<T> &src, vector<V> &dst, Fn func)
{
transform(src.begin(), src.end(), back_inserter(dst), func);
}
void OutputString(int8_t color, int &x, int &y, const std::string &text, bool newline = false, int left_margin = 0)
{
Screen::paintString(Screen::Pen(' ', color, 0), x, y, text);
if (newline)
{
++y;
x = left_margin;
}
else
x += text.length();
}
df::job *get_suspended_job(df::building *bld)
{
if (bld->getBuildStage() != 0)
@ -168,7 +146,7 @@ void show_suspended_buildings()
else if (sb->was_resumed)
color = COLOR_RED;
OutputString(color, x, y, "X");
OutputString(color, x, y, "X", false, 0, 0, true /* map */);
}
sb++;