2020-09-15 20:57:54 +00:00
|
|
|
// SPDX-License-Identifier: MIT
|
2020-06-06 14:48:05 +00:00
|
|
|
//
|
2020-09-15 20:57:54 +00:00
|
|
|
// EmulationStation Desktop Edition
|
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
|
|
|
//
|
|
|
|
|
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
|
|
|
|
2021-07-07 18:03:42 +00:00
|
|
|
#include "GuiComponent.h"
|
|
|
|
#include "Sound.h"
|
2022-02-06 13:01:40 +00:00
|
|
|
#include "SystemData.h"
|
|
|
|
#include "components/CarouselComponent.h"
|
2022-01-30 20:16:03 +00:00
|
|
|
#include "components/DateTimeComponent.h"
|
|
|
|
#include "components/LottieComponent.h"
|
|
|
|
#include "components/ScrollableContainer.h"
|
2017-11-01 22:21:10 +00:00
|
|
|
#include "components/TextComponent.h"
|
2022-01-30 20:16:03 +00:00
|
|
|
#include "components/TextListComponent.h"
|
|
|
|
#include "components/VideoFFmpegComponent.h"
|
2017-11-01 22:21:10 +00:00
|
|
|
#include "resources/Font.h"
|
2020-07-09 17:24:20 +00:00
|
|
|
|
2017-11-01 22:21:10 +00:00
|
|
|
#include <memory>
|
2014-06-25 16:29:58 +00:00
|
|
|
|
2017-11-01 22:21:10 +00:00
|
|
|
class SystemData;
|
2014-06-25 16:29:58 +00:00
|
|
|
|
2022-02-06 13:01:40 +00:00
|
|
|
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;
|
2017-03-13 21:11:07 +00:00
|
|
|
};
|
|
|
|
|
2022-02-06 13:01:40 +00:00
|
|
|
class SystemView : public GuiComponent
|
2014-06-25 16:29:58 +00:00
|
|
|
{
|
|
|
|
public:
|
2022-01-19 17:01:54 +00:00
|
|
|
SystemView();
|
2020-08-15 07:28:47 +00:00
|
|
|
~SystemView();
|
2014-06-25 16:29:58 +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;
|
2021-08-15 17:30:31 +00:00
|
|
|
void render(const glm::mat4& parentTrans) override;
|
2014-06-25 16:29:58 +00:00
|
|
|
|
2022-02-06 13:01:40 +00:00
|
|
|
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(); }
|
|
|
|
|
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;
|
2022-01-18 16:40:47 +00:00
|
|
|
HelpStyle getHelpStyle() override;
|
2014-06-25 16:29:58 +00:00
|
|
|
|
|
|
|
protected:
|
2022-02-06 13:01:40 +00:00
|
|
|
void onCursorChanged(const CursorState& state);
|
2014-06-25 16:29:58 +00:00
|
|
|
|
|
|
|
private:
|
2020-06-21 12:25:28 +00:00
|
|
|
void populate();
|
2020-11-15 19:06:33 +00:00
|
|
|
void updateGameCount();
|
2021-08-15 17:30:31 +00:00
|
|
|
// Get the ThemeElements that make up the SystemView.
|
2020-06-21 12:25:28 +00:00
|
|
|
void getViewElements(const std::shared_ptr<ThemeData>& theme);
|
2022-02-06 13:01:40 +00:00
|
|
|
|
2021-08-15 17:30:31 +00:00
|
|
|
void renderFade(const glm::mat4& trans);
|
2020-06-21 12:25:28 +00:00
|
|
|
|
2022-02-06 13:01:40 +00:00
|
|
|
std::unique_ptr<CarouselComponent> mCarousel;
|
|
|
|
std::unique_ptr<TextComponent> mSystemInfo;
|
|
|
|
|
|
|
|
std::vector<SystemViewElements> mElements;
|
2020-06-21 12:25:28 +00:00
|
|
|
|
|
|
|
float mCamOffset;
|
2022-02-06 13:01:40 +00:00
|
|
|
float mFadeOpacity;
|
2020-06-21 12:25:28 +00:00
|
|
|
|
2020-11-15 19:06:33 +00:00
|
|
|
bool mUpdatedGameCount;
|
2020-06-21 12:25:28 +00:00
|
|
|
bool mViewNeedsReload;
|
2022-01-30 20:16:03 +00:00
|
|
|
bool mLegacyMode;
|
2014-06-25 16:29:58 +00:00
|
|
|
};
|
2017-10-31 17:12:50 +00:00
|
|
|
|
|
|
|
#endif // ES_APP_VIEWS_SYSTEM_VIEW_H
|