2013-06-19 01:12:30 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "../GuiComponent.h"
|
2014-03-08 01:35:16 +00:00
|
|
|
#include "ImageComponent.h"
|
2013-06-19 01:12:30 +00:00
|
|
|
|
2014-01-24 22:21:10 +00:00
|
|
|
// A very simple "on/off" switch.
|
|
|
|
// Should hopefully be switched to use images instead of text in the future.
|
2013-06-19 01:12:30 +00:00
|
|
|
class SwitchComponent : public GuiComponent
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
SwitchComponent(Window* window, bool state = false);
|
|
|
|
|
|
|
|
bool input(InputConfig* config, Input input) override;
|
2013-07-10 11:29:43 +00:00
|
|
|
void render(const Eigen::Affine3f& parentTrans) override;
|
2013-06-19 01:12:30 +00:00
|
|
|
|
2014-03-08 01:35:16 +00:00
|
|
|
bool getState() const;
|
2013-06-19 01:12:30 +00:00
|
|
|
void setState(bool state);
|
|
|
|
|
2014-01-25 23:34:29 +00:00
|
|
|
virtual std::vector<HelpPrompt> getHelpPrompts() override;
|
|
|
|
|
2013-06-19 01:12:30 +00:00
|
|
|
private:
|
2014-03-08 01:35:16 +00:00
|
|
|
void onStateChanged();
|
|
|
|
|
|
|
|
ImageComponent mImage;
|
2013-06-19 01:12:30 +00:00
|
|
|
bool mState;
|
|
|
|
};
|