Commit afee6ca1 authored by Bkg2k's avatar Bkg2k Committed by Supernature2k
Browse files

feat(frontend): add system sorting option

parent 954c9ddd
......@@ -78,8 +78,6 @@ All notable changes to this project have been documented in this file since 8.1.
- add dipswitch support for 15khz/31khz and 50hz modes
- Improve text for favorites list in system (#2062)
- Fix 'This title is not available to watch instantly' error on Netflix (#2088)
- Add manufacturer property in systemlist.xml (#2101)
- Add default configuration for Kodi (#1927)
- Fix annoying error popup when kodi starts (#2097)
- Fix 'All Games' label in EmulationSttion (#2124)
......
......@@ -9,6 +9,7 @@ as release notes for end user on a Recalbox upgrade.
- Add delete game options
- Add core libretro vitaquake2 for x64
- New system sorting options in UI menu: sort your systems by type, manufacturer, release dates and more !
### Improvements
......@@ -37,16 +38,6 @@ as release notes for end user on a Recalbox upgrade.
- Fix TV Remote controller (CEC) not working with Kodi on Raspberry Pi3 and Pi4
- Fix Raspberry Pi Zero 2 performances issues
- Add Mupen64plus GLide64MK2 on RPI3
- Add support Recalbox RGB Dual for rpi3, rpi4 and rpi400
### Improvements
- Bump libretro-mupen64plus-next
### Improvements
- Add manufacturer property in systemlist.xml
### Fix
- Fix memory issues on Raspberry Pi Zero 2 plugged on HDMI
- Add a better text when you are stuck in the favorites list in any system.
- Fix controllers in Duckstation (access menu with HK+B)
- Fix frontend not displaying two letter extentions games (.md/.st)
......
......@@ -39,7 +39,6 @@ Pour les pending features, elles ne seront activées que si les beta testeurs le
- [ ] Test mupen64 on Pi3 and Pi4 - Should be fullscreen in all cases
## [8.0]
- [ ] Check that systemlist.xml as a manufacturer property for all systems
- [ ] Check letters order in recalbox.conf for odroidgo2, odroidxu4 and rpi4 (#1795)
- [ ] Check screenshot for yarntown game on solarus and craft on ports (#2017)
- [ ] Check that the mednafen psx hw and glide64mk2 cores appear as the default core on x64 (#2018)
......
......@@ -31,6 +31,7 @@ set(ES_HEADERS
src/systems/SystemDescriptor.h
src/systems/SystemDeserializer.h
src/systems/SystemManager.h
src/systems/SystemSorting.h
src/usernotifications/NotificationManager.h
# GuiComponents
......@@ -233,6 +234,7 @@ set(ES_SOURCES
src/systems/SystemDescriptor.cpp
src/systems/SystemDeserializer.cpp
src/systems/SystemManager.cpp
src/systems/SystemSorting.cpp
src/usernotifications/NotificationManager.cpp
# GuiComponents
......
......@@ -112,6 +112,7 @@ class MenuMessages
#define MENUMESSAGE_ADVANCED_EMULATOR_ADVANCED_HELP_MSG "Override global options like emulator, core, ratio and more for each available system in your recalbox."
#define MENUMESSAGE_ADVANCED_BOOT_HELP_MSG "Configure boot options that make your recalbox boot straight into a system or into Kodi, lock a user to a single system, or directly show the gamelist."
#define MENUMESSAGE_ADVANCED_ALLGAMES_HELP_MSG "Show a 'all-games' system with all games from all systems."
#define MENUMESSAGE_ADVANCED_SORTINGOPTION_HELP_MSG "Default: use original or custom systemlist.xml order\nSystem Type: order by Console/Handheld/Computer/Arcade/Other\nRelease Date: order by release date asc\nManufacturer: order by manufacturer (e.g. Sega)\nSpecial Blend: Sort by type then Manufacturer then Release Date"
#define MENUMESSAGE_ADVANCED_MULTIPLAYERS_HELP_MSG "Show multiplayer games (all games playable by two or more players)."
#define MENUMESSAGE_ADVANCED_LASTPLAYED_HELP_MSG "Show last played games."
#define MENUMESSAGE_ADVANCED_LIGHTGUN_HELP_MSG "Show all available games playable with a lightgun."
......
......@@ -13,7 +13,6 @@
#include "GuiMenuCRT.h"
#include <guis/MenuMessages.h>
#include <utils/locale/LocaleHelper.h>
//#include <components/OptionListComponent.h>
#include <components/SwitchComponent.h>
#include <utils/Files.h>
#include <guis/GuiMsgBox.h>
......@@ -24,6 +23,7 @@ GuiMenuAdvancedSettings::GuiMenuAdvancedSettings(WindowManager& window, SystemMa
: GuiMenuBase(window, _("ADVANCED SETTINGS"), this)
, mSystemManager(systemManager)
, mDefaultOverclock({ "none", _("NONE"), false, 0})
, mOriginalSort(RecalboxConf::Instance().GetSystemSorting())
, mLastHazardous(false)
, mValidOverclock(false)
{
......@@ -33,6 +33,9 @@ GuiMenuAdvancedSettings::GuiMenuAdvancedSettings(WindowManager& window, SystemMa
// Boot
AddSubMenu(_("BOOT SETTINGS"), (int)Components::BootSubMenu, _(MENUMESSAGE_ADVANCED_BOOT_HELP_MSG));
// System sort
mSort = AddList<SystemSorting>(_("SYSTEM SORTING"), (int)Components::SystemSort, this, GetSortingEntries(), _(MENUMESSAGE_ADVANCED_SORTINGOPTION_HELP_MSG));
// Virtual systems
AddSubMenu(_("VIRTUAL SYSTEMS"), (int)Components::VirtualSubMenu, _(MENUMESSAGE_ADVANCED_VIRTUALSYSTEMS_HELP_MSG));
......@@ -208,6 +211,7 @@ void GuiMenuAdvancedSettings::SwitchComponentChanged(int id, bool status)
case Components::Manager: RecalboxConf::Instance().SetSystemManagerEnabled(status).Save(); break;
case Components::OverclockList:
case Components::BootSubMenu:
case Components::SystemSort:
case Components::VirtualSubMenu:
case Components::AdvancedSubMenu:
case Components::KodiSubMenu:
......@@ -227,6 +231,7 @@ void GuiMenuAdvancedSettings::SubMenuSelected(int id)
case Components::AdvancedSubMenu: mWindow.pushGui(new GuiMenuSystemList(mWindow, mSystemManager)); break;
case Components::KodiSubMenu: mWindow.pushGui(new GuiMenuKodiSettings(mWindow)); break;
case Components::FactoryReset: ResetFactory(); break;
case Components::SystemSort:
case Components::OverclockList:
case Components::AdultGames:
case Components::Overscan:
......@@ -286,3 +291,30 @@ void GuiMenuAdvancedSettings::DoResetFactory()
if (system("shutdown -r now") != 0)
{ LOG(LogError) << "[ResetFactory] Error rebooting system"; }
}
void GuiMenuAdvancedSettings::OptionListComponentChanged(int id, int index, const SystemSorting& value)
{
(void)index;
(void)id;
RecalboxConf::Instance().SetSystemSorting(value).Save();
mSystemManager.SystemSorting();
ViewController::Instance().getSystemListView().Sort();
}
std::vector<GuiMenuBase::ListEntry<SystemSorting>> GuiMenuAdvancedSettings::GetSortingEntries()
{
mOriginalSort = RecalboxConf::Instance().GetSystemSorting();
return std::vector<ListEntry<SystemSorting>>
({
{ _("DEFAULT") , SystemSorting::Default , mOriginalSort == SystemSorting::Default },
{ _("NAME") , SystemSorting::Name , mOriginalSort == SystemSorting::Name },
{ _("RELEASE DATE") , SystemSorting::ReleaseDate , mOriginalSort == SystemSorting::ReleaseDate },
{ _("TYPE, THEN NAME") , SystemSorting::SystemTypeThenName , mOriginalSort == SystemSorting::SystemTypeThenName },
{ _("TYPE, THEN RELEASE DATE") , SystemSorting::SystemTypeThenReleaseDate , mOriginalSort == SystemSorting::SystemTypeThenReleaseDate },
{ _("MANUFACTURER, THEN NAME") , SystemSorting::ManufacturerThenName , mOriginalSort == SystemSorting::ManufacturerThenName },
{ _("MANUFACTURER, THEN RELEASE DATE") , SystemSorting::ManufacturerThenReleaseData , mOriginalSort == SystemSorting::ManufacturerThenReleaseData },
{ _("TYPE, THEN MANUFACTURER, THEN NAME") , SystemSorting::SystemTypeThenManufacturerThenName , mOriginalSort == SystemSorting::SystemTypeThenManufacturerThenName },
{ _("TYPE, THEN MANUFACTURER, THEN RELEASE DATE") , SystemSorting::SystemTypeThenManufacturerThenReleasdeDate , mOriginalSort == SystemSorting::SystemTypeThenManufacturerThenReleasdeDate },
});
}
\ No newline at end of file
......@@ -27,6 +27,7 @@ struct Overclocking
class GuiMenuAdvancedSettings : public GuiMenuBase
, private IOptionListComponent<Overclocking>
, private IOptionListComponent<SystemSorting>
, private ISwitchComponent
, private IGuiMenuBase
{
......@@ -44,6 +45,7 @@ class GuiMenuAdvancedSettings : public GuiMenuBase
enum class Components
{
OverclockList,
SystemSort,
BootSubMenu,
VirtualSubMenu,
AdultGames,
......@@ -70,6 +72,8 @@ class GuiMenuAdvancedSettings : public GuiMenuBase
Overclocking mDefaultOverclock;
//! Original overclock value
std::string mOriginalOverclock;
//! Original Sorting type
SystemSorting mOriginalSort;
//! Last overclock hazardous?
bool mLastHazardous;
//! Is there at least a valid O/C?
......@@ -77,6 +81,8 @@ class GuiMenuAdvancedSettings : public GuiMenuBase
//! Overclock
std::shared_ptr<OptionListComponent<Overclocking>> mOverclock;
//! System Sort
std::shared_ptr<OptionListComponent<SystemSorting>> mSort;
//! Adult
std::shared_ptr<SwitchComponent> mAdult;
//! Overscan
......@@ -104,6 +110,9 @@ class GuiMenuAdvancedSettings : public GuiMenuBase
//! Do Reset Factory
static void DoResetFactory();
//! Get Sorting List
std::vector<ListEntry<SystemSorting>> GetSortingEntries();
/*
* IOptionListComponent<Overclocking> implementation
*/
......@@ -121,6 +130,12 @@ class GuiMenuAdvancedSettings : public GuiMenuBase
*/
void SubMenuSelected(int id) override;
/*
* IOptionListComponent<SystemSorting> implementation
*/
void OptionListComponentChanged(int id, int index, const SystemSorting& value) override;
};
......
......@@ -46,6 +46,7 @@ class SystemDescriptor
, mIcon(0)
, mScreenScraperID(0)
, mReleaseDate(0)
, mManufacturer()
, mType(SystemType::Unknown)
, mPad(DeviceRequirement::Unknown)
, mKeyboard(DeviceRequirement::Unknown)
......@@ -129,6 +130,7 @@ class SystemDescriptor
const std::string& keyboard,
const std::string& mouse,
const std::string& releasedate,
const std::string& manufacturer,
bool lightgun,
bool multiresolution,
bool multiregion)
......@@ -137,8 +139,9 @@ class SystemDescriptor
mPad = ConvertDeviceRequirement(pad);
mKeyboard = ConvertDeviceRequirement(keyboard);
mMouse = ConvertDeviceRequirement(mouse);
if (Strings::ToInt(Strings::Replace(releasedate, "-", ""), mReleaseDate))
if (!Strings::ToInt(Strings::Replace(releasedate, "-", ""), mReleaseDate))
mReleaseDate = 0;
mManufacturer = manufacturer;
mLightgun = lightgun;
mCrtInterlaced = multiresolution;
mCrtMultiRegion = multiregion;
......@@ -201,6 +204,9 @@ class SystemDescriptor
int ScreenScaperID() const { return mScreenScraperID; }
int ReleaseDate() const { return mReleaseDate; }
const std::string& Manufacturer() const { return mManufacturer; }
SystemType Type() const { return mType; }
DeviceRequirement PadRequirement() const { return mPad; }
DeviceRequirement KeyboardRequirement() const { return mKeyboard; }
......@@ -252,6 +258,7 @@ class SystemDescriptor
int mScreenScraperID; //!< ScreenScraper ID
// Properties
int mReleaseDate; //!< Release date in numeric format yyyymm
std::string mManufacturer; //!< Manufacturer ("Nintendo")
SystemType mType; //!< System type
DeviceRequirement mPad; //!< Pad state
DeviceRequirement mKeyboard; //!< Pad state
......
......@@ -53,6 +53,7 @@ bool SystemDeserializer::Deserialize(int index, SystemDescriptor& systemDescript
Xml::AttributeAsString(properties, "keyboard", ""),
Xml::AttributeAsString(properties, "mouse", ""),
Xml::AttributeAsString(properties, "releasedate", ""),
Xml::AttributeAsString(properties, "manufacturer", ""),
Xml::AttributeAsBool(properties, "lightgun", false),
Xml::AttributeAsBool(properties, "crt.multiresolution", false),
Xml::AttributeAsBool(properties, "crt.multiregion", false));
......
......@@ -6,6 +6,7 @@
#include "SystemDescriptor.h"
#include "SystemDeserializer.h"
#include "LightGunDatabase.h"
#include <systems/SystemSorting.h>
#include <utils/Log.h>
#include <RecalboxConf.h>
#include <utils/os/system/ThreadPool.h>
......@@ -15,7 +16,6 @@
#include <algorithm>
#include <utils/locale/LocaleHelper.h>
SystemManager::RomSources SystemManager::GetRomSource(const SystemDescriptor& systemDescriptor, PortTypes port)
{
RomSources roots;
......@@ -134,6 +134,7 @@ SystemData* SystemManager::CreateFavoriteSystem(const std::string& name, const s
SystemDescriptor descriptor;
descriptor.SetSystemInformation(fullName, name, fullName, "")
.SetPropertiesInformation("virtual", "mandatory", "mandatory", "mandatory", "2020-01-01", "None", false, false, false)
.SetDescriptorInformation("", "", themeFolder, "", "", false, false);
SystemData* result = new SystemData(*this, descriptor, SystemData::Properties::Virtual | SystemData::Properties::AlwaysFlat | SystemData::Properties::Favorite);
......@@ -164,6 +165,7 @@ SystemData* SystemManager::CreateMetaSystem(const std::string& name, const std::
SystemDescriptor descriptor;
descriptor.SetSystemInformation(fullName, name, fullName, "")
.SetPropertiesInformation("engine", "mandatory", "optional", "no", "2020-01-01", "None", false, false, false)
.SetDescriptorInformation("", "", themeFolder, "", "", false, false);
SystemData* result = new SystemData(*this, descriptor, SystemData::Properties::Virtual | properties, fixedSort);
......@@ -194,6 +196,7 @@ SystemData* SystemManager::CreateMetaSystem(const std::string& name, const std::
SystemDescriptor descriptor;
descriptor.SetSystemInformation(fullName, name, fullName, "")
.SetPropertiesInformation("virtual", "mandatory", "mandatory", "mandatory", "2020-01-01", "None", false, false, false)
.SetDescriptorInformation("", "", themeFolder, "", "", false, false);
SystemData* result = new SystemData(*this, descriptor, SystemData::Properties::Virtual | properties, fixedSort);
......@@ -545,7 +548,7 @@ bool SystemManager::LoadSystemConfigurations(FileNotifier& gamelistWatcher, bool
// Is there at least
if (!loaded)
{
{ LOG(LogError) << "[System] No es_systems.cfg file available!"; }
{ LOG(LogError) << "[System] No systemlist.xml file available!"; }
GenerateExampleConfigurationFile(SystemDeserializer::UserConfigurationPath());
return false;
}
......@@ -610,6 +613,10 @@ bool SystemManager::LoadSystemConfigurations(FileNotifier& gamelistWatcher, bool
AddSpecialCollectionsMetaSystems(portableSystem);
AddArcadeMetaSystem(); // Must be latest
// Sort systems based on conf option
mOriginalVisibleSystemVector = mVisibleSystemVector;
SystemSorting(mVisibleSystemVector, mOriginalVisibleSystemVector);
// Set *all* service vector
for(SystemData* service : mVisibleSystemVector) mAllSystemVector.push_back(service);
for(SystemData* service : mHiddenSystemVector) mAllSystemVector.push_back(service);
......@@ -799,3 +806,25 @@ FileData::List SystemManager::searchTextInGames(FolderData::FastSearchContext co
return results;
}
void SystemManager::SystemSorting()
{
SystemSorting(mVisibleSystemVector, mOriginalVisibleSystemVector);
}
void SystemManager::SystemSorting(std::vector<SystemData *>& systems, const std::vector<SystemData *>& originalSystems)
{
switch (RecalboxConf::Instance().GetSystemSorting())
{
case SystemSorting::Name: { std::sort(systems.begin(), systems.end(), SortingName()); break; }
case SystemSorting::ReleaseDate: { std::sort(systems.begin(), systems.end(), SortingReleaseDate()); break; }
case SystemSorting::SystemTypeThenName: { std::sort(systems.begin(), systems.end(), Sorting1Type2Name()); break; }
case SystemSorting::SystemTypeThenReleaseDate: { std::sort(systems.begin(), systems.end(), Sorting1Type2ReleaseDate()); break; }
case SystemSorting::ManufacturerThenName: { std::sort(systems.begin(), systems.end(), Sorting1Manufacturer2Name()); break; }
case SystemSorting::ManufacturerThenReleaseData: { std::sort(systems.begin(), systems.end(), Sorting1Manufacturer2ReleaseDate()); break; }
case SystemSorting::SystemTypeThenManufacturerThenName: { std::sort(systems.begin(), systems.end(), Sorting1Type2Manufacturer3Name()); break; }
case SystemSorting::SystemTypeThenManufacturerThenReleasdeDate: { std::sort(systems.begin(), systems.end(), Sorting1Type2Manufacturer3ReleaseDate()); break; }
case SystemSorting::Default:
default: systems = originalSystems; break;
}
}
......@@ -66,6 +66,8 @@ class SystemManager :
//! Visible system, including virtual system (Arcade)
std::vector<SystemData*> mVisibleSystemVector;
//! Original of Visible system (copy)
std::vector<SystemData*> mOriginalVisibleSystemVector;
//! Hidden system, just here to hold their own children
std::vector<SystemData*> mHiddenSystemVector;
//! ALL systems, visible and hidden
......@@ -231,6 +233,13 @@ class SystemManager :
void ThreadPoolTick(int completed, int total) override;
/*!
* @brief Sort systems based on conf option
* @param systems Systemlist to be sorted
* @param originalSystems original Systemlist
*/
static void SystemSorting(std::vector<SystemData*>& systems, const std::vector<SystemData *>& originalSystems);
public:
/*!
* @brief constructor
......@@ -384,5 +393,7 @@ class SystemManager :
//! Auto-scrape game image
static void AutoScrape(SystemData* pData);
};
//! Sort or resort system list
void SystemSorting();
};
//
// Created by bkg2k on 16/01/2022.
//
// As part of the RECALBOX Project
// http://www.recalbox.com
//
#include <systems/SystemSorting.h>
#include <systems/SystemData.h>
bool SortingName::operator()(const SystemData* a, const SystemData* b) const
{
return (a->Descriptor().FullName() < b->Descriptor().FullName());
}
bool SortingReleaseDate::operator()(const SystemData* a, const SystemData* b) const
{
return (a->Descriptor().ReleaseDate() < b->Descriptor().ReleaseDate());
}
bool Sorting1Type2Name::operator()(const SystemData* a, const SystemData* b) const
{
if (a->Descriptor().Type() == b->Descriptor().Type())
{
return a->Descriptor().FullName() < b->Descriptor().FullName();
}
return (a->Descriptor().Type() < b->Descriptor().Type());
}
bool Sorting1Type2ReleaseDate::operator()(const SystemData* a, const SystemData* b) const
{
if (a->Descriptor().Type() == b->Descriptor().Type())
{
return a->Descriptor().ReleaseDate() < b->Descriptor().ReleaseDate();
}
return (a->Descriptor().Type() < b->Descriptor().Type());
}
bool Sorting1Manufacturer2Name::operator()(const SystemData* a, const SystemData* b) const
{
if (a->Descriptor().Manufacturer() == b->Descriptor().Manufacturer())
{
return a->Descriptor().FullName() < b->Descriptor().FullName();
}
return (a->Descriptor().Manufacturer() < b->Descriptor().Manufacturer());
}
bool Sorting1Manufacturer2ReleaseDate::operator()(const SystemData* a, const SystemData* b) const
{
if (a->Descriptor().Manufacturer() == b->Descriptor().Manufacturer())
{
return a->Descriptor().ReleaseDate() < b->Descriptor().ReleaseDate();
}
return (a->Descriptor().Manufacturer() < b->Descriptor().Manufacturer());
}
bool Sorting1Type2Manufacturer3Name::operator()(const SystemData* a, const SystemData* b) const
{
if (a->Descriptor().Type() == b->Descriptor().Type())
{
if (a->Descriptor().Manufacturer() == a->Descriptor().Manufacturer())
{
return (a->Descriptor().FullName() < b->Descriptor().FullName());
}
return (a->Descriptor().Manufacturer() < b->Descriptor().Manufacturer());
}
return (a->Descriptor().Type() < b->Descriptor().Type());
}
bool Sorting1Type2Manufacturer3ReleaseDate::operator()(const SystemData* a, const SystemData* b) const
{
if (a->Descriptor().Type() == b->Descriptor().Type())
{
if (a->Descriptor().Manufacturer() == b->Descriptor().Manufacturer())
{
return (a->Descriptor().ReleaseDate() < b->Descriptor().ReleaseDate());
}
return (a->Descriptor().Manufacturer() < b->Descriptor().Manufacturer());
}
return (a->Descriptor().Type() < b->Descriptor().Type());
}
//
// Created by bkg2k on 16/01/2022.
//
// As part of the RECALBOX Project
// http://www.recalbox.com
//
#pragma once
class SystemData;
enum class SystemSorting
{
Default, //!< Default sorting as defined in the xml file
Name, //!< Sort by system name (not including manufacturer)
ReleaseDate, //!< Sort by release date of the original hardware
SystemTypeThenName, //!< Sort by system type (console, computer, ...), then by name
SystemTypeThenReleaseDate, //!< Sort by system type (console, computer, ...), then by release data
ManufacturerThenName, //!< Sort by manufacturer name, then system name
ManufacturerThenReleaseData, //!< Sort by manufacturer name, then system name
SystemTypeThenManufacturerThenName, //! Sort by type, then manufacturer, then name
SystemTypeThenManufacturerThenReleasdeDate, //! Sort by type, then manufacturer, then release date
};
//! Sort by name only
struct SortingName
{
bool operator()(const SystemData* a, const SystemData* b) const;
};
//! Sort by release date only
struct SortingReleaseDate
{
bool operator()(const SystemData* a, const SystemData* b) const;
};
//! Sort by type then by name
struct Sorting1Type2Name
{
bool operator()(const SystemData* a, const SystemData* b) const;
};
//! Sort by type then by release date
struct Sorting1Type2ReleaseDate
{
bool operator()(const SystemData* a, const SystemData* b) const;
};
//! Sort by manufacturer then by name
struct Sorting1Manufacturer2Name
{
bool operator()(const SystemData* a, const SystemData* b) const;
};
//! Sort by manufacturer then by release date
struct Sorting1Manufacturer2ReleaseDate
{
bool operator()(const SystemData* a, const SystemData* b) const;
};
//! Sort by type then by manufacturer then by name
struct Sorting1Type2Manufacturer3Name
{
bool operator()(const SystemData* a, const SystemData* b) const;
};
//! Sort by type then by manufacturer then by release date
struct Sorting1Type2Manufacturer3ReleaseDate
{
bool operator()(const SystemData* a, const SystemData* b) const;
};
......@@ -26,10 +26,10 @@ SystemView::SystemView(WindowManager& window, SystemManager& systemManager)
mCamOffset(0),
mExtrasCamOffset(0),
mExtrasFadeOpacity(0.0f),
lastSystem(nullptr),
mCurrentSystem(nullptr),
mViewNeedsReload(true),
mShowing(false),
launchKodi(false)
launchKodi(false)
{
setSize(Renderer::Instance().DisplayWidthAsFloat(), Renderer::Instance().DisplayHeightAsFloat());
}
......@@ -158,11 +158,25 @@ void SystemView::addSystem(SystemData * it)
this->add(e);
}
void SystemView::Sort()
{
std::vector<Entry> newEntries;
for(auto* const system : mSystemManager.GetVisibleSystemList())
for(auto& systemView : mEntries)
if (systemView.object == system)
{
newEntries.push_back(systemView);
break;
}
mEntries = newEntries;
goToSystem(mCurrentSystem, false);
}
void SystemView::populate()
{
mEntries.clear();
for (const auto& it : mSystemManager.GetVisibleSystemList())
for (const auto it : mSystemManager.GetVisibleSystemList())
addSystem(it);
}
......@@ -284,8 +298,8 @@ void SystemView::onCursorChanged(const CursorState& state)
{
(void)state;
if(lastSystem != getSelected()){
lastSystem = getSelected();
if(mCurrentSystem != getSelected()){
mCurrentSystem = getSelected();
AudioManager::Instance().StartPlaying(getSelected()->Theme());
}
// update help style
......
......@@ -63,6 +63,10 @@ public:
void manageFavorite();
void addSystem(SystemData * it);
SystemData& CurrentSystem() const { return *mCurrentSystem; }
void Sort();
protected:
void onCursorChanged(const CursorState& state) override;
......@@ -86,7 +90,7 @@ private:
float mCamOffset;
float mExtrasCamOffset;
float mExtrasFadeOpacity;
SystemData* lastSystem;
SystemData* mCurrentSystem;
bool mViewNeedsReload;
bool mShowing;
bool launchKodi;
......
......@@ -40,18 +40,9 @@ const std::string& RecalboxConf::MenuFromEnum(RecalboxConf::Menu menu)