mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-26 16:15:39 +00:00
Merge pull request #390 from Koerty/grid-swap-left-right-shoulder
[GRID 1] Allow quick system swap using left/right shoulder
This commit is contained in:
commit
75844f4568
|
@ -97,6 +97,16 @@ void BasicGameListView::addPlaceholder()
|
|||
mList.add(placeholder->getName(), placeholder, (placeholder->getType() == PLACEHOLDER));
|
||||
}
|
||||
|
||||
std::string BasicGameListView::getQuickSystemSelectRightButton()
|
||||
{
|
||||
return "right";
|
||||
}
|
||||
|
||||
std::string BasicGameListView::getQuickSystemSelectLeftButton()
|
||||
{
|
||||
return "left";
|
||||
}
|
||||
|
||||
void BasicGameListView::launch(FileData* game)
|
||||
{
|
||||
ViewController::get()->launch(game);
|
||||
|
|
|
@ -24,6 +24,8 @@ public:
|
|||
virtual void launch(FileData* game) override;
|
||||
|
||||
protected:
|
||||
virtual std::string getQuickSystemSelectRightButton() override;
|
||||
virtual std::string getQuickSystemSelectLeftButton() override;
|
||||
virtual void populateList(const std::vector<FileData*>& files) override;
|
||||
virtual void remove(FileData* game, bool deleteFile) override;
|
||||
virtual void addPlaceholder();
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#include "views/gamelist/GridGameListView.h"
|
||||
|
||||
#include "views/ViewController.h"
|
||||
#include "Settings.h"
|
||||
#include "SystemData.h"
|
||||
|
||||
GridGameListView::GridGameListView(Window* window, FileData* root) : ISimpleGameListView(window, root),
|
||||
|
@ -27,6 +28,16 @@ void GridGameListView::setCursor(FileData* file)
|
|||
}
|
||||
}
|
||||
|
||||
std::string GridGameListView::getQuickSystemSelectRightButton()
|
||||
{
|
||||
return "pagedown"; //rightshoulder
|
||||
}
|
||||
|
||||
std::string GridGameListView::getQuickSystemSelectLeftButton()
|
||||
{
|
||||
return "pageup"; //leftshoulder
|
||||
}
|
||||
|
||||
bool GridGameListView::input(InputConfig* config, Input input)
|
||||
{
|
||||
if(config->isMappedTo("left", input) || config->isMappedTo("right", input))
|
||||
|
@ -88,6 +99,12 @@ void GridGameListView::remove(FileData *game, bool deleteFile)
|
|||
std::vector<HelpPrompt> GridGameListView::getHelpPrompts()
|
||||
{
|
||||
std::vector<HelpPrompt> prompts;
|
||||
|
||||
if(Settings::getInstance()->getBool("QuickSystemSelect"))
|
||||
{
|
||||
prompts.push_back(HelpPrompt("l", "system"));
|
||||
prompts.push_back(HelpPrompt("r", "system"));
|
||||
}
|
||||
prompts.push_back(HelpPrompt("up/down/left/right", "scroll"));
|
||||
prompts.push_back(HelpPrompt("a", "launch"));
|
||||
prompts.push_back(HelpPrompt("b", "back"));
|
||||
|
|
|
@ -23,6 +23,8 @@ public:
|
|||
virtual void launch(FileData* game) override;
|
||||
|
||||
protected:
|
||||
virtual std::string getQuickSystemSelectRightButton() override;
|
||||
virtual std::string getQuickSystemSelectLeftButton() override;
|
||||
virtual void populateList(const std::vector<FileData*>& files) override;
|
||||
virtual void remove(FileData* game, bool deleteFile) override;
|
||||
virtual void addPlaceholder();
|
||||
|
|
|
@ -118,7 +118,7 @@ bool ISimpleGameListView::input(InputConfig* config, Input input)
|
|||
}
|
||||
|
||||
return true;
|
||||
}else if(config->isMappedTo("right", input))
|
||||
}else if(config->isMappedTo(getQuickSystemSelectRightButton(), input))
|
||||
{
|
||||
if(Settings::getInstance()->getBool("QuickSystemSelect"))
|
||||
{
|
||||
|
@ -126,7 +126,7 @@ bool ISimpleGameListView::input(InputConfig* config, Input input)
|
|||
ViewController::get()->goToNextGameList();
|
||||
return true;
|
||||
}
|
||||
}else if(config->isMappedTo("left", input))
|
||||
}else if(config->isMappedTo(getQuickSystemSelectLeftButton(), input))
|
||||
{
|
||||
if(Settings::getInstance()->getBool("QuickSystemSelect"))
|
||||
{
|
||||
|
|
|
@ -28,6 +28,8 @@ public:
|
|||
virtual void launch(FileData* game) = 0;
|
||||
|
||||
protected:
|
||||
virtual std::string getQuickSystemSelectRightButton() = 0;
|
||||
virtual std::string getQuickSystemSelectLeftButton() = 0;
|
||||
virtual void populateList(const std::vector<FileData*>& files) = 0;
|
||||
|
||||
TextComponent mHeaderText;
|
||||
|
|
Loading…
Reference in a new issue