2013-08-18 14:16:11 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "../GuiComponent.h"
|
|
|
|
#include "ComponentListComponent.h"
|
|
|
|
#include "../MetaData.h"
|
|
|
|
#include "TextComponent.h"
|
|
|
|
#include "../GameData.h"
|
2013-08-23 02:41:40 +00:00
|
|
|
#include "NinePatchComponent.h"
|
2013-08-22 20:29:50 +00:00
|
|
|
#include "ButtonComponent.h"
|
2013-08-23 22:15:00 +00:00
|
|
|
#include <functional>
|
2013-09-17 21:50:49 +00:00
|
|
|
#include "../scrapers/Scraper.h"
|
2013-08-18 14:16:11 +00:00
|
|
|
|
2013-08-23 22:15:00 +00:00
|
|
|
class GuiMetaDataEd : public GuiComponent
|
2013-08-18 14:16:11 +00:00
|
|
|
{
|
|
|
|
public:
|
2013-09-17 21:50:49 +00:00
|
|
|
GuiMetaDataEd(Window* window, MetaDataList* md, const std::vector<MetaDataDecl>& mdd, ScraperSearchParams params,
|
2013-08-23 22:15:00 +00:00
|
|
|
const std::string& header, std::function<void()> savedCallback, std::function<void()> deleteFunc);
|
|
|
|
virtual ~GuiMetaDataEd();
|
2013-08-18 14:16:11 +00:00
|
|
|
|
|
|
|
private:
|
2013-08-23 22:15:00 +00:00
|
|
|
void save();
|
2013-09-15 19:11:39 +00:00
|
|
|
void fetch();
|
2013-09-19 23:41:14 +00:00
|
|
|
void fetchDone(MetaDataList result);
|
2013-08-22 20:29:50 +00:00
|
|
|
|
2013-08-18 14:16:11 +00:00
|
|
|
void populateList(const std::vector<MetaDataDecl>& mdd);
|
|
|
|
|
2013-09-17 21:50:49 +00:00
|
|
|
ScraperSearchParams mScraperParams;
|
|
|
|
|
2013-08-23 02:41:40 +00:00
|
|
|
NinePatchComponent mBox;
|
2013-08-18 14:16:11 +00:00
|
|
|
|
|
|
|
ComponentListComponent mList;
|
|
|
|
|
2013-08-23 22:15:00 +00:00
|
|
|
TextComponent mHeader;
|
2013-08-18 14:16:11 +00:00
|
|
|
|
2013-08-22 20:29:50 +00:00
|
|
|
std::vector<TextComponent*> mLabels;
|
|
|
|
std::vector<GuiComponent*> mEditors;
|
2013-08-18 14:16:11 +00:00
|
|
|
|
2013-09-19 23:41:14 +00:00
|
|
|
std::vector<MetaDataDecl> mMetaDataDecl;
|
2013-08-23 22:15:00 +00:00
|
|
|
MetaDataList* mMetaData;
|
|
|
|
std::function<void()> mSavedCallback;
|
|
|
|
std::function<void()> mDeleteFunc;
|
2013-08-22 20:29:50 +00:00
|
|
|
|
|
|
|
ButtonComponent mDeleteButton;
|
|
|
|
ButtonComponent mFetchButton;
|
|
|
|
ButtonComponent mSaveButton;
|
2013-08-18 14:16:11 +00:00
|
|
|
};
|