1 #pragma once
2 #ifndef ES_APP_VIEWS_GAME_LIST_GRID_GAME_LIST_VIEW_H
3 #define ES_APP_VIEWS_GAME_LIST_GRID_GAME_LIST_VIEW_H
4 
5 #include "components/DateTimeComponent.h"
6 #include "components/RatingComponent.h"
7 #include "components/ScrollableContainer.h"
8 #include "components/ImageGridComponent.h"
9 #include "components/VideoComponent.h"
10 #include "views/gamelist/ISimpleGameListView.h"
11 
12 class GridGameListView : public ISimpleGameListView
13 {
14 public:
15 	GridGameListView(Window* window, FileData* root);
16 	virtual ~GridGameListView();
17 
18 	virtual void onShow() override;
19 
20 	virtual void onThemeChanged(const std::shared_ptr<ThemeData>& theme) override;
21 
22 	virtual FileData* getCursor() override;
23 	virtual void setCursor(FileData*) override;
24 
25 	virtual bool input(InputConfig* config, Input input) override;
26 
getName()27 	virtual const char* getName() const override { return "grid"; }
28 
29 	virtual std::vector<HelpPrompt> getHelpPrompts() override;
30 	virtual void launch(FileData* game) override;
31 
32 protected:
33 	virtual void update(int deltaTime) override;
34 	virtual std::string getQuickSystemSelectRightButton() override;
35 	virtual std::string getQuickSystemSelectLeftButton() override;
36 	virtual void populateList(const std::vector<FileData*>& files) override;
37 	virtual void remove(FileData* game, bool deleteFile) override;
38 	virtual void addPlaceholder();
39 
40 	ImageGridComponent<FileData*> mGrid;
41 
42 private:
43 	void updateInfoPanel();
44 	const std::string getImagePath(FileData* file);
45 
46 	void initMDLabels();
47 	void initMDValues();
48 
49 	TextComponent mLblRating, mLblReleaseDate, mLblDeveloper, mLblPublisher, mLblGenre, mLblPlayers, mLblLastPlayed, mLblPlayCount;
50 
51 	ImageComponent mMarquee;
52 	VideoComponent* mVideo;
53 	bool mVideoPlaying;
54 	ImageComponent mImage;
55 	RatingComponent mRating;
56 	DateTimeComponent mReleaseDate;
57 	TextComponent mDeveloper;
58 	TextComponent mPublisher;
59 	TextComponent mGenre;
60 	TextComponent mPlayers;
61 	DateTimeComponent mLastPlayed;
62 	TextComponent mPlayCount;
63 	TextComponent mName;
64 
65 	std::vector<TextComponent*> getMDLabels();
66 	std::vector<GuiComponent*> getMDValues();
67 
68 	ScrollableContainer mDescContainer;
69 	TextComponent mDescription;
70 };
71 
72 #endif // ES_APP_VIEWS_GAME_LIST_GRID_GAME_LIST_VIEW_H
73