From 06e02ed77f231036192baddff9d79cc602ac8dbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C5=A1per=20Sedej?= Date: Wed, 12 Mar 2014 10:53:56 +0100 Subject: [PATCH] Added version and revision number to mainmenu --- apps/openmw/mwgui/mainmenu.cpp | 10 ++++++++++ apps/openmw/mwgui/mainmenu.hpp | 1 + files/mygui/openmw_mainmenu.layout | 6 +++++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwgui/mainmenu.cpp b/apps/openmw/mwgui/mainmenu.cpp index da1992474..2788c8f5c 100644 --- a/apps/openmw/mwgui/mainmenu.cpp +++ b/apps/openmw/mwgui/mainmenu.cpp @@ -1,5 +1,7 @@ #include "mainmenu.hpp" +#include + #include "../mwbase/environment.hpp" #include "../mwbase/windowmanager.hpp" #include "../mwbase/soundmanager.hpp" @@ -20,6 +22,14 @@ namespace MWGui , mButtonBox(0), mWidth (w), mHeight (h) , mSaveGameDialog(NULL) { + getWidget(mVersionText, "VersionText"); + std::string rev = OPENMW_VERSION_COMMITHASH; + rev = rev.substr(0,10); + std::stringstream sstream; + sstream << "OpenMW version: " << OPENMW_VERSION << "\nrevision: " << rev; + std::string output = sstream.str(); + mVersionText->setCaptionWithReplacing(output); + updateMenu(); } diff --git a/apps/openmw/mwgui/mainmenu.hpp b/apps/openmw/mwgui/mainmenu.hpp index 6d52f26d5..a9453b2c8 100644 --- a/apps/openmw/mwgui/mainmenu.hpp +++ b/apps/openmw/mwgui/mainmenu.hpp @@ -24,6 +24,7 @@ namespace MWGui private: MyGUI::Widget* mButtonBox; + MyGUI::TextBox* mVersionText; std::map mButtons; diff --git a/files/mygui/openmw_mainmenu.layout b/files/mygui/openmw_mainmenu.layout index 4479a121f..2dc43f1b7 100644 --- a/files/mygui/openmw_mainmenu.layout +++ b/files/mygui/openmw_mainmenu.layout @@ -2,5 +2,9 @@ - + + + + +