ES-DE/es-app/src/views/SystemView.h

98 lines
2.7 KiB
C
Raw Normal View History

// SPDX-License-Identifier: MIT
//
// EmulationStation Desktop Edition
// SystemView.h
//
// Main system view.
//
#ifndef ES_APP_VIEWS_SYSTEM_VIEW_H
#define ES_APP_VIEWS_SYSTEM_VIEW_H
#include "GuiComponent.h"
#include "Sound.h"
#include "SystemData.h"
#include "components/CarouselComponent.h"
#include "components/DateTimeComponent.h"
#include "components/LottieComponent.h"
#include "components/ScrollableContainer.h"
2017-11-01 22:21:10 +00:00
#include "components/TextComponent.h"
#include "components/TextListComponent.h"
#include "components/VideoFFmpegComponent.h"
2017-11-01 22:21:10 +00:00
#include "resources/Font.h"
2017-11-01 22:21:10 +00:00
#include <memory>
2017-11-01 22:21:10 +00:00
class SystemData;
struct SystemViewElements {
std::string name;
std::vector<GuiComponent*> legacyExtras;
std::vector<GuiComponent*> children;
std::vector<std::unique_ptr<TextComponent>> textComponents;
std::vector<std::unique_ptr<ImageComponent>> imageComponents;
std::vector<std::unique_ptr<VideoFFmpegComponent>> videoComponents;
std::vector<std::unique_ptr<LottieComponent>> lottieAnimComponents;
std::vector<std::unique_ptr<ScrollableContainer>> containerComponents;
std::vector<std::unique_ptr<TextComponent>> containerTextComponents;
};
class SystemView : public GuiComponent
{
public:
SystemView();
~SystemView();
void goToSystem(SystemData* system, bool animate);
bool input(InputConfig* config, Input input) override;
void update(int deltaTime) override;
void render(const glm::mat4& parentTrans) override;
bool isScrolling() { return mCarousel->isScrolling(); }
void stopScrolling() { mCarousel->stopScrolling(); }
bool isSystemAnimationPlaying(unsigned char slot)
{
return mCarousel->isAnimationPlaying(slot);
}
void finishSystemAnimation(unsigned char slot)
{
finishAnimation(slot);
mCarousel->finishAnimation(slot);
}
CarouselComponent::CarouselType getCarouselType() { return mCarousel->getType(); }
SystemData* getFirstSystem() { return mCarousel->getFirst(); }
void onThemeChanged(const std::shared_ptr<ThemeData>& theme);
std::vector<HelpPrompt> getHelpPrompts() override;
HelpStyle getHelpStyle() override;
protected:
void onCursorChanged(const CursorState& state);
private:
void populate();
2020-11-15 19:06:33 +00:00
void updateGameCount();
// Get the ThemeElements that make up the SystemView.
void getViewElements(const std::shared_ptr<ThemeData>& theme);
void renderFade(const glm::mat4& trans);
std::unique_ptr<CarouselComponent> mCarousel;
std::unique_ptr<TextComponent> mSystemInfo;
std::vector<SystemViewElements> mElements;
float mCamOffset;
float mFadeOpacity;
2020-11-15 19:06:33 +00:00
bool mUpdatedGameCount;
bool mViewNeedsReload;
bool mLegacyMode;
};
#endif // ES_APP_VIEWS_SYSTEM_VIEW_H