1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 19:19:56 +00:00

Fix MyGUI log

Also actually print an error to the regular log when the MyGUI log can't
be opened so we notice if we kill it again in under five years.
This commit is contained in:
AnyOldName3 2021-03-15 22:35:13 +00:00
parent 20852e82b2
commit ba74fbf30e
2 changed files with 5 additions and 1 deletions

View file

@ -189,7 +189,7 @@ namespace MWGui
{ {
float uiScale = Settings::Manager::getFloat("scaling factor", "GUI"); float uiScale = Settings::Manager::getFloat("scaling factor", "GUI");
mGuiPlatform = new osgMyGUI::Platform(viewer, guiRoot, resourceSystem->getImageManager(), uiScale); mGuiPlatform = new osgMyGUI::Platform(viewer, guiRoot, resourceSystem->getImageManager(), uiScale);
mGuiPlatform->initialise(resourcePath, logpath); mGuiPlatform->initialise(resourcePath, (boost::filesystem::path(logpath) / "MyGUI.log").generic_string());
mGui = new MyGUI::Gui; mGui = new MyGUI::Gui;
mGui->initialise(""); mGui->initialise("");

View file

@ -2,11 +2,15 @@
#include <iomanip> #include <iomanip>
#include <components/debug/debuglog.hpp>
namespace osgMyGUI namespace osgMyGUI
{ {
void CustomLogListener::open() void CustomLogListener::open()
{ {
mStream.open(boost::filesystem::path(mFileName), std::ios_base::out); mStream.open(boost::filesystem::path(mFileName), std::ios_base::out);
if (!mStream.is_open())
Log(Debug::Error) << "Unable to create MyGUI log with path " << mFileName;
} }
void CustomLogListener::close() void CustomLogListener::close()