2020-09-21 17:17:34 +00:00
|
|
|
// SPDX-License-Identifier: MIT
|
2020-06-28 16:39:18 +00:00
|
|
|
//
|
2020-09-21 17:17:34 +00:00
|
|
|
// EmulationStation Desktop Edition
|
2020-06-28 16:39:18 +00:00
|
|
|
// HelpComponent.h
|
|
|
|
//
|
|
|
|
// Help information in icon and text pairs.
|
|
|
|
//
|
|
|
|
|
2017-10-31 17:12:50 +00:00
|
|
|
#ifndef ES_CORE_COMPONENTS_HELP_COMPONENT_H
|
|
|
|
#define ES_CORE_COMPONENTS_HELP_COMPONENT_H
|
2014-01-25 23:34:29 +00:00
|
|
|
|
2014-06-20 01:30:09 +00:00
|
|
|
#include "GuiComponent.h"
|
|
|
|
#include "HelpStyle.h"
|
2014-01-25 23:34:29 +00:00
|
|
|
|
2017-11-01 22:21:10 +00:00
|
|
|
class ComponentGrid;
|
2014-01-25 23:34:29 +00:00
|
|
|
class ImageComponent;
|
|
|
|
class TextureResource;
|
|
|
|
|
|
|
|
class HelpComponent : public GuiComponent
|
|
|
|
{
|
|
|
|
public:
|
2020-06-28 16:39:18 +00:00
|
|
|
HelpComponent(Window* window);
|
2014-01-25 23:34:29 +00:00
|
|
|
|
2021-05-23 17:12:31 +00:00
|
|
|
void assignIcons();
|
|
|
|
|
2020-06-28 16:39:18 +00:00
|
|
|
void clearPrompts();
|
|
|
|
void setPrompts(const std::vector<HelpPrompt>& prompts);
|
2014-01-25 23:34:29 +00:00
|
|
|
|
2020-06-28 16:39:18 +00:00
|
|
|
void render(const Transform4x4f& parent) override;
|
|
|
|
void setOpacity(unsigned char opacity) override;
|
2014-01-25 23:34:29 +00:00
|
|
|
|
2020-06-28 16:39:18 +00:00
|
|
|
void setStyle(const HelpStyle& style);
|
2014-05-29 20:41:47 +00:00
|
|
|
|
2014-01-25 23:34:29 +00:00
|
|
|
private:
|
2020-06-28 16:39:18 +00:00
|
|
|
std::shared_ptr<TextureResource> getIconTexture(const char* name);
|
2021-03-27 09:26:13 +00:00
|
|
|
std::map<std::string, std::shared_ptr<TextureResource>> mIconCache;
|
2014-01-25 23:34:29 +00:00
|
|
|
|
2020-06-28 16:39:18 +00:00
|
|
|
std::shared_ptr<ComponentGrid> mGrid;
|
|
|
|
void updateGrid();
|
2014-01-25 23:34:29 +00:00
|
|
|
|
2020-06-28 16:39:18 +00:00
|
|
|
std::vector<HelpPrompt> mPrompts;
|
|
|
|
HelpStyle mStyle;
|
2014-01-25 23:34:29 +00:00
|
|
|
};
|
2017-10-31 17:12:50 +00:00
|
|
|
|
|
|
|
#endif // ES_CORE_COMPONENTS_HELP_COMPONENT_H
|