Update StarGraphicsMenu.cpp
This commit is contained in:
parent
1303f54e30
commit
e12860ad25
@ -9,10 +9,12 @@
|
|||||||
#include "StarButtonWidget.hpp"
|
#include "StarButtonWidget.hpp"
|
||||||
#include "StarOrderedSet.hpp"
|
#include "StarOrderedSet.hpp"
|
||||||
#include "StarJsonExtra.hpp"
|
#include "StarJsonExtra.hpp"
|
||||||
|
#include "StarShadersMenu.hpp"
|
||||||
|
|
||||||
namespace Star {
|
namespace Star {
|
||||||
|
|
||||||
GraphicsMenu::GraphicsMenu() {
|
GraphicsMenu::GraphicsMenu(PaneManager* manager,UniverseClientPtr client)
|
||||||
|
: m_paneManager(manager) {
|
||||||
GuiReader reader;
|
GuiReader reader;
|
||||||
reader.registerCallback("cancel",
|
reader.registerCallback("cancel",
|
||||||
[&](Widget*) {
|
[&](Widget*) {
|
||||||
@ -103,10 +105,14 @@ GraphicsMenu::GraphicsMenu() {
|
|||||||
Root::singleton().configuration()->set("newLighting", checked);
|
Root::singleton().configuration()->set("newLighting", checked);
|
||||||
syncGui();
|
syncGui();
|
||||||
});
|
});
|
||||||
|
reader.registerCallback("showShadersMenu", [=](Widget*) {
|
||||||
|
displayShaders();
|
||||||
|
});
|
||||||
|
|
||||||
auto assets = Root::singleton().assets();
|
auto assets = Root::singleton().assets();
|
||||||
|
|
||||||
Json paneLayout = assets->json("/interface/windowconfig/graphicsmenu.config:paneLayout");
|
auto config = assets->json("/interface/windowconfig/graphicsmenu.config");
|
||||||
|
Json paneLayout = config.get("paneLayout");
|
||||||
|
|
||||||
m_interfaceScaleList = jsonToIntList(assets->json("/interface/windowconfig/graphicsmenu.config:interfaceScaleList"));
|
m_interfaceScaleList = jsonToIntList(assets->json("/interface/windowconfig/graphicsmenu.config:interfaceScaleList"));
|
||||||
m_resList = jsonToVec2UList(assets->json("/interface/windowconfig/graphicsmenu.config:resolutionList"));
|
m_resList = jsonToVec2UList(assets->json("/interface/windowconfig/graphicsmenu.config:resolutionList"));
|
||||||
@ -122,6 +128,8 @@ GraphicsMenu::GraphicsMenu() {
|
|||||||
|
|
||||||
initConfig();
|
initConfig();
|
||||||
syncGui();
|
syncGui();
|
||||||
|
|
||||||
|
m_shadersMenu = make_shared<ShadersMenu>(assets->json(config.getString("shadersPanePath", "/interface/opensb/shaders/shaders.config")), client);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GraphicsMenu::show() {
|
void GraphicsMenu::show() {
|
||||||
@ -240,6 +248,10 @@ void GraphicsMenu::apply() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GraphicsMenu::displayShaders() {
|
||||||
|
m_paneManager->displayPane(PaneLayer::ModalWindow, m_shadersMenu);
|
||||||
|
}
|
||||||
|
|
||||||
void GraphicsMenu::applyWindowSettings() {
|
void GraphicsMenu::applyWindowSettings() {
|
||||||
auto configuration = Root::singleton().configuration();
|
auto configuration = Root::singleton().configuration();
|
||||||
auto appController = GuiContext::singleton().applicationController();
|
auto appController = GuiContext::singleton().applicationController();
|
||||||
@ -253,4 +265,4 @@ void GraphicsMenu::applyWindowSettings() {
|
|||||||
appController->setNormalWindow(jsonToVec2U(configuration->get("windowedResolution")));
|
appController->setNormalWindow(jsonToVec2U(configuration->get("windowedResolution")));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user