From f3695a7545135f982049bccaf233b8c1271fe1f9 Mon Sep 17 00:00:00 2001 From: Aloshi Date: Thu, 10 Oct 2013 16:49:59 -0500 Subject: [PATCH] Started work on "scrape multiple games" UI. --- CMakeLists.txt | 2 ++ src/components/GuiGameList.cpp | 8 +++++++ src/components/GuiScraperStart.cpp | 32 ++++++++++++++++++++++++++ src/components/GuiScraperStart.h | 36 ++++++++++++++++++++++++++++++ 4 files changed, 78 insertions(+) create mode 100644 src/components/GuiScraperStart.cpp create mode 100644 src/components/GuiScraperStart.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 30539343e..93b87a664 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -182,6 +182,7 @@ set(ES_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/src/components/GuiInputConfig.h ${CMAKE_CURRENT_SOURCE_DIR}/src/components/GuiMenu.h ${CMAKE_CURRENT_SOURCE_DIR}/src/components/GuiSettingsMenu.h + ${CMAKE_CURRENT_SOURCE_DIR}/src/components/GuiScraperStart.h ${CMAKE_CURRENT_SOURCE_DIR}/src/scrapers/Scraper.h ${CMAKE_CURRENT_SOURCE_DIR}/src/scrapers/GamesDBScraper.h ${CMAKE_CURRENT_SOURCE_DIR}/src/scrapers/TheArchiveScraper.h @@ -237,6 +238,7 @@ set(ES_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/components/GuiInputConfig.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/components/GuiMenu.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/components/GuiSettingsMenu.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/components/GuiScraperStart.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/scrapers/Scraper.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/scrapers/GamesDBScraper.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/scrapers/TheArchiveScraper.cpp diff --git a/src/components/GuiGameList.cpp b/src/components/GuiGameList.cpp index 27e17707f..f23ae169c 100644 --- a/src/components/GuiGameList.cpp +++ b/src/components/GuiGameList.cpp @@ -6,7 +6,9 @@ #include #include "../Log.h" #include "../Settings.h" + #include "GuiMetaDataEd.h" +#include "GuiScraperStart.h" std::vector GuiGameList::sortStates; @@ -140,6 +142,12 @@ bool GuiGameList::input(InputConfig* config, Input input) return true; } + if(input.id == SDLK_F5) + { + mWindow->pushGui(new GuiScraperStart(mWindow)); + return true; + } + if(config->isMappedTo("a", input) && mFolder->getFileCount() > 0 && input.value != 0) { //play select sound diff --git a/src/components/GuiScraperStart.cpp b/src/components/GuiScraperStart.cpp new file mode 100644 index 000000000..cb7821e45 --- /dev/null +++ b/src/components/GuiScraperStart.cpp @@ -0,0 +1,32 @@ +#include "GuiScraperStart.h" + +GuiScraperStart::GuiScraperStart(Window* window) : GuiComponent(window), + mBox(window, ":/frame.png"), + mList(window, Eigen::Vector2i(2, 4)), + mFilterLabel(mWindow), + mSystemsLabel(mWindow), + mManualLabel(mWindow), + mFiltersOpt(mWindow), + mSystemsOpt(mWindow), + mManualSwitch(mWindow) +{ + mFilterLabel.setText("Filter: "); + mSystemsLabel.setText("Systems: "); + mManualLabel.setText("Manual mode: "); + + addChild(&mBox); + addChild(&mList); + + using namespace Eigen; + mList.setEntry(Vector2i(0, 0), Vector2i(1, 1), &mFilterLabel, false, ComponentListComponent::AlignRight); + mList.setEntry(Vector2i(1, 0), Vector2i(1, 1), &mFiltersOpt, true, ComponentListComponent::AlignCenter); + + mList.setEntry(Vector2i(0, 1), Vector2i(1, 1), &mSystemsLabel, false, ComponentListComponent::AlignRight); + mList.setEntry(Vector2i(1, 1), Vector2i(1, 1), &mSystemsOpt, true, ComponentListComponent::AlignCenter); + + mList.setEntry(Vector2i(0, 2), Vector2i(1, 1), &mManualLabel, false, ComponentListComponent::AlignRight); + mList.setEntry(Vector2i(1, 2), Vector2i(1, 1), &mManualSwitch, true, ComponentListComponent::AlignCenter); + + mBox.fitTo(mList.getSize()); +} + diff --git a/src/components/GuiScraperStart.h b/src/components/GuiScraperStart.h new file mode 100644 index 000000000..c32a5f5cb --- /dev/null +++ b/src/components/GuiScraperStart.h @@ -0,0 +1,36 @@ +#pragma once + +#include "../GuiComponent.h" +#include "../SystemData.h" +#include "TextComponent.h" +#include "ComponentListComponent.h" +#include "OptionListComponent.h" +#include "SwitchComponent.h" + +class GuiScraperStart : public GuiComponent +{ +public: + GuiScraperStart(Window* window); + +private: + NinePatchComponent mBox; + ComponentListComponent mList; + + TextComponent mFilterLabel; + TextComponent mSystemsLabel; + TextComponent mManualLabel; + + OptionListComponent mFiltersOpt; + OptionListComponent mSystemsOpt; + SwitchComponent mManualSwitch; +}; + +/* + +Filter: [MISSING IMAGES | ALL] +Systems: [# selected] +Manual Mode: [ON | OFF] +GO GO GO + +*/ +