2012-07-20 01:08:29 +00:00
# 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"
2013-06-14 15:48:13 +00:00
# include "TextComponent.h"
2012-07-20 01:08:29 +00:00
# include <string>
2012-07-27 16:58:27 +00:00
# include <stack>
2012-07-20 16:14:09 +00:00
# include "../SystemData.h"
# include "../GameData.h"
2012-07-27 16:58:27 +00:00
# include "../FolderData.h"
2013-07-03 01:01:58 +00:00
# include "ScrollableContainer.h"
2012-07-20 01:08:29 +00:00
2012-09-07 21:44:07 +00:00
//This is where the magic happens - GuiGameList is the parent of almost every graphical element in ES at the moment.
2013-06-14 15:48:13 +00:00
//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
2012-07-20 01:08:29 +00:00
{
Support sorting of game list via input
You can now map the functions "sortordernext" and "sortorderprevious" to
inputs (in es_input.cfg) and toggle the game list sort order with them.
The order is: "file name, ascending" (default), "file name, descending",
"rating ascending", "rating descending", "user rating ascending", "user
rating descending", "time played ascending", "times played descending",
"last played time ascending", "last played time descending".
2013-06-28 17:44:28 +00:00
static std : : vector < FolderData : : SortState > sortStates ;
size_t sortStateIndex ;
2012-07-20 01:08:29 +00:00
public :
2013-07-02 07:04:52 +00:00
GuiGameList ( Window * window ) ;
2013-06-02 15:08:32 +00:00
virtual ~ GuiGameList ( ) ;
2012-07-21 19:06:24 +00:00
2012-07-21 20:57:53 +00:00
void setSystemId ( int id ) ;
2012-07-20 01:08:29 +00:00
2013-07-02 07:04:52 +00:00
bool input ( InputConfig * config , Input input ) override ;
void update ( int deltaTime ) override ;
2013-07-10 11:29:43 +00:00
void render ( const Eigen : : Affine3f & parentTrans ) override ;
2012-07-27 16:58:27 +00:00
2013-04-08 17:40:15 +00:00
void updateDetailData ( ) ;
2013-06-30 17:24:09 +00:00
const FolderData : : SortState & getSortState ( ) const ;
Support sorting of game list via input
You can now map the functions "sortordernext" and "sortorderprevious" to
inputs (in es_input.cfg) and toggle the game list sort order with them.
The order is: "file name, ascending" (default), "file name, descending",
"rating ascending", "rating descending", "user rating ascending", "user
rating descending", "time played ascending", "times played descending",
"last played time ascending", "last played time descending".
2013-06-28 17:44:28 +00:00
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 ) ;
2012-10-05 20:18:36 +00:00
2013-07-02 07:04:52 +00:00
bool isDetailed ( ) const ;
2012-08-14 01:27:39 +00:00
static const float sInfoWidth ;
2012-07-20 01:08:29 +00:00
private :
2012-08-12 14:43:09 +00:00
void updateList ( ) ;
2012-08-10 19:28:34 +00:00
void updateTheme ( ) ;
2012-10-17 17:15:58 +00:00
void clearDetailData ( ) ;
2013-06-16 21:23:04 +00:00
void doTransition ( int dir ) ;
2012-12-17 19:29:43 +00:00
std : : string getThemeFile ( ) ;
2012-08-10 19:28:34 +00:00
2012-07-20 16:14:09 +00:00
SystemData * mSystem ;
2012-07-27 16:58:27 +00:00
FolderData * mFolder ;
std : : stack < FolderData * > mFolderStack ;
2012-07-21 20:57:53 +00:00
int mSystemId ;
2012-08-02 01:43:55 +00:00
2013-07-02 07:04:52 +00:00
TextListComponent < FileData * > mList ;
ImageComponent mScreenshot ;
2013-06-14 15:48:13 +00:00
TextComponent mDescription ;
2013-07-03 01:01:58 +00:00
ScrollableContainer mDescContainer ;
2013-07-02 07:04:52 +00:00
AnimationComponent mImageAnimation ;
2013-06-02 15:08:32 +00:00
ThemeComponent * mTheme ;
2013-06-14 15:48:13 +00:00
2013-06-16 21:23:04 +00:00
ImageComponent mTransitionImage ;
AnimationComponent mTransitionAnimation ;
2013-07-10 11:29:43 +00:00
Eigen : : Vector3f getImagePos ( ) ;
2012-07-20 01:08:29 +00:00
} ;
# endif