2014-03-01 00:52:32 +00:00
|
|
|
#pragma once
|
2012-07-22 21:15:55 +00:00
|
|
|
|
2013-06-02 15:08:32 +00:00
|
|
|
#include "../GuiComponent.h"
|
2014-03-22 01:12:57 +00:00
|
|
|
#include "../components/NinePatchComponent.h"
|
|
|
|
#include "../components/ComponentGrid.h"
|
|
|
|
#include "../components/ComponentList.h"
|
|
|
|
|
|
|
|
class TextComponent;
|
2012-07-22 21:15:55 +00:00
|
|
|
|
2013-06-02 15:08:32 +00:00
|
|
|
class GuiInputConfig : public GuiComponent
|
2013-04-08 16:52:40 +00:00
|
|
|
{
|
2012-07-22 21:15:55 +00:00
|
|
|
public:
|
2014-03-22 01:12:57 +00:00
|
|
|
GuiInputConfig(Window* window, InputConfig* target, bool reconfigureAll, const std::function<void()>& okCallback);
|
2012-07-22 21:15:55 +00:00
|
|
|
|
2014-03-22 01:12:57 +00:00
|
|
|
void onSizeChanged() override;
|
2013-04-09 18:13:47 +00:00
|
|
|
|
2012-07-22 21:15:55 +00:00
|
|
|
private:
|
2014-03-22 01:12:57 +00:00
|
|
|
void error(const std::string& msg);
|
|
|
|
bool process(InputConfig* config, Input input, int inputId, const std::shared_ptr<TextComponent>& text);
|
|
|
|
|
|
|
|
NinePatchComponent mBackground;
|
|
|
|
ComponentGrid mGrid;
|
|
|
|
|
|
|
|
std::shared_ptr<TextComponent> mTitle;
|
|
|
|
std::shared_ptr<TextComponent> mSubtitle1;
|
|
|
|
std::shared_ptr<TextComponent> mSubtitle2;
|
|
|
|
std::shared_ptr<ComponentList> mList;
|
|
|
|
std::shared_ptr<ComponentGrid> mButtonGrid;
|
|
|
|
|
2013-04-09 18:13:47 +00:00
|
|
|
InputConfig* mTargetConfig;
|
2014-03-22 01:12:57 +00:00
|
|
|
bool mConfiguringRow; // next input captured by mList will be interpretted as a remap
|
|
|
|
bool mConfiguringAll; // move the cursor down after configuring a row and start configuring the next row until we reach the bottom
|
2012-07-22 21:15:55 +00:00
|
|
|
};
|