mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-02-16 12:05:38 +00:00
Made the help system themable.
This commit is contained in:
parent
09312a5b2d
commit
4439beceba
|
@ -141,6 +141,7 @@ set(ES_HEADERS
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/FileData.h
|
${CMAKE_CURRENT_SOURCE_DIR}/src/FileData.h
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/FileSorts.h
|
${CMAKE_CURRENT_SOURCE_DIR}/src/FileSorts.h
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/GuiComponent.h
|
${CMAKE_CURRENT_SOURCE_DIR}/src/GuiComponent.h
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/src/HelpStyle.h
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/HttpReq.h
|
${CMAKE_CURRENT_SOURCE_DIR}/src/HttpReq.h
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/ImageIO.h
|
${CMAKE_CURRENT_SOURCE_DIR}/src/ImageIO.h
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/InputConfig.h
|
${CMAKE_CURRENT_SOURCE_DIR}/src/InputConfig.h
|
||||||
|
@ -232,6 +233,7 @@ set(ES_SOURCES
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/FileData.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/src/FileData.cpp
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/FileSorts.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/src/FileSorts.cpp
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/GuiComponent.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/src/GuiComponent.cpp
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/src/HelpStyle.cpp
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/HttpReq.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/src/HttpReq.cpp
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/ImageIO.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/src/ImageIO.cpp
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/src/InputConfig.cpp
|
${CMAKE_CURRENT_SOURCE_DIR}/src/InputConfig.cpp
|
||||||
|
|
37
THEMES.md
37
THEMES.md
|
@ -270,6 +270,8 @@ Reference
|
||||||
## Views, their elements, and themable properties:
|
## Views, their elements, and themable properties:
|
||||||
|
|
||||||
#### basic
|
#### basic
|
||||||
|
* `helpsystem name="help"` - ALL
|
||||||
|
- The help system style for this view.
|
||||||
* `image name="background"` - ALL
|
* `image name="background"` - ALL
|
||||||
- This is a background image that exists for convenience. It goes from (0, 0) to (1, 1).
|
- This is a background image that exists for convenience. It goes from (0, 0) to (1, 1).
|
||||||
* `text name="logoText"` - ALL
|
* `text name="logoText"` - ALL
|
||||||
|
@ -282,6 +284,8 @@ Reference
|
||||||
---
|
---
|
||||||
|
|
||||||
#### detailed
|
#### detailed
|
||||||
|
* `helpsystem name="help"` - ALL
|
||||||
|
- The help system style for this view.
|
||||||
* `image name="background"` - ALL
|
* `image name="background"` - ALL
|
||||||
- This is a background image that exists for convenience. It goes from (0, 0) to (1, 1).
|
- This is a background image that exists for convenience. It goes from (0, 0) to (1, 1).
|
||||||
* `text name="logoText"` - ALL
|
* `text name="logoText"` - ALL
|
||||||
|
@ -329,6 +333,8 @@ Reference
|
||||||
---
|
---
|
||||||
|
|
||||||
#### grid
|
#### grid
|
||||||
|
* `helpsystem name="help"` - ALL
|
||||||
|
- The help system style for this view.
|
||||||
* `image name="background"` - ALL
|
* `image name="background"` - ALL
|
||||||
- This is a background image that exists for convenience. It goes from (0, 0) to (1, 1).
|
- This is a background image that exists for convenience. It goes from (0, 0) to (1, 1).
|
||||||
* `text name="logoText"` - ALL
|
* `text name="logoText"` - ALL
|
||||||
|
@ -339,32 +345,12 @@ Reference
|
||||||
---
|
---
|
||||||
|
|
||||||
#### system
|
#### system
|
||||||
|
* `helpsystem name="help"` - ALL
|
||||||
|
- The help system style for this view.
|
||||||
* `image name="logo"` - PATH
|
* `image name="logo"` - PATH
|
||||||
- A logo image, to be displayed in the system logo carousel.
|
- A logo image, to be displayed in the system logo carousel.
|
||||||
* You can use extra elements (elements with `extra="true"`) to add your own backgrounds, etc. They will be displayed behind the carousel, and scroll relative to the carousel.
|
* You can use extra elements (elements with `extra="true"`) to add your own backgrounds, etc. They will be displayed behind the carousel, and scroll relative to the carousel.
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
#### fastSelect
|
|
||||||
* `ninepatch name="windowBackground"` - PATH
|
|
||||||
- Fit around the fast select UI as a background.
|
|
||||||
* `text name="letter"` - FONT_PATH | COLOR
|
|
||||||
- The big letter that shows what letter you'll jump to when you let go of the fast select button.
|
|
||||||
* `text name="subtext"` - FONT_PATH | COLOR
|
|
||||||
- The text that displays the current sort mode.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
#### menu
|
|
||||||
* `ninepatch name="windowBackground"` - PATH
|
|
||||||
- Background for the menu. Fit from top-left corner at (0.175, 0.05) to bottom-right corner at (0.825, 0.95).
|
|
||||||
* `textlist name="menulist"` - FONT_PATH | COLOR | SOUND
|
|
||||||
- The list of menu options. `primaryColor` is for most options, `secondaryColor` is for the "shutdown" option.
|
|
||||||
* `sound name="menuOpen"` - PATH
|
|
||||||
- Played when the menu opens.
|
|
||||||
* `sound name="menuClose"` - PATH
|
|
||||||
- Played when the menu closes.
|
|
||||||
|
|
||||||
|
|
||||||
## Types of properties:
|
## Types of properties:
|
||||||
|
|
||||||
|
@ -479,7 +465,14 @@ EmulationStation borrows the concept of "nine patches" from Android (or "9-Slice
|
||||||
* `path` - type: PATH.
|
* `path` - type: PATH.
|
||||||
- Path to the sound file. Only .wav files are currently supported.
|
- Path to the sound file. Only .wav files are currently supported.
|
||||||
|
|
||||||
|
#### helpsystem
|
||||||
|
|
||||||
|
* `pos` - type: NORMALIZED_PAIR.
|
||||||
|
* `textColor` - type: COLOR.
|
||||||
|
* `fontPath` - type: PATH.
|
||||||
|
* `fontSize` - type: FLOAT.
|
||||||
|
|
||||||
|
The help system is a special element that displays a context-sensitive list of actions the user can take at any time. You should try and keep the position constant throughout every screen. Keep in mind the "default" settings (including position) are used whenever the user opens a menu.
|
||||||
|
|
||||||
[*Check out the "official" themes for some more examples!*](http://aloshi.com/emulationstation#themes)
|
[*Check out the "official" themes for some more examples!*](http://aloshi.com/emulationstation#themes)
|
||||||
|
|
||||||
|
|
|
@ -169,7 +169,7 @@ void GuiComponent::setOpacity(unsigned char opacity)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const Eigen::Affine3f GuiComponent::getTransform()
|
const Eigen::Affine3f& GuiComponent::getTransform()
|
||||||
{
|
{
|
||||||
mTransform.setIdentity();
|
mTransform.setIdentity();
|
||||||
mTransform.translate(mPosition);
|
mTransform.translate(mPosition);
|
||||||
|
@ -325,5 +325,10 @@ void GuiComponent::updateHelpPrompts()
|
||||||
std::vector<HelpPrompt> prompts = getHelpPrompts();
|
std::vector<HelpPrompt> prompts = getHelpPrompts();
|
||||||
|
|
||||||
if(mWindow->peekGui() == this)
|
if(mWindow->peekGui() == this)
|
||||||
mWindow->setHelpPrompts(prompts);
|
mWindow->setHelpPrompts(prompts, getHelpStyle());
|
||||||
|
}
|
||||||
|
|
||||||
|
HelpStyle GuiComponent::getHelpStyle()
|
||||||
|
{
|
||||||
|
return HelpStyle();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +1,15 @@
|
||||||
#ifndef _GUICOMPONENT_H_
|
#pragma once
|
||||||
#define _GUICOMPONENT_H_
|
|
||||||
|
|
||||||
#include "InputConfig.h"
|
#include "InputConfig.h"
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <Eigen/Dense>
|
#include <Eigen/Dense>
|
||||||
|
#include "HelpStyle.h"
|
||||||
|
|
||||||
class Window;
|
class Window;
|
||||||
class Animation;
|
class Animation;
|
||||||
class AnimationController;
|
class AnimationController;
|
||||||
class ThemeData;
|
class ThemeData;
|
||||||
|
class Font;
|
||||||
|
|
||||||
typedef std::pair<const char*, const char*> HelpPrompt;
|
typedef std::pair<const char*, const char*> HelpPrompt;
|
||||||
|
|
||||||
|
@ -69,7 +70,7 @@ public:
|
||||||
virtual unsigned char getOpacity() const;
|
virtual unsigned char getOpacity() const;
|
||||||
virtual void setOpacity(unsigned char opacity);
|
virtual void setOpacity(unsigned char opacity);
|
||||||
|
|
||||||
const Eigen::Affine3f getTransform();
|
const Eigen::Affine3f& getTransform();
|
||||||
|
|
||||||
virtual std::string getValue() const;
|
virtual std::string getValue() const;
|
||||||
virtual void setValue(const std::string& value);
|
virtual void setValue(const std::string& value);
|
||||||
|
@ -86,6 +87,8 @@ public:
|
||||||
|
|
||||||
// Called whenever help prompts change.
|
// Called whenever help prompts change.
|
||||||
void updateHelpPrompts();
|
void updateHelpPrompts();
|
||||||
|
|
||||||
|
virtual HelpStyle getHelpStyle();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void renderChildren(const Eigen::Affine3f& transform) const;
|
void renderChildren(const Eigen::Affine3f& transform) const;
|
||||||
|
@ -106,5 +109,3 @@ private:
|
||||||
Eigen::Affine3f mTransform; //Don't access this directly! Use getTransform()!
|
Eigen::Affine3f mTransform; //Don't access this directly! Use getTransform()!
|
||||||
AnimationController* mAnimationMap[MAX_ANIMATIONS];
|
AnimationController* mAnimationMap[MAX_ANIMATIONS];
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
28
src/HelpStyle.cpp
Normal file
28
src/HelpStyle.cpp
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
#include "HelpStyle.h"
|
||||||
|
#include "ThemeData.h"
|
||||||
|
#include "Renderer.h"
|
||||||
|
#include "resources/Font.h"
|
||||||
|
|
||||||
|
HelpStyle::HelpStyle()
|
||||||
|
{
|
||||||
|
position = Eigen::Vector2f(12.0f, Renderer::getScreenHeight() * 0.955f);
|
||||||
|
iconColor = 0x777777FF;
|
||||||
|
textColor = 0x777777FF;
|
||||||
|
font = Font::get(FONT_SIZE_SMALL);
|
||||||
|
}
|
||||||
|
|
||||||
|
void HelpStyle::applyTheme(const std::shared_ptr<ThemeData>& theme, const std::string& view)
|
||||||
|
{
|
||||||
|
auto elem = theme->getElement(view, "help", "helpsystem");
|
||||||
|
if(!elem)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if(elem->has("pos"))
|
||||||
|
position = elem->get<Eigen::Vector2f>("pos").cwiseProduct(Eigen::Vector2f((float)Renderer::getScreenWidth(), (float)Renderer::getScreenHeight()));
|
||||||
|
|
||||||
|
if(elem->has("textColor"))
|
||||||
|
textColor = elem->get<unsigned int>("textColor");
|
||||||
|
|
||||||
|
if(elem->has("fontPath") || elem->has("fontSize"))
|
||||||
|
font = Font::getFromTheme(elem, ThemeFlags::ALL, font);
|
||||||
|
}
|
19
src/HelpStyle.h
Normal file
19
src/HelpStyle.h
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <Eigen/Dense>
|
||||||
|
#include <memory>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
class ThemeData;
|
||||||
|
class Font;
|
||||||
|
|
||||||
|
struct HelpStyle
|
||||||
|
{
|
||||||
|
Eigen::Vector2f position;
|
||||||
|
unsigned int iconColor;
|
||||||
|
unsigned int textColor;
|
||||||
|
std::shared_ptr<Font> font;
|
||||||
|
|
||||||
|
HelpStyle(); // default values
|
||||||
|
void applyTheme(const std::shared_ptr<ThemeData>& theme, const std::string& view);
|
||||||
|
};
|
|
@ -76,7 +76,12 @@ std::map< std::string, ElementMapType > ThemeData::sElementMap = boost::assign::
|
||||||
("filledPath", PATH)
|
("filledPath", PATH)
|
||||||
("unfilledPath", PATH)))
|
("unfilledPath", PATH)))
|
||||||
("sound", makeMap(boost::assign::map_list_of
|
("sound", makeMap(boost::assign::map_list_of
|
||||||
("path", PATH)));
|
("path", PATH)))
|
||||||
|
("helpsystem", makeMap(boost::assign::map_list_of
|
||||||
|
("pos", NORMALIZED_PAIR)
|
||||||
|
("textColor", COLOR)
|
||||||
|
("fontPath", PATH)
|
||||||
|
("fontSize", FLOAT)));
|
||||||
|
|
||||||
namespace fs = boost::filesystem;
|
namespace fs = boost::filesystem;
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ Window::~Window()
|
||||||
void Window::pushGui(GuiComponent* gui)
|
void Window::pushGui(GuiComponent* gui)
|
||||||
{
|
{
|
||||||
mGuiStack.push_back(gui);
|
mGuiStack.push_back(gui);
|
||||||
setHelpPrompts(gui->getHelpPrompts());
|
gui->updateHelpPrompts();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Window::removeGui(GuiComponent* gui)
|
void Window::removeGui(GuiComponent* gui)
|
||||||
|
@ -49,7 +49,7 @@ void Window::removeGui(GuiComponent* gui)
|
||||||
i = mGuiStack.erase(i);
|
i = mGuiStack.erase(i);
|
||||||
|
|
||||||
if(i == mGuiStack.end() && mGuiStack.size()) // we just popped the stack and the stack is not empty
|
if(i == mGuiStack.end() && mGuiStack.size()) // we just popped the stack and the stack is not empty
|
||||||
setHelpPrompts(mGuiStack.back()->getHelpPrompts());
|
mGuiStack.back()->updateHelpPrompts();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -88,7 +88,7 @@ bool Window::init(unsigned int width, unsigned int height)
|
||||||
|
|
||||||
// update our help because font sizes probably changed
|
// update our help because font sizes probably changed
|
||||||
if(peekGui())
|
if(peekGui())
|
||||||
setHelpPrompts(peekGui()->getHelpPrompts());
|
peekGui()->updateHelpPrompts();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -257,9 +257,10 @@ void Window::renderHelpPromptsEarly()
|
||||||
mRenderedHelpPrompts = true;
|
mRenderedHelpPrompts = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Window::setHelpPrompts(const std::vector<HelpPrompt>& prompts)
|
void Window::setHelpPrompts(const std::vector<HelpPrompt>& prompts, const HelpStyle& style)
|
||||||
{
|
{
|
||||||
mHelp->clearPrompts();
|
mHelp->clearPrompts();
|
||||||
|
mHelp->setStyle(style);
|
||||||
|
|
||||||
std::vector<HelpPrompt> addPrompts;
|
std::vector<HelpPrompt> addPrompts;
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@ public:
|
||||||
void renderLoadingScreen();
|
void renderLoadingScreen();
|
||||||
|
|
||||||
void renderHelpPromptsEarly(); // used by ViewController to render HelpPrompts before a fade
|
void renderHelpPromptsEarly(); // used by ViewController to render HelpPrompts before a fade
|
||||||
void setHelpPrompts(const std::vector<HelpPrompt>& prompts);
|
void setHelpPrompts(const std::vector<HelpPrompt>& prompts, const HelpStyle& style);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ViewController* mViewController;
|
ViewController* mViewController;
|
||||||
|
|
|
@ -46,6 +46,12 @@ void HelpComponent::setPrompts(const std::vector<HelpPrompt>& prompts)
|
||||||
updateGrid();
|
updateGrid();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void HelpComponent::setStyle(const HelpStyle& style)
|
||||||
|
{
|
||||||
|
mStyle = style;
|
||||||
|
updateGrid();
|
||||||
|
}
|
||||||
|
|
||||||
void HelpComponent::updateGrid()
|
void HelpComponent::updateGrid()
|
||||||
{
|
{
|
||||||
if(!Settings::getInstance()->getBool("ShowHelpPrompts") || mPrompts.empty())
|
if(!Settings::getInstance()->getBool("ShowHelpPrompts") || mPrompts.empty())
|
||||||
|
@ -54,10 +60,10 @@ void HelpComponent::updateGrid()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::shared_ptr<Font>& font = mStyle.font;
|
||||||
|
|
||||||
mGrid = std::make_shared<ComponentGrid>(mWindow, Vector2i(mPrompts.size() * 4, 1));
|
mGrid = std::make_shared<ComponentGrid>(mWindow, Vector2i(mPrompts.size() * 4, 1));
|
||||||
// [icon] [spacer1] [text] [spacer2]
|
// [icon] [spacer1] [text] [spacer2]
|
||||||
|
|
||||||
std::shared_ptr<Font> font = Font::get(FONT_SIZE_SMALL);
|
|
||||||
|
|
||||||
std::vector< std::shared_ptr<ImageComponent> > icons;
|
std::vector< std::shared_ptr<ImageComponent> > icons;
|
||||||
std::vector< std::shared_ptr<TextComponent> > labels;
|
std::vector< std::shared_ptr<TextComponent> > labels;
|
||||||
|
@ -71,7 +77,7 @@ void HelpComponent::updateGrid()
|
||||||
icon->setResize(0, height);
|
icon->setResize(0, height);
|
||||||
icons.push_back(icon);
|
icons.push_back(icon);
|
||||||
|
|
||||||
auto lbl = std::make_shared<TextComponent>(mWindow, strToUpper(it->second), font, 0x777777FF);
|
auto lbl = std::make_shared<TextComponent>(mWindow, strToUpper(it->second), font, mStyle.textColor);
|
||||||
labels.push_back(lbl);
|
labels.push_back(lbl);
|
||||||
|
|
||||||
width += icon->getSize().x() + lbl->getSize().x() + ICON_TEXT_SPACING + ENTRY_SPACING;
|
width += icon->getSize().x() + lbl->getSize().x() + ICON_TEXT_SPACING + ENTRY_SPACING;
|
||||||
|
@ -89,7 +95,8 @@ void HelpComponent::updateGrid()
|
||||||
mGrid->setEntry(labels.at(i), Vector2i(col + 2, 0), false, false);
|
mGrid->setEntry(labels.at(i), Vector2i(col + 2, 0), false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
mGrid->setPosition(OFFSET_X, Renderer::getScreenHeight() - mGrid->getSize().y() - OFFSET_Y);
|
mGrid->setPosition(Eigen::Vector3f(mStyle.position.x(), mStyle.position.y(), 0.0f));
|
||||||
|
//mGrid->setPosition(OFFSET_X, Renderer::getScreenHeight() - mGrid->getSize().y() - OFFSET_Y);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<TextureResource> HelpComponent::getIconTexture(const char* name)
|
std::shared_ptr<TextureResource> HelpComponent::getIconTexture(const char* name)
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "../GuiComponent.h"
|
#include "../GuiComponent.h"
|
||||||
|
#include "../HelpStyle.h"
|
||||||
|
|
||||||
class ImageComponent;
|
class ImageComponent;
|
||||||
class TextureResource;
|
class TextureResource;
|
||||||
|
@ -17,6 +18,8 @@ public:
|
||||||
void render(const Eigen::Affine3f& parent) override;
|
void render(const Eigen::Affine3f& parent) override;
|
||||||
void setOpacity(unsigned char opacity) override;
|
void setOpacity(unsigned char opacity) override;
|
||||||
|
|
||||||
|
void setStyle(const HelpStyle& style);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::shared_ptr<TextureResource> getIconTexture(const char* name);
|
std::shared_ptr<TextureResource> getIconTexture(const char* name);
|
||||||
std::map< std::string, std::shared_ptr<TextureResource> > mIconCache;
|
std::map< std::string, std::shared_ptr<TextureResource> > mIconCache;
|
||||||
|
@ -25,4 +28,5 @@ private:
|
||||||
void updateGrid();
|
void updateGrid();
|
||||||
|
|
||||||
std::vector<HelpPrompt> mPrompts;
|
std::vector<HelpPrompt> mPrompts;
|
||||||
|
HelpStyle mStyle;
|
||||||
};
|
};
|
||||||
|
|
|
@ -316,3 +316,10 @@ std::vector<HelpPrompt> SystemView::getHelpPrompts()
|
||||||
prompts.push_back(HelpPrompt("a", "select"));
|
prompts.push_back(HelpPrompt("a", "select"));
|
||||||
return prompts;
|
return prompts;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HelpStyle SystemView::getHelpStyle()
|
||||||
|
{
|
||||||
|
HelpStyle style;
|
||||||
|
style.applyTheme(mEntries.at(mCursor).object->getTheme(), "system");
|
||||||
|
return style;
|
||||||
|
}
|
||||||
|
|
|
@ -29,7 +29,8 @@ public:
|
||||||
void render(const Eigen::Affine3f& parentTrans) override;
|
void render(const Eigen::Affine3f& parentTrans) override;
|
||||||
|
|
||||||
std::vector<HelpPrompt> getHelpPrompts() override;
|
std::vector<HelpPrompt> getHelpPrompts() override;
|
||||||
|
virtual HelpStyle getHelpStyle() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void onCursorChanged(const CursorState& state) override;
|
void onCursorChanged(const CursorState& state) override;
|
||||||
|
|
||||||
|
|
|
@ -364,3 +364,11 @@ std::vector<HelpPrompt> ViewController::getHelpPrompts()
|
||||||
|
|
||||||
return prompts;
|
return prompts;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HelpStyle ViewController::getHelpStyle()
|
||||||
|
{
|
||||||
|
if(!mCurrentView)
|
||||||
|
return GuiComponent::getHelpStyle();
|
||||||
|
|
||||||
|
return mCurrentView->getHelpStyle();
|
||||||
|
}
|
||||||
|
|
|
@ -60,6 +60,7 @@ public:
|
||||||
inline const State& getState() const { return mState; }
|
inline const State& getState() const { return mState; }
|
||||||
|
|
||||||
virtual std::vector<HelpPrompt> getHelpPrompts() override;
|
virtual std::vector<HelpPrompt> getHelpPrompts() override;
|
||||||
|
virtual HelpStyle getHelpStyle() override;
|
||||||
|
|
||||||
std::shared_ptr<IGameListView> getGameListView(SystemData* system);
|
std::shared_ptr<IGameListView> getGameListView(SystemData* system);
|
||||||
std::shared_ptr<SystemView> getSystemListView();
|
std::shared_ptr<SystemView> getSystemListView();
|
||||||
|
|
|
@ -34,3 +34,10 @@ void IGameListView::setTheme(const std::shared_ptr<ThemeData>& theme)
|
||||||
mTheme = theme;
|
mTheme = theme;
|
||||||
onThemeChanged(theme);
|
onThemeChanged(theme);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HelpStyle IGameListView::getHelpStyle()
|
||||||
|
{
|
||||||
|
HelpStyle style;
|
||||||
|
style.applyTheme(mTheme, getName());
|
||||||
|
return style;
|
||||||
|
}
|
||||||
|
|
|
@ -34,6 +34,8 @@ public:
|
||||||
virtual bool input(InputConfig* config, Input input) override;
|
virtual bool input(InputConfig* config, Input input) override;
|
||||||
|
|
||||||
virtual const char* getName() const = 0;
|
virtual const char* getName() const = 0;
|
||||||
|
|
||||||
|
virtual HelpStyle getHelpStyle() override;
|
||||||
protected:
|
protected:
|
||||||
FileData* mRoot;
|
FileData* mRoot;
|
||||||
std::shared_ptr<ThemeData> mTheme;
|
std::shared_ptr<ThemeData> mTheme;
|
||||||
|
|
Loading…
Reference in a new issue