Renamed GameList to Gamelist throughout the codebase.

This commit is contained in:
Leon Styhre 2022-01-15 13:38:09 +01:00
parent 92f5284bf3
commit c7964b7ebc
31 changed files with 293 additions and 293 deletions

View file

@ -48,12 +48,12 @@ set(ES_HEADERS
${CMAKE_CURRENT_SOURCE_DIR}/src/scrapers/ScreenScraper.h ${CMAKE_CURRENT_SOURCE_DIR}/src/scrapers/ScreenScraper.h
# Views # Views
${CMAKE_CURRENT_SOURCE_DIR}/src/views/gamelist/BasicGameListView.h ${CMAKE_CURRENT_SOURCE_DIR}/src/views/gamelist/BasicGamelistView.h
${CMAKE_CURRENT_SOURCE_DIR}/src/views/gamelist/DetailedGameListView.h ${CMAKE_CURRENT_SOURCE_DIR}/src/views/gamelist/DetailedGamelistView.h
${CMAKE_CURRENT_SOURCE_DIR}/src/views/gamelist/GridGameListView.h ${CMAKE_CURRENT_SOURCE_DIR}/src/views/gamelist/GridGamelistView.h
${CMAKE_CURRENT_SOURCE_DIR}/src/views/gamelist/IGameListView.h ${CMAKE_CURRENT_SOURCE_DIR}/src/views/gamelist/IGamelistView.h
${CMAKE_CURRENT_SOURCE_DIR}/src/views/gamelist/ISimpleGameListView.h ${CMAKE_CURRENT_SOURCE_DIR}/src/views/gamelist/ISimpleGamelistView.h
${CMAKE_CURRENT_SOURCE_DIR}/src/views/gamelist/VideoGameListView.h ${CMAKE_CURRENT_SOURCE_DIR}/src/views/gamelist/VideoGamelistView.h
${CMAKE_CURRENT_SOURCE_DIR}/src/views/SystemView.h ${CMAKE_CURRENT_SOURCE_DIR}/src/views/SystemView.h
${CMAKE_CURRENT_SOURCE_DIR}/src/views/UIModeController.h ${CMAKE_CURRENT_SOURCE_DIR}/src/views/UIModeController.h
${CMAKE_CURRENT_SOURCE_DIR}/src/views/ViewController.h ${CMAKE_CURRENT_SOURCE_DIR}/src/views/ViewController.h
@ -98,12 +98,12 @@ set(ES_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/src/scrapers/ScreenScraper.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/scrapers/ScreenScraper.cpp
# Views # Views
${CMAKE_CURRENT_SOURCE_DIR}/src/views/gamelist/BasicGameListView.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/views/gamelist/BasicGamelistView.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/views/gamelist/DetailedGameListView.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/views/gamelist/DetailedGamelistView.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/views/gamelist/GridGameListView.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/views/gamelist/GridGamelistView.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/views/gamelist/IGameListView.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/views/gamelist/IGamelistView.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/views/gamelist/ISimpleGameListView.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/views/gamelist/ISimpleGamelistView.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/views/gamelist/VideoGameListView.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/views/gamelist/VideoGamelistView.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/views/SystemView.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/views/SystemView.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/views/UIModeController.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/views/UIModeController.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/views/ViewController.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/views/ViewController.cpp

View file

@ -33,7 +33,7 @@
#include "utils/TimeUtil.h" #include "utils/TimeUtil.h"
#include "views/UIModeController.h" #include "views/UIModeController.h"
#include "views/ViewController.h" #include "views/ViewController.h"
#include "views/gamelist/IGameListView.h" #include "views/gamelist/IGamelistView.h"
#include <fstream> #include <fstream>
#include <pugixml.hpp> #include <pugixml.hpp>
@ -265,7 +265,7 @@ void CollectionSystemsManager::updateSystemsList()
for (auto sysIt = SystemData::sSystemVector.cbegin(); // Line break. for (auto sysIt = SystemData::sSystemVector.cbegin(); // Line break.
sysIt != SystemData::sSystemVector.cend(); ++sysIt) { sysIt != SystemData::sSystemVector.cend(); ++sysIt) {
if ((*sysIt)->isCollection()) if ((*sysIt)->isCollection())
ViewController::getInstance()->getGameListView((*sysIt)); ViewController::getInstance()->getGamelistView((*sysIt));
} }
// If we were editing a custom collection, and it's no longer enabled, exit edit mode. // If we were editing a custom collection, and it's no longer enabled, exit edit mode.
@ -345,13 +345,13 @@ void CollectionSystemsManager::updateCollectionSystem(FileData* file, Collection
// Found it, and we are removing it. // Found it, and we are removing it.
if (name == "favorites" && file->metadata.get("favorite") == "false") { if (name == "favorites" && file->metadata.get("favorite") == "false") {
// Need to check if it is still marked as favorite, if not remove it. // Need to check if it is still marked as favorite, if not remove it.
ViewController::getInstance()->getGameListView(curSys).get()->remove( ViewController::getInstance()->getGamelistView(curSys).get()->remove(
collectionEntry, false); collectionEntry, false);
} }
else if (name == "recent" && file->metadata.get("lastplayed") == "0") { else if (name == "recent" && file->metadata.get("lastplayed") == "0") {
// If lastplayed is set to 0 it means the entry has been cleared, and the // If lastplayed is set to 0 it means the entry has been cleared, and the
// game should therefore be removed. // game should therefore be removed.
ViewController::getInstance()->getGameListView(curSys).get()->remove( ViewController::getInstance()->getGamelistView(curSys).get()->remove(
collectionEntry, false); collectionEntry, false);
ViewController::getInstance()->onFileChanged(rootFolder, true); ViewController::getInstance()->onFileChanged(rootFolder, true);
} }
@ -359,7 +359,7 @@ void CollectionSystemsManager::updateCollectionSystem(FileData* file, Collection
// If the countasgame flag has been set to false, then remove the game. // If the countasgame flag has been set to false, then remove the game.
if (curSys->isGroupedCustomCollection()) { if (curSys->isGroupedCustomCollection()) {
ViewController::getInstance() ViewController::getInstance()
->getGameListView(curSys->getRootFolder()->getParent()->getSystem()) ->getGamelistView(curSys->getRootFolder()->getParent()->getSystem())
.get() .get()
->remove(collectionEntry, false); ->remove(collectionEntry, false);
FileData* parentRootFolder = FileData* parentRootFolder =
@ -375,7 +375,7 @@ void CollectionSystemsManager::updateCollectionSystem(FileData* file, Collection
4000); 4000);
} }
else { else {
ViewController::getInstance()->getGameListView(curSys).get()->remove( ViewController::getInstance()->getGamelistView(curSys).get()->remove(
collectionEntry, false); collectionEntry, false);
} }
rootFolder->sort(rootFolder->getSortTypeFromString(rootFolder->getSortTypeString()), rootFolder->sort(rootFolder->getSortTypeFromString(rootFolder->getSortTypeString()),
@ -403,7 +403,7 @@ void CollectionSystemsManager::updateCollectionSystem(FileData* file, Collection
CollectionFileData* newGame = new CollectionFileData(file, curSys); CollectionFileData* newGame = new CollectionFileData(file, curSys);
rootFolder->addChild(newGame); rootFolder->addChild(newGame);
fileIndex->addToIndex(newGame); fileIndex->addToIndex(newGame);
ViewController::getInstance()->getGameListView(curSys)->onFileChanged(newGame, ViewController::getInstance()->getGamelistView(curSys)->onFileChanged(newGame,
true); true);
} }
} }
@ -451,8 +451,8 @@ void CollectionSystemsManager::updateCollectionSystem(FileData* file, Collection
auto nTime = Utils::Time::now(); auto nTime = Utils::Time::now();
if (nTime - Utils::Time::stringToTime(file->metadata.get("lastplayed")) < 2) { if (nTime - Utils::Time::stringToTime(file->metadata.get("lastplayed")) < 2) {
// Select the first row of the gamelist (the game just played). // Select the first row of the gamelist (the game just played).
IGameListView* gameList = ViewController::getInstance() IGamelistView* gameList = ViewController::getInstance()
->getGameListView(getSystemToView(sysData.system)) ->getGamelistView(getSystemToView(sysData.system))
.get(); .get();
gameList->setCursor(gameList->getFirstEntry()); gameList->setCursor(gameList->getFirstEntry());
} }
@ -492,7 +492,7 @@ void CollectionSystemsManager::deleteCollectionFiles(FileData* file)
FileData* collectionEntry = children.at(key); FileData* collectionEntry = children.at(key);
SystemData* systemViewToUpdate = getSystemToView(sysDataIt->second.system); SystemData* systemViewToUpdate = getSystemToView(sysDataIt->second.system);
ViewController::getInstance() ViewController::getInstance()
->getGameListView(systemViewToUpdate) ->getGamelistView(systemViewToUpdate)
.get() .get()
->remove(collectionEntry, false); ->remove(collectionEntry, false);
if (sysDataIt->second.decl.isCustom) if (sysDataIt->second.decl.isCustom)
@ -626,8 +626,8 @@ void CollectionSystemsManager::exitEditMode(bool showPopup)
// Remove all tick marks from the games that are part of the collection. // Remove all tick marks from the games that are part of the collection.
for (auto it = SystemData::sSystemVector.begin(); it != SystemData::sSystemVector.end(); ++it) { for (auto it = SystemData::sSystemVector.begin(); it != SystemData::sSystemVector.end(); ++it) {
ViewController::getInstance()->getGameListView((*it))->onFileChanged( ViewController::getInstance()->getGamelistView((*it))->onFileChanged(
ViewController::getInstance()->getGameListView((*it))->getCursor(), false); ViewController::getInstance()->getGamelistView((*it))->getCursor(), false);
} }
mEditingCollectionSystemData->system->onMetaDataSavePoint(); mEditingCollectionSystemData->system->onMetaDataSavePoint();
@ -673,13 +673,13 @@ const bool CollectionSystemsManager::toggleGameInCollection(FileData* file)
FileData* collectionEntry = children.at(key); FileData* collectionEntry = children.at(key);
fileIndex->removeFromIndex(collectionEntry); fileIndex->removeFromIndex(collectionEntry);
ViewController::getInstance() ViewController::getInstance()
->getGameListView(systemViewToUpdate) ->getGamelistView(systemViewToUpdate)
.get() .get()
->remove(collectionEntry, false); ->remove(collectionEntry, false);
systemViewToUpdate->getRootFolder()->sort( systemViewToUpdate->getRootFolder()->sort(
rootFolder->getSortTypeFromString(rootFolder->getSortTypeString()), rootFolder->getSortTypeFromString(rootFolder->getSortTypeString()),
Settings::getInstance()->getBool("FavFirstCustom")); Settings::getInstance()->getBool("FavFirstCustom"));
ViewController::getInstance()->reloadGameListView(systemViewToUpdate); ViewController::getInstance()->reloadGamelistView(systemViewToUpdate);
updateCollectionFolderMetadata(systemViewToUpdate); updateCollectionFolderMetadata(systemViewToUpdate);
} }
@ -719,7 +719,7 @@ const bool CollectionSystemsManager::toggleGameInCollection(FileData* file)
file->getSourceFileData()->getSystem()->onMetaDataSavePoint(); file->getSourceFileData()->getSystem()->onMetaDataSavePoint();
refreshCollectionSystems(file->getSourceFileData()); refreshCollectionSystems(file->getSourceFileData());
if (mAutoCollectionSystemsData["favorites"].isEnabled) if (mAutoCollectionSystemsData["favorites"].isEnabled)
ViewController::getInstance()->reloadGameListView( ViewController::getInstance()->reloadGamelistView(
mAutoCollectionSystemsData["favorites"].system); mAutoCollectionSystemsData["favorites"].system);
} }
if (adding) { if (adding) {
@ -917,7 +917,7 @@ void CollectionSystemsManager::deleteCustomCollection(const std::string& collect
CollectionSystemsManager::getInstance()->loadEnabledListFromSettings(); CollectionSystemsManager::getInstance()->loadEnabledListFromSettings();
CollectionSystemsManager::getInstance()->updateSystemsList(); CollectionSystemsManager::getInstance()->updateSystemsList();
ViewController::getInstance()->removeGameListView(collectionEntry->second.system); ViewController::getInstance()->removeGamelistView(collectionEntry->second.system);
ViewController::getInstance()->reloadAll(); ViewController::getInstance()->reloadAll();
delete collectionEntry->second.system; delete collectionEntry->second.system;
@ -1006,7 +1006,7 @@ void CollectionSystemsManager::repopulateCollection(SystemData* sysData)
// and then point to this, and for collections with games in them we select the first // and then point to this, and for collections with games in them we select the first
// entry. // entry.
auto autoView = auto autoView =
ViewController::getInstance()->getGameListView(autoSystem->system).get(); ViewController::getInstance()->getGamelistView(autoSystem->system).get();
if (autoSystem->system->getRootFolder()->getChildren().size() == 0) { if (autoSystem->system->getRootFolder()->getChildren().size() == 0) {
autoView->addPlaceholder(autoSystem->system->getRootFolder()); autoView->addPlaceholder(autoSystem->system->getRootFolder());
autoView->setCursor(autoView->getLastEntry()); autoView->setCursor(autoView->getLastEntry());
@ -1043,7 +1043,7 @@ void CollectionSystemsManager::repopulateCollection(SystemData* sysData)
populateCustomCollection(customSystem); populateCustomCollection(customSystem);
auto autoView = auto autoView =
ViewController::getInstance()->getGameListView(customSystem->system).get(); ViewController::getInstance()->getGamelistView(customSystem->system).get();
autoView->setCursor( autoView->setCursor(
customSystem->system->getRootFolder()->getChildrenRecursive().front()); customSystem->system->getRootFolder()->getChildrenRecursive().front());
autoView->setCursor(autoView->getFirstEntry()); autoView->setCursor(autoView->getFirstEntry());
@ -1163,13 +1163,13 @@ void CollectionSystemsManager::populateAutoCollection(CollectionSystemData* sysD
// The following is needed to avoid a crash when repopulating the system as the previous // The following is needed to avoid a crash when repopulating the system as the previous
// cursor pointer may point to a random memory address. // cursor pointer may point to a random memory address.
auto recentGamelist = auto recentGamelist =
ViewController::getInstance()->getGameListView(rootFolder->getSystem()).get(); ViewController::getInstance()->getGamelistView(rootFolder->getSystem()).get();
recentGamelist->setCursor( recentGamelist->setCursor(
rootFolder->getSystem()->getRootFolder()->getChildrenRecursive().front()); rootFolder->getSystem()->getRootFolder()->getChildrenRecursive().front());
recentGamelist->setCursor(recentGamelist->getFirstEntry()); recentGamelist->setCursor(recentGamelist->getFirstEntry());
if (rootFolder->getChildren().size() > 0) if (rootFolder->getChildren().size() > 0)
ViewController::getInstance() ViewController::getInstance()
->getGameListView(rootFolder->getSystem()) ->getGamelistView(rootFolder->getSystem())
.get() .get()
->onFileChanged(rootFolder->getChildren().front(), false); ->onFileChanged(rootFolder->getChildren().front(), false);
} }
@ -1257,7 +1257,7 @@ void CollectionSystemsManager::removeCollectionsFromDisplayedSystems()
// Clear index. // Clear index.
mCustomCollectionsBundle->getIndex()->resetIndex(); mCustomCollectionsBundle->getIndex()->resetIndex();
// Remove view so it's re-created as needed. // Remove view so it's re-created as needed.
ViewController::getInstance()->removeGameListView(mCustomCollectionsBundle); ViewController::getInstance()->removeGamelistView(mCustomCollectionsBundle);
} }
void CollectionSystemsManager::addEnabledCollectionsToDisplayedSystems( void CollectionSystemsManager::addEnabledCollectionsToDisplayedSystems(
@ -1288,8 +1288,8 @@ void CollectionSystemsManager::addEnabledCollectionsToDisplayedSystems(
rootFolder->getSortTypeFromString(rootFolder->getSortTypeString()), rootFolder->getSortTypeFromString(rootFolder->getSortTypeString()),
Settings::getInstance()->getBool("FavFirstCustom")); Settings::getInstance()->getBool("FavFirstCustom"));
// Jump to the first row of the game list, assuming it's not empty. // Jump to the first row of the game list, assuming it's not empty.
IGameListView* gameList = IGamelistView* gameList =
ViewController::getInstance()->getGameListView((it->second.system)).get(); ViewController::getInstance()->getGamelistView((it->second.system)).get();
if (!gameList->getCursor()->isPlaceHolder()) { if (!gameList->getCursor()->isPlaceHolder()) {
gameList->setCursor(gameList->getFirstEntry()); gameList->setCursor(gameList->getFirstEntry());
} }
@ -1443,7 +1443,7 @@ void CollectionSystemsManager::trimCollectionCount(FileData* rootFolder, int lim
while (static_cast<int>(rootFolder->getChildrenListToDisplay().size()) > limit) { while (static_cast<int>(rootFolder->getChildrenListToDisplay().size()) > limit) {
CollectionFileData* gameToRemove = CollectionFileData* gameToRemove =
(CollectionFileData*)rootFolder->getChildrenListToDisplay().back(); (CollectionFileData*)rootFolder->getChildrenListToDisplay().back();
ViewController::getInstance()->getGameListView(curSys).get()->remove(gameToRemove, false); ViewController::getInstance()->getGamelistView(curSys).get()->remove(gameToRemove, false);
} }
} }

View file

@ -23,7 +23,7 @@
#include "utils/StringUtil.h" #include "utils/StringUtil.h"
#include "views/UIModeController.h" #include "views/UIModeController.h"
#include "views/ViewController.h" #include "views/ViewController.h"
#include "views/gamelist/IGameListView.h" #include "views/gamelist/IGamelistView.h"
#include <fstream> #include <fstream>
#include <pugixml.hpp> #include <pugixml.hpp>
@ -1127,7 +1127,7 @@ FileData* SystemData::getRandomGame(const FileData* currentGame)
} }
else { else {
gameList = ViewController::getInstance() gameList = ViewController::getInstance()
->getGameListView(mRootFolder->getSystem()) ->getGamelistView(mRootFolder->getSystem())
.get() .get()
->getCursor() ->getCursor()
->getParent() ->getParent()
@ -1209,10 +1209,10 @@ void SystemData::sortSystem(bool reloadGamelist, bool jumpToFirstRow)
favoritesSorting); favoritesSorting);
if (reloadGamelist) if (reloadGamelist)
ViewController::getInstance()->reloadGameListView(this, false); ViewController::getInstance()->reloadGamelistView(this, false);
if (jumpToFirstRow) { if (jumpToFirstRow) {
IGameListView* gameList = ViewController::getInstance()->getGameListView(this).get(); IGamelistView* gameList = ViewController::getInstance()->getGamelistView(this).get();
gameList->setCursor(gameList->getFirstEntry()); gameList->setCursor(gameList->getFirstEntry());
} }
} }

