ES-DE/src/components/GuiGameList.h

86 lines
2.2 KiB
C
Raw Normal View History

#ifndef _GUIGAMELIST_H_
#define _GUIGAMELIST_H_
2013-06-02 15:08:32 +00:00
#include "../GuiComponent.h"
#include "TextListComponent.h"
#include "ImageComponent.h"
#include "ThemeComponent.h"
#include "AnimationComponent.h"
#include "TextComponent.h"
#include <string>
#include <stack>
#include "../SystemData.h"
#include "../GameData.h"
#include "../FolderData.h"
#include "ScrollableContainer.h"
2013-09-23 19:58:28 +00:00
#include "RatingComponent.h"
//This is where the magic happens - GuiGameList is the parent of almost every graphical element in ES at the moment.
//It has a TextListComponent child that handles the game list, a ThemeComponent that handles the theming system, and an ImageComponent for game images.
2013-06-02 15:08:32 +00:00
class GuiGameList : public GuiComponent
{
static std::vector<FolderData::SortState> sortStates;
size_t sortStateIndex;
public:
GuiGameList(Window* window);
2013-06-02 15:08:32 +00:00
virtual ~GuiGameList();
void setSystemId(int id);
bool input(InputConfig* config, Input input) override;
void update(int deltaTime) override;
void render(const Eigen::Affine3f& parentTrans) override;
2013-04-08 17:40:15 +00:00
void updateDetailData();
const FolderData::SortState & getSortState() const;
void setSortIndex(size_t index);
void setNextSortIndex();
void setPreviousSortIndex();
void sort(FolderData::ComparisonFunction & comparisonFunction = FolderData::compareFileName, bool ascending = true);
2013-04-08 16:52:40 +00:00
static GuiGameList* create(Window* window);
bool isDetailed() const;
static const float sInfoWidth;
private:
void updateList();
void updateTheme();
2013-09-24 02:02:41 +00:00
void hideDetailData();
void doTransition(int dir);
std::string getThemeFile();
SystemData* mSystem;
FolderData* mFolder;
std::stack<FolderData*> mFolderStack;
int mSystemId;
TextListComponent<FileData*> mList;
ImageComponent mScreenshot;
TextComponent mDescription;
2013-09-23 19:58:28 +00:00
RatingComponent mRating;
ScrollableContainer mDescContainer;
AnimationComponent mImageAnimation;
2013-06-02 15:08:32 +00:00
ThemeComponent* mTheme;
TextComponent mHeaderText;
ImageComponent mTransitionImage;
AnimationComponent mTransitionAnimation;
Eigen::Vector3f getImagePos();
2013-08-06 13:15:20 +00:00
bool mLockInput;
void (GuiGameList::*mEffectFunc)(int);
int mEffectTime;
int mGameLaunchEffectLength;
void updateGameLaunchEffect(int t);
void updateGameReturnEffect(int t);
};
#endif