mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-01-17 22:55:38 +00:00
Renamed/moved maximum scraper results constant to be used in scraper
This commit is contained in:
parent
51e797bbd0
commit
57eb9849ff
|
@ -4,10 +4,8 @@
|
|||
#include "../scrapers/Scraper.h"
|
||||
#include "../Settings.h"
|
||||
|
||||
#define RESULT_COUNT 5
|
||||
|
||||
GuiGameScraper::GuiGameScraper(Window* window, ScraperSearchParams params, std::function<void(MetaDataList)> doneFunc, std::function<void()> skipFunc) : GuiComponent(window),
|
||||
mList(window, Eigen::Vector2i(2, 7 + RESULT_COUNT)),
|
||||
mList(window, Eigen::Vector2i(2, 7 + MAX_SCRAPER_RESULTS)),
|
||||
mBox(window, ":/frame.png"),
|
||||
mHeader(window, params.game->getBaseName(), Font::get(*window->getResourceManager(), Font::getDefaultPath(), FONT_SIZE_MEDIUM)),
|
||||
mResultName(window, "", Font::get(*window->getResourceManager(), Font::getDefaultPath(), FONT_SIZE_MEDIUM)),
|
||||
|
@ -78,8 +76,8 @@ GuiGameScraper::GuiGameScraper(Window* window, ScraperSearchParams params, std::
|
|||
//y = 5 is a spacer row
|
||||
|
||||
std::shared_ptr<Font> font = Font::get(*window->getResourceManager(), Font::getDefaultPath(), FONT_SIZE_SMALL);
|
||||
mResultNames.reserve(RESULT_COUNT);
|
||||
for(int i = 0; i < RESULT_COUNT; i ++)
|
||||
mResultNames.reserve(MAX_SCRAPER_RESULTS);
|
||||
for(int i = 0; i < MAX_SCRAPER_RESULTS; i ++)
|
||||
{
|
||||
mResultNames.push_back(TextComponent(mWindow, "RESULT...", font));
|
||||
mResultNames.at(i).setColor(0x111111FF);
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
#include "../HttpReq.h"
|
||||
#include "ImageComponent.h"
|
||||
|
||||
#define MAX_SCRAPER_RESULTS 5
|
||||
|
||||
class GuiGameScraper : public GuiComponent
|
||||
{
|
||||
public:
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#include "GamesDBScraper.h"
|
||||
#include "../components/GuiGameScraper.h"
|
||||
#include "../components/AsyncReqComponent.h"
|
||||
#include "../Log.h"
|
||||
#include "../pugiXML/pugixml.hpp"
|
||||
|
@ -49,7 +50,7 @@ std::vector<MetaDataList> GamesDBScraper::parseReq(ScraperSearchParams params, s
|
|||
|
||||
unsigned int resultNum = 0;
|
||||
pugi::xml_node game = data.child("Game");
|
||||
while(game && resultNum < 5)
|
||||
while(game && resultNum < MAX_SCRAPER_RESULTS)
|
||||
{
|
||||
mdl.push_back(MetaDataList(params.system->getGameMDD()));
|
||||
mdl.back().set("name", game.child("GameTitle").text().get());
|
||||
|
|
Loading…
Reference in a new issue