2020-05-26 16:34:33 +00:00
|
|
|
//
|
|
|
|
// GuiMetaDataEd.h
|
|
|
|
//
|
|
|
|
// Game metadata edit user interface.
|
|
|
|
// This interface is triggered from the GuiGamelistOptions menu.
|
|
|
|
// The scraping interface is handled by GuiGameScraper which calls
|
2020-06-06 12:14:13 +00:00
|
|
|
// GuiScraperSearch.
|
2020-05-26 16:34:33 +00:00
|
|
|
//
|
|
|
|
|
2014-06-25 16:29:58 +00:00
|
|
|
#pragma once
|
2017-10-31 17:12:50 +00:00
|
|
|
#ifndef ES_APP_GUIS_GUI_META_DATA_ED_H
|
|
|
|
#define ES_APP_GUIS_GUI_META_DATA_ED_H
|
2014-06-25 16:29:58 +00:00
|
|
|
|
2017-11-01 22:21:10 +00:00
|
|
|
#include "components/ComponentGrid.h"
|
|
|
|
#include "components/NinePatchComponent.h"
|
|
|
|
#include "scrapers/Scraper.h"
|
2014-06-25 16:29:58 +00:00
|
|
|
#include "GuiComponent.h"
|
|
|
|
#include "MetaData.h"
|
|
|
|
|
2017-11-01 22:21:10 +00:00
|
|
|
class ComponentList;
|
|
|
|
class TextComponent;
|
2014-06-25 16:29:58 +00:00
|
|
|
|
|
|
|
class GuiMetaDataEd : public GuiComponent
|
|
|
|
{
|
|
|
|
public:
|
2020-05-26 16:34:33 +00:00
|
|
|
GuiMetaDataEd(
|
|
|
|
Window* window,
|
|
|
|
MetaDataList* md, const std::vector<MetaDataDecl>&mdd,
|
|
|
|
ScraperSearchParams params,
|
|
|
|
const std::string& header,
|
|
|
|
std::function<void()> savedCallback,
|
|
|
|
std::function<void()> deleteFunc);
|
2019-08-25 15:23:02 +00:00
|
|
|
|
2014-06-25 16:29:58 +00:00
|
|
|
bool input(InputConfig* config, Input input) override;
|
|
|
|
void onSizeChanged() override;
|
|
|
|
virtual std::vector<HelpPrompt> getHelpPrompts() override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
void save();
|
|
|
|
void fetch();
|
|
|
|
void fetchDone(const ScraperSearchResult& result);
|
|
|
|
void close(bool closeAllWindows);
|
|
|
|
|
|
|
|
NinePatchComponent mBackground;
|
|
|
|
ComponentGrid mGrid;
|
2019-08-25 15:23:02 +00:00
|
|
|
|
2014-06-25 16:29:58 +00:00
|
|
|
std::shared_ptr<TextComponent> mTitle;
|
|
|
|
std::shared_ptr<TextComponent> mSubtitle;
|
|
|
|
std::shared_ptr<ComponentGrid> mHeaderGrid;
|
|
|
|
std::shared_ptr<ComponentList> mList;
|
|
|
|
std::shared_ptr<ComponentGrid> mButtons;
|
|
|
|
|
|
|
|
ScraperSearchParams mScraperParams;
|
|
|
|
|
|
|
|
std::vector< std::shared_ptr<GuiComponent> > mEditors;
|
|
|
|
|
|
|
|
std::vector<MetaDataDecl> mMetaDataDecl;
|
|
|
|
MetaDataList* mMetaData;
|
|
|
|
std::function<void()> mSavedCallback;
|
|
|
|
std::function<void()> mDeleteFunc;
|
2020-06-06 11:10:33 +00:00
|
|
|
|
|
|
|
bool mMetadataUpdated;
|
2014-06-25 16:29:58 +00:00
|
|
|
};
|
2017-10-31 17:12:50 +00:00
|
|
|
|
|
|
|
#endif // ES_APP_GUIS_GUI_META_DATA_ED_H
|