2020-09-21 17:17:34 +00:00
|
|
|
// SPDX-License-Identifier: MIT
|
2020-05-26 16:34:33 +00:00
|
|
|
//
|
2020-09-21 17:17:34 +00:00
|
|
|
// EmulationStation Desktop Edition
|
2020-06-21 12:25:28 +00:00
|
|
|
// GuiMetaDataEd.h
|
2020-05-26 16:34:33 +00:00
|
|
|
//
|
2020-06-21 12:25:28 +00:00
|
|
|
// Game metadata edit user interface.
|
|
|
|
// This interface is triggered from the GuiGamelistOptions menu.
|
2021-08-09 14:47:36 +00:00
|
|
|
// The scraping interface is handled by GuiGameScraper which calls GuiScraperSearch.
|
2020-05-26 16:34:33 +00:00
|
|
|
//
|
|
|
|
|
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
|
|
|
|
2021-07-07 18:03:42 +00:00
|
|
|
#include "GuiComponent.h"
|
|
|
|
#include "MetaData.h"
|
2021-10-23 18:28:07 +00:00
|
|
|
#include "components/BadgeComponent.h"
|
2017-11-01 22:21:10 +00:00
|
|
|
#include "components/ComponentGrid.h"
|
|
|
|
#include "components/NinePatchComponent.h"
|
2021-10-10 16:15:37 +00:00
|
|
|
#include "components/ScrollIndicatorComponent.h"
|
2021-09-04 09:21:55 +00:00
|
|
|
#include "guis/GuiSettings.h"
|
2017-11-01 22:21:10 +00:00
|
|
|
#include "scrapers/Scraper.h"
|
2014-06-25 16:29:58 +00:00
|
|
|
|
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:
|
2021-07-07 18:03:42 +00:00
|
|
|
GuiMetaDataEd(Window* window,
|
|
|
|
MetaDataList* md,
|
|
|
|
const std::vector<MetaDataDecl>& mdd,
|
|
|
|
ScraperSearchParams params,
|
|
|
|
std::function<void()> savedCallback,
|
|
|
|
std::function<void()> clearGameFunc,
|
|
|
|
std::function<void()> deleteGameFunc);
|
2019-08-25 15:23:02 +00:00
|
|
|
|
2020-06-21 12:25:28 +00:00
|
|
|
bool input(InputConfig* config, Input input) override;
|
|
|
|
void onSizeChanged() override;
|
2020-06-07 18:09:02 +00:00
|
|
|
|
2020-06-21 12:25:28 +00:00
|
|
|
virtual std::vector<HelpPrompt> getHelpPrompts() override;
|
|
|
|
HelpStyle getHelpStyle() override;
|
2014-06-25 16:29:58 +00:00
|
|
|
|
|
|
|
private:
|
2020-06-21 12:25:28 +00:00
|
|
|
void save();
|
|
|
|
void fetch();
|
|
|
|
void fetchDone(const ScraperSearchResult& result);
|
|
|
|
void close();
|
2014-06-25 16:29:58 +00:00
|
|
|
|
2020-06-21 12:25:28 +00:00
|
|
|
NinePatchComponent mBackground;
|
|
|
|
ComponentGrid mGrid;
|
2019-08-25 15:23:02 +00:00
|
|
|
|
2020-06-21 12:25:28 +00:00
|
|
|
std::shared_ptr<TextComponent> mTitle;
|
2021-10-10 16:15:37 +00:00
|
|
|
std::shared_ptr<ImageComponent> mScrollUp;
|
|
|
|
std::shared_ptr<ImageComponent> mScrollDown;
|
|
|
|
std::shared_ptr<ScrollIndicatorComponent> mScrollIndicator;
|
2020-06-21 12:25:28 +00:00
|
|
|
std::shared_ptr<TextComponent> mSubtitle;
|
|
|
|
std::shared_ptr<ComponentGrid> mHeaderGrid;
|
|
|
|
std::shared_ptr<ComponentList> mList;
|
|
|
|
std::shared_ptr<ComponentGrid> mButtons;
|
2014-06-25 16:29:58 +00:00
|
|
|
|
2020-06-21 12:25:28 +00:00
|
|
|
ScraperSearchParams mScraperParams;
|
2014-06-25 16:29:58 +00:00
|
|
|
|
2021-10-23 20:49:34 +00:00
|
|
|
std::vector<GameControllers> mControllerBadges;
|
2020-07-15 15:44:27 +00:00
|
|
|
std::vector<std::shared_ptr<GuiComponent>> mEditors;
|
2014-06-25 16:29:58 +00:00
|
|
|
|
2020-06-21 12:25:28 +00:00
|
|
|
std::vector<MetaDataDecl> mMetaDataDecl;
|
|
|
|
MetaDataList* mMetaData;
|
|
|
|
std::function<void()> mSavedCallback;
|
2020-09-27 08:41:00 +00:00
|
|
|
std::function<void()> mClearGameFunc;
|
2020-07-30 18:05:57 +00:00
|
|
|
std::function<void()> mDeleteGameFunc;
|
2020-06-06 11:10:33 +00:00
|
|
|
|
2020-07-13 18:10:09 +00:00
|
|
|
bool mMediaFilesUpdated;
|
2021-12-02 16:34:30 +00:00
|
|
|
bool mSavedMediaAndAborted;
|
2021-09-04 09:21:55 +00:00
|
|
|
bool mInvalidEmulatorEntry;
|
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
|