first attempt to read the journal

actorid
gugus 13 years ago
parent 0178e22605
commit d59284a096

@ -1,5 +1,8 @@
#include "journalwindow.hpp"
#include "window_manager.hpp"
#include "../mwdialogue/journal.hpp"
#include "../mwworld/environment.hpp"
#include "../mwworld/world.hpp"
std::list<std::string> formatText(std::string text)
@ -84,13 +87,28 @@ MWGui::JournalWindow::JournalWindow (WindowManager& parWindowManager)
mLeftTextWidget->setEditStatic(true);
mRightTextWidget->addText("Right texxt ");
std::list<std::string> list = formatText("OpenMW rgh dsfg sqef srg ZT uzql n ZLIEHRF LQSJH GLOIjf qjfmj hslkdgn jlkdjhg qlr isgli shli uhs fiuh qksf cg ksjnf lkqsnbf ksbf sbfkl zbf kuyzflkj sbgdfkj zlfh ozhjfmo hzmfh lizuf rty qzt ezy tkyEZT RYYJ DG fgh is an open-source implementation of the game engine found in the game Morrowind. This is a dumb test text msodjbg smojg smoig fiiinnn");
displayLeftText(list.front());
//std::list<std::string> list = formatText("OpenMW rgh dsfg sqef srg ZT uzql n ZLIEHRF LQSJH GLOIjf qjfmj hslkdgn jlkdjhg qlr isgli shli uhs fiuh qksf cg ksjnf lkqsnbf ksbf sbfkl zbf kuyzflkj sbgdfkj zlfh ozhjfmo hzmfh lizuf rty qzt ezy tkyEZT RYYJ DG fgh is an open-source implementation of the game engine found in the game Morrowind. This is a dumb test text msodjbg smojg smoig fiiinnn");
//std::list<std::string> list = formatText();
//displayLeftText(list.front());
MyGUI::WindowPtr t = static_cast<MyGUI::WindowPtr>(mMainWidget);
t->eventWindowChangeCoord = MyGUI::newDelegate(this, &JournalWindow::onWindowResize);
}
void MWGui::JournalWindow::open()
{
if(mWindowManager.getEnvironment().mJournal->begin()!=mWindowManager.getEnvironment().mJournal->end())
{
std::string a = mWindowManager.getEnvironment().mJournal->begin()->getText(mWindowManager.getEnvironment().mWorld->getStore());
std::cout << a;
}
else
{
std::cout << "empty";
//std::cout << mWindowManager.getEnvironment().mJournal->begin()->getText(mWindowManager.getEnvironment().mWorld->getStore());
}
}
void MWGui::JournalWindow::onWindowResize(MyGUI::Window* window)
{
}

@ -5,7 +5,6 @@
#include <set>
#include <string>
#include <utility>
#include "../mwdialogue/journal.hpp"
#include "window_base.hpp"
@ -17,6 +16,7 @@ namespace MWGui
{
public:
JournalWindow(WindowManager& parWindowManager);
void open();
private:
enum ColorStyle

@ -144,6 +144,11 @@ void WindowManager::update()
}
}
MWWorld::Environment& WindowManager::getEnvironment()
{
return environment;
}
void WindowManager::setNextMode(GuiMode newMode)
{
nextMode = newMode;
@ -351,6 +356,7 @@ void WindowManager::updateVisible()
if(mode == GM_Journal)
{
mJournal->setVisible(true);
mJournal->open();
return;
}

@ -174,6 +174,8 @@ namespace MWGui
*/
void update();
MWWorld::Environment& getEnvironment();
void setMode(GuiMode newMode)
{
if (newMode==GM_Inventory && allowed==GW_None)

Loading…
Cancel
Save