Commit 139fc720 authored by Aloshi's avatar Aloshi

Moved Guis from src/components to src/guis.

Renamed ComponentListComponent to ComponentGrid.
Changed some older files' #ifdefs to #pragma once to be more consistent.
parent 8e8c2fed
......@@ -161,12 +161,13 @@ set(ES_HEADERS
${CMAKE_CURRENT_SOURCE_DIR}/src/components/AsyncReqComponent.h
${CMAKE_CURRENT_SOURCE_DIR}/src/components/ButtonComponent.h
${CMAKE_CURRENT_SOURCE_DIR}/src/components/ComponentListComponent.h
${CMAKE_CURRENT_SOURCE_DIR}/src/components/ComponentGrid.h
${CMAKE_CURRENT_SOURCE_DIR}/src/components/DateTimeComponent.h
${CMAKE_CURRENT_SOURCE_DIR}/src/components/HelpComponent.h
${CMAKE_CURRENT_SOURCE_DIR}/src/components/IList.h
${CMAKE_CURRENT_SOURCE_DIR}/src/components/ImageComponent.h
${CMAKE_CURRENT_SOURCE_DIR}/src/components/ImageGridComponent.h
${CMAKE_CURRENT_SOURCE_DIR}/src/components/MenuComponent.h
${CMAKE_CURRENT_SOURCE_DIR}/src/components/NinePatchComponent.h
${CMAKE_CURRENT_SOURCE_DIR}/src/components/OptionListComponent.h
${CMAKE_CURRENT_SOURCE_DIR}/src/components/RatingComponent.h
......@@ -176,17 +177,18 @@ set(ES_HEADERS
${CMAKE_CURRENT_SOURCE_DIR}/src/components/TextComponent.h
${CMAKE_CURRENT_SOURCE_DIR}/src/components/TextEditComponent.h
${CMAKE_CURRENT_SOURCE_DIR}/src/components/TextListComponent.h
${CMAKE_CURRENT_SOURCE_DIR}/src/components/GuiDetectDevice.h
${CMAKE_CURRENT_SOURCE_DIR}/src/components/GuiFastSelect.h
${CMAKE_CURRENT_SOURCE_DIR}/src/components/GuiMetaDataEd.h
${CMAKE_CURRENT_SOURCE_DIR}/src/components/GuiMsgBoxOk.h
${CMAKE_CURRENT_SOURCE_DIR}/src/components/GuiMsgBoxYesNo.h
${CMAKE_CURRENT_SOURCE_DIR}/src/components/GuiGameScraper.h
${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/components/GuiScraperLog.h
${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiDetectDevice.h
${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiFastSelect.h
${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiMetaDataEd.h
${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiMsgBoxOk.h
${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiMsgBoxYesNo.h
${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiGameScraper.h
${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiInputConfig.h
${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiMenu.h
${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiSettingsMenu.h
${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiScraperStart.h
${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiScraperLog.h
${CMAKE_CURRENT_SOURCE_DIR}/src/scrapers/Scraper.h
${CMAKE_CURRENT_SOURCE_DIR}/src/scrapers/GamesDBScraper.h
......@@ -241,10 +243,11 @@ set(ES_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/src/components/AsyncReqComponent.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/components/ButtonComponent.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/components/ComponentListComponent.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/components/ComponentGrid.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/components/DateTimeComponent.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/components/HelpComponent.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/components/ImageComponent.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/components/MenuComponent.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/components/NinePatchComponent.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/components/RatingComponent.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/components/ScrollableContainer.cpp
......@@ -252,17 +255,18 @@ set(ES_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/src/components/SwitchComponent.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/components/TextComponent.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/components/TextEditComponent.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/components/GuiDetectDevice.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/components/GuiFastSelect.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/components/GuiMetaDataEd.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/components/GuiMsgBoxOk.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/components/GuiMsgBoxYesNo.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/components/GuiGameScraper.cpp
${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/components/GuiScraperLog.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiDetectDevice.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiFastSelect.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiMetaDataEd.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiMsgBoxOk.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiMsgBoxYesNo.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiGameScraper.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiInputConfig.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiMenu.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiSettingsMenu.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiScraperStart.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/guis/GuiScraperLog.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/scrapers/Scraper.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/scrapers/GamesDBScraper.cpp
......
#include "ComponentListComponent.h"
#include "ComponentGrid.h"
#include "../Log.h"
#include "../Renderer.h"
#define INITIAL_CELL_SIZE 12
ComponentListComponent::ComponentListComponent(Window* window, Eigen::Vector2i gridDimensions) : GuiComponent(window),
ComponentGrid::ComponentGrid(Window* window, Eigen::Vector2i gridDimensions) : GuiComponent(window),
mGrid(NULL), mColumnWidths(NULL), mRowHeights(NULL),
mColumnWidthForced(NULL), mRowHeightForced(NULL),
mCursor(-1, -1)
......@@ -13,7 +13,7 @@ ComponentListComponent::ComponentListComponent(Window* window, Eigen::Vector2i g
makeCells(gridDimensions);
}
ComponentListComponent::~ComponentListComponent()
ComponentGrid::~ComponentGrid()
{
for(auto iter = mEntries.begin(); iter != mEntries.end(); iter++)
{
......@@ -21,7 +21,7 @@ ComponentListComponent::~ComponentListComponent()
}
}
void ComponentListComponent::makeCells(Eigen::Vector2i size)
void ComponentGrid::makeCells(Eigen::Vector2i size)
{
if(mGrid)
delete[] mGrid;
......@@ -50,7 +50,7 @@ void ComponentListComponent::makeCells(Eigen::Vector2i size)
resetCursor();
}
void ComponentListComponent::setEntry(Eigen::Vector2i pos, Eigen::Vector2i size, GuiComponent* component, bool canFocus, AlignmentType align,
void ComponentGrid::setEntry(Eigen::Vector2i pos, Eigen::Vector2i size, GuiComponent* component, bool canFocus, AlignmentType align,
Eigen::Matrix<bool, 1, 2> autoFit, UpdateBehavior updateType)
{
if(pos.x() > mGridSize.x() || pos.y() > mGridSize.y() || pos.x() < 0 || pos.y() < 0)
......@@ -78,7 +78,7 @@ void ComponentListComponent::setEntry(Eigen::Vector2i pos, Eigen::Vector2i size,
}
if(component->getParent() != NULL)
LOG(LogError) << "ComponentListComponent ruining an existing parent-child relationship! Call a social worker!";
LOG(LogError) << "ComponentGrid ruining an existing parent-child relationship! Call a social worker!";
component->setParent(this);
if(!cursorValid() && canFocus)
......@@ -96,7 +96,7 @@ void ComponentListComponent::setEntry(Eigen::Vector2i pos, Eigen::Vector2i size,
updateSize();
}
void ComponentListComponent::removeEntriesIn(Eigen::Vector2i pos, Eigen::Vector2i size)
void ComponentGrid::removeEntriesIn(Eigen::Vector2i pos, Eigen::Vector2i size)
{
auto iter = mEntries.begin();
while(iter != mEntries.end())
......@@ -126,7 +126,7 @@ void ComponentListComponent::removeEntriesIn(Eigen::Vector2i pos, Eigen::Vector2
resetCursor();
}
void ComponentListComponent::forceRowHeight(int row, unsigned int size)
void ComponentGrid::forceRowHeight(int row, unsigned int size)
{
mRowHeights[row] = size;
mRowHeightForced[row] = true;
......@@ -134,7 +134,7 @@ void ComponentListComponent::forceRowHeight(int row, unsigned int size)
updateComponentOffsets();
}
void ComponentListComponent::forceColumnWidth(int col, unsigned int size)
void ComponentGrid::forceColumnWidth(int col, unsigned int size)
{
mColumnWidths[col] = size;
mColumnWidthForced[col] = true;
......@@ -142,10 +142,10 @@ void ComponentListComponent::forceColumnWidth(int col, unsigned int size)
updateComponentOffsets();
}
unsigned int ComponentListComponent::getRowHeight(int row) { return mRowHeights[row]; }
unsigned int ComponentListComponent::getColumnWidth(int col) { return mColumnWidths[col]; }
unsigned int ComponentGrid::getRowHeight(int row) { return mRowHeights[row]; }
unsigned int ComponentGrid::getColumnWidth(int col) { return mColumnWidths[col]; }
Eigen::Vector3f ComponentListComponent::getCellOffset(Eigen::Vector2i pos)
Eigen::Vector3f ComponentGrid::getCellOffset(Eigen::Vector2i pos)
{
Eigen::Vector3f offset(0, 0, 0);
......@@ -177,7 +177,7 @@ Eigen::Vector3f ComponentListComponent::getCellOffset(Eigen::Vector2i pos)
return offset;
}
void ComponentListComponent::setCell(unsigned int x, unsigned int y, ComponentEntry* entry)
void ComponentGrid::setCell(unsigned int x, unsigned int y, ComponentEntry* entry)
{
if(x >= (unsigned int)mGridSize.x() || y >= (unsigned int)mGridSize.y())
{
......@@ -188,7 +188,7 @@ void ComponentListComponent::setCell(unsigned int x, unsigned int y, ComponentEn
mGrid[y * mGridSize.x() + x] = entry;
}
ComponentListComponent::ComponentEntry* ComponentListComponent::getCell(unsigned int x, unsigned int y)
ComponentGrid::ComponentEntry* ComponentGrid::getCell(unsigned int x, unsigned int y)
{
if(x >= (unsigned int)mGridSize.x() || y >= (unsigned int)mGridSize.y())
{
......@@ -199,7 +199,7 @@ ComponentListComponent::ComponentEntry* ComponentListComponent::getCell(unsigned
return mGrid[y * mGridSize.x() + x];
}
void ComponentListComponent::updateSize()
void ComponentGrid::updateSize()
{
mSize = Eigen::Vector2f(0, 0);
for(int x = 0; x < mGridSize.x(); x++)
......@@ -208,7 +208,7 @@ void ComponentListComponent::updateSize()
mSize.y() += getRowHeight(y);
}
void ComponentListComponent::updateComponentOffsets()
void ComponentGrid::updateComponentOffsets()
{
for(auto iter = mEntries.begin(); iter != mEntries.end(); iter++)
{
......@@ -216,7 +216,7 @@ void ComponentListComponent::updateComponentOffsets()
}
}
void ComponentListComponent::updateCellSize(ComponentEntry* e, bool updWidth, bool updHeight)
void ComponentGrid::updateCellSize(ComponentEntry* e, bool updWidth, bool updHeight)
{
if(!e)
{
......@@ -263,7 +263,7 @@ void ComponentListComponent::updateCellSize(ComponentEntry* e, bool updWidth, bo
updateSize();
}
void ComponentListComponent::updateComponent(GuiComponent* cmp)
void ComponentGrid::updateComponent(GuiComponent* cmp)
{
for(auto iter = mEntries.begin(); iter != mEntries.end(); iter++)
{
......@@ -274,7 +274,7 @@ void ComponentListComponent::updateComponent(GuiComponent* cmp)
}
}
bool ComponentListComponent::input(InputConfig* config, Input input)
bool ComponentGrid::input(InputConfig* config, Input input)
{
if(cursorValid() && getCell(mCursor.x(), mCursor.y())->component->input(config, input))
return true;
......@@ -306,7 +306,7 @@ bool ComponentListComponent::input(InputConfig* config, Input input)
return false;
}
void ComponentListComponent::resetCursor()
void ComponentGrid::resetCursor()
{
auto iter = mEntries.begin();
while(iter != mEntries.end())
......@@ -327,7 +327,7 @@ void ComponentListComponent::resetCursor()
onCursorMoved(origCursor, mCursor);
}
void ComponentListComponent::moveCursor(Eigen::Vector2i dir)
void ComponentGrid::moveCursor(Eigen::Vector2i dir)
{
if(dir.x() != 0 && dir.y() != 0)
{
......@@ -390,7 +390,7 @@ void ComponentListComponent::moveCursor(Eigen::Vector2i dir)
mCursor = origCursor;
}
bool ComponentListComponent::cursorValid()
bool ComponentGrid::cursorValid()
{
if(mCursor.x() < 0 || mCursor.y() < 0 || mCursor.x() >= mGridSize.x() || mCursor.y() >= mGridSize.y())
return false;
......@@ -398,7 +398,7 @@ bool ComponentListComponent::cursorValid()
return getCell(mCursor.x(), mCursor.y()) != NULL;
}
void ComponentListComponent::update(int deltaTime)
void ComponentGrid::update(int deltaTime)
{
for(auto iter = mEntries.begin(); iter != mEntries.end(); iter++)
{
......@@ -416,7 +416,7 @@ void ComponentListComponent::update(int deltaTime)
}
}
void ComponentListComponent::render(const Eigen::Affine3f& parentTrans)
void ComponentGrid::render(const Eigen::Affine3f& parentTrans)
{
Eigen::Affine3f trans = parentTrans * getTransform();
......@@ -459,25 +459,25 @@ void ComponentListComponent::render(const Eigen::Affine3f& parentTrans)
}
void ComponentListComponent::textInput(const char* text)
void ComponentGrid::textInput(const char* text)
{
if(getSelectedComponent() != NULL)
getSelectedComponent()->textInput(text);
}
void ComponentListComponent::onPositionChanged()
void ComponentGrid::onPositionChanged()
{
updateComponentOffsets();
}
GuiComponent* ComponentListComponent::getSelectedComponent()
GuiComponent* ComponentGrid::getSelectedComponent()
{
if(!cursorValid())
return NULL;
return getCell(mCursor.x(), mCursor.y())->component;
}
void ComponentListComponent::onCursorMoved(Eigen::Vector2i from, Eigen::Vector2i to)
void ComponentGrid::onCursorMoved(Eigen::Vector2i from, Eigen::Vector2i to)
{
if(from != Eigen::Vector2i(-1, -1))
getCell(from.x(), from.y())->component->onFocusLost();
......@@ -488,7 +488,7 @@ void ComponentListComponent::onCursorMoved(Eigen::Vector2i from, Eigen::Vector2i
updateHelpPrompts();
}
std::vector<HelpPrompt> ComponentListComponent::getHelpPrompts()
std::vector<HelpPrompt> ComponentGrid::getHelpPrompts()
{
std::vector<HelpPrompt> prompts;
if(cursorValid())
......
......@@ -2,11 +2,12 @@
#include "../GuiComponent.h"
class ComponentListComponent : public GuiComponent
// Used to arrange a bunch of components in a spreadsheet-esque grid.
class ComponentGrid : public GuiComponent
{
public:
ComponentListComponent(Window* window, Eigen::Vector2i gridDimensions);
virtual ~ComponentListComponent();
ComponentGrid(Window* window, Eigen::Vector2i gridDimensions);
virtual ~ComponentGrid();
enum UpdateBehavior
{
......@@ -92,27 +93,3 @@ private:
void updateComponentOffsets();
void updateCellSize(ComponentEntry* e, bool updWidth = true, bool updHeight = true);
};
//ability to define a list of components in terms of a grid
//these comments are kinda old
//input
//pass to selected component
// if returns true, stop
// else, process:
// if input == up/down
// scroll to prev/next selectable component in grid Y
// if input == left/right
// scroll to prev/next selectable component in grid X
//entry struct/class
// GuiComponent* component - component to work with
// bool canFocus - can we pass input to this? (necessary for labels to not be selectable)
// UpdateBehavior update - how to handle updates (all the time or only when focused)
//update
//pass update to all entries with appropriate update behavior
//render
//clip rect to our size
//render a "selected" effect behind component with focus somehow
#pragma once
#include "IList.h"
class MenuComponent : public IList
{
public:
MenuComponent(Window* window);
private:
};
......@@ -3,7 +3,6 @@
#include "../resources/Font.h"
#include "../Window.h"
#include "../Renderer.h"
#include "ComponentListComponent.h"
TextEditComponent::TextEditComponent(Window* window) : GuiComponent(window),
mBox(window, ":/textbox.png"), mFocused(false),
......
#ifndef _GUIDETECTDEVICE_H_
#define _GUIDETECTDEVICE_H_
#pragma once
#include "../GuiComponent.h"
......@@ -19,5 +18,3 @@ private:
int mFinishTimer;
int mCurrentPlayer;
};
#endif
......@@ -3,8 +3,8 @@
#include "../GuiComponent.h"
#include "../views/gamelist/IGameListView.h"
#include "NinePatchComponent.h"
#include "TextComponent.h"
#include "../components/NinePatchComponent.h"
#include "../components/TextComponent.h"
class GuiFastSelect : public GuiComponent
{
......
......@@ -49,29 +49,29 @@ GuiGameScraper::GuiGameScraper(Window* window, ScraperSearchParams params, std::
using namespace Eigen;
mList.setEntry(Vector2i(0, 0), Vector2i(2, 1), &mHeader, false, ComponentListComponent::AlignCenter);
mList.setEntry(Vector2i(0, 0), Vector2i(2, 1), &mHeader, false, ComponentGrid::AlignCenter);
//y = 1 is a spacer row
mResultName.setText(params.game->getName());
mResultName.setColor(0x3B56CCFF);
mList.setEntry(Vector2i(0, 1), Vector2i(1, 1), &mResultName, false, ComponentListComponent::AlignLeft);
mList.setEntry(Vector2i(0, 1), Vector2i(1, 1), &mResultName, false, ComponentGrid::AlignLeft);
mResultDesc.setText(params.game->metadata.get("desc"));
mResultDesc.setSize(col1Width, 0);
mResultInfo.addChild(&mResultDesc);
mResultInfo.setSize(mResultDesc.getSize().x(), mResultDesc.getFont()->getHeight() * 3.0f);
mList.setEntry(Vector2i(0, 2), Vector2i(1, 1), &mResultInfo, false, ComponentListComponent::AlignLeft);
mList.setEntry(Vector2i(0, 2), Vector2i(1, 1), &mResultInfo, false, ComponentGrid::AlignLeft);
mResultThumbnail.setMaxSize(col2Width, mResultInfo.getSize().y());
mList.setEntry(Vector2i(1, 2), Vector2i(1, 1), &mResultThumbnail, false, ComponentListComponent::AlignCenter);
mList.setEntry(Vector2i(1, 2), Vector2i(1, 1), &mResultThumbnail, false, ComponentGrid::AlignCenter);
//y = 3 is a spacer row
mList.setEntry(Vector2i(0, 4), Vector2i(1, 1), &mSearchLabel, false, ComponentListComponent::AlignLeft);
mList.setEntry(Vector2i(0, 4), Vector2i(1, 1), &mSearchLabel, false, ComponentGrid::AlignLeft);
mSearchText.setValue(!params.nameOverride.empty() ? params.nameOverride : getCleanFileName(params.game->getPath()));
mSearchText.setSize(listWidth - mSearchLabel.getSize().x() - 20, mSearchText.getSize().y());
mList.setEntry(Vector2i(1, 4), Vector2i(1, 1), &mSearchText, true, ComponentListComponent::AlignRight);
mList.setEntry(Vector2i(1, 4), Vector2i(1, 1), &mSearchText, true, ComponentGrid::AlignRight);
//y = 5 is a spacer row
......@@ -112,12 +112,12 @@ void GuiGameScraper::onSearchDone(std::vector<MetaDataList> results)
if(end == 0)
{
mResultNames.at(0).setText("No games found!");
mList.setEntry(Eigen::Vector2i(0, 6), Eigen::Vector2i(1, 1), &mResultNames.at(0), false, ComponentListComponent::AlignLeft);
mList.setEntry(Eigen::Vector2i(0, 6), Eigen::Vector2i(1, 1), &mResultNames.at(0), false, ComponentGrid::AlignLeft);
}else{
for(int i = 0; i < end; i++)
{
mResultNames.at(i).setText(results.at(i).get("name"));
mList.setEntry(Eigen::Vector2i(0, 6 + i), Eigen::Vector2i(1, 1), &mResultNames.at(i), true, ComponentListComponent::AlignLeft);
mList.setEntry(Eigen::Vector2i(0, 6 + i), Eigen::Vector2i(1, 1), &mResultNames.at(i), true, ComponentGrid::AlignLeft);
}
}
......
......@@ -2,14 +2,14 @@
#include "../GuiComponent.h"
#include "../scrapers/Scraper.h"
#include "ComponentListComponent.h"
#include "TextComponent.h"
#include "ScrollableContainer.h"
#include "TextEditComponent.h"
#include "NinePatchComponent.h"
#include "../components/ComponentGrid.h"
#include "../components/TextComponent.h"
#include "../components/ScrollableContainer.h"
#include "../components/TextEditComponent.h"
#include "../components/NinePatchComponent.h"
#include "../components/ImageComponent.h"
#include "../Settings.h"
#include "../HttpReq.h"
#include "ImageComponent.h"
#define MAX_SCRAPER_RESULTS 5
......@@ -31,7 +31,7 @@ private:
void updateInfoPane();
void updateThumbnail();
ComponentListComponent mList;
ComponentGrid mList;
NinePatchComponent mBox;
TextComponent mHeader;
......
#ifndef _GUIINPUTCONFIG_H_
#define _GUIINPUTCONFIG_H_
#pragma once
#include "../GuiComponent.h"
#include <string>
......@@ -19,5 +18,3 @@ private:
int mCurInputId;
bool mCanSkip;
};
#endif
#pragma once
#include "../GuiComponent.h"
#include "TextListComponent.h"
#include "NinePatchComponent.h"
#include "../components/TextListComponent.h"
#include "../components/NinePatchComponent.h"
#include <functional>
class GuiMenu : public GuiComponent
......
#include "GuiMetaDataEd.h"
#include "../Renderer.h"
#include "../Log.h"
#include "AsyncReqComponent.h"
#include "../components/AsyncReqComponent.h"
#include "../Settings.h"
#include "GuiGameScraper.h"
#include <boost/filesystem.hpp>
#include "GuiMsgBoxYesNo.h"
#include <boost/filesystem.hpp>
#define MDED_RESERVED_ROWS 3
......@@ -84,10 +84,10 @@ void GuiMetaDataEd::populateList(const std::vector<MetaDataDecl>& mdd)
int y = 0;
//fetch button
mList.setEntry(Vector2i(0, y), Vector2i(1, 1), &mFetchButton, true, ComponentListComponent::AlignLeft);
mList.setEntry(Vector2i(0, y), Vector2i(1, 1), &mFetchButton, true, ComponentGrid::AlignLeft);
//delete button
mList.setEntry(Vector2i(1, y), Vector2i(1, 1), &mDeleteButton, true, ComponentListComponent::AlignRight);
mList.setEntry(Vector2i(1, y), Vector2i(1, 1), &mDeleteButton, true, ComponentGrid::AlignRight);
y++;
......@@ -95,20 +95,20 @@ void GuiMetaDataEd::populateList(const std::vector<MetaDataDecl>& mdd)
{
TextComponent* label = new TextComponent(mWindow);
label->setText(iter->key);
mList.setEntry(Vector2i(0, y), Vector2i(1, 1), label, false, ComponentListComponent::AlignLeft);
mList.setEntry(Vector2i(0, y), Vector2i(1, 1), label, false, ComponentGrid::AlignLeft);
mLabels.push_back(label);
GuiComponent* ed = MetaDataList::makeEditor(mWindow, iter->type);
ed->setSize(Renderer::getScreenWidth() * 0.4f, ed->getSize().y());
ed->setValue(mMetaData->get(iter->key));
mList.setEntry(Vector2i(1, y), Vector2i(1, 1), ed, true, ComponentListComponent::AlignRight);
mList.setEntry(Vector2i(1, y), Vector2i(1, 1), ed, true, ComponentGrid::AlignRight);
mEditors.push_back(ed);
y++;
}
//save button
mList.setEntry(Vector2i(0, y), Vector2i(2, 1), &mSaveButton, true, ComponentListComponent::AlignCenter);
mList.setEntry(Vector2i(0, y), Vector2i(2, 1), &mSaveButton, true, ComponentGrid::AlignCenter);
}
void GuiMetaDataEd::save()
......
#pragma once
#include "../GuiComponent.h"
#include "ComponentListComponent.h"
#include "../components/ComponentGrid.h"
#include "../MetaData.h"
#include "TextComponent.h"
#include "NinePatchComponent.h"
#include "ButtonComponent.h"
#include <functional>
#include "../components/TextComponent.h"
#include "../components/NinePatchComponent.h"
#include "../components/ButtonComponent.h"
#include "../scrapers/Scraper.h"
#include <functional>
class GuiMetaDataEd : public GuiComponent
{
public:
......@@ -31,7 +32,7 @@ private:
NinePatchComponent mBox;
ComponentListComponent mList;
ComponentGrid mList;
TextComponent mHeader;
......
#pragma once
#include "../GuiComponent.h"
#include "TextComponent.h"
#include "../components/TextComponent.h"
#include <functional>
//A simple popup message box with callbacks for when the user dismisses it.
......
#pragma once
#include "../GuiComponent.h"
#include "TextComponent.h"
#include "../components/TextComponent.h"
#include <functional>
//A simple "yes or no" popup box with callbacks for yes or no.
......
#include "GuiScraperLog.h"
#include "../Settings.h"
#include "GuiGameScraper.h"
#include "../Settings.h"
#include "../Renderer.h"
#include "../Log.h"
#include "../XMLReader.h"
......
#pragma once
#include "../GuiComponent.h"
#include "NinePatchComponent.h"
#include <queue>
#include "../components/NinePatchComponent.h"
#include "../scrapers/Scraper.h"
#include "../components/TextComponent.h"
#include <queue>
#include <boost/circular_buffer.hpp>
#include "TextComponent.h"
//A "terminal" of sorts for scraping.
//Doesn't accept input, but renders log-style messages and handles the callback chain for multi-game scraping.
......
......@@ -28,8 +28,8 @@ GuiScraperStart::GuiScraperStart(Window* window) : GuiComponent(window),
mFiltersOpt.addEntry(mFiltersOpt.makeEntry("Missing Image",
[](SystemData*, FileData* g) -> bool { return g->metadata.get("image").empty(); }));
mList.setEntry(Vector2i(0, 0), Vector2i(1, 1), &mFilterLabel, false, ComponentListComponent::AlignRight);
mList.setEntry(Vector2i(1, 0), Vector2i(1, 1), &mFiltersOpt, true, ComponentListComponent::AlignLeft);
mList.setEntry(Vector2i(0, 0), Vector2i(1, 1), &mFilterLabel, false, ComponentGrid::AlignRight);
mList.setEntry(Vector2i(1, 0), Vector2i(1, 1), &mFiltersOpt, true, ComponentGrid::AlignLeft);
//add systems (all with a platformid specified selected)
std::vector<SystemData*> sys = SystemData::sSystemVector;
......@@ -38,15 +38,15 @@ GuiScraperStart::GuiScraperStart(Window* window) : GuiComponent(window),
return mSystemsOpt.makeEntry(s->getName(), s, s->getPlatformId() != PlatformIds::PLATFORM_UNKNOWN);
});
mList.setEntry(Vector2i(0, 1), Vector2i(1, 1), &mSystemsLabel, false, ComponentListComponent::AlignRight);
mList.setEntry(Vector2i(1, 1), Vector2i(1, 1), &mSystemsOpt, true, ComponentListComponent::AlignLeft);
mList.setEntry(Vector2i(0, 1), Vector2i(1, 1), &mSystemsLabel, false, ComponentGrid::AlignRight);
mList.setEntry(Vector2i(1, 1), Vector2i(1, 1), &mSystemsOpt, true, ComponentGrid::AlignLeft);
mList.setEntry(Vector2i(0, 2), Vector2i(1, 1), &mManualLabel, false, ComponentListComponent::AlignRight);
mList.setEntry(Vector2i(1, 2), Vector2i(1, 1), &mManualSwitch, true, ComponentListComponent::AlignLeft);
mList.setEntry(Vector2i(0, 2), Vector2i(1, 1), &mManualLabel, false, ComponentGrid::AlignRight);
mList.setEntry(Vector2i(1, 2), Vector2i(1, 1), &mManualSwitch, true, ComponentGrid::AlignLeft);
mStartButton.setText("GO GO GO GO", "begin", 0x00FF00FF);
mStartButton.setPressedFunc(std::bind(&GuiScraperStart::pressedStart, this));
mList.setEntry(Vector2i(0, 3), Vector2i(2, 1), &mStartButton, true, ComponentListComponent::AlignCenter);
mList.setEntry(Vector2i(0, 3), Vector2i(2, 1), &mStartButton, true, ComponentGrid::AlignCenter);
mList.setPosition(Renderer::getScreenWidth() / 2 - mList.getSize().x() / 2, Renderer::getScreenHeight() / 2 - mList.getSize().y() / 2);
......
......@@ -2,11 +2,11 @@
#include "../GuiComponent.h"
#include "../SystemData.h"
#include "TextComponent.h"
#include "ComponentListComponent.h"
#include "OptionListComponent.h"
#include "SwitchComponent.h"
#include "ButtonComponent.h"
#include "../components/TextComponent.h"
#include "../components/ComponentGrid.h"
#include "../components/OptionListComponent.h"
#include "../components/SwitchComponent.h"
#include "../components/ButtonComponent.h"
#include "../scrapers/Scraper.h"
#include <queue>
......@@ -30,7 +30,7 @@ private:
std::queue<ScraperSearchParams> getSearches(std::vector<SystemData*> systems, GameFilterFunc selector);
NinePatchComponent mBox;
ComponentListComponent mList;
ComponentGrid mList;
TextComponent mFilterLabel;
TextComponent mSystemsLabel;
......@@ -42,13 +42,3 @@ private:
ButtonComponent mStartButton;
};
/*
Filter: [MISSING IMAGES | ALL]
Systems: [# selected]
Manual Mode: [ON | OFF]
GO GO GO