// SPDX-License-Identifier: MIT // // ES-DE Frontend // GuiOfflineGenerator.h // // User interface for the miximage offline generator. // Calls MiximageGenerator to do the actual work. // #ifndef ES_APP_GUIS_GUI_OFFLINE_GENERATOR_H #define ES_APP_GUIS_GUI_OFFLINE_GENERATOR_H #include "GuiComponent.h" #include "MiximageGenerator.h" #include "components/ButtonComponent.h" #include "components/ComponentGrid.h" #include "views/ViewController.h" #include class TextComponent; class GuiOfflineGenerator : public GuiComponent { public: GuiOfflineGenerator(const std::queue& gameQueue); ~GuiOfflineGenerator(); private: void onSizeChanged() override; void update(int deltaTime) override; std::vector getHelpPrompts() override; HelpStyle getHelpStyle() override { return ViewController::getInstance()->getViewHelpStyle(); } std::queue mGameQueue; std::unique_ptr mMiximageGenerator; std::thread mMiximageGeneratorThread; std::promise mGeneratorPromise; std::future mGeneratorFuture; FileData* mGame; bool mProcessing; bool mPaused; bool mOverwriting; std::string mResultMessage; unsigned int mTotalGames; unsigned int mGamesProcessed; unsigned int mImagesGenerated; unsigned int mImagesOverwritten; unsigned int mGamesSkipped; unsigned int mGamesFailed; Renderer* mRenderer; NinePatchComponent mBackground; ComponentGrid mGrid; std::shared_ptr mTitle; std::shared_ptr mStatus; std::shared_ptr mGameCounter; std::shared_ptr mGeneratedLbl; std::shared_ptr mGeneratedVal; std::shared_ptr mOverwrittenLbl; std::shared_ptr mOverwrittenVal; std::shared_ptr mSkippedLbl; std::shared_ptr mSkippedVal; std::shared_ptr mFailedLbl; std::shared_ptr mFailedVal; std::shared_ptr mProcessingLbl; std::shared_ptr mProcessingVal; std::string mGameName; std::shared_ptr mLastErrorLbl; std::shared_ptr mLastErrorVal; std::shared_ptr mButtonGrid; std::shared_ptr mStartPauseButton; std::shared_ptr mCloseButton; }; #endif // ES_APP_GUIS_GUI_OFFLINE_GENERATOR_H