From 0e6b82284fe0beab83a2bc769c133d66c7c605f2 Mon Sep 17 00:00:00 2001 From: scrawl Date: Thu, 3 May 2012 03:33:33 +0200 Subject: [PATCH] book & scroll windows --- apps/openmw/CMakeLists.txt | 2 +- apps/openmw/mwgui/bookwindow.cpp | 15 +++++++++++++++ apps/openmw/mwgui/bookwindow.hpp | 20 ++++++++++++++++++++ apps/openmw/mwgui/journalwindow.cpp | 7 ------- apps/openmw/mwgui/journalwindow.hpp | 9 --------- apps/openmw/mwgui/scrollwindow.cpp | 14 ++++++++++++++ apps/openmw/mwgui/scrollwindow.hpp | 19 +++++++++++++++++++ apps/openmw/mwgui/window_manager.cpp | 6 ++++++ apps/openmw/mwgui/window_manager.hpp | 4 ++++ files/mygui/CMakeLists.txt | 3 +++ files/mygui/core.xml | 1 + files/mygui/openmw_book_layout.xml | 20 ++++++++++++++++++++ files/mygui/openmw_journal_layout.xml | 7 ++----- files/mygui/openmw_journal_skin.xml | 6 +++--- files/mygui/openmw_scroll_layout.xml | 16 ++++++++++++++++ files/mygui/openmw_scroll_skin.xml | 15 +++++++++++++++ 16 files changed, 139 insertions(+), 25 deletions(-) create mode 100644 apps/openmw/mwgui/bookwindow.cpp create mode 100644 apps/openmw/mwgui/bookwindow.hpp create mode 100644 apps/openmw/mwgui/scrollwindow.cpp create mode 100644 apps/openmw/mwgui/scrollwindow.hpp create mode 100644 files/mygui/openmw_book_layout.xml create mode 100644 files/mygui/openmw_scroll_layout.xml create mode 100644 files/mygui/openmw_scroll_skin.xml diff --git a/apps/openmw/CMakeLists.txt b/apps/openmw/CMakeLists.txt index 79ea262e68..0fc841ce6e 100644 --- a/apps/openmw/CMakeLists.txt +++ b/apps/openmw/CMakeLists.txt @@ -25,7 +25,7 @@ add_openmw_dir (mwinput add_openmw_dir (mwgui layouts text_input widgets race class birth review window_manager console dialogue dialogue_history window_base stats_window messagebox journalwindow charactercreation - map_window window_pinnable_base cursorreplace tooltips + map_window window_pinnable_base cursorreplace tooltips scrollwindow bookwindow ) add_openmw_dir (mwdialogue diff --git a/apps/openmw/mwgui/bookwindow.cpp b/apps/openmw/mwgui/bookwindow.cpp new file mode 100644 index 0000000000..ce816a6693 --- /dev/null +++ b/apps/openmw/mwgui/bookwindow.cpp @@ -0,0 +1,15 @@ +#include "bookwindow.hpp" + +using namespace MWGui; + +BookWindow::BookWindow(WindowManager& parWindowManager) : + WindowBase("openmw_book_layout.xml", parWindowManager) +{ + //setVisible(false); + center(); +} + +void BookWindow::open(MWWorld::Ptr book) +{ +} + diff --git a/apps/openmw/mwgui/bookwindow.hpp b/apps/openmw/mwgui/bookwindow.hpp new file mode 100644 index 0000000000..57f45f0172 --- /dev/null +++ b/apps/openmw/mwgui/bookwindow.hpp @@ -0,0 +1,20 @@ +#ifndef MWGUI_BOOKWINDOW_H +#define MWGUI_BOOKWINDOW_H + +#include "window_base.hpp" + +#include "../mwworld/ptr.hpp" + +namespace MWGui +{ + class BookWindow : public WindowBase + { + public: + BookWindow(WindowManager& parWindowManager); + void open(MWWorld::Ptr book); + }; + +} + +#endif + diff --git a/apps/openmw/mwgui/journalwindow.cpp b/apps/openmw/mwgui/journalwindow.cpp index e67eda7771..4030911a00 100644 --- a/apps/openmw/mwgui/journalwindow.cpp +++ b/apps/openmw/mwgui/journalwindow.cpp @@ -109,9 +109,6 @@ MWGui::JournalWindow::JournalWindow (WindowManager& parWindowManager) //std::list 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 list = formatText(); //displayLeftText(list.front()); - - MyGUI::WindowPtr t = static_cast(mMainWidget); - t->eventWindowChangeCoord += MyGUI::newDelegate(this, &JournalWindow::onWindowResize); } void MWGui::JournalWindow::open() @@ -159,10 +156,6 @@ void MWGui::JournalWindow::open() } } -void MWGui::JournalWindow::onWindowResize(MyGUI::Window* window) -{ -} - void MWGui::JournalWindow::displayLeftText(std::string text) { mLeftTextWidget->eraseText(0,mLeftTextWidget->getTextLength()); diff --git a/apps/openmw/mwgui/journalwindow.hpp b/apps/openmw/mwgui/journalwindow.hpp index 4656c7a482..c5009d6548 100644 --- a/apps/openmw/mwgui/journalwindow.hpp +++ b/apps/openmw/mwgui/journalwindow.hpp @@ -19,15 +19,6 @@ namespace MWGui void open(); private: - enum ColorStyle - { - CS_Sub, - CS_Normal, - CS_Super - }; - - void onWindowResize(MyGUI::Window* window); - void displayLeftText(std::string text); void displayRightText(std::string text); diff --git a/apps/openmw/mwgui/scrollwindow.cpp b/apps/openmw/mwgui/scrollwindow.cpp new file mode 100644 index 0000000000..ab4065e418 --- /dev/null +++ b/apps/openmw/mwgui/scrollwindow.cpp @@ -0,0 +1,14 @@ +#include "scrollwindow.hpp" + +using namespace MWGui; + +ScrollWindow::ScrollWindow(WindowManager& parWindowManager) : + WindowBase("openmw_scroll_layout.xml", parWindowManager) +{ + setVisible(false); + center(); +} + +void ScrollWindow::open(MWWorld::Ptr scroll) +{ +} diff --git a/apps/openmw/mwgui/scrollwindow.hpp b/apps/openmw/mwgui/scrollwindow.hpp new file mode 100644 index 0000000000..d7f5cd686c --- /dev/null +++ b/apps/openmw/mwgui/scrollwindow.hpp @@ -0,0 +1,19 @@ +#ifndef MWGUI_SCROLLWINDOW_H +#define MWGUI_SCROLLWINDOW_H + +#include "window_base.hpp" + +#include "../mwworld/ptr.hpp" + +namespace MWGui +{ + class ScrollWindow : public WindowBase + { + public: + ScrollWindow(WindowManager& parWindowManager); + void open(MWWorld::Ptr scroll); + }; + +} + +#endif diff --git a/apps/openmw/mwgui/window_manager.cpp b/apps/openmw/mwgui/window_manager.cpp index 0f2df53e1a..40fc9308d7 100644 --- a/apps/openmw/mwgui/window_manager.cpp +++ b/apps/openmw/mwgui/window_manager.cpp @@ -8,6 +8,8 @@ #include "stats_window.hpp" #include "messagebox.hpp" #include "tooltips.hpp" +#include "scrollwindow.hpp" +#include "bookwindow.hpp" #include "../mwmechanics/mechanicsmanager.hpp" #include "../mwinput/inputmanager.hpp" @@ -37,6 +39,8 @@ WindowManager::WindowManager( , mMessageBoxManager(NULL) , console(NULL) , mJournal(NULL) + , mBookWindow(NULL) + , mScrollWindow(NULL) , dialogueWindow(nullptr) , mCharGen(NULL) , playerClass() @@ -84,6 +88,8 @@ WindowManager::WindowManager( mMessageBoxManager = new MessageBoxManager(this); dialogueWindow = new DialogueWindow(*this); mToolTips = new ToolTips(this); + mScrollWindow = new ScrollWindow(*this); + mBookWindow = new BookWindow(*this); // The HUD is always on hud->setVisible(true); diff --git a/apps/openmw/mwgui/window_manager.hpp b/apps/openmw/mwgui/window_manager.hpp index f96660715a..13da6c7f01 100644 --- a/apps/openmw/mwgui/window_manager.hpp +++ b/apps/openmw/mwgui/window_manager.hpp @@ -62,6 +62,8 @@ namespace MWGui class JournalWindow; class CharacterCreation; class ToolTips; + class ScrollWindow; + class BookWindow; class TextInputDialog; class InfoBoxDialog; @@ -203,6 +205,8 @@ namespace MWGui Console *console; JournalWindow* mJournal; DialogueWindow *dialogueWindow; + ScrollWindow* mScrollWindow; + BookWindow* mBookWindow; CharacterCreation* mCharGen; diff --git a/files/mygui/CMakeLists.txt b/files/mygui/CMakeLists.txt index 49055d2ede..ef62fb68ce 100644 --- a/files/mygui/CMakeLists.txt +++ b/files/mygui/CMakeLists.txt @@ -51,6 +51,9 @@ configure_file("${SDIR}/openmw_interactive_messagebox_layout.xml" "${DDIR}/openm configure_file("${SDIR}/openmw_journal_layout.xml" "${DDIR}/openmw_journal_layout.xml" COPYONLY) configure_file("${SDIR}/openmw_journal_skin.xml" "${DDIR}/openmw_journal_skin.xml" COPYONLY) configure_file("${SDIR}/openmw_tooltips.xml" "${DDIR}/openmw_tooltips.xml" COPYONLY) +configure_file("${SDIR}/openmw_scroll_layout.xml" "${DDIR}/openmw_scroll_layout.xml" COPYONLY) +configure_file("${SDIR}/openmw_scroll_skin.xml" "${DDIR}/openmw_scroll_skin.xml" COPYONLY) +configure_file("${SDIR}/openmw_book_layout.xml" "${DDIR}/openmw_book_layout.xml" COPYONLY) configure_file("${SDIR}/smallbars.png" "${DDIR}/smallbars.png" COPYONLY) configure_file("${SDIR}/transparent.png" "${DDIR}/transparent.png" COPYONLY) configure_file("${SDIR}/EBGaramond-Regular.ttf" "${DDIR}/EBGaramond-Regular.ttf" COPYONLY) diff --git a/files/mygui/core.xml b/files/mygui/core.xml index 7417328cf1..c0a29d1f6e 100644 --- a/files/mygui/core.xml +++ b/files/mygui/core.xml @@ -20,6 +20,7 @@ + diff --git a/files/mygui/openmw_book_layout.xml b/files/mygui/openmw_book_layout.xml new file mode 100644 index 0000000000..ccf494860b --- /dev/null +++ b/files/mygui/openmw_book_layout.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/files/mygui/openmw_journal_layout.xml b/files/mygui/openmw_journal_layout.xml index da4fe658bd..5711053aca 100644 --- a/files/mygui/openmw_journal_layout.xml +++ b/files/mygui/openmw_journal_layout.xml @@ -7,11 +7,8 @@ - - - - - + + diff --git a/files/mygui/openmw_journal_skin.xml b/files/mygui/openmw_journal_skin.xml index 0ef87852f4..a983ac523b 100644 --- a/files/mygui/openmw_journal_skin.xml +++ b/files/mygui/openmw_journal_skin.xml @@ -1,9 +1,9 @@ - - - + + + diff --git a/files/mygui/openmw_scroll_layout.xml b/files/mygui/openmw_scroll_layout.xml new file mode 100644 index 0000000000..b396931edd --- /dev/null +++ b/files/mygui/openmw_scroll_layout.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/files/mygui/openmw_scroll_skin.xml b/files/mygui/openmw_scroll_skin.xml new file mode 100644 index 0000000000..e55396ac44 --- /dev/null +++ b/files/mygui/openmw_scroll_skin.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + +