diff --git a/apps/openmw/mwgui/messagebox.cpp b/apps/openmw/mwgui/messagebox.cpp index 28aae874f..1527bde4c 100644 --- a/apps/openmw/mwgui/messagebox.cpp +++ b/apps/openmw/mwgui/messagebox.cpp @@ -78,6 +78,10 @@ void MessageBoxManager::createInteractiveMessageBox (const std::string& message, std::copy (buttons.begin(), buttons.end(), std::ostream_iterator (std::cout, ", ")); std::cout << std::endl; + InteractiveMessageBox *box = new InteractiveMessageBox(*this, message, buttons); + mInterMessageBoxes.push_back(box); + + // delete all non-interactive MessageBox'es std::vector::iterator it = mMessageBoxes.begin(); while(it != mMessageBoxes.end()) { @@ -174,3 +178,18 @@ int MessageBox::getHeight () { return mHeight+mNextBoxPadding; // 20 is the padding between this and the next MessageBox } + + + +InteractiveMessageBox::InteractiveMessageBox(MessageBoxManager& parMessageBoxManager, const std::string& message, const std::vector& buttons) + : Layout("openmw_interactive_messagebox_layout.xml") + , mMessageBoxManager(parMessageBoxManager) +{ + getWidget(mMessageWidget, "message"); + getWidget(mButtonsWidget, "buttons"); + + mMessageWidget->setOverflowToTheLeft(true); + mMessageWidget->addText(message); +} + + diff --git a/apps/openmw/mwgui/messagebox.hpp b/apps/openmw/mwgui/messagebox.hpp index fe58a31c8..e394b4c26 100644 --- a/apps/openmw/mwgui/messagebox.hpp +++ b/apps/openmw/mwgui/messagebox.hpp @@ -11,6 +11,7 @@ namespace MWGui { + class InteractiveMessageBox; class MessageBoxManager; class MessageBox; @@ -36,6 +37,7 @@ namespace MWGui private: std::vector mMessageBoxes; + std::vector mInterMessageBoxes; std::vector mTimers; float mMessageBoxSpeed; }; @@ -59,6 +61,17 @@ namespace MWGui int mBottomPadding; int mNextBoxPadding; }; + + class InteractiveMessageBox : public OEngine::GUI::Layout + { + public: + InteractiveMessageBox (MessageBoxManager& parMessageBoxManager, const std::string& message, const std::vector& buttons); + + protected: + MessageBoxManager& mMessageBoxManager; + MyGUI::EditPtr mMessageWidget; + MyGUI::WidgetPtr mButtonsWidget; + }; } diff --git a/extern/mygui_3.0.1/CMakeLists.txt b/extern/mygui_3.0.1/CMakeLists.txt index 36467733d..566fea773 100644 --- a/extern/mygui_3.0.1/CMakeLists.txt +++ b/extern/mygui_3.0.1/CMakeLists.txt @@ -69,6 +69,7 @@ configure_file("${SDIR}/openmw_stats_window_layout.xml" "${DDIR}/openmw_stats_wi configure_file("${SDIR}/openmw_text.skin.xml" "${DDIR}/openmw_text.skin.xml" COPYONLY) configure_file("${SDIR}/openmw_windows.skin.xml" "${DDIR}/openmw_windows.skin.xml" COPYONLY) configure_file("${SDIR}/openmw_messagebox_layout.xml" "${DDIR}/openmw_messagebox_layout.xml" COPYONLY) +configure_file("${SDIR}/openmw_interactive_messagebox_layout.xml" "${DDIR}/openmw_interactive_messagebox_layout.xml" COPYONLY) configure_file("${SDIR}/smallbars.png" "${DDIR}/smallbars.png" COPYONLY) configure_file("${SDIR}/transparent.png" "${DDIR}/transparent.png" COPYONLY) configure_file("${SDIR}/VeraMono.ttf" "${DDIR}/VeraMono.ttf" COPYONLY) diff --git a/extern/mygui_3.0.1/openmw_resources/openmw_interactive_messagebox_layout.xml b/extern/mygui_3.0.1/openmw_resources/openmw_interactive_messagebox_layout.xml new file mode 100644 index 000000000..4db91341e --- /dev/null +++ b/extern/mygui_3.0.1/openmw_resources/openmw_interactive_messagebox_layout.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/extern/mygui_3.0.1/openmw_resources/openmw_messagebox_layout.xml b/extern/mygui_3.0.1/openmw_resources/openmw_messagebox_layout.xml index fb4235ff1..890752db3 100644 --- a/extern/mygui_3.0.1/openmw_resources/openmw_messagebox_layout.xml +++ b/extern/mygui_3.0.1/openmw_resources/openmw_messagebox_layout.xml @@ -12,6 +12,8 @@ + +