2014-06-25 16:29:58 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "GuiComponent.h"
|
|
|
|
#include "components/ImageComponent.h"
|
|
|
|
#include "components/TextComponent.h"
|
|
|
|
#include "components/ScrollableContainer.h"
|
|
|
|
#include "components/IList.h"
|
|
|
|
#include "resources/TextureResource.h"
|
|
|
|
|
|
|
|
class SystemData;
|
|
|
|
class AnimatedImageComponent;
|
|
|
|
|
2017-03-13 21:11:07 +00:00
|
|
|
enum CarouselType : unsigned int
|
|
|
|
{
|
|
|
|
HORIZONTAL = 0,
|
|
|
|
VERTICAL = 1
|
|
|
|
};
|
|
|
|
|
2014-06-25 16:29:58 +00:00
|
|
|
struct SystemViewData
|
|
|
|
{
|
|
|
|
std::shared_ptr<GuiComponent> logo;
|
|
|
|
std::shared_ptr<GuiComponent> logoSelected;
|
|
|
|
std::shared_ptr<ThemeExtras> backgroundExtras;
|
|
|
|
};
|
|
|
|
|
2017-03-13 21:11:07 +00:00
|
|
|
struct SystemViewCarousel
|
|
|
|
{
|
|
|
|
CarouselType type;
|
|
|
|
Eigen::Vector2f pos;
|
|
|
|
Eigen::Vector2f size;
|
|
|
|
float logoScale;
|
|
|
|
Eigen::Vector2f logoSpacing;
|
|
|
|
unsigned int color;
|
|
|
|
int maxLogoCount; // number of logos shown on the carousel
|
|
|
|
Eigen::Vector2f logoSize;
|
|
|
|
};
|
|
|
|
|
2014-06-25 16:29:58 +00:00
|
|
|
class SystemView : public IList<SystemViewData, SystemData*>
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
SystemView(Window* window);
|
|
|
|
|
|
|
|
void goToSystem(SystemData* system, bool animate);
|
|
|
|
|
|
|
|
bool input(InputConfig* config, Input input) override;
|
|
|
|
void update(int deltaTime) override;
|
|
|
|
void render(const Eigen::Affine3f& parentTrans) override;
|
|
|
|
|
2017-03-13 21:11:07 +00:00
|
|
|
void onThemeChanged(const std::shared_ptr<ThemeData>& theme);
|
|
|
|
|
2014-06-25 16:29:58 +00:00
|
|
|
std::vector<HelpPrompt> getHelpPrompts() override;
|
|
|
|
virtual HelpStyle getHelpStyle() override;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void onCursorChanged(const CursorState& state) override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
void populate();
|
2017-03-13 21:11:07 +00:00
|
|
|
void getViewElements(const std::shared_ptr<ThemeData>& theme);
|
|
|
|
void getDefaultElements(void);
|
|
|
|
void getCarouselFromTheme(const ThemeData::ThemeElement* elem);
|
2014-06-25 16:29:58 +00:00
|
|
|
|
2017-03-13 21:11:07 +00:00
|
|
|
void renderCarousel(const Eigen::Affine3f& parentTrans);
|
|
|
|
void renderExtras(const Eigen::Affine3f& parentTrans);
|
|
|
|
void renderInfoBar(const Eigen::Affine3f& trans);
|
|
|
|
|
|
|
|
SystemViewCarousel mCarousel;
|
2014-06-25 16:29:58 +00:00
|
|
|
TextComponent mSystemInfo;
|
|
|
|
|
|
|
|
// unit is list index
|
|
|
|
float mCamOffset;
|
|
|
|
float mExtrasCamOffset;
|
|
|
|
float mExtrasFadeOpacity;
|
2017-03-13 21:11:07 +00:00
|
|
|
|
|
|
|
bool mViewNeedsReload;
|
2014-06-25 16:29:58 +00:00
|
|
|
};
|