2020-06-06 14:48:05 +00:00
|
|
|
//
|
2020-06-21 12:25:28 +00:00
|
|
|
// SystemView.h
|
2020-06-06 14:48:05 +00:00
|
|
|
//
|
2020-06-21 12:25:28 +00:00
|
|
|
// Main system view.
|
2020-06-06 14:48:05 +00:00
|
|
|
//
|
|
|
|
|
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 "components/IList.h"
|
2017-11-01 22:21:10 +00:00
|
|
|
#include "components/TextComponent.h"
|
|
|
|
#include "resources/Font.h"
|
|
|
|
#include "GuiComponent.h"
|
2020-06-17 20:13:07 +00:00
|
|
|
#include "Sound.h"
|
2017-11-01 22:21:10 +00:00
|
|
|
#include <memory>
|
2014-06-25 16:29:58 +00:00
|
|
|
|
|
|
|
class AnimatedImageComponent;
|
2017-11-01 22:21:10 +00:00
|
|
|
class SystemData;
|
2014-06-25 16:29:58 +00:00
|
|
|
|
2020-06-06 14:48:05 +00:00
|
|
|
enum CarouselType : unsigned int {
|
2020-06-21 12:25:28 +00:00
|
|
|
HORIZONTAL = 0,
|
|
|
|
VERTICAL = 1,
|
|
|
|
VERTICAL_WHEEL = 2,
|
|
|
|
HORIZONTAL_WHEEL = 3
|
2017-03-13 21:11:07 +00:00
|
|
|
};
|
|
|
|
|
2020-06-06 14:48:05 +00:00
|
|
|
struct SystemViewData {
|
2020-06-21 12:25:28 +00:00
|
|
|
std::shared_ptr<GuiComponent> logo;
|
|
|
|
std::vector<GuiComponent*> backgroundExtras;
|
2014-06-25 16:29:58 +00:00
|
|
|
};
|
|
|
|
|
2020-06-06 14:48:05 +00:00
|
|
|
struct SystemViewCarousel {
|
2020-06-21 12:25:28 +00:00
|
|
|
CarouselType type;
|
|
|
|
Vector2f pos;
|
|
|
|
Vector2f size;
|
|
|
|
Vector2f origin;
|
|
|
|
float logoScale;
|
|
|
|
float logoRotation;
|
|
|
|
Vector2f logoRotationOrigin;
|
|
|
|
Alignment logoAlignment;
|
|
|
|
unsigned int color;
|
|
|
|
unsigned int colorEnd;
|
|
|
|
bool colorGradientHorizontal;
|
|
|
|
int maxLogoCount; // Number of logos shown on the carousel.
|
|
|
|
Vector2f logoSize;
|
|
|
|
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:
|
2020-06-21 12:25:28 +00:00
|
|
|
SystemView(Window* window);
|
2014-06-25 16:29:58 +00:00
|
|
|
|
2020-06-21 12:25:28 +00:00
|
|
|
virtual void onShow() override;
|
|
|
|
virtual void onHide() override;
|
2017-08-15 02:34:34 +00:00
|
|
|
|
2020-06-21 12:25:28 +00:00
|
|
|
void goToSystem(SystemData* system, bool animate);
|
2014-06-25 16:29:58 +00:00
|
|
|
|
2020-06-21 12:25:28 +00:00
|
|
|
bool input(InputConfig* config, Input input) override;
|
|
|
|
void update(int deltaTime) override;
|
|
|
|
void render(const Transform4x4f& parentTrans) override;
|
2014-06-25 16:29:58 +00:00
|
|
|
|
2020-06-21 12:25:28 +00:00
|
|
|
void onThemeChanged(const std::shared_ptr<ThemeData>& theme);
|
2017-03-13 21:11:07 +00:00
|
|
|
|
2020-06-21 12:25:28 +00:00
|
|
|
std::vector<HelpPrompt> getHelpPrompts() override;
|
|
|
|
virtual HelpStyle getHelpStyle() override;
|
2014-06-25 16:29:58 +00:00
|
|
|
|
|
|
|
protected:
|
2020-06-21 12:25:28 +00:00
|
|
|
void onCursorChanged(const CursorState& state) override;
|
|
|
|
virtual void onScroll() {
|
|
|
|
NavigationSounds::getInstance()->playThemeNavigationSound(SYSTEMBROWSESOUND); }
|
2014-06-25 16:29:58 +00:00
|
|
|
|
|
|
|
private:
|
2020-06-21 12:25:28 +00:00
|
|
|
void populate();
|
|
|
|
void getViewElements(const std::shared_ptr<ThemeData>& theme);
|
|
|
|
void getDefaultElements(void);
|
|
|
|
void getCarouselFromTheme(const ThemeData::ThemeElement* elem);
|
|
|
|
|
|
|
|
void renderCarousel(const Transform4x4f& parentTrans);
|
|
|
|
void renderExtras(const Transform4x4f& parentTrans, float lower, float upper);
|
|
|
|
void renderInfoBar(const Transform4x4f& trans);
|
|
|
|
void renderFade(const Transform4x4f& trans);
|
|
|
|
|
|
|
|
SystemViewCarousel mCarousel;
|
|
|
|
TextComponent mSystemInfo;
|
|
|
|
|
|
|
|
// Unit is list index.
|
|
|
|
float mCamOffset;
|
|
|
|
float mExtrasCamOffset;
|
|
|
|
float mExtrasFadeOpacity;
|
|
|
|
|
|
|
|
bool mViewNeedsReload;
|
|
|
|
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
|