#pragma once #include "../GuiComponent.h" #include "../scrapers/Scraper.h" #include "ComponentListComponent.h" #include "TextComponent.h" #include "ScrollableContainer.h" #include "TextEditComponent.h" #include "NinePatchComponent.h" #include "../Settings.h" #include "../HttpReq.h" #include "ImageComponent.h" class GuiGameScraper : public GuiComponent { public: GuiGameScraper(Window* window, ScraperSearchParams params, std::function doneFunc, std::function skipFunc = NULL); bool input(InputConfig* config, Input input) override; void update(int deltaTime) override; void search(); private: int getSelectedIndex(); void onSearchDone(std::vector results); void updateThumbnail(); ComponentListComponent mList; NinePatchComponent mBox; TextComponent mHeader; TextComponent mResultName; ScrollableContainer mResultInfo; TextComponent mResultDesc; ImageComponent mResultThumbnail; TextComponent mSearchLabel; TextEditComponent mSearchText; std::vector mResultNames; ScraperSearchParams mSearchParams; std::vector mScraperResults; std::function mDoneFunc; std::function mSkipFunc; std::unique_ptr mThumbnailReq; };