2013-10-13 19:07:48 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "../GuiComponent.h"
|
2014-03-01 00:52:32 +00:00
|
|
|
#include "../components/NinePatchComponent.h"
|
2013-10-13 19:07:48 +00:00
|
|
|
#include "../scrapers/Scraper.h"
|
2014-03-01 00:52:32 +00:00
|
|
|
#include "../components/TextComponent.h"
|
|
|
|
|
|
|
|
#include <queue>
|
2013-10-13 19:07:48 +00:00
|
|
|
#include <boost/circular_buffer.hpp>
|
|
|
|
|
2013-10-16 22:05:02 +00:00
|
|
|
//A "terminal" of sorts for scraping.
|
|
|
|
//Doesn't accept input, but renders log-style messages and handles the callback chain for multi-game scraping.
|
2013-10-13 19:07:48 +00:00
|
|
|
class GuiScraperLog : public GuiComponent
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
GuiScraperLog(Window* window, const std::queue<ScraperSearchParams>& params, bool manualMode);
|
2013-10-13 21:40:36 +00:00
|
|
|
~GuiScraperLog();
|
2013-10-13 19:07:48 +00:00
|
|
|
|
|
|
|
void start();
|
|
|
|
|
|
|
|
void render(const Eigen::Affine3f& parentTrans) override;
|
|
|
|
bool input(InputConfig* config, Input input) override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
void updateStatus();
|
|
|
|
void writeLine(const std::string& line, unsigned int color);
|
|
|
|
|
|
|
|
void resultFetched(ScraperSearchParams params, MetaDataList mdl);
|
|
|
|
void resultResolved(ScraperSearchParams params, MetaDataList mdl);
|
|
|
|
void resultEmpty(ScraperSearchParams params);
|
|
|
|
|
|
|
|
void next();
|
|
|
|
void done();
|
|
|
|
|
|
|
|
bool mManualMode;
|
|
|
|
|
|
|
|
NinePatchComponent mBox;
|
|
|
|
|
|
|
|
std::queue<ScraperSearchParams> mSearches;
|
|
|
|
|
|
|
|
TextComponent mStatus;
|
|
|
|
boost::circular_buffer< std::shared_ptr<TextComponent> > mTextLines;
|
2013-10-13 21:40:36 +00:00
|
|
|
|
|
|
|
unsigned int mSuccessCount;
|
|
|
|
unsigned int mSkippedCount;
|
2013-10-13 19:07:48 +00:00
|
|
|
};
|