mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-04-10 19:15:13 +00:00
Rewrote the logic for the 'none' value for the helpsystem element scope property
This commit is contained in:
parent
57815f6633
commit
db2b00a49e
|
@ -352,8 +352,6 @@ void GamelistView::onThemeChanged(const std::shared_ptr<ThemeData>& theme)
|
|||
else if (element.second.type == "helpsystem") {
|
||||
mHelpComponents.emplace_back(std::make_unique<HelpComponent>());
|
||||
mHelpComponents.back()->applyTheme(theme, "gamelist", element.first, ALL);
|
||||
if (mHelpComponents.back()->getHelpComponentScope() == HelpComponentScope::NONE)
|
||||
mHelpComponents.pop_back();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -726,10 +726,6 @@ void SystemView::populate()
|
|||
elements.helpComponents.emplace_back(std::make_unique<HelpComponent>());
|
||||
elements.helpComponents.back()->applyTheme(theme, "system", element.first,
|
||||
ThemeFlags::ALL);
|
||||
if (elements.helpComponents.back()->getHelpComponentScope() ==
|
||||
HelpComponentScope::NONE) {
|
||||
elements.helpComponents.pop_back();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -608,6 +608,8 @@ void Window::render()
|
|||
if (!mRenderedHelpPrompts) {
|
||||
if (mHelpComponents != nullptr) {
|
||||
for (auto& helpComponent : *mHelpComponents) {
|
||||
if (helpComponent->getHelpComponentScope() == HelpComponentScope::NONE)
|
||||
continue;
|
||||
if (helpComponent->getHelpComponentScope() != HelpComponentScope::VIEW) {
|
||||
helpComponent->setVisible(true);
|
||||
helpComponent->render(trans);
|
||||
|
@ -773,6 +775,8 @@ void Window::renderHelpPromptsEarly()
|
|||
{
|
||||
if (mHelpComponents != nullptr) {
|
||||
for (auto& helpComponent : *mHelpComponents) {
|
||||
if (helpComponent->getHelpComponentScope() == HelpComponentScope::NONE)
|
||||
continue;
|
||||
if (helpComponent->getHelpComponentScope() != HelpComponentScope::MENU) {
|
||||
helpComponent->setVisible(true);
|
||||
helpComponent->render(mRenderer->getIdentity());
|
||||
|
@ -855,11 +859,13 @@ void Window::setHelpPrompts(const std::vector<HelpPrompt>& prompts)
|
|||
|
||||
if (mHelpComponents != nullptr) {
|
||||
for (auto& helpComponent : *mHelpComponents) {
|
||||
if (helpComponent->getHelpComponentScope() == HelpComponentScope::NONE)
|
||||
continue;
|
||||
if (mGuiStack.size() == 1 &&
|
||||
helpComponent->getHelpComponentScope() == HelpComponentScope::MENU)
|
||||
continue;
|
||||
else if (mGuiStack.size() > 1 &&
|
||||
helpComponent->getHelpComponentScope() == HelpComponentScope::VIEW)
|
||||
if (mGuiStack.size() > 1 &&
|
||||
helpComponent->getHelpComponentScope() == HelpComponentScope::VIEW)
|
||||
continue;
|
||||
helpComponent->clearPrompts();
|
||||
helpComponent->setPrompts(addPrompts);
|
||||
|
|
|
@ -270,11 +270,6 @@ void HelpComponent::applyTheme(const std::shared_ptr<ThemeData>& theme,
|
|||
if (!elem)
|
||||
return;
|
||||
|
||||
if (elem->has("scope") && elem->get<std::string>("scope") == "none") {
|
||||
mHelpComponentScope = HelpComponentScope::NONE;
|
||||
return;
|
||||
}
|
||||
|
||||
if (elem->has("pos"))
|
||||
mStylePosition = elem->get<glm::vec2>("pos") *
|
||||
glm::vec2 {Renderer::getScreenWidth(), Renderer::getScreenHeight()};
|
||||
|
@ -329,6 +324,9 @@ void HelpComponent::applyTheme(const std::shared_ptr<ThemeData>& theme,
|
|||
else if (scope == "menu") {
|
||||
mHelpComponentScope = HelpComponentScope::MENU;
|
||||
}
|
||||
else if (scope == "none") {
|
||||
mHelpComponentScope = HelpComponentScope::NONE;
|
||||
}
|
||||
else {
|
||||
LOG(LogWarning) << "HelpComponent: Invalid theme configuration, property "
|
||||
"\"scope\" for element \""
|
||||
|
|
Loading…
Reference in a new issue