View file

@ -17,7 +17,7 @@
#include "utils/FileSystemUtil.h" #include "utils/FileSystemUtil.h"
#include "utils/StringUtil.h" #include "utils/StringUtil.h"
#include "views/ViewController.h" #include "views/ViewController.h"
#include "views/gamelist/IGameListView.h" #include "views/gamelist/IGamelistView.h"
#include <random> #include <random>
#include <time.h> #include <time.h>
@ -210,9 +210,9 @@ void SystemScreensaver::launchGame()
if (mCurrentGame != nullptr) { if (mCurrentGame != nullptr) {
// Launching game // Launching game
ViewController::getInstance()->triggerGameLaunch(mCurrentGame); ViewController::getInstance()->triggerGameLaunch(mCurrentGame);
ViewController::getInstance()->goToGameList(mCurrentGame->getSystem()); ViewController::getInstance()->goToGamelist(mCurrentGame->getSystem());
IGameListView* view = IGamelistView* view =
ViewController::getInstance()->getGameListView(mCurrentGame->getSystem()).get(); ViewController::getInstance()->getGamelistView(mCurrentGame->getSystem()).get();
view->setCursor(mCurrentGame); view->setCursor(mCurrentGame);
ViewController::getInstance()->cancelViewTransitions(); ViewController::getInstance()->cancelViewTransitions();
} }
@ -222,9 +222,9 @@ void SystemScreensaver::goToGame()
{ {
if (mCurrentGame != nullptr) { if (mCurrentGame != nullptr) {
// Go to the game in the gamelist view, but don't launch it. // Go to the game in the gamelist view, but don't launch it.
ViewController::getInstance()->goToGameList(mCurrentGame->getSystem()); ViewController::getInstance()->goToGamelist(mCurrentGame->getSystem());
IGameListView* view = IGamelistView* view =
ViewController::getInstance()->getGameListView(mCurrentGame->getSystem()).get(); ViewController::getInstance()->getGamelistView(mCurrentGame->getSystem()).get();
view->setCursor(mCurrentGame); view->setCursor(mCurrentGame);
ViewController::getInstance()->cancelViewTransitions(); ViewController::getInstance()->cancelViewTransitions();
} }

View file

@ -23,7 +23,7 @@
#include "scrapers/Scraper.h" #include "scrapers/Scraper.h"
#include "views/UIModeController.h" #include "views/UIModeController.h"
#include "views/ViewController.h" #include "views/ViewController.h"
#include "views/gamelist/IGameListView.h" #include "views/gamelist/IGamelistView.h"
GuiGamelistOptions::GuiGamelistOptions(Window* window, SystemData* system) GuiGamelistOptions::GuiGamelistOptions(Window* window, SystemData* system)
: GuiComponent(window) : GuiComponent(window)
@ -262,16 +262,16 @@ GuiGamelistOptions::~GuiGamelistOptions()
if (mFiltersChanged) { if (mFiltersChanged) {
if (!mCustomCollectionSystem) { if (!mCustomCollectionSystem) {
ViewController::getInstance()->reloadGameListView(mSystem); ViewController::getInstance()->reloadGamelistView(mSystem);
} }
else { else {
if (!mFromPlaceholder) { if (!mFromPlaceholder) {
ViewController::getInstance()->reloadGameListView(mSystem); ViewController::getInstance()->reloadGamelistView(mSystem);
} }
else if (!mCustomCollectionSystem->getRootFolder() else if (!mCustomCollectionSystem->getRootFolder()
->getChildrenListToDisplay() ->getChildrenListToDisplay()
.empty()) { .empty()) {
ViewController::getInstance()->reloadGameListView(mSystem); ViewController::getInstance()->reloadGamelistView(mSystem);
getGamelist()->setCursor( getGamelist()->setCursor(
mCustomCollectionSystem->getRootFolder()->getChildrenListToDisplay().front()); mCustomCollectionSystem->getRootFolder()->getChildrenListToDisplay().front());
} }
@ -353,8 +353,8 @@ void GuiGamelistOptions::startEditMode()
// currently being edited. This is done cheaply using onFileChanged() which will trigger // currently being edited. This is done cheaply using onFileChanged() which will trigger
// populateList(). // populateList().
for (auto it = SystemData::sSystemVector.begin(); it != SystemData::sSystemVector.end(); ++it) { for (auto it = SystemData::sSystemVector.begin(); it != SystemData::sSystemVector.end(); ++it) {
ViewController::getInstance()->getGameListView((*it))->onFileChanged( ViewController::getInstance()->getGamelistView((*it))->onFileChanged(
ViewController::getInstance()->getGameListView((*it))->getCursor(), false); ViewController::getInstance()->getGamelistView((*it))->getCursor(), false);
} }
if (mSystem->getRootFolder()->getChildren().size() == 0) if (mSystem->getRootFolder()->getChildren().size() == 0)
@ -396,7 +396,7 @@ void GuiGamelistOptions::openMetaDataEd()
LOG(LogInfo) << "Deleting the media files and gamelist.xml entry for the file \"" LOG(LogInfo) << "Deleting the media files and gamelist.xml entry for the file \""
<< file->getFullPath() << "\""; << file->getFullPath() << "\"";
} }
ViewController::getInstance()->getGameListView(file->getSystem()).get()->removeMedia(file); ViewController::getInstance()->getGamelistView(file->getSystem()).get()->removeMedia(file);
// Manually reset all the metadata values, set the name to the actual file/folder name. // Manually reset all the metadata values, set the name to the actual file/folder name.
const std::vector<MetaDataDecl>& mdd = file->metadata.getMDD(); const std::vector<MetaDataDecl>& mdd = file->metadata.getMDD();
@ -443,10 +443,10 @@ void GuiGamelistOptions::openMetaDataEd()
LOG(LogInfo) << "Deleting the game file \"" << file->getFullPath() LOG(LogInfo) << "Deleting the game file \"" << file->getFullPath()
<< "\", all its media files and its gamelist.xml entry."; << "\", all its media files and its gamelist.xml entry.";
CollectionSystemsManager::getInstance()->deleteCollectionFiles(file); CollectionSystemsManager::getInstance()->deleteCollectionFiles(file);
ViewController::getInstance()->getGameListView(file->getSystem()).get()->removeMedia(file); ViewController::getInstance()->getGamelistView(file->getSystem()).get()->removeMedia(file);
ViewController::getInstance()->getGameListView(file->getSystem()).get()->remove(file, true); ViewController::getInstance()->getGamelistView(file->getSystem()).get()->remove(file, true);
mSystem->getRootFolder()->sort(*mListSort->getSelected(), mFavoritesSorting); mSystem->getRootFolder()->sort(*mListSort->getSelected(), mFavoritesSorting);
ViewController::getInstance()->reloadGameListView(mSystem); ViewController::getInstance()->reloadGamelistView(mSystem);
mWindow->invalidateCachedBackground(); mWindow->invalidateCachedBackground();
}; };
@ -454,16 +454,16 @@ void GuiGamelistOptions::openMetaDataEd()
if (file->getType() == FOLDER) { if (file->getType() == FOLDER) {
mWindow->pushGui(new GuiMetaDataEd( mWindow->pushGui(new GuiMetaDataEd(
mWindow, &file->metadata, file->metadata.getMDD(FOLDER_METADATA), p, mWindow, &file->metadata, file->metadata.getMDD(FOLDER_METADATA), p,
std::bind(&IGameListView::onFileChanged, std::bind(&IGamelistView::onFileChanged,
ViewController::getInstance()->getGameListView(file->getSystem()).get(), file, ViewController::getInstance()->getGamelistView(file->getSystem()).get(), file,
true), true),
clearGameBtnFunc, deleteGameBtnFunc)); clearGameBtnFunc, deleteGameBtnFunc));
} }
else { else {
mWindow->pushGui(new GuiMetaDataEd( mWindow->pushGui(new GuiMetaDataEd(
mWindow, &file->metadata, file->metadata.getMDD(GAME_METADATA), p, mWindow, &file->metadata, file->metadata.getMDD(GAME_METADATA), p,
std::bind(&IGameListView::onFileChanged, std::bind(&IGamelistView::onFileChanged,
ViewController::getInstance()->getGameListView(file->getSystem()).get(), file, ViewController::getInstance()->getGamelistView(file->getSystem()).get(), file,
true), true),
clearGameBtnFunc, deleteGameBtnFunc)); clearGameBtnFunc, deleteGameBtnFunc));
} }
@ -566,7 +566,7 @@ std::vector<HelpPrompt> GuiGamelistOptions::getHelpPrompts()
return prompts; return prompts;
} }
IGameListView* GuiGamelistOptions::getGamelist() IGamelistView* GuiGamelistOptions::getGamelist()
{ {
return ViewController::getInstance()->getGameListView(mSystem).get(); return ViewController::getInstance()->getGamelistView(mSystem).get();
} }

