2014-06-25 16:29:58 +00:00
|
|
|
#pragma once
|
2017-10-31 17:12:50 +00:00
|
|
|
#ifndef ES_APP_VIEWS_SYSTEM_VIEW_H
|
|
|
|
#define ES_APP_VIEWS_SYSTEM_VIEW_H
|
2014-06-25 16:29:58 +00:00
|
|
|
|
|
|
|
#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,
|
2017-08-15 02:34:34 +00:00
|
|
|
VERTICAL = 1,
|
|
|
|
VERTICAL_WHEEL = 2
|
2017-03-13 21:11:07 +00:00
|
|
|
};
|
|
|
|
|
2014-06-25 16:29:58 +00:00
|
|
|
struct SystemViewData
|
|
|
|
{
|
|
|
|
std::shared_ptr<GuiComponent> logo;
|
2017-04-22 14:15:16 +00:00
|
|
|
std::vector<GuiComponent*> backgroundExtras;
|
2014-06-25 16:29:58 +00:00
|
|
|
};
|
|
|
|
|
2017-03-13 21:11:07 +00:00
|
|
|
struct SystemViewCarousel
|
|
|
|
{
|
|
|
|
CarouselType type;
|
2017-10-28 20:24:35 +00:00
|
|
|
Vector2f pos;
|
|
|
|
Vector2f size;
|
|
|
|
Vector2f origin;
|
2017-03-13 21:11:07 +00:00
|
|
|
float logoScale;
|
2017-08-15 02:34:34 +00:00
|
|
|
float logoRotation;
|
2017-10-28 20:24:35 +00:00
|
|
|
Vector2f logoRotationOrigin;
|
2017-08-15 02:34:34 +00:00
|
|
|
Alignment logoAlignment;
|
2017-03-13 21:11:07 +00:00
|
|
|
unsigned int color;
|
|
|
|
int maxLogoCount; // number of logos shown on the carousel
|
2017-10-28 20:24:35 +00:00
|
|
|
Vector2f logoSize;
|
2017-04-22 14:15:16 +00:00
|
|
|
float zIndex;
|
2017-03-13 21:11:07 +00:00
|
|
|
};
|
|
|
|
|
2014-06-25 16:29:58 +00:00
|
|
|
class SystemView : public IList<SystemViewData, SystemData*>
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
SystemView(Window* window);
|
|
|
|
|
2017-08-15 02:34:34 +00:00
|
|
|
virtual void onShow() override;
|
|
|
|
virtual void onHide() override;
|
|
|
|
|
2014-06-25 16:29:58 +00:00
|
|
|
void goToSystem(SystemData* system, bool animate);
|
|
|
|
|
|
|
|
bool input(InputConfig* config, Input input) override;
|
|
|
|
void update(int deltaTime) override;
|
2017-10-28 20:24:35 +00:00
|
|
|
void render(const Transform4x4f& parentTrans) override;
|
2014-06-25 16:29:58 +00:00
|
|
|
|
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-10-28 20:24:35 +00:00
|
|
|
void renderCarousel(const Transform4x4f& parentTrans);
|
|
|
|
void renderExtras(const Transform4x4f& parentTrans, float lower, float upper);
|
|
|
|
void renderInfoBar(const Transform4x4f& trans);
|
|
|
|
void renderFade(const Transform4x4f& trans);
|
2017-04-22 14:15:16 +00:00
|
|
|
|
2017-03-13 21:11:07 +00:00
|
|
|
|
|
|
|
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;
|
2017-08-15 02:34:34 +00:00
|
|
|
bool mShowing;
|
2014-06-25 16:29:58 +00:00
|
|
|
};
|
2017-10-31 17:12:50 +00:00
|
|
|
|
|
|
|
#endif // ES_APP_VIEWS_SYSTEM_VIEW_H
|