View file

@ -19,7 +19,7 @@
#include "components/OptionListComponent.h" #include "components/OptionListComponent.h"
#include "utils/StringUtil.h" #include "utils/StringUtil.h"
class IGameListView; class IGamelistView;
class SystemData; class SystemData;
class GuiGamelistOptions : public GuiComponent class GuiGamelistOptions : public GuiComponent
@ -50,7 +50,7 @@ private:
std::shared_ptr<SortList> mListSort; std::shared_ptr<SortList> mListSort;
SystemData* mSystem; SystemData* mSystem;
IGameListView* getGamelist(); IGamelistView* getGamelist();
bool mFoldersOnTop; bool mFoldersOnTop;
bool mFavoritesSorting; bool mFavoritesSorting;
bool mOnlyHasFolders; bool mOnlyHasFolders;

View file

@ -35,7 +35,7 @@
#include "utils/PlatformUtil.h" #include "utils/PlatformUtil.h"
#include "views/UIModeController.h" #include "views/UIModeController.h"
#include "views/ViewController.h" #include "views/ViewController.h"
#include "views/gamelist/IGameListView.h" #include "views/gamelist/IGamelistView.h"
#include <SDL2/SDL_events.h> #include <SDL2/SDL_events.h>
#include <algorithm> #include <algorithm>
@ -129,7 +129,7 @@ void GuiMenu::openUIOptions()
} }
}); });
// GameList view style. // Gamelist view style.
auto gamelist_view_style = std::make_shared<OptionListComponent<std::string>>( auto gamelist_view_style = std::make_shared<OptionListComponent<std::string>>(
mWindow, getHelpStyle(), "GAMELIST VIEW STYLE", false); mWindow, getHelpStyle(), "GAMELIST VIEW STYLE", false);
std::string selectedViewStyle = Settings::getInstance()->getString("GamelistViewStyle"); std::string selectedViewStyle = Settings::getInstance()->getString("GamelistViewStyle");

View file

@ -715,7 +715,7 @@ void GuiMetaDataEd::save()
if (std::find(children.begin(), children.end(), hideGame) != children.end()) { if (std::find(children.begin(), children.end(), hideGame) != children.end()) {
sys->getIndex()->removeFromIndex(hideGame); sys->getIndex()->removeFromIndex(hideGame);
// Reload the gamelist as well as the view style may need to change. // Reload the gamelist as well as the view style may need to change.
ViewController::getInstance()->reloadGameListView(sys); ViewController::getInstance()->reloadGamelistView(sys);
} }
} }
} }
@ -844,7 +844,7 @@ void GuiMetaDataEd::close()
// until the user scrolls up and down the gamelist. // until the user scrolls up and down the gamelist.
TextureResource::manualUnload(mScraperParams.game->getImagePath(), false); TextureResource::manualUnload(mScraperParams.game->getImagePath(), false);
TextureResource::manualUnload(mScraperParams.game->getMarqueePath(), false); TextureResource::manualUnload(mScraperParams.game->getMarqueePath(), false);
ViewController::getInstance()->reloadGameListView(mScraperParams.system); ViewController::getInstance()->reloadGamelistView(mScraperParams.system);
// Update all collections where the game is present. // Update all collections where the game is present.
CollectionSystemsManager::getInstance()->refreshCollectionSystems(mScraperParams.game); CollectionSystemsManager::getInstance()->refreshCollectionSystems(mScraperParams.game);
mWindow->invalidateCachedBackground(); mWindow->invalidateCachedBackground();

View file

@ -19,7 +19,7 @@
#include "guis/GuiTextEditKeyboardPopup.h" #include "guis/GuiTextEditKeyboardPopup.h"
#include "guis/GuiTextEditPopup.h" #include "guis/GuiTextEditPopup.h"
#include "views/ViewController.h" #include "views/ViewController.h"
#include "views/gamelist/IGameListView.h" #include "views/gamelist/IGamelistView.h"
GuiSettings::GuiSettings(Window* window, std::string title) GuiSettings::GuiSettings(Window* window, std::string title)
: GuiComponent(window) : GuiComponent(window)
@ -77,7 +77,7 @@ void GuiSettings::save()
(*it)->sortSystem(true); (*it)->sortSystem(true);
// Jump to the first row of the gamelist. // Jump to the first row of the gamelist.
IGameListView* gameList = ViewController::getInstance()->getGameListView((*it)).get(); IGamelistView* gameList = ViewController::getInstance()->getGamelistView((*it)).get();
gameList->setCursor(gameList->getFirstEntry()); gameList->setCursor(gameList->getFirstEntry());
} }
} }

View file

@ -185,7 +185,7 @@ void thegamesdb_generate_json_scraper_requests(
} }
if (usingGameID) { if (usingGameID) {
// If we have the ID already, we don't need the GetGameList request. // If we have the ID already, we don't need the GetGamelist request.
requests.push(std::unique_ptr<ScraperRequest>(new TheGamesDBJSONRequest(results, path))); requests.push(std::unique_ptr<ScraperRequest>(new TheGamesDBJSONRequest(results, path)));
} }
else { else {

View file

@ -30,7 +30,7 @@ void thegamesdb_generate_json_scraper_requests(
class TheGamesDBJSONRequest : public ScraperHttpRequest class TheGamesDBJSONRequest : public ScraperHttpRequest
{ {
public: public:
// Constructor for a GetGameList request. // Constructor for a GetGamelist request.
TheGamesDBJSONRequest(std::queue<std::unique_ptr<ScraperRequest>>& requestsWrite, TheGamesDBJSONRequest(std::queue<std::unique_ptr<ScraperRequest>>& requestsWrite,
std::vector<ScraperSearchResult>& resultsWrite, std::vector<ScraperSearchResult>& resultsWrite,
const std::string& url) const std::string& url)

View file

@ -25,7 +25,7 @@ void screenscraper_generate_scraper_requests(const ScraperSearchParams& params,
class ScreenScraperRequest : public ScraperHttpRequest class ScreenScraperRequest : public ScraperHttpRequest
{ {
public: public:
// ctor for a GetGameList request. // Constructor for a GetGamelist request.
ScreenScraperRequest(std::queue<std::unique_ptr<ScraperRequest>>& requestsWrite, ScreenScraperRequest(std::queue<std::unique_ptr<ScraperRequest>>& requestsWrite,
std::vector<ScraperSearchResult>& resultsWrite, std::vector<ScraperSearchResult>& resultsWrite,
const std::string& url) const std::string& url)
@ -34,7 +34,7 @@ public:
{ {
} }
// ctor for a GetGame request. // Constructor for a GetGame request.
ScreenScraperRequest(std::vector<ScraperSearchResult>& resultsWrite, const std::string& url) ScreenScraperRequest(std::vector<ScraperSearchResult>& resultsWrite, const std::string& url)
: ScraperHttpRequest(resultsWrite, url) : ScraperHttpRequest(resultsWrite, url)
, mRequestQueue(nullptr) , mRequestQueue(nullptr)

View file

@ -283,7 +283,7 @@ bool SystemView::input(InputConfig* config, Input input)
if (config->isMappedTo("a", input)) { if (config->isMappedTo("a", input)) {
stopScrolling(); stopScrolling();
ViewController::getInstance()->goToGameList(getSelected()); ViewController::getInstance()->goToGamelist(getSelected());
NavigationSounds::getInstance().playThemeNavigationSound(SELECTSOUND); NavigationSounds::getInstance().playThemeNavigationSound(SELECTSOUND);
return true; return true;
} }

View file

@ -28,10 +28,10 @@
#include "guis/GuiTextEditPopup.h" #include "guis/GuiTextEditPopup.h"
#include "views/SystemView.h" #include "views/SystemView.h"
#include "views/UIModeController.h" #include "views/UIModeController.h"
#include "views/gamelist/DetailedGameListView.h" #include "views/gamelist/DetailedGamelistView.h"
#include "views/gamelist/GridGameListView.h" #include "views/gamelist/GridGamelistView.h"
#include "views/gamelist/IGameListView.h" #include "views/gamelist/IGamelistView.h"
#include "views/gamelist/VideoGameListView.h" #include "views/gamelist/VideoGamelistView.h"
#if defined(_MSC_VER) // MSVC compiler. #if defined(_MSC_VER) // MSVC compiler.
const std::string ViewController::CONTROLLER_CHAR = Utils::String::wideStringToString(L"\uf11b"); const std::string ViewController::CONTROLLER_CHAR = Utils::String::wideStringToString(L"\uf11b");
@ -249,7 +249,7 @@ void ViewController::goToStart(bool playTransition)
for (auto it = SystemData::sSystemVector.cbegin(); // Line break. for (auto it = SystemData::sSystemVector.cbegin(); // Line break.
it != SystemData::sSystemVector.cend(); ++it) { it != SystemData::sSystemVector.cend(); ++it) {
if ((*it)->getName() == requestedSystem) { if ((*it)->getName() == requestedSystem) {
goToGameList(*it); goToGamelist(*it);
if (!playTransition) if (!playTransition)
cancelViewTransitions(); cancelViewTransitions();
return; return;
@ -416,27 +416,27 @@ void ViewController::goToSystem(SystemData* system, bool animate)
mSystemListView->goToSystem(system, animate); mSystemListView->goToSystem(system, animate);
} }
void ViewController::goToNextGameList() void ViewController::goToNextGamelist()
{ {
assert(mState.viewing == GAME_LIST); assert(mState.viewing == GAME_LIST);
SystemData* system = getState().getSystem(); SystemData* system = getState().getSystem();
assert(system); assert(system);
NavigationSounds::getInstance().playThemeNavigationSound(QUICKSYSSELECTSOUND); NavigationSounds::getInstance().playThemeNavigationSound(QUICKSYSSELECTSOUND);
mNextSystem = true; mNextSystem = true;
goToGameList(system->getNext()); goToGamelist(system->getNext());
} }
void ViewController::goToPrevGameList() void ViewController::goToPrevGamelist()
{ {
assert(mState.viewing == GAME_LIST); assert(mState.viewing == GAME_LIST);
SystemData* system = getState().getSystem(); SystemData* system = getState().getSystem();
assert(system); assert(system);
NavigationSounds::getInstance().playThemeNavigationSound(QUICKSYSSELECTSOUND); NavigationSounds::getInstance().playThemeNavigationSound(QUICKSYSSELECTSOUND);
mNextSystem = false; mNextSystem = false;
goToGameList(system->getPrev()); goToGamelist(system->getPrev());
} }
void ViewController::goToGameList(SystemData* system) void ViewController::goToGamelist(SystemData* system)
{ {
bool wrapFirstToLast = false; bool wrapFirstToLast = false;
bool wrapLastToFirst = false; bool wrapLastToFirst = false;
@ -462,7 +462,7 @@ void ViewController::goToGameList(SystemData* system)
else if (!mPreviousView && mState.viewing == GAME_LIST) { else if (!mPreviousView && mState.viewing == GAME_LIST) {
// This is needed as otherwise the static image would not get rendered during the // This is needed as otherwise the static image would not get rendered during the
// first Slide transition when coming from the System view. // first Slide transition when coming from the System view.
mSkipView = getGameListView(system); mSkipView = getGamelistView(system);
} }
if (mState.viewing != SYSTEM_SELECT) { if (mState.viewing != SYSTEM_SELECT) {
@ -516,7 +516,7 @@ void ViewController::goToGameList(SystemData* system)
if (wrapFirstToLast) { if (wrapFirstToLast) {
glm::vec3 currentPosition{mCurrentView->getPosition()}; glm::vec3 currentPosition{mCurrentView->getPosition()};
mWrapPreviousPositionX = currentPosition.x; mWrapPreviousPositionX = currentPosition.x;
float offsetX{getGameListView(system)->getPosition().x}; float offsetX{getGamelistView(system)->getPosition().x};
// This is needed to move the camera in the correct direction if there are only two systems. // This is needed to move the camera in the correct direction if there are only two systems.
if (SystemData::sSystemVector.size() == 2 && mNextSystem) if (SystemData::sSystemVector.size() == 2 && mNextSystem)
offsetX -= Renderer::getScreenWidth(); offsetX -= Renderer::getScreenWidth();
@ -530,7 +530,7 @@ void ViewController::goToGameList(SystemData* system)
else if (wrapLastToFirst) { else if (wrapLastToFirst) {
glm::vec3 currentPosition{mCurrentView->getPosition()}; glm::vec3 currentPosition{mCurrentView->getPosition()};
mWrapPreviousPositionX = currentPosition.x; mWrapPreviousPositionX = currentPosition.x;
float offsetX{getGameListView(system)->getPosition().x}; float offsetX{getGamelistView(system)->getPosition().x};
if (SystemData::sSystemVector.size() == 2 && !mNextSystem) if (SystemData::sSystemVector.size() == 2 && !mNextSystem)
offsetX += Renderer::getScreenWidth(); offsetX += Renderer::getScreenWidth();
else else
@ -541,7 +541,7 @@ void ViewController::goToGameList(SystemData* system)
mWrappedViews = true; mWrappedViews = true;
} }
mCurrentView = getGameListView(system); mCurrentView = getGamelistView(system);
// Application startup animation, if starting in a gamelist rather than in the system view. // Application startup animation, if starting in a gamelist rather than in the system view.
if (mState.viewing == NOTHING) { if (mState.viewing == NOTHING) {
@ -561,8 +561,8 @@ void ViewController::goToGameList(SystemData* system)
mState.viewing = GAME_LIST; mState.viewing = GAME_LIST;
mState.system = system; mState.system = system;
auto it = mGameListViews.find(system); auto it = mGamelistViews.find(system);
if (it != mGameListViews.cend()) { if (it != mGamelistViews.cend()) {
std::string viewStyle = it->second->getName(); std::string viewStyle = it->second->getName();
if (viewStyle == "basic") if (viewStyle == "basic")
mState.viewstyle = BASIC; mState.viewstyle = BASIC;
@ -664,11 +664,11 @@ void ViewController::playViewTransition(bool instant)
} }
} }
void ViewController::onFileChanged(FileData* file, bool reloadGameList) void ViewController::onFileChanged(FileData* file, bool reloadGamelist)
{ {
auto it = mGameListViews.find(file->getSystem()); auto it = mGamelistViews.find(file->getSystem());
if (it != mGameListViews.cend()) if (it != mGamelistViews.cend())
it->second->onFileChanged(file, reloadGameList); it->second->onFileChanged(file, reloadGamelist);
} }
void ViewController::launch(FileData* game) void ViewController::launch(FileData* game)
@ -731,30 +731,30 @@ void ViewController::launch(FileData* game)
}); });
} }
void ViewController::removeGameListView(SystemData* system) void ViewController::removeGamelistView(SystemData* system)
{ {
auto exists = mGameListViews.find(system); auto exists = mGamelistViews.find(system);
if (exists != mGameListViews.cend()) { if (exists != mGamelistViews.cend()) {
exists->second.reset(); exists->second.reset();
mGameListViews.erase(system); mGamelistViews.erase(system);
} }
} }
std::shared_ptr<IGameListView> ViewController::getGameListView(SystemData* system) std::shared_ptr<IGamelistView> ViewController::getGamelistView(SystemData* system)
{ {
// If we have already created an entry for this system, then return that one. // If we have already created an entry for this system, then return that one.
auto exists = mGameListViews.find(system); auto exists = mGamelistViews.find(system);
if (exists != mGameListViews.cend()) if (exists != mGamelistViews.cend())
return exists->second; return exists->second;
system->getIndex()->setKidModeFilters(); system->getIndex()->setKidModeFilters();
// If there's no entry, then create it and return it. // If there's no entry, then create it and return it.
std::shared_ptr<IGameListView> view; std::shared_ptr<IGamelistView> view;
bool themeHasVideoView = system->getTheme()->hasView("video"); bool themeHasVideoView = system->getTheme()->hasView("video");
// Decide which view style to use. // Decide which view style to use.
GameListViewStyle selectedViewStyle = AUTOMATIC; GamelistViewStyle selectedViewStyle = AUTOMATIC;
std::string viewPreference = Settings::getInstance()->getString("GamelistViewStyle"); std::string viewPreference = Settings::getInstance()->getString("GamelistViewStyle");
if (viewPreference.compare("basic") == 0) if (viewPreference.compare("basic") == 0)
@ -783,28 +783,28 @@ std::shared_ptr<IGameListView> ViewController::getGameListView(SystemData* syste
// Create the view. // Create the view.
switch (selectedViewStyle) { switch (selectedViewStyle) {
case VIDEO: { case VIDEO: {
view = std::shared_ptr<IGameListView>( view = std::shared_ptr<IGamelistView>(
new VideoGameListView(mWindow, system->getRootFolder())); new VideoGamelistView(mWindow, system->getRootFolder()));
mState.viewstyle = VIDEO; mState.viewstyle = VIDEO;
break; break;
} }
case DETAILED: { case DETAILED: {
view = std::shared_ptr<IGameListView>( view = std::shared_ptr<IGamelistView>(
new DetailedGameListView(mWindow, system->getRootFolder())); new DetailedGamelistView(mWindow, system->getRootFolder()));
mState.viewstyle = DETAILED; mState.viewstyle = DETAILED;
break; break;
} }
case GRID: { case GRID: {
view = std::shared_ptr<IGameListView>( view = std::shared_ptr<IGamelistView>(
new GridGameListView(mWindow, system->getRootFolder())); new GridGamelistView(mWindow, system->getRootFolder()));
mState.viewstyle = GRID; mState.viewstyle = GRID;
break; break;
} }
case BASIC: { case BASIC: {
} }
default: { default: {
view = std::shared_ptr<IGameListView>( view = std::shared_ptr<IGamelistView>(
new BasicGameListView(mWindow, system->getRootFolder())); new BasicGamelistView(mWindow, system->getRootFolder()));
mState.viewstyle = BASIC; mState.viewstyle = BASIC;
break; break;
} }
@ -819,7 +819,7 @@ std::shared_ptr<IGameListView> ViewController::getGameListView(SystemData* syste
addChild(view.get()); addChild(view.get());
mGameListViews[system] = view; mGamelistViews[system] = view;
return view; return view;
} }
@ -924,7 +924,7 @@ void ViewController::render(const glm::mat4& parentTrans)
getSystemListView()->render(trans); getSystemListView()->render(trans);
// Draw the gamelists. // Draw the gamelists.
for (auto it = mGameListViews.cbegin(); it != mGameListViews.cend(); ++it) { for (auto it = mGamelistViews.cbegin(); it != mGamelistViews.cend(); ++it) {
// Same thing as for the system view, limit the rendering only to what needs to be drawn. // Same thing as for the system view, limit the rendering only to what needs to be drawn.
if (it->second == mCurrentView || (it->second == mPreviousView && isCameraMoving())) { if (it->second == mCurrentView || (it->second == mPreviousView && isCameraMoving())) {
// Clipping. // Clipping.
@ -970,9 +970,9 @@ void ViewController::preload()
(*it)->getIndex()->resetFilters(); (*it)->getIndex()->resetFilters();
if (Settings::getInstance()->getBool("PreloadGamelists")) if (Settings::getInstance()->getBool("PreloadGamelists"))
getGameListView(*it)->preloadGamelist(); getGamelistView(*it)->preloadGamelist();
else else
getGameListView(*it); getGamelistView(*it);
} }
// Load navigation sounds, either from the theme if it supports it, or otherwise from // Load navigation sounds, either from the theme if it supports it, or otherwise from
@ -989,9 +989,9 @@ void ViewController::preload()
NavigationSounds::getInstance().loadThemeNavigationSounds(nullptr); NavigationSounds::getInstance().loadThemeNavigationSounds(nullptr);
} }
void ViewController::reloadGameListView(IGameListView* view, bool reloadTheme) void ViewController::reloadGamelistView(IGamelistView* view, bool reloadTheme)
{ {
for (auto it = mGameListViews.cbegin(); it != mGameListViews.cend(); ++it) { for (auto it = mGamelistViews.cbegin(); it != mGamelistViews.cend(); ++it) {
if (it->second.get() == view) { if (it->second.get() == view) {
bool isCurrent = (mCurrentView == it->second); bool isCurrent = (mCurrentView == it->second);
SystemData* system = it->first; SystemData* system = it->first;
@ -1001,7 +1001,7 @@ void ViewController::reloadGameListView(IGameListView* view, bool reloadTheme)
std::vector<FileData*> cursorHistoryTemp; std::vector<FileData*> cursorHistoryTemp;
it->second->copyCursorHistory(cursorHistoryTemp); it->second->copyCursorHistory(cursorHistoryTemp);
mGameListViews.erase(it); mGamelistViews.erase(it);
if (isCurrent) if (isCurrent)
mCurrentView = nullptr; mCurrentView = nullptr;
@ -1009,7 +1009,7 @@ void ViewController::reloadGameListView(IGameListView* view, bool reloadTheme)
if (reloadTheme) if (reloadTheme)
system->loadTheme(); system->loadTheme();
system->getIndex()->setKidModeFilters(); system->getIndex()->setKidModeFilters();
std::shared_ptr<IGameListView> newView = getGameListView(system); std::shared_ptr<IGamelistView> newView = getGamelistView(system);
// To counter having come from a placeholder. // To counter having come from a placeholder.
if (!cursor->isPlaceHolder()) { if (!cursor->isPlaceHolder()) {
@ -1043,19 +1043,19 @@ void ViewController::reloadAll()
cancelViewTransitions(); cancelViewTransitions();
// Clear all GameListViews. // Clear all GamelistViews.
std::map<SystemData*, FileData*> cursorMap; std::map<SystemData*, FileData*> cursorMap;
for (auto it = mGameListViews.cbegin(); it != mGameListViews.cend(); ++it) for (auto it = mGamelistViews.cbegin(); it != mGamelistViews.cend(); ++it)
cursorMap[it->first] = it->second->getCursor(); cursorMap[it->first] = it->second->getCursor();
mGameListViews.clear(); mGamelistViews.clear();
mCurrentView = nullptr; mCurrentView = nullptr;
// Load themes, create GameListViews and reset filters. // Load themes, create GamelistViews and reset filters.
for (auto it = cursorMap.cbegin(); it != cursorMap.cend(); ++it) { for (auto it = cursorMap.cbegin(); it != cursorMap.cend(); ++it) {
it->first->loadTheme(); it->first->loadTheme();
it->first->getIndex()->resetFilters(); it->first->getIndex()->resetFilters();
getGameListView(it->first)->setCursor(it->second); getGamelistView(it->first)->setCursor(it->second);
} }
// Rebuild SystemListView. // Rebuild SystemListView.
@ -1064,7 +1064,7 @@ void ViewController::reloadAll()
// Update mCurrentView since the pointers changed. // Update mCurrentView since the pointers changed.
if (mState.viewing == GAME_LIST) { if (mState.viewing == GAME_LIST) {
mCurrentView = getGameListView(mState.getSystem()); mCurrentView = getGamelistView(mState.getSystem());
} }
else if (mState.viewing == SYSTEM_SELECT) { else if (mState.viewing == SYSTEM_SELECT) {
SystemData* system = mState.getSystem(); SystemData* system = mState.getSystem();

View file

@ -20,7 +20,7 @@
#include <vector> #include <vector>
class IGameListView; class IGamelistView;
class SystemData; class SystemData;
class SystemView; class SystemView;
@ -36,25 +36,25 @@ public:
void noGamesDialog(); void noGamesDialog();
void invalidAlternativeEmulatorDialog(); void invalidAlternativeEmulatorDialog();
// Try to completely populate the GameListView map. // Try to completely populate the GamelistView map.
// Caches things so there's no pauses during transitions. // Caches things so there's no pauses during transitions.
void preload(); void preload();
// If a basic view detected a metadata change, it can request to recreate // If a basic view detected a metadata change, it can request to recreate
// the current gamelist view (as it may change to be detailed). // the current gamelist view (as it may change to be detailed).
void reloadGameListView(IGameListView* gamelist, bool reloadTheme = false); void reloadGamelistView(IGamelistView* gamelist, bool reloadTheme = false);
void reloadGameListView(SystemData* system, bool reloadTheme = false) void reloadGamelistView(SystemData* system, bool reloadTheme = false)
{ {
reloadGameListView(getGameListView(system).get(), reloadTheme); reloadGamelistView(getGamelistView(system).get(), reloadTheme);
} }
// Reload everything with a theme. // Reload everything with a theme.
// Used when the "ThemeSet" setting changes. // Used when the "ThemeSet" setting changes.
void reloadAll(); void reloadAll();
// Navigation. // Navigation.
void goToNextGameList(); void goToNextGamelist();
void goToPrevGameList(); void goToPrevGamelist();
void goToGameList(SystemData* system); void goToGamelist(SystemData* system);
void goToSystemView(SystemData* system, bool playTransition); void goToSystemView(SystemData* system, bool playTransition);
void goToSystem(SystemData* system, bool animate); void goToSystem(SystemData* system, bool animate);
void goToStart(bool playTransition); void goToStart(bool playTransition);
@ -65,7 +65,7 @@ public:
void cancelViewTransitions(); void cancelViewTransitions();
void stopScrolling(); void stopScrolling();
void onFileChanged(FileData* file, bool reloadGameList); void onFileChanged(FileData* file, bool reloadGamelist);
void triggerGameLaunch(FileData* game) void triggerGameLaunch(FileData* game)
{ {
mGameToLaunch = game; mGameToLaunch = game;
@ -84,7 +84,7 @@ public:
GAME_LIST GAME_LIST
}; };
enum GameListViewStyle { enum GamelistViewStyle {
AUTOMATIC, // Replace with AllowShortEnumsOnASingleLine: false (clang-format >=11.0). AUTOMATIC, // Replace with AllowShortEnumsOnASingleLine: false (clang-format >=11.0).
BASIC, BASIC,
DETAILED, DETAILED,
@ -94,7 +94,7 @@ public:
struct State { struct State {
ViewMode viewing; ViewMode viewing;
GameListViewStyle viewstyle; GamelistViewStyle viewstyle;
SystemData* getSystem() const SystemData* getSystem() const
{ {
@ -112,9 +112,9 @@ public:
virtual std::vector<HelpPrompt> getHelpPrompts() override; virtual std::vector<HelpPrompt> getHelpPrompts() override;
virtual HelpStyle getHelpStyle() override; virtual HelpStyle getHelpStyle() override;
std::shared_ptr<IGameListView> getGameListView(SystemData* system); std::shared_ptr<IGamelistView> getGamelistView(SystemData* system);
std::shared_ptr<SystemView> getSystemListView(); std::shared_ptr<SystemView> getSystemListView();
void removeGameListView(SystemData* system); void removeGamelistView(SystemData* system);
// Font Awesome symbols. // Font Awesome symbols.
static const std::string CONTROLLER_CHAR; static const std::string CONTROLLER_CHAR;
@ -144,7 +144,7 @@ private:
std::shared_ptr<GuiComponent> mCurrentView; std::shared_ptr<GuiComponent> mCurrentView;
std::shared_ptr<GuiComponent> mPreviousView; std::shared_ptr<GuiComponent> mPreviousView;
std::shared_ptr<GuiComponent> mSkipView; std::shared_ptr<GuiComponent> mSkipView;
std::map<SystemData*, std::shared_ptr<IGameListView>> mGameListViews; std::map<SystemData*, std::shared_ptr<IGamelistView>> mGamelistViews;
std::shared_ptr<SystemView> mSystemListView; std::shared_ptr<SystemView> mSystemListView;
FileData* mGameToLaunch; FileData* mGameToLaunch;

View file

@ -1,12 +1,12 @@
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
// //
// EmulationStation Desktop Edition // EmulationStation Desktop Edition
// BasicGameListView.cpp // BasicGamelistView.cpp
// //
// Interface that defines a GameListView of the type 'Basic'. // Interface that defines a GamelistView of the type 'Basic'.
// //
#include "views/gamelist/BasicGameListView.h" #include "views/gamelist/BasicGamelistView.h"
#include "CollectionSystemsManager.h" #include "CollectionSystemsManager.h"
#include "Settings.h" #include "Settings.h"
@ -15,8 +15,8 @@
#include "views/UIModeController.h" #include "views/UIModeController.h"
#include "views/ViewController.h" #include "views/ViewController.h"
BasicGameListView::BasicGameListView(Window* window, FileData* root) BasicGamelistView::BasicGamelistView(Window* window, FileData* root)
: ISimpleGameListView(window, root) : ISimpleGamelistView(window, root)
, mList(window) , mList(window)
{ {
mList.setSize(mSize.x, mSize.y * 0.8f); mList.setSize(mSize.x, mSize.y * 0.8f);
@ -27,27 +27,27 @@ BasicGameListView::BasicGameListView(Window* window, FileData* root)
populateList(root->getChildrenListToDisplay(), root); populateList(root->getChildrenListToDisplay(), root);
} }
void BasicGameListView::onThemeChanged(const std::shared_ptr<ThemeData>& theme) void BasicGamelistView::onThemeChanged(const std::shared_ptr<ThemeData>& theme)
{ {
ISimpleGameListView::onThemeChanged(theme); ISimpleGamelistView::onThemeChanged(theme);
using namespace ThemeFlags; using namespace ThemeFlags;
mList.applyTheme(theme, getName(), "gamelist", ALL); mList.applyTheme(theme, getName(), "gamelist", ALL);
sortChildren(); sortChildren();
} }
void BasicGameListView::onFileChanged(FileData* file, bool reloadGameList) void BasicGamelistView::onFileChanged(FileData* file, bool reloadGamelist)
{ {
if (reloadGameList) { if (reloadGamelist) {
// Might switch to a detailed view. // Might switch to a detailed view.
ViewController::getInstance()->reloadGameListView(this); ViewController::getInstance()->reloadGamelistView(this);
return; return;
} }
ISimpleGameListView::onFileChanged(file, reloadGameList); ISimpleGamelistView::onFileChanged(file, reloadGamelist);
} }
void BasicGameListView::populateList(const std::vector<FileData*>& files, FileData* firstEntry) void BasicGamelistView::populateList(const std::vector<FileData*>& files, FileData* firstEntry)
{ {
mFirstGameEntry = nullptr; mFirstGameEntry = nullptr;
bool favoriteStar = true; bool favoriteStar = true;
@ -119,7 +119,7 @@ void BasicGameListView::populateList(const std::vector<FileData*>& files, FileDa
generateFirstLetterIndex(files); generateFirstLetterIndex(files);
} }
void BasicGameListView::setCursor(FileData* cursor) void BasicGamelistView::setCursor(FileData* cursor)
{ {
if (!mList.setCursor(cursor) && (!cursor->isPlaceHolder())) { if (!mList.setCursor(cursor) && (!cursor->isPlaceHolder())) {
populateList(cursor->getParent()->getChildrenListToDisplay(), cursor->getParent()); populateList(cursor->getParent()->getChildrenListToDisplay(), cursor->getParent());
@ -146,7 +146,7 @@ void BasicGameListView::setCursor(FileData* cursor)
} }
} }
void BasicGameListView::addPlaceholder(FileData* firstEntry) void BasicGamelistView::addPlaceholder(FileData* firstEntry)
{ {
// Empty list, add a placeholder. // Empty list, add a placeholder.
FileData* placeholder; FileData* placeholder;
@ -159,13 +159,13 @@ void BasicGameListView::addPlaceholder(FileData* firstEntry)
mList.add(placeholder->getName(), placeholder, (placeholder->getType() == PLACEHOLDER)); mList.add(placeholder->getName(), placeholder, (placeholder->getType() == PLACEHOLDER));
} }
void BasicGameListView::launch(FileData* game) void BasicGamelistView::launch(FileData* game)
{ {
// This triggers ViewController to launch the game. // This triggers ViewController to launch the game.
ViewController::getInstance()->triggerGameLaunch(game); ViewController::getInstance()->triggerGameLaunch(game);
} }
void BasicGameListView::remove(FileData* game, bool deleteFile) void BasicGamelistView::remove(FileData* game, bool deleteFile)
{ {
// Delete the game file on the filesystem. // Delete the game file on the filesystem.
if (deleteFile) if (deleteFile)
@ -204,7 +204,7 @@ void BasicGameListView::remove(FileData* game, bool deleteFile)
} }
} }
void BasicGameListView::removeMedia(FileData* game) void BasicGamelistView::removeMedia(FileData* game)
{ {
std::string systemMediaDir = FileData::getMediaDirectory() + game->getSystem()->getName(); std::string systemMediaDir = FileData::getMediaDirectory() + game->getSystem()->getName();
std::string mediaType; std::string mediaType;
@ -308,7 +308,7 @@ void BasicGameListView::removeMedia(FileData* game)
} }
} }
std::vector<HelpPrompt> BasicGameListView::getHelpPrompts() std::vector<HelpPrompt> BasicGamelistView::getHelpPrompts()
{ {
std::vector<HelpPrompt> prompts; std::vector<HelpPrompt> prompts;

View file

@ -1,24 +1,24 @@
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
// //
// EmulationStation Desktop Edition // EmulationStation Desktop Edition
// BasicGameListView.h // BasicGamelistView.h
// //
// Interface that defines a GameListView of the type 'basic'. // Interface that defines a GamelistView of the type 'basic'.
// //
#ifndef ES_APP_VIEWS_GAME_LIST_BASIC_GAME_LIST_VIEW_H #ifndef ES_APP_VIEWS_GAME_LIST_BASIC_GAME_LIST_VIEW_H
#define ES_APP_VIEWS_GAME_LIST_BASIC_GAME_LIST_VIEW_H #define ES_APP_VIEWS_GAME_LIST_BASIC_GAME_LIST_VIEW_H
#include "components/TextListComponent.h" #include "components/TextListComponent.h"
#include "views/gamelist/ISimpleGameListView.h" #include "views/gamelist/ISimpleGamelistView.h"
class BasicGameListView : public ISimpleGameListView class BasicGamelistView : public ISimpleGamelistView
{ {
public: public:
BasicGameListView(Window* window, FileData* root); BasicGamelistView(Window* window, FileData* root);
// Called when a FileData* is added, has its metadata changed, or is removed. // Called when a FileData* is added, has its metadata changed, or is removed.
virtual void onFileChanged(FileData* file, bool reloadGameList) override; virtual void onFileChanged(FileData* file, bool reloadGamelist) override;
virtual void onThemeChanged(const std::shared_ptr<ThemeData>& theme) override; virtual void onThemeChanged(const std::shared_ptr<ThemeData>& theme) override;
virtual void setCursor(FileData* cursor) override; virtual void setCursor(FileData* cursor) override;

View file

@ -1,12 +1,12 @@
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
// //
// EmulationStation Desktop Edition // EmulationStation Desktop Edition
// DetailedGameListView.cpp // DetailedGamelistView.cpp
// //
// Interface that defines a GameListView of the type 'detailed'. // Interface that defines a GamelistView of the type 'detailed'.
// //
#include "views/gamelist/DetailedGameListView.h" #include "views/gamelist/DetailedGamelistView.h"
#include "CollectionSystemsManager.h" #include "CollectionSystemsManager.h"
#include "SystemData.h" #include "SystemData.h"
@ -16,8 +16,8 @@
#define FADE_IN_START_OPACITY 0.5f #define FADE_IN_START_OPACITY 0.5f
#define FADE_IN_TIME 650 #define FADE_IN_TIME 650
DetailedGameListView::DetailedGameListView(Window* window, FileData* root) DetailedGamelistView::DetailedGamelistView(Window* window, FileData* root)
: BasicGameListView(window, root) : BasicGamelistView(window, root)
, mThumbnail(window) , mThumbnail(window)
, mMarquee(window) , mMarquee(window)
, mImage(window) , mImage(window)
@ -137,9 +137,9 @@ DetailedGameListView::DetailedGameListView(Window* window, FileData* root)
initMDValues(); initMDValues();
} }
void DetailedGameListView::onThemeChanged(const std::shared_ptr<ThemeData>& theme) void DetailedGamelistView::onThemeChanged(const std::shared_ptr<ThemeData>& theme)
{ {
BasicGameListView::onThemeChanged(theme); BasicGamelistView::onThemeChanged(theme);
using namespace ThemeFlags; using namespace ThemeFlags;
mThumbnail.applyTheme(theme, getName(), "md_thumbnail", mThumbnail.applyTheme(theme, getName(), "md_thumbnail",
@ -188,7 +188,7 @@ void DetailedGameListView::onThemeChanged(const std::shared_ptr<ThemeData>& them
sortChildren(); sortChildren();
} }
void DetailedGameListView::initMDLabels() void DetailedGamelistView::initMDLabels()
{ {
std::vector<TextComponent*> components = getMDLabels(); std::vector<TextComponent*> components = getMDLabels();
@ -218,7 +218,7 @@ void DetailedGameListView::initMDLabels()
} }
} }
void DetailedGameListView::initMDValues() void DetailedGamelistView::initMDValues()
{ {
std::vector<TextComponent*> labels = getMDLabels(); std::vector<TextComponent*> labels = getMDLabels();
std::vector<GuiComponent*> values = getMDValues(); std::vector<GuiComponent*> values = getMDValues();
@ -253,7 +253,7 @@ void DetailedGameListView::initMDValues()
mDescContainer.setSize(mDescContainer.getSize().x, mSize.y - mDescContainer.getPosition().y); mDescContainer.setSize(mDescContainer.getSize().x, mSize.y - mDescContainer.getPosition().y);
} }
void DetailedGameListView::updateInfoPanel() void DetailedGamelistView::updateInfoPanel()
{ {
FileData* file = (mList.size() == 0 || mList.isScrolling()) ? nullptr : mList.getSelected(); FileData* file = (mList.size() == 0 || mList.isScrolling()) ? nullptr : mList.getSelected();
@ -474,12 +474,12 @@ void DetailedGameListView::updateInfoPanel()
} }
} }
void DetailedGameListView::launch(FileData* game) void DetailedGamelistView::launch(FileData* game)
{ {
ViewController::getInstance()->triggerGameLaunch(game); ViewController::getInstance()->triggerGameLaunch(game);
} }
std::vector<TextComponent*> DetailedGameListView::getMDLabels() std::vector<TextComponent*> DetailedGamelistView::getMDLabels()
{ {
std::vector<TextComponent*> ret; std::vector<TextComponent*> ret;
ret.push_back(&mLblRating); ret.push_back(&mLblRating);
@ -493,7 +493,7 @@ std::vector<TextComponent*> DetailedGameListView::getMDLabels()
return ret; return ret;
} }
std::vector<GuiComponent*> DetailedGameListView::getMDValues() std::vector<GuiComponent*> DetailedGamelistView::getMDValues()
{ {
std::vector<GuiComponent*> ret; std::vector<GuiComponent*> ret;
ret.push_back(&mRating); ret.push_back(&mRating);
@ -507,16 +507,16 @@ std::vector<GuiComponent*> DetailedGameListView::getMDValues()
return ret; return ret;
} }
void DetailedGameListView::update(int deltaTime) void DetailedGamelistView::update(int deltaTime)
{ {
BasicGameListView::update(deltaTime); BasicGamelistView::update(deltaTime);
mImage.update(deltaTime); mImage.update(deltaTime);
if (ViewController::getInstance()->getGameLaunchTriggered() && mImage.isAnimationPlaying(0)) if (ViewController::getInstance()->getGameLaunchTriggered() && mImage.isAnimationPlaying(0))
mImage.finishAnimation(0); mImage.finishAnimation(0);
} }
void DetailedGameListView::onShow() void DetailedGamelistView::onShow()
{ {
// Reset any Lottie animations. // Reset any Lottie animations.
for (auto extra : mThemeExtras) for (auto extra : mThemeExtras)

View file

@ -1,9 +1,9 @@
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
// //
// EmulationStation Desktop Edition // EmulationStation Desktop Edition
// DetailedGameListView.h // DetailedGamelistView.h
// //
// Interface that defines a GameListView of the type 'detailed'. // Interface that defines a GamelistView of the type 'detailed'.
// //
#ifndef ES_APP_VIEWS_GAME_LIST_DETAILED_GAME_LIST_VIEW_H #ifndef ES_APP_VIEWS_GAME_LIST_DETAILED_GAME_LIST_VIEW_H
@ -13,12 +13,12 @@
#include "components/DateTimeComponent.h" #include "components/DateTimeComponent.h"
#include "components/RatingComponent.h" #include "components/RatingComponent.h"
#include "components/ScrollableContainer.h" #include "components/ScrollableContainer.h"
#include "views/gamelist/BasicGameListView.h" #include "views/gamelist/BasicGamelistView.h"
class DetailedGameListView : public BasicGameListView class DetailedGamelistView : public BasicGamelistView
{ {
public: public:
DetailedGameListView(Window* window, FileData* root); DetailedGamelistView(Window* window, FileData* root);
virtual void onShow() override; virtual void onShow() override;
virtual void onThemeChanged(const std::shared_ptr<ThemeData>& theme) override; virtual void onThemeChanged(const std::shared_ptr<ThemeData>& theme) override;

View file

@ -1,12 +1,12 @@
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
// //
// EmulationStation Desktop Edition // EmulationStation Desktop Edition
// GridGameListView.cpp // GridGamelistView.cpp
// //
// Interface that defines a GameListView of the type 'grid'. // Interface that defines a GamelistView of the type 'grid'.
// //
#include "views/gamelist/GridGameListView.h" #include "views/gamelist/GridGamelistView.h"
#include "CollectionSystemsManager.h" #include "CollectionSystemsManager.h"
#include "Settings.h" #include "Settings.h"
@ -19,8 +19,8 @@
#define FADE_IN_START_OPACITY 0.5f #define FADE_IN_START_OPACITY 0.5f
#define FADE_IN_TIME 650 #define FADE_IN_TIME 650
GridGameListView::GridGameListView(Window* window, FileData* root) GridGamelistView::GridGamelistView(Window* window, FileData* root)
: ISimpleGameListView(window, root) : ISimpleGamelistView(window, root)
, mGrid(window) , mGrid(window)
, mMarquee(window) , mMarquee(window)
, mImage(window) , mImage(window)
@ -126,18 +126,18 @@ GridGameListView::GridGameListView(Window* window, FileData* root)
updateInfoPanel(); updateInfoPanel();
} }
void GridGameListView::onFileChanged(FileData* file, bool reloadGameList) void GridGamelistView::onFileChanged(FileData* file, bool reloadGamelist)
{ {
if (reloadGameList) { if (reloadGamelist) {
// Might switch to a detailed view. // Might switch to a detailed view.
ViewController::getInstance()->reloadGameListView(this); ViewController::getInstance()->reloadGamelistView(this);
return; return;
} }
ISimpleGameListView::onFileChanged(file, reloadGameList); ISimpleGamelistView::onFileChanged(file, reloadGamelist);
} }
void GridGameListView::setCursor(FileData* cursor) void GridGamelistView::setCursor(FileData* cursor)
{ {
if (!mGrid.setCursor(cursor) && (!cursor->isPlaceHolder())) { if (!mGrid.setCursor(cursor) && (!cursor->isPlaceHolder())) {
populateList(cursor->getParent()->getChildrenListToDisplay(), cursor->getParent()); populateList(cursor->getParent()->getChildrenListToDisplay(), cursor->getParent());
@ -163,7 +163,7 @@ void GridGameListView::setCursor(FileData* cursor)
} }
} }
bool GridGameListView::input(InputConfig* config, Input input) bool GridGamelistView::input(InputConfig* config, Input input)
{ {
if (input.value == 0 && if (input.value == 0 &&
(config->isMappedLike("left", input) || config->isMappedLike("right", input) || (config->isMappedLike("left", input) || config->isMappedLike("right", input) ||
@ -183,10 +183,10 @@ bool GridGameListView::input(InputConfig* config, Input input)
if (config->isMappedLike("left", input) || config->isMappedLike("right", input)) if (config->isMappedLike("left", input) || config->isMappedLike("right", input))
return GuiComponent::input(config, input); return GuiComponent::input(config, input);
return ISimpleGameListView::input(config, input); return ISimpleGamelistView::input(config, input);
} }
const std::string GridGameListView::getImagePath(FileData* file) const std::string GridGamelistView::getImagePath(FileData* file)
{ {
ImageSource src = mGrid.getImageSource(); ImageSource src = mGrid.getImageSource();
@ -210,7 +210,7 @@ const std::string GridGameListView::getImagePath(FileData* file)
return file->getThumbnailPath(); return file->getThumbnailPath();
} }
void GridGameListView::populateList(const std::vector<FileData*>& files, FileData* firstEntry) void GridGamelistView::populateList(const std::vector<FileData*>& files, FileData* firstEntry)
{ {
firstGameEntry = nullptr; firstGameEntry = nullptr;
@ -231,9 +231,9 @@ void GridGameListView::populateList(const std::vector<FileData*>& files, FileDat
generateFirstLetterIndex(files); generateFirstLetterIndex(files);
} }
void GridGameListView::onThemeChanged(const std::shared_ptr<ThemeData>& theme) void GridGamelistView::onThemeChanged(const std::shared_ptr<ThemeData>& theme)
{ {
ISimpleGameListView::onThemeChanged(theme); ISimpleGamelistView::onThemeChanged(theme);
using namespace ThemeFlags; using namespace ThemeFlags;
mGrid.applyTheme(theme, getName(), "gamegrid", ALL); mGrid.applyTheme(theme, getName(), "gamegrid", ALL);
@ -286,7 +286,7 @@ void GridGameListView::onThemeChanged(const std::shared_ptr<ThemeData>& theme)
sortChildren(); sortChildren();
} }
void GridGameListView::onShow() void GridGamelistView::onShow()
{ {
// Reset any Lottie animations. // Reset any Lottie animations.
for (auto extra : mThemeExtras) for (auto extra : mThemeExtras)
@ -296,7 +296,7 @@ void GridGameListView::onShow()
updateInfoPanel(); updateInfoPanel();
} }
void GridGameListView::initMDLabels() void GridGamelistView::initMDLabels()
{ {
std::vector<TextComponent*> components = getMDLabels(); std::vector<TextComponent*> components = getMDLabels();
@ -326,7 +326,7 @@ void GridGameListView::initMDLabels()
} }
} }
void GridGameListView::initMDValues() void GridGamelistView::initMDValues()
{ {
std::vector<TextComponent*> labels = getMDLabels(); std::vector<TextComponent*> labels = getMDLabels();
std::vector<GuiComponent*> values = getMDValues(); std::vector<GuiComponent*> values = getMDValues();
@ -360,7 +360,7 @@ void GridGameListView::initMDValues()
mDescContainer.setSize(mDescContainer.getSize().x, mSize.y - mDescContainer.getPosition().y); mDescContainer.setSize(mDescContainer.getSize().x, mSize.y - mDescContainer.getPosition().y);
} }
void GridGameListView::updateInfoPanel() void GridGamelistView::updateInfoPanel()
{ {
FileData* file = (mGrid.size() == 0 || mGrid.isScrolling()) ? nullptr : mGrid.getSelected(); FileData* file = (mGrid.size() == 0 || mGrid.isScrolling()) ? nullptr : mGrid.getSelected();
bool hideMetaDataFields = false; bool hideMetaDataFields = false;
@ -507,7 +507,7 @@ void GridGameListView::updateInfoPanel()
} }
} }
void GridGameListView::addPlaceholder(FileData* firstEntry) void GridGamelistView::addPlaceholder(FileData* firstEntry)
{ {
// Empty list, add a placeholder. // Empty list, add a placeholder.
FileData* placeholder; FileData* placeholder;
@ -520,13 +520,13 @@ void GridGameListView::addPlaceholder(FileData* firstEntry)
mGrid.add(placeholder->getName(), "", placeholder); mGrid.add(placeholder->getName(), "", placeholder);
} }
void GridGameListView::launch(FileData* game) void GridGamelistView::launch(FileData* game)
{ {
// This triggers ViewController to launch the game. // This triggers ViewController to launch the game.
ViewController::getInstance()->triggerGameLaunch(game); ViewController::getInstance()->triggerGameLaunch(game);
} }
void GridGameListView::remove(FileData* game, bool deleteFile) void GridGamelistView::remove(FileData* game, bool deleteFile)
{ {
// Delete the game file on the filesystem. // Delete the game file on the filesystem.
if (deleteFile) if (deleteFile)
@ -560,7 +560,7 @@ void GridGameListView::remove(FileData* game, bool deleteFile)
onFileChanged(parent, false); onFileChanged(parent, false);
} }
void GridGameListView::removeMedia(FileData* game) void GridGamelistView::removeMedia(FileData* game)
{ {
std::string systemMediaDir = FileData::getMediaDirectory() + game->getSystem()->getName(); std::string systemMediaDir = FileData::getMediaDirectory() + game->getSystem()->getName();
std::string mediaType; std::string mediaType;
@ -661,7 +661,7 @@ void GridGameListView::removeMedia(FileData* game)
} }
} }
std::vector<TextComponent*> GridGameListView::getMDLabels() std::vector<TextComponent*> GridGamelistView::getMDLabels()
{ {
std::vector<TextComponent*> ret; std::vector<TextComponent*> ret;
ret.push_back(&mLblRating); ret.push_back(&mLblRating);
@ -675,7 +675,7 @@ std::vector<TextComponent*> GridGameListView::getMDLabels()
return ret; return ret;
} }
std::vector<GuiComponent*> GridGameListView::getMDValues() std::vector<GuiComponent*> GridGamelistView::getMDValues()
{ {
std::vector<GuiComponent*> ret; std::vector<GuiComponent*> ret;
ret.push_back(&mRating); ret.push_back(&mRating);
@ -689,7 +689,7 @@ std::vector<GuiComponent*> GridGameListView::getMDValues()
return ret; return ret;
} }
std::vector<HelpPrompt> GridGameListView::getHelpPrompts() std::vector<HelpPrompt> GridGamelistView::getHelpPrompts()
{ {
std::vector<HelpPrompt> prompts; std::vector<HelpPrompt> prompts;
@ -736,8 +736,8 @@ std::vector<HelpPrompt> GridGameListView::getHelpPrompts()
return prompts; return prompts;
} }
void GridGameListView::update(int deltaTime) void GridGamelistView::update(int deltaTime)
{ {
// Update. // Update.
ISimpleGameListView::update(deltaTime); ISimpleGamelistView::update(deltaTime);
} }

View file

@ -1,9 +1,9 @@
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
// //
// EmulationStation Desktop Edition // EmulationStation Desktop Edition
// GridGameListView.h // GridGamelistView.h
// //
// Interface that defines a GameListView of the type 'grid'. // Interface that defines a GamelistView of the type 'grid'.
// //
#ifndef ES_APP_VIEWS_GAME_LIST_GRID_GAME_LIST_VIEW_H #ifndef ES_APP_VIEWS_GAME_LIST_GRID_GAME_LIST_VIEW_H
@ -15,16 +15,16 @@
#include "components/RatingComponent.h" #include "components/RatingComponent.h"
#include "components/ScrollableContainer.h" #include "components/ScrollableContainer.h"
#include "components/VideoComponent.h" #include "components/VideoComponent.h"
#include "views/gamelist/ISimpleGameListView.h" #include "views/gamelist/ISimpleGamelistView.h"
class GridGameListView : public ISimpleGameListView class GridGamelistView : public ISimpleGamelistView
{ {
public: public:
GridGameListView(Window* window, FileData* root); GridGamelistView(Window* window, FileData* root);
virtual ~GridGameListView() {} virtual ~GridGamelistView() {}
// Called when a FileData* is added, has its metadata changed, or is removed. // Called when a FileData* is added, has its metadata changed, or is removed.
virtual void onFileChanged(FileData* file, bool reloadGameList) override; virtual void onFileChanged(FileData* file, bool reloadGamelist) override;
virtual void onShow() override; virtual void onShow() override;
virtual void onThemeChanged(const std::shared_ptr<ThemeData>& theme) override; virtual void onThemeChanged(const std::shared_ptr<ThemeData>& theme) override;

View file

@ -1,12 +1,12 @@
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
// //
// EmulationStation Desktop Edition // EmulationStation Desktop Edition
// IGameListView.cpp // IGamelistView.cpp
// //
// Interface that defines the minimum for a GameListView. // Interface that defines the minimum for a GamelistView.
// //
#include "views/gamelist/IGameListView.h" #include "views/gamelist/IGamelistView.h"
#include "Sound.h" #include "Sound.h"
#include "Window.h" #include "Window.h"
@ -14,7 +14,7 @@
#include "views/UIModeController.h" #include "views/UIModeController.h"
#include "views/ViewController.h" #include "views/ViewController.h"
IGameListView::IGameListView(Window* window, FileData* root) IGamelistView::IGamelistView(Window* window, FileData* root)
: GuiComponent(window) : GuiComponent(window)
, mRoot(root) , mRoot(root)
{ {
@ -22,13 +22,13 @@ IGameListView::IGameListView(Window* window, FileData* root)
static_cast<float>(Renderer::getScreenHeight())); static_cast<float>(Renderer::getScreenHeight()));
} }
void IGameListView::setTheme(const std::shared_ptr<ThemeData>& theme) void IGamelistView::setTheme(const std::shared_ptr<ThemeData>& theme)
{ {
mTheme = theme; mTheme = theme;
onThemeChanged(theme); onThemeChanged(theme);
} }
bool IGameListView::input(InputConfig* config, Input input) bool IGamelistView::input(InputConfig* config, Input input)
{ {
// Select button opens GuiGamelistOptions. // Select button opens GuiGamelistOptions.
if (!UIModeController::getInstance()->isUIModeKid() && // Line break. if (!UIModeController::getInstance()->isUIModeKid() && // Line break.
@ -44,22 +44,22 @@ bool IGameListView::input(InputConfig* config, Input input)
config->getDeviceId() == DEVICE_KEYBOARD && config->getDeviceId() == DEVICE_KEYBOARD &&
(SDL_GetModState() & (KMOD_LCTRL | KMOD_RCTRL)) && input.id == SDLK_r && (SDL_GetModState() & (KMOD_LCTRL | KMOD_RCTRL)) && input.id == SDLK_r &&
input.value != 0) { input.value != 0) {
LOG(LogDebug) << "IGameListView::input(): Reloading view"; LOG(LogDebug) << "IGamelistView::input(): Reloading view";
ViewController::getInstance()->reloadGameListView(this, true); ViewController::getInstance()->reloadGamelistView(this, true);
return true; return true;
} }
return GuiComponent::input(config, input); return GuiComponent::input(config, input);
} }
HelpStyle IGameListView::getHelpStyle() HelpStyle IGamelistView::getHelpStyle()
{ {
HelpStyle style; HelpStyle style;
style.applyTheme(mTheme, getName()); style.applyTheme(mTheme, getName());
return style; return style;
} }
void IGameListView::render(const glm::mat4& parentTrans) void IGamelistView::render(const glm::mat4& parentTrans)
{ {
glm::mat4 trans{parentTrans * getTransform()}; glm::mat4 trans{parentTrans * getTransform()};

View file

@ -1,9 +1,9 @@
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
// //
// EmulationStation Desktop Edition // EmulationStation Desktop Edition
// IGameListView.h // IGamelistView.h
// //
// Interface that defines the minimum for a GameListView. // Interface that defines the minimum for a GamelistView.
// //
#ifndef ES_APP_VIEWS_GAME_LIST_IGAME_LIST_VIEW_H #ifndef ES_APP_VIEWS_GAME_LIST_IGAME_LIST_VIEW_H
@ -16,15 +16,15 @@
class ThemeData; class ThemeData;
class Window; class Window;
// This is an interface that defines the minimum for a GameListView. // This is an interface that defines the minimum for a GamelistView.
class IGameListView : public GuiComponent class IGamelistView : public GuiComponent
{ {
public: public:
IGameListView(Window* window, FileData* root); IGamelistView(Window* window, FileData* root);
virtual ~IGameListView() {} virtual ~IGamelistView() {}
// Called when a FileData* is added, has its metadata changed, or is removed. // Called when a FileData* is added, has its metadata changed, or is removed.
virtual void onFileChanged(FileData* file, bool reloadGameList) = 0; virtual void onFileChanged(FileData* file, bool reloadGamelist) = 0;
// Called whenever the theme changes. // Called whenever the theme changes.
virtual void onThemeChanged(const std::shared_ptr<ThemeData>& theme) = 0; virtual void onThemeChanged(const std::shared_ptr<ThemeData>& theme) = 0;

View file

@ -1,12 +1,12 @@
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
// //
// EmulationStation Desktop Edition // EmulationStation Desktop Edition
// ISimpleGameListView.cpp // ISimpleGamelistView.cpp
// //
// Interface that defines a simple gamelist view. // Interface that defines a simple gamelist view.
// //
#include "views/gamelist/ISimpleGameListView.h" #include "views/gamelist/ISimpleGamelistView.h"
#include "CollectionSystemsManager.h" #include "CollectionSystemsManager.h"
#include "FileFilterIndex.h" #include "FileFilterIndex.h"
@ -20,8 +20,8 @@
#include "Log.h" #include "Log.h"
ISimpleGameListView::ISimpleGameListView(Window* window, FileData* root) ISimpleGamelistView::ISimpleGamelistView(Window* window, FileData* root)
: IGameListView(window, root) : IGamelistView(window, root)
, mHeaderText(window) , mHeaderText(window)
, mHeaderImage(window) , mHeaderImage(window)
, mBackground(window) , mBackground(window)
@ -45,7 +45,7 @@ ISimpleGameListView::ISimpleGameListView(Window* window, FileData* root)
addChild(&mBackground); addChild(&mBackground);
} }
ISimpleGameListView::~ISimpleGameListView() ISimpleGamelistView::~ISimpleGamelistView()
{ {
// Remove theme extras. // Remove theme extras.
for (auto extra : mThemeExtras) { for (auto extra : mThemeExtras) {
@ -55,7 +55,7 @@ ISimpleGameListView::~ISimpleGameListView()
mThemeExtras.clear(); mThemeExtras.clear();
} }
void ISimpleGameListView::onThemeChanged(const std::shared_ptr<ThemeData>& theme) void ISimpleGamelistView::onThemeChanged(const std::shared_ptr<ThemeData>& theme)
{ {
using namespace ThemeFlags; using namespace ThemeFlags;
mBackground.applyTheme(theme, getName(), "background", ALL); mBackground.applyTheme(theme, getName(), "background", ALL);
@ -84,7 +84,7 @@ void ISimpleGameListView::onThemeChanged(const std::shared_ptr<ThemeData>& theme
} }
} }
void ISimpleGameListView::onFileChanged(FileData* file, bool reloadGameList) void ISimpleGamelistView::onFileChanged(FileData* file, bool reloadGamelist)
{ {
// We could be tricky here to be efficient; // We could be tricky here to be efficient;
// but this shouldn't happen very often so we'll just always repopulate. // but this shouldn't happen very often so we'll just always repopulate.
@ -99,7 +99,7 @@ void ISimpleGameListView::onFileChanged(FileData* file, bool reloadGameList)
} }
} }
bool ISimpleGameListView::input(InputConfig* config, Input input) bool ISimpleGamelistView::input(InputConfig* config, Input input)
{ {
if (input.value != 0) { if (input.value != 0) {
if (config->isMappedTo("a", input)) { if (config->isMappedTo("a", input)) {
@ -209,7 +209,7 @@ bool ISimpleGameListView::input(InputConfig* config, Input input)
onPauseVideo(); onPauseVideo();
onFocusLost(); onFocusLost();
stopListScrolling(); stopListScrolling();
ViewController::getInstance()->goToNextGameList(); ViewController::getInstance()->goToNextGamelist();
return true; return true;
} }
} }
@ -219,7 +219,7 @@ bool ISimpleGameListView::input(InputConfig* config, Input input)
onPauseVideo(); onPauseVideo();
onFocusLost(); onFocusLost();
stopListScrolling(); stopListScrolling();
ViewController::getInstance()->goToPrevGameList(); ViewController::getInstance()->goToPrevGamelist();
return true; return true;
} }
} }
@ -428,9 +428,9 @@ bool ISimpleGameListView::input(InputConfig* config, Input input)
// sorted yet. // sorted yet.
if (removedLastFavorite) { if (removedLastFavorite) {
ViewController::getInstance() ViewController::getInstance()
->getGameListView(entryToUpdate->getSystem()) ->getGamelistView(entryToUpdate->getSystem())
->setCursor(ViewController::getInstance() ->setCursor(ViewController::getInstance()
->getGameListView(entryToUpdate->getSystem()) ->getGamelistView(entryToUpdate->getSystem())
->getFirstEntry()); ->getFirstEntry());
} }
return true; return true;
@ -445,15 +445,15 @@ bool ISimpleGameListView::input(InputConfig* config, Input input)
// As the toggling of the game destroyed this object, we need to get the view // As the toggling of the game destroyed this object, we need to get the view
// from ViewController instead of using the reference that existed before the // from ViewController instead of using the reference that existed before the
// destruction. Otherwise we get random crashes. // destruction. Otherwise we get random crashes.
IGameListView* view = IGamelistView* view =
ViewController::getInstance()->getGameListView(system).get(); ViewController::getInstance()->getGamelistView(system).get();
// Jump to the first entry in the gamelist if the last favorite was unmarked. // Jump to the first entry in the gamelist if the last favorite was unmarked.
if (foldersOnTop && removedLastFavorite && if (foldersOnTop && removedLastFavorite &&
!entryToUpdate->getSystem()->isCustomCollection()) { !entryToUpdate->getSystem()->isCustomCollection()) {
ViewController::getInstance() ViewController::getInstance()
->getGameListView(entryToUpdate->getSystem()) ->getGamelistView(entryToUpdate->getSystem())
->setCursor(ViewController::getInstance() ->setCursor(ViewController::getInstance()
->getGameListView(entryToUpdate->getSystem()) ->getGamelistView(entryToUpdate->getSystem())
->getFirstGameEntry()); ->getFirstGameEntry());
} }
else if (removedLastFavorite && else if (removedLastFavorite &&
@ -469,8 +469,8 @@ bool ISimpleGameListView::input(InputConfig* config, Input input)
if (isEditing) { if (isEditing) {
for (auto it = SystemData::sSystemVector.begin(); for (auto it = SystemData::sSystemVector.begin();
it != SystemData::sSystemVector.end(); ++it) { it != SystemData::sSystemVector.end(); ++it) {
ViewController::getInstance()->getGameListView((*it))->onFileChanged( ViewController::getInstance()->getGamelistView((*it))->onFileChanged(
ViewController::getInstance()->getGameListView((*it))->getCursor(), ViewController::getInstance()->getGamelistView((*it))->getCursor(),
false); false);
} }
} }
@ -483,10 +483,10 @@ bool ISimpleGameListView::input(InputConfig* config, Input input)
} }
} }
return IGameListView::input(config, input); return IGamelistView::input(config, input);
} }
void ISimpleGameListView::generateGamelistInfo(FileData* cursor, FileData* firstEntry) void ISimpleGamelistView::generateGamelistInfo(FileData* cursor, FileData* firstEntry)
{ {
// Generate data needed for the gamelistInfo field, which is displayed from the // Generate data needed for the gamelistInfo field, which is displayed from the
// gamelist interfaces (Detailed/Video/Grid). // gamelist interfaces (Detailed/Video/Grid).
@ -525,7 +525,7 @@ void ISimpleGameListView::generateGamelistInfo(FileData* cursor, FileData* first
mIsFolder = true; mIsFolder = true;
} }
void ISimpleGameListView::generateFirstLetterIndex(const std::vector<FileData*>& files) void ISimpleGamelistView::generateFirstLetterIndex(const std::vector<FileData*>& files)
{ {
std::string firstChar; std::string firstChar;

View file

@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
// //
// EmulationStation Desktop Edition // EmulationStation Desktop Edition
// ISimpleGameListView.h // ISimpleGamelistView.h
// //
// Interface that defines a simple gamelist view. // Interface that defines a simple gamelist view.
// //
@ -11,18 +11,18 @@
#include "components/ImageComponent.h" #include "components/ImageComponent.h"
#include "components/TextComponent.h" #include "components/TextComponent.h"
#include "views/gamelist/IGameListView.h" #include "views/gamelist/IGamelistView.h"
#include <stack> #include <stack>
class ISimpleGameListView : public IGameListView class ISimpleGamelistView : public IGamelistView
{ {
public: public:
ISimpleGameListView(Window* window, FileData* root); ISimpleGamelistView(Window* window, FileData* root);
virtual ~ISimpleGameListView(); virtual ~ISimpleGamelistView();
// Called when a FileData* is added, has its metadata changed, or is removed. // Called when a FileData* is added, has its metadata changed, or is removed.
virtual void onFileChanged(FileData* file, bool reloadGameList) override; virtual void onFileChanged(FileData* file, bool reloadGamelist) override;
// Called whenever the theme changes. // Called whenever the theme changes.
virtual void onThemeChanged(const std::shared_ptr<ThemeData>& theme) override; virtual void onThemeChanged(const std::shared_ptr<ThemeData>& theme) override;

View file

@ -1,12 +1,12 @@
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
// //
// EmulationStation Desktop Edition // EmulationStation Desktop Edition
// VideoGameListView.cpp // VideoGamelistView.cpp
// //
// Interface that defines a GameListView of the type 'video'. // Interface that defines a GamelistView of the type 'video'.
// //
#include "views/gamelist/VideoGameListView.h" #include "views/gamelist/VideoGamelistView.h"
#include "CollectionSystemsManager.h" #include "CollectionSystemsManager.h"
#include "SystemData.h" #include "SystemData.h"
@ -18,8 +18,8 @@
#define FADE_IN_START_OPACITY 0.5f #define FADE_IN_START_OPACITY 0.5f
#define FADE_IN_TIME 650 #define FADE_IN_TIME 650
VideoGameListView::VideoGameListView(Window* window, FileData* root) VideoGamelistView::VideoGamelistView(Window* window, FileData* root)
: BasicGameListView(window, root) : BasicGamelistView(window, root)
, mThumbnail(window) , mThumbnail(window)
, mMarquee(window) , mMarquee(window)
, mImage(window) , mImage(window)
@ -142,11 +142,11 @@ VideoGameListView::VideoGameListView(Window* window, FileData* root)
initMDValues(); initMDValues();
} }
VideoGameListView::~VideoGameListView() { delete mVideo; } VideoGamelistView::~VideoGamelistView() { delete mVideo; }
void VideoGameListView::onThemeChanged(const std::shared_ptr<ThemeData>& theme) void VideoGamelistView::onThemeChanged(const std::shared_ptr<ThemeData>& theme)
{ {
BasicGameListView::onThemeChanged(theme); BasicGamelistView::onThemeChanged(theme);
using namespace ThemeFlags; using namespace ThemeFlags;
mThumbnail.applyTheme(theme, getName(), "md_thumbnail", mThumbnail.applyTheme(theme, getName(), "md_thumbnail",
@ -198,7 +198,7 @@ void VideoGameListView::onThemeChanged(const std::shared_ptr<ThemeData>& theme)
sortChildren(); sortChildren();
} }
void VideoGameListView::initMDLabels() void VideoGamelistView::initMDLabels()
{ {
std::vector<TextComponent*> components = getMDLabels(); std::vector<TextComponent*> components = getMDLabels();
@ -228,7 +228,7 @@ void VideoGameListView::initMDLabels()
} }
} }
void VideoGameListView::initMDValues() void VideoGamelistView::initMDValues()
{ {
std::vector<TextComponent*> labels = getMDLabels(); std::vector<TextComponent*> labels = getMDLabels();
std::vector<GuiComponent*> values = getMDValues(); std::vector<GuiComponent*> values = getMDValues();
@ -263,7 +263,7 @@ void VideoGameListView::initMDValues()
mDescContainer.setSize(mDescContainer.getSize().x, mSize.y - mDescContainer.getPosition().y); mDescContainer.setSize(mDescContainer.getSize().x, mSize.y - mDescContainer.getPosition().y);
} }
void VideoGameListView::updateInfoPanel() void VideoGamelistView::updateInfoPanel()
{ {
FileData* file = (mList.size() == 0 || mList.isScrolling()) ? nullptr : mList.getSelected(); FileData* file = (mList.size() == 0 || mList.isScrolling()) ? nullptr : mList.getSelected();
@ -502,12 +502,12 @@ void VideoGameListView::updateInfoPanel()
} }
} }
void VideoGameListView::launch(FileData* game) void VideoGamelistView::launch(FileData* game)
{ {
ViewController::getInstance()->triggerGameLaunch(game); ViewController::getInstance()->triggerGameLaunch(game);
} }
std::vector<TextComponent*> VideoGameListView::getMDLabels() std::vector<TextComponent*> VideoGamelistView::getMDLabels()
{ {
std::vector<TextComponent*> ret; std::vector<TextComponent*> ret;
ret.push_back(&mLblRating); ret.push_back(&mLblRating);
@ -521,7 +521,7 @@ std::vector<TextComponent*> VideoGameListView::getMDLabels()
return ret; return ret;
} }
std::vector<GuiComponent*> VideoGameListView::getMDValues() std::vector<GuiComponent*> VideoGamelistView::getMDValues()
{ {
std::vector<GuiComponent*> ret; std::vector<GuiComponent*> ret;
ret.push_back(&mRating); ret.push_back(&mRating);
@ -535,21 +535,21 @@ std::vector<GuiComponent*> VideoGameListView::getMDValues()
return ret; return ret;
} }
void VideoGameListView::update(int deltaTime) void VideoGamelistView::update(int deltaTime)
{ {
if (!mVideoPlaying) if (!mVideoPlaying)
mVideo->onHide(); mVideo->onHide();
else if (mVideoPlaying && !mVideo->isVideoPaused() && !mWindow->isScreensaverActive()) else if (mVideoPlaying && !mVideo->isVideoPaused() && !mWindow->isScreensaverActive())
mVideo->onShow(); mVideo->onShow();
BasicGameListView::update(deltaTime); BasicGamelistView::update(deltaTime);
mVideo->update(deltaTime); mVideo->update(deltaTime);
if (ViewController::getInstance()->getGameLaunchTriggered() && mVideo->isAnimationPlaying(0)) if (ViewController::getInstance()->getGameLaunchTriggered() && mVideo->isAnimationPlaying(0))
mVideo->finishAnimation(0); mVideo->finishAnimation(0);
} }
void VideoGameListView::onShow() void VideoGamelistView::onShow()
{ {
// Reset any Lottie animations. // Reset any Lottie animations.
for (auto extra : mThemeExtras) for (auto extra : mThemeExtras)

View file

@ -1,9 +1,9 @@
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
// //
// EmulationStation Desktop Edition // EmulationStation Desktop Edition
// VideoGameListView.h // VideoGamelistView.h
// //
// Interface that defines a GameListView of the type 'video'. // Interface that defines a GamelistView of the type 'video'.
// //
#ifndef ES_APP_VIEWS_GAME_LIST_VIDEO_GAME_LIST_VIEW_H #ifndef ES_APP_VIEWS_GAME_LIST_VIDEO_GAME_LIST_VIEW_H
@ -13,15 +13,15 @@
#include "components/DateTimeComponent.h" #include "components/DateTimeComponent.h"
#include "components/RatingComponent.h" #include "components/RatingComponent.h"
#include "components/ScrollableContainer.h" #include "components/ScrollableContainer.h"
#include "views/gamelist/BasicGameListView.h" #include "views/gamelist/BasicGamelistView.h"
class VideoComponent; class VideoComponent;
class VideoGameListView : public BasicGameListView class VideoGamelistView : public BasicGamelistView
{ {
public: public:
VideoGameListView(Window* window, FileData* root); VideoGamelistView(Window* window, FileData* root);
virtual ~VideoGameListView(); virtual ~VideoGamelistView();
virtual void onShow() override; virtual void onShow() override;
virtual void onThemeChanged(const std::shared_ptr<ThemeData>& theme) override; virtual void onThemeChanged(const std::shared_ptr<ThemeData>& theme) override;

View file

@ -3,7 +3,7 @@
// EmulationStation Desktop Edition // EmulationStation Desktop Edition
// GridTileComponent.cpp // GridTileComponent.cpp
// //
// X*Y tile grid, used indirectly by GridGameListView via ImageGridComponent. // X*Y tile grid, used indirectly by GridGamelistView via ImageGridComponent.
// //
#include "GridTileComponent.h" #include "GridTileComponent.h"

View file

@ -3,7 +3,7 @@
// EmulationStation Desktop Edition // EmulationStation Desktop Edition
// GridTileComponent.h // GridTileComponent.h
// //
// X*Y tile grid, used indirectly by GridGameListView via ImageGridComponent. // X*Y tile grid, used indirectly by GridGamelistView via ImageGridComponent.
// //
#ifndef ES_CORE_COMPONENTS_GRID_TILE_COMPONENT_H #ifndef ES_CORE_COMPONENTS_GRID_TILE_COMPONENT_H

View file

@ -3,7 +3,7 @@
// EmulationStation Desktop Edition // EmulationStation Desktop Edition
// ImageGridComponent.cpp // ImageGridComponent.cpp
// //
// X*Y image grid, used by GridGameListView. // X*Y image grid, used by GridGamelistView.
// //
#ifndef ES_CORE_COMPONENTS_IMAGE_GRID_COMPONENT_H #ifndef ES_CORE_COMPONENTS_IMAGE_GRID_COMPONENT_H

View file

@ -168,7 +168,7 @@ namespace Renderer
} }
unsigned int createTexture(const Texture::Type type, unsigned int createTexture(const Texture::Type type,
const Texture::Type format, // Not used for desktop OpenGL. const Texture::Type /*format*/,
const bool linearMinify, const bool linearMinify,
const bool linearMagnify, const bool linearMagnify,
const bool repeat, const bool repeat,