From d4f3430fc66e8bc5db5c2035235a23ff43564485 Mon Sep 17 00:00:00 2001 From: gugus Date: Mon, 19 Mar 2012 19:17:20 +0100 Subject: [PATCH 01/19] fix: topics who should not be displayed are not displayed anymore. --- apps/openmw/mwdialogue/dialoguemanager.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/apps/openmw/mwdialogue/dialoguemanager.cpp b/apps/openmw/mwdialogue/dialoguemanager.cpp index 7950a78881..ef68226436 100644 --- a/apps/openmw/mwdialogue/dialoguemanager.cpp +++ b/apps/openmw/mwdialogue/dialoguemanager.cpp @@ -517,7 +517,6 @@ namespace MWDialogue return false; // TODO check DATAstruct - for (std::vector::const_iterator iter (info.selects.begin()); iter != info.selects.end(); ++iter) if (!isMatching (actor, *iter)) @@ -691,7 +690,8 @@ namespace MWDialogue void DialogueManager::updateTopics() { std::list keywordList; - + int choice = mChoice; + mChoice = -1; actorKnownTopics.clear(); MWGui::DialogueWindow* win = mEnvironment.mWindowManager->getDialogueWindow(); ESMS::RecListT::MapType dialogueList = mEnvironment.mWorld->getStore().dialogs.list; @@ -703,7 +703,7 @@ namespace MWDialogue for (std::vector::const_iterator iter (it->second.mInfo.begin()); iter!=it->second.mInfo.end(); ++iter) { - if (isMatching (mActor, *iter) && functionFilter(mActor,*iter,false)) + if (isMatching (mActor, *iter) && functionFilter(mActor,*iter,true)) { actorKnownTopics.push_back(it->first); //does the player know the topic? @@ -717,6 +717,7 @@ namespace MWDialogue } } win->setKeywords(keywordList); + mChoice = choice; } void DialogueManager::keywordSelected(std::string keyword) @@ -726,10 +727,9 @@ namespace MWDialogue if(mDialogueMap.find(keyword) != mDialogueMap.end()) { ESM::Dialogue ndialogue = mDialogueMap[keyword]; - std::vector::const_iterator iter; if(ndialogue.type == ESM::Dialogue::Topic) { - for (iter = ndialogue.mInfo.begin(); + for (std::vector::const_iterator iter = ndialogue.mInfo.begin(); iter!=ndialogue.mInfo.end(); ++iter) { if (isMatching (mActor, *iter) && functionFilter(mActor,*iter,true)) @@ -753,6 +753,7 @@ namespace MWDialogue } } } + std::cout << std::endl << std::endl; updateTopics(); } From 82c4bfbf18c2ec95a3d5aed46c9245b7cb638f55 Mon Sep 17 00:00:00 2001 From: Michael Papageorgiou Date: Mon, 19 Mar 2012 20:18:08 +0200 Subject: [PATCH 02/19] Add a notification when the journal is updated --- apps/openmw/mwdialogue/journal.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/apps/openmw/mwdialogue/journal.cpp b/apps/openmw/mwdialogue/journal.cpp index 42cce5cf55..c272de6050 100644 --- a/apps/openmw/mwdialogue/journal.cpp +++ b/apps/openmw/mwdialogue/journal.cpp @@ -3,6 +3,9 @@ #include "../mwworld/environment.hpp" +#include "../mwgui/window_manager.hpp" +#include "../mwgui/messagebox.hpp" + namespace MWDialogue { Quest& Journal::getQuest (const std::string& id) @@ -34,6 +37,10 @@ namespace MWDialogue Quest& quest = getQuest (id); quest.addEntry (entry, *mEnvironment.mWorld); // we are doing slicing on purpose here + + std::vector empty; + std::string notification = "Your Journal has been updated."; + mEnvironment.mWindowManager->messageBox (notification, empty); } void Journal::setJournalIndex (const std::string& id, int index) From fc959172533fe9b1a5059bef0fbd43ea6ba3e28a Mon Sep 17 00:00:00 2001 From: Lukasz Gromanowski Date: Mon, 19 Mar 2012 20:54:30 +0100 Subject: [PATCH 03/19] Fix for not visible pthreads function with glibc 2.15 Linking error will appear: Linking CXX executable ../../openmw /usr/bin/ld: CMakeFiles/openmw.dir/__/__/components/bsa/bsa_archive.cpp.o: undefined reference to symbol 'pthread_mutexattr_settype@@GLIBC_2.2.5' /usr/bin/ld: note: 'pthread_mutexattr_settype@@GLIBC_2.2.5' is defined in DSO /lib/libpthread.so.0 so try adding it to the linker command line /lib/libpthread.so.0: could not read symbols: Invalid operation collect2: ld returned 1 exit status if we don't add explicitly pthreads library to linker flags after update glibc to version 2.15 on (Arch) Linux. Signed-off-by: Lukasz Gromanowski --- CMakeLists.txt | 5 +++++ apps/openmw/CMakeLists.txt | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 08ce829f65..ab299b5491 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -186,6 +186,11 @@ endif (APPLE) # Dependencies +# Fix for not visible pthreads functions for linker with glibc 2.15 +if (UNIX AND NOT APPLE) +find_package (Threads) +endif() + find_package(OGRE REQUIRED) find_package(Boost REQUIRED COMPONENTS system filesystem program_options thread) find_package(OIS REQUIRED) diff --git a/apps/openmw/CMakeLists.txt b/apps/openmw/CMakeLists.txt index 6d33298dfe..4edc08ba6a 100644 --- a/apps/openmw/CMakeLists.txt +++ b/apps/openmw/CMakeLists.txt @@ -81,7 +81,7 @@ add_definitions(${SOUND_DEFINE}) target_link_libraries(openmw ${OGRE_LIBRARIES} - ${OGRE_STATIC_PLUGINS} + ${OGRE_STATIC_PLUGINS} ${OIS_LIBRARIES} ${Boost_LIBRARIES} ${OPENAL_LIBRARY} @@ -92,6 +92,11 @@ target_link_libraries(openmw MyGUIOgrePlatform ) +# Fix for not visible pthreads functions for linker with glibc 2.15 +if (UNIX AND NOT APPLE) +target_link_libraries(openmw ${CMAKE_THREAD_LIBS_INIT}) +endif() + if(APPLE) find_library(CARBON_FRAMEWORK Carbon) target_link_libraries(openmw ${CARBON_FRAMEWORK}) From 04c6f23a2b44abead632e0cd9d9e13ae60d67862 Mon Sep 17 00:00:00 2001 From: scrawl Date: Mon, 19 Mar 2012 22:54:04 +0100 Subject: [PATCH 04/19] disabled solstheim weather (we can't travel there anyway) also, there was a bug that could cause this weather to show up on morrowind, which is fixed now --- apps/openmw/mwworld/weather.cpp | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/apps/openmw/mwworld/weather.cpp b/apps/openmw/mwworld/weather.cpp index 044d6e83a7..9a918c2fb3 100644 --- a/apps/openmw/mwworld/weather.cpp +++ b/apps/openmw/mwworld/weather.cpp @@ -271,7 +271,8 @@ WeatherManager::WeatherManager(MWRender::RenderingManager* rendering, Environmen blight.mGlareView = 0; blight.mAmbientLoopSoundID = "blight"; mWeatherSettings["blight"] = blight; - + + /* Weather snow; snow.mCloudTexture = "tx_bm_sky_snow.dds"; snow.mCloudsMaximumPercent = 1.0; @@ -328,6 +329,7 @@ WeatherManager::WeatherManager(MWRender::RenderingManager* rendering, Environmen blizzard.mGlareView = 0; blizzard.mAmbientLoopSoundID = "BM Blizzard"; mWeatherSettings["blizzard"] = blizzard; + */ } void WeatherManager::setWeather(const String& weather, bool instant) @@ -509,32 +511,32 @@ void WeatherManager::update(float duration) float thunder = region->data.thunder/255.f; float ash = region->data.ash/255.f; float blight = region->data.blight/255.f; - float snow = region->data.a/255.f; - float blizzard = region->data.b/255.f; + //float snow = region->data.a/255.f; + //float blizzard = region->data.b/255.f; // re-scale to 100 percent - const float total = clear+cloudy+foggy+overcast+rain+thunder+ash+blight+snow+blizzard; + const float total = clear+cloudy+foggy+overcast+rain+thunder+ash+blight;//+snow+blizzard; srand(time(NULL)); float random = ((rand()%100)/100.f) * total; - if (random >= snow+blight+ash+thunder+rain+overcast+foggy+cloudy+clear) - weather = "blizzard"; - else if (random >= blight+ash+thunder+rain+overcast+foggy+cloudy+clear) - weather = "snow"; - else if (random >= ash+thunder+rain+overcast+foggy+cloudy+clear) + //if (random > snow+blight+ash+thunder+rain+overcast+foggy+cloudy+clear) + // weather = "blizzard"; + //else if (random > blight+ash+thunder+rain+overcast+foggy+cloudy+clear) + // weather = "snow"; + /*else*/ if (random > ash+thunder+rain+overcast+foggy+cloudy+clear) weather = "blight"; - else if (random >= thunder+rain+overcast+foggy+cloudy+clear) + else if (random > thunder+rain+overcast+foggy+cloudy+clear) weather = "ashstorm"; - else if (random >= rain+overcast+foggy+cloudy+clear) + else if (random > rain+overcast+foggy+cloudy+clear) weather = "thunderstorm"; - else if (random >= overcast+foggy+cloudy+clear) + else if (random > overcast+foggy+cloudy+clear) weather = "rain"; - else if (random >= foggy+cloudy+clear) + else if (random > foggy+cloudy+clear) weather = "overcast"; - else if (random >= cloudy+clear) + else if (random > cloudy+clear) weather = "foggy"; - else if (random >= clear) + else if (random > clear) weather = "cloudy"; else weather = "clear"; From 0b517d15c14e19ce9cc4d9a14c9e1df41dc085c3 Mon Sep 17 00:00:00 2001 From: Pieter van der Kloet Date: Tue, 20 Mar 2012 02:49:59 +0100 Subject: [PATCH 05/19] Made missing data files dialog less scary and added exception handling for esmreader --- apps/launcher/datafilespage.cpp | 105 +++++++++++++++++--------------- 1 file changed, 56 insertions(+), 49 deletions(-) diff --git a/apps/launcher/datafilespage.cpp b/apps/launcher/datafilespage.cpp index 054cbf1414..c96fc2c7b6 100644 --- a/apps/launcher/datafilespage.cpp +++ b/apps/launcher/datafilespage.cpp @@ -222,7 +222,7 @@ void DataFilesPage::setupDataFiles() QMessageBox msgBox; msgBox.setWindowTitle("Error detecting Morrowind installation"); - msgBox.setIcon(QMessageBox::Critical); + msgBox.setIcon(QMessageBox::Warning); msgBox.setStandardButtons(QMessageBox::Cancel); msgBox.setText(tr("
Could not find the Data Files location

\ The directory containing the Data Files was not found.

\ @@ -279,72 +279,79 @@ void DataFilesPage::setupDataFiles() const Files::MultiDirCollection &esp = fileCollections.getCollection(".esp"); for (Files::MultiDirCollection::TIter iter(esp.begin()); iter!=esp.end(); ++iter) { - ESMReader fileReader; - QStringList availableMasters; // Will contain all found masters - fileReader.setEncoding(variables["encoding"].as()); - fileReader.open(iter->second.string()); + try { + ESMReader fileReader; + QStringList availableMasters; // Will contain all found masters + + fileReader.setEncoding(variables["encoding"].as()); + fileReader.open(iter->second.string()); - // First we fill the availableMasters and the mMastersWidget - ESMReader::MasterList mlist = fileReader.getMasters(); + // First we fill the availableMasters and the mMastersWidget + ESMReader::MasterList mlist = fileReader.getMasters(); - for (unsigned int i = 0; i < mlist.size(); ++i) { - const QString currentMaster = QString::fromStdString(mlist[i].name); - availableMasters.append(currentMaster); + for (unsigned int i = 0; i < mlist.size(); ++i) { + const QString currentMaster = QString::fromStdString(mlist[i].name); + availableMasters.append(currentMaster); - const QList itemList = mMastersWidget->findItems(currentMaster, Qt::MatchExactly); + const QList itemList = mMastersWidget->findItems(currentMaster, Qt::MatchExactly); - if (itemList.isEmpty()) { // Master is not yet in the widget - mMastersWidget->insertRow(i); + if (itemList.isEmpty()) { // Master is not yet in the widget + mMastersWidget->insertRow(i); - QTableWidgetItem *item = new QTableWidgetItem(currentMaster); - item->setForeground(Qt::red); - item->setFlags(item->flags() & ~(Qt::ItemIsSelectable)); + QTableWidgetItem *item = new QTableWidgetItem(currentMaster); + item->setForeground(Qt::red); + item->setFlags(item->flags() & ~(Qt::ItemIsSelectable)); - mMastersWidget->setItem(i, 0, item); + mMastersWidget->setItem(i, 0, item); + } } - } - availableMasters.sort(); // Sort the masters alphabetically + availableMasters.sort(); // Sort the masters alphabetically - // Now we put the current plugin in the mDataFilesModel under its masters - QStandardItem *parent = new QStandardItem(availableMasters.join(",")); + // Now we put the current plugin in the mDataFilesModel under its masters + QStandardItem *parent = new QStandardItem(availableMasters.join(",")); - QString fileName = QString::fromStdString(boost::filesystem::path (iter->second.filename()).string()); - QStandardItem *child = new QStandardItem(fileName); + QString fileName = QString::fromStdString(boost::filesystem::path (iter->second.filename()).string()); + QStandardItem *child = new QStandardItem(fileName); - // Tooltip information - QString author = QString::fromStdString(fileReader.getAuthor()); - float version = fileReader.getFVer(); - QString description = QString::fromStdString(fileReader.getDesc()); + // Tooltip information + QString author = QString::fromStdString(fileReader.getAuthor()); + float version = fileReader.getFVer(); + QString description = QString::fromStdString(fileReader.getDesc()); - // For the date created/modified - QFileInfo fi(QString::fromStdString(iter->second.string())); + // For the date created/modified + QFileInfo fi(QString::fromStdString(iter->second.string())); - QString toolTip= QString("Author: %1
\ - Version: %2

\ - Description:
\ - %3

\ - Created on: %4
\ - Last modified: %5") - .arg(author) - .arg(version) - .arg(description) - .arg(fi.created().toString(Qt::TextDate)) - .arg(fi.lastModified().toString(Qt::TextDate)); + QString toolTip= QString("Author: %1
\ + Version: %2

\ + Description:
\ + %3

\ + Created on: %4
\ + Last modified: %5") + .arg(author) + .arg(version) + .arg(description) + .arg(fi.created().toString(Qt::TextDate)) + .arg(fi.lastModified().toString(Qt::TextDate)); - child->setToolTip(toolTip); + child->setToolTip(toolTip); - const QList masterList = mDataFilesModel->findItems(availableMasters.join(",")); + const QList masterList = mDataFilesModel->findItems(availableMasters.join(",")); - if (masterList.isEmpty()) { // Masters node not yet in the mDataFilesModel - parent->appendRow(child); - mDataFilesModel->appendRow(parent); - } else { - // Masters node exists, append current plugin - foreach (QStandardItem *currentItem, masterList) { - currentItem->appendRow(child); + if (masterList.isEmpty()) { // Masters node not yet in the mDataFilesModel + parent->appendRow(child); + mDataFilesModel->appendRow(parent); + } else { + // Masters node exists, append current plugin + foreach (QStandardItem *currentItem, masterList) { + currentItem->appendRow(child); + } } + + } catch(std::runtime_error &e) { + // An error occurred while reading the .esp + continue; } } From 42584b013fa265f029ffd9686e1dd782f1d1f9f7 Mon Sep 17 00:00:00 2001 From: Brother Brick Date: Tue, 20 Mar 2012 09:43:48 +0100 Subject: [PATCH 06/19] Updated dependency to match our PPA --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 08ce829f65..7cbc9b12f6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -322,7 +322,7 @@ if(DPKG_PROGRAM) SET(CPACK_DEBIAN_PACKAGE_NAME "openmw") SET(CPACK_DEBIAN_PACKAGE_VERSION "${VERSION_STRING}") SET(CPACK_PACKAGE_EXECUTABLES "openmw;OpenMW esmtool;Esmtool omwlauncher;OMWLauncher") - SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libogre-1.7.3 (>= 1.7.3), libbullet0 (>= 2.77), libboost-filesystem1.46.1 (>= 1.46.1), libboost-program-options1.46.1 (>= 1.46.1), libboost-system1.46.1 (>= 1.46.1), libboost-thread1.46.1 (>= 1.46.1), libc6 (>= 2.11.2), libfreetype6 (>= 2.2.1), libgcc1 (>= 1:4.1.1), libmpg123-0 (>= 1.12.1), libois-1.3.0 (>= 1.3.0), libopenal1 (>= 1:1.12.854), libsndfile1 (>= 1.0.23), libstdc++6 (>= 4.4.5), libuuid1 (>= 2.17.2), libqtgui4 (>= 4.7.0)") + SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libogre-1.7.4 (>= 1.7.4), libbullet0 (>= 2.77), libboost-filesystem1.46.1 (>= 1.46.1), libboost-program-options1.46.1 (>= 1.46.1), libboost-system1.46.1 (>= 1.46.1), libboost-thread1.46.1 (>= 1.46.1), libc6 (>= 2.11.2), libfreetype6 (>= 2.2.1), libgcc1 (>= 1:4.1.1), libmpg123-0 (>= 1.12.1), libois-1.3.0 (>= 1.3.0), libopenal1 (>= 1:1.12.854), libsndfile1 (>= 1.0.23), libstdc++6 (>= 4.4.5), libuuid1 (>= 2.17.2), libqtgui4 (>= 4.7.0)") SET(CPACK_DEBIAN_PACKAGE_SECTION "Games") From b6b972b73b6ee259293edcf76705d0443309cc88 Mon Sep 17 00:00:00 2001 From: Brother Brick Date: Tue, 20 Mar 2012 09:53:39 +0100 Subject: [PATCH 07/19] Removed libbullet and libogre dependencies and added nvidia-toolkit. We are releasing OpenMW based on static libraries, so the first two are no longer necessary --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7cbc9b12f6..5fc9cd1662 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -322,7 +322,7 @@ if(DPKG_PROGRAM) SET(CPACK_DEBIAN_PACKAGE_NAME "openmw") SET(CPACK_DEBIAN_PACKAGE_VERSION "${VERSION_STRING}") SET(CPACK_PACKAGE_EXECUTABLES "openmw;OpenMW esmtool;Esmtool omwlauncher;OMWLauncher") - SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libogre-1.7.4 (>= 1.7.4), libbullet0 (>= 2.77), libboost-filesystem1.46.1 (>= 1.46.1), libboost-program-options1.46.1 (>= 1.46.1), libboost-system1.46.1 (>= 1.46.1), libboost-thread1.46.1 (>= 1.46.1), libc6 (>= 2.11.2), libfreetype6 (>= 2.2.1), libgcc1 (>= 1:4.1.1), libmpg123-0 (>= 1.12.1), libois-1.3.0 (>= 1.3.0), libopenal1 (>= 1:1.12.854), libsndfile1 (>= 1.0.23), libstdc++6 (>= 4.4.5), libuuid1 (>= 2.17.2), libqtgui4 (>= 4.7.0)") + SET(CPACK_DEBIAN_PACKAGE_DEPENDS "nvidia-cg-toolkit (>= 2.1), libboost-filesystem1.46.1 (>= 1.46.1), libboost-program-options1.46.1 (>= 1.46.1), libboost-system1.46.1 (>= 1.46.1), libboost-thread1.46.1 (>= 1.46.1), libc6 (>= 2.11.2), libfreetype6 (>= 2.2.1), libgcc1 (>= 1:4.1.1), libmpg123-0 (>= 1.12.1), libois-1.3.0 (>= 1.3.0), libopenal1 (>= 1:1.12.854), libsndfile1 (>= 1.0.23), libstdc++6 (>= 4.4.5), libuuid1 (>= 2.17.2), libqtgui4 (>= 4.7.0)") SET(CPACK_DEBIAN_PACKAGE_SECTION "Games") From c3494326dbac6bf1f20a55f7354a53b22ae48737 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Tue, 20 Mar 2012 10:08:16 +0100 Subject: [PATCH 08/19] adjusted changelog --- readme.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.txt b/readme.txt index 149fd4f193..cb91faea2c 100644 --- a/readme.txt +++ b/readme.txt @@ -140,6 +140,7 @@ Bug #203: Torch lights only visible on short distance Bug #207: Ogre.log not written Bug #209: Sounds do not play Bug #210: Ogre crash at Dren plantation +Bug #214: Unsupported file format version Feature #9: NPC Dialogue Window Feature #16/42: New sky/weather implementation Feature #40: Fading From 6a0474a977989ab3d9e5a308005d5b14d482fde2 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Tue, 20 Mar 2012 10:15:22 +0100 Subject: [PATCH 09/19] removed some cout spam --- apps/openmw/mwdialogue/dialoguemanager.cpp | 2 +- apps/openmw/mwgui/messagebox.cpp | 121 ++++++++++----------- 2 files changed, 58 insertions(+), 65 deletions(-) diff --git a/apps/openmw/mwdialogue/dialoguemanager.cpp b/apps/openmw/mwdialogue/dialoguemanager.cpp index 91785819f9..82a28ab502 100644 --- a/apps/openmw/mwdialogue/dialoguemanager.cpp +++ b/apps/openmw/mwdialogue/dialoguemanager.cpp @@ -742,7 +742,7 @@ namespace MWDialogue } } } - std::cout << std::endl << std::endl; + updateTopics(); } diff --git a/apps/openmw/mwgui/messagebox.cpp b/apps/openmw/mwgui/messagebox.cpp index f0745bbbec..cd32fc40f8 100644 --- a/apps/openmw/mwgui/messagebox.cpp +++ b/apps/openmw/mwgui/messagebox.cpp @@ -19,7 +19,7 @@ void MessageBoxManager::onFrame (float frameDuration) if(it->current >= it->max) { it->messageBox->mMarkedToDelete = true; - + if(*mMessageBoxes.begin() == it->messageBox) // if this box is the last one { // collect all with mMarkedToDelete and delete them. @@ -47,7 +47,7 @@ void MessageBoxManager::onFrame (float frameDuration) it++; } } - + if(mInterMessageBoxe != NULL && mInterMessageBoxe->mMarkedToDelete) { delete mInterMessageBoxe; mInterMessageBoxe = NULL; @@ -57,20 +57,18 @@ void MessageBoxManager::onFrame (float frameDuration) void MessageBoxManager::createMessageBox (const std::string& message) { - std::cout << "MessageBox: " << message << std::endl; - MessageBox *box = new MessageBox(*this, message); - + removeMessageBox(message.length()*mMessageBoxSpeed, box); - + mMessageBoxes.push_back(box); std::vector::iterator it; - + if(mMessageBoxes.size() > 3) { delete *mMessageBoxes.begin(); mMessageBoxes.erase(mMessageBoxes.begin()); } - + int height = 0; for(it = mMessageBoxes.begin(); it != mMessageBoxes.end(); ++it) { @@ -88,9 +86,9 @@ bool MessageBoxManager::createInteractiveMessageBox (const std::string& message, std::cout << "interactive MessageBox: " << message << " - "; std::copy (buttons.begin(), buttons.end(), std::ostream_iterator (std::cout, ", ")); std::cout << std::endl; - + mInterMessageBoxe = new InteractiveMessageBox(*this, message, buttons); - + return true; } @@ -105,7 +103,7 @@ void MessageBoxManager::removeMessageBox (float time, MessageBox *msgbox) timer.current = 0; timer.max = time; timer.messageBox = msgbox; - + mTimers.insert(mTimers.end(), timer); } @@ -152,25 +150,25 @@ MessageBox::MessageBox(MessageBoxManager& parMessageBoxManager, const std::strin mBottomPadding = 20; mNextBoxPadding = 20; mMarkedToDelete = false; - + getWidget(mMessageWidget, "message"); - + mMessageWidget->setOverflowToTheLeft(true); mMessageWidget->addText(cMessage); - + MyGUI::IntSize size; size.width = mFixedWidth; size.height = 100; // dummy - + MyGUI::IntCoord coord; coord.left = 10; // dummy coord.top = 10; // dummy mMessageWidget->setSize(size); - + MyGUI::IntSize textSize = mMessageWidget->_getTextSize(); size.height = mHeight = textSize.height + 20; // this is the padding between the text and the box - + mMainWidget->setSize(size); size.width -= 15; // this is to center the text (see messagebox_layout.xml, Widget type="Edit" position="-2 -3 0 0") mMessageWidget->setSize(size); @@ -182,11 +180,11 @@ void MessageBox::update (int height) MyGUI::IntCoord coord; coord.left = (gameWindowSize.width - mFixedWidth)/2; coord.top = (gameWindowSize.height - mHeight - height - mBottomPadding); - + MyGUI::IntSize size; size.width = mFixedWidth; size.height = mHeight; - + mMainWidget->setCoord(coord); mMainWidget->setSize(size); mMainWidget->setVisible(true); @@ -211,26 +209,26 @@ InteractiveMessageBox::InteractiveMessageBox(MessageBoxManager& parMessageBoxMan int buttonTopPadding = 5; // ^-- if vertical int buttonPadding = 5; // padding between button label and button itself int buttonMainPadding = 10; // padding between buttons and bottom of the main widget - + mMarkedToDelete = false; - - + + getWidget(mMessageWidget, "message"); getWidget(mButtonsWidget, "buttons"); - + mMessageWidget->setOverflowToTheLeft(true); mMessageWidget->addText(message); - + MyGUI::IntSize textSize = mMessageWidget->_getTextSize(); - + MyGUI::IntSize gameWindowSize = mMessageBoxManager.mWindowManager->getGui()->getViewSize(); - + int biggestButtonWidth = 0; int buttonWidth = 0; int buttonsWidth = 0; int buttonHeight = 0; MyGUI::IntCoord dummyCoord(0, 0, 0, 0); - + std::vector::const_iterator it; for(it = buttons.begin(); it != buttons.end(); ++it) { @@ -240,28 +238,28 @@ InteractiveMessageBox::InteractiveMessageBox(MessageBoxManager& parMessageBoxMan dummyCoord, MyGUI::Align::Default); button->setCaption(*it); - - button->eventMouseButtonClick = MyGUI::newDelegate(this, &InteractiveMessageBox::mousePressed); - + + button->eventMouseButtonClick = MyGUI::newDelegate(this, &InteractiveMessageBox::mousePressed); + mButtons.push_back(button); - + buttonWidth = button->_getTextSize().width + 2*buttonPadding + buttonLeftPadding; buttonsWidth += buttonWidth; buttonHeight = button->_getTextSize().height + 2*buttonPadding + buttonTopPadding; - + if(buttonWidth > biggestButtonWidth) { biggestButtonWidth = buttonWidth; } } buttonsWidth += buttonLeftPadding; - + MyGUI::IntSize mainWidgetSize; if(buttonsWidth < fixedWidth) { // on one line std::cout << "on one line" << std::endl; - + if(textSize.width + 2*textPadding < buttonsWidth) { std::cout << "width = buttonsWidth" << std::endl; @@ -272,48 +270,48 @@ InteractiveMessageBox::InteractiveMessageBox(MessageBoxManager& parMessageBoxMan mainWidgetSize.width = textSize.width + 3*textPadding; } mainWidgetSize.height = textSize.height + textButtonPadding + buttonHeight + buttonMainPadding; - + MyGUI::IntCoord absCoord; absCoord.left = (gameWindowSize.width - mainWidgetSize.width)/2; absCoord.top = (gameWindowSize.height - mainWidgetSize.height)/2; - + std::cout << "width " << mainWidgetSize.width << " height " << mainWidgetSize.height << std::endl; std::cout << "left " << absCoord.left << " top " << absCoord.top << std::endl; - + mMainWidget->setCoord(absCoord); mMainWidget->setSize(mainWidgetSize); - - + + MyGUI::IntCoord messageWidgetCoord; messageWidgetCoord.left = (mainWidgetSize.width - textSize.width)/2; messageWidgetCoord.top = textPadding; mMessageWidget->setCoord(messageWidgetCoord); - + mMessageWidget->setSize(textSize); - + MyGUI::IntCoord buttonCord; MyGUI::IntSize buttonSize(0, buttonHeight); int left = (mainWidgetSize.width - buttonsWidth)/2 + buttonPadding; - + std::vector::const_iterator button; for(button = mButtons.begin(); button != mButtons.end(); ++button) { buttonCord.left = left; buttonCord.top = textSize.height + textButtonPadding; - + buttonSize.width = (*button)->_getTextSize().width + 2*buttonPadding; buttonSize.height = (*button)->_getTextSize().height + 2*buttonPadding; - + (*button)->setCoord(buttonCord); (*button)->setSize(buttonSize); - + left += buttonSize.width + buttonLeftPadding; } } else { // among each other - + if(biggestButtonWidth > textSize.width) { mainWidgetSize.width = biggestButtonWidth + buttonTopPadding; } @@ -321,46 +319,46 @@ InteractiveMessageBox::InteractiveMessageBox(MessageBoxManager& parMessageBoxMan mainWidgetSize.width = textSize.width + 3*textPadding; } mainWidgetSize.height = textSize.height + 2*textPadding + textButtonPadding + buttonHeight * buttons.size() + buttonMainPadding; - + std::cout << "biggestButtonWidth " << biggestButtonWidth << " textSize.width " << textSize.width << std::endl; std::cout << "width " << mainWidgetSize.width << " height " << mainWidgetSize.height << std::endl; mMainWidget->setSize(mainWidgetSize); - + MyGUI::IntCoord absCoord; absCoord.left = (gameWindowSize.width - mainWidgetSize.width)/2; absCoord.top = (gameWindowSize.height - mainWidgetSize.height)/2; - + mMainWidget->setCoord(absCoord); mMainWidget->setSize(mainWidgetSize); - - + + MyGUI::IntCoord messageWidgetCoord; messageWidgetCoord.left = (mainWidgetSize.width - textSize.width)/2; messageWidgetCoord.top = textPadding; mMessageWidget->setCoord(messageWidgetCoord); - + mMessageWidget->setSize(textSize); - + MyGUI::IntCoord buttonCord; MyGUI::IntSize buttonSize(0, buttonHeight); - + int top = textButtonPadding + buttonTopPadding + textSize.height; - + std::vector::const_iterator button; for(button = mButtons.begin(); button != mButtons.end(); ++button) { buttonSize.width = (*button)->_getTextSize().width + buttonPadding*2; buttonSize.height = (*button)->_getTextSize().height + buttonPadding*2; - + buttonCord.top = top; buttonCord.left = (mainWidgetSize.width - buttonSize.width)/2 - 5; // FIXME: -5 is not so nice :/ - + (*button)->setCoord(buttonCord); (*button)->setSize(buttonSize); - + top += buttonSize.height + 2*buttonTopPadding; } - + } } @@ -387,8 +385,3 @@ int InteractiveMessageBox::readPressedButton () mButtonPressed = -1; return pressed; } - - - - - From eed4441013a2201e377b08ff5580bcb9e60a13b2 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Tue, 20 Mar 2012 10:22:01 +0100 Subject: [PATCH 10/19] adjusted changelog again --- readme.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.txt b/readme.txt index cb91faea2c..d58463ced9 100644 --- a/readme.txt +++ b/readme.txt @@ -134,6 +134,7 @@ Bug #179: Pressing space in console triggers activation Bug #186: CMake doesn't use the debug versions of Ogre libraries on Linux Bug #189: ASCII 16 character added to console on it's activation on Mac OS X Bug #190: Case Folding fails with music files +Bug #192: Keypresses write Text into Console no matter which gui element is active Bug #196: Collision shapes out of place Bug #202: ESMTool doesn't not work with localised ESM files anymore Bug #203: Torch lights only visible on short distance From 226d0b279e6b58217f69f07f09d781633a11ce96 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Tue, 20 Mar 2012 10:22:44 +0100 Subject: [PATCH 11/19] updated team list in readme.txt --- readme.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.txt b/readme.txt index d58463ced9..83624fefec 100644 --- a/readme.txt +++ b/readme.txt @@ -104,6 +104,7 @@ Marc “Zini” Zinnschlag Michael “werdanith” Papageorgiou Nikolay “corristo” Kasyanov Pieter “pvdk” van der Kloet +Roman "Kromgart" Melni Sebastian “swick” Wick Retired Developers: From 1023ddd5872ed594e5f601dc2544e89f272bc560 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Tue, 20 Mar 2012 10:30:21 +0100 Subject: [PATCH 12/19] silenced some warnings --- apps/openmw/mwdialogue/dialoguemanager.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/apps/openmw/mwdialogue/dialoguemanager.cpp b/apps/openmw/mwdialogue/dialoguemanager.cpp index 82a28ab502..50549f4a55 100644 --- a/apps/openmw/mwdialogue/dialoguemanager.cpp +++ b/apps/openmw/mwdialogue/dialoguemanager.cpp @@ -145,8 +145,6 @@ namespace MWDialogue bool DialogueManager::functionFilter(const MWWorld::Ptr& actor, const ESM::DialInfo& info,bool choice) { - bool isAChoice = false;//is there any choice in the filters? - bool isFunction = false; for (std::vector::const_iterator iter (info.selects.begin()); iter != info.selects.end(); ++iter) { @@ -154,7 +152,6 @@ namespace MWDialogue char type = select.selectRule[1]; if(type == '1') { - isFunction = true; char comp = select.selectRule[4]; std::string name = select.selectRule.substr (5); std::string function = select.selectRule.substr(2,2); @@ -193,7 +190,7 @@ namespace MWDialogue break; case 50://choice - isAChoice = true; + if(choice) { if(!selectCompare(comp,mChoice,select.i)) return false; From f1f6e214425cba905be0f880cae7503deef982ec Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Tue, 20 Mar 2012 10:33:43 +0100 Subject: [PATCH 13/19] fixed a copy & paste error --- readme.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.txt b/readme.txt index 83624fefec..d53ec379c9 100644 --- a/readme.txt +++ b/readme.txt @@ -104,7 +104,7 @@ Marc “Zini” Zinnschlag Michael “werdanith” Papageorgiou Nikolay “corristo” Kasyanov Pieter “pvdk” van der Kloet -Roman "Kromgart" Melni +Roman "Kromgart" Melnik Sebastian “swick” Wick Retired Developers: From 95d27090d75f6ed8fc3a97000d040e6c9fe87916 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Tue, 20 Mar 2012 13:53:13 +0100 Subject: [PATCH 14/19] updated team list again --- readme.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.txt b/readme.txt index d53ec379c9..8f360235fd 100644 --- a/readme.txt +++ b/readme.txt @@ -93,6 +93,7 @@ CREDITS Current Developers: Alexander “Ace” Olofsson athile +BrotherBrick Cris “Mirceam” Mihalache gugus / gus Jacob “Yacoby” Essex From fd4826d06fc9cb6489f10c177c2fcee4786939e0 Mon Sep 17 00:00:00 2001 From: Pieter van der Kloet Date: Thu, 22 Mar 2012 12:34:43 +0100 Subject: [PATCH 15/19] Fix for Bug #222, config is always written to user location now --- apps/launcher/datafilespage.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/apps/launcher/datafilespage.cpp b/apps/launcher/datafilespage.cpp index c96fc2c7b6..6d8c1f19dd 100644 --- a/apps/launcher/datafilespage.cpp +++ b/apps/launcher/datafilespage.cpp @@ -1057,16 +1057,8 @@ void DataFilesPage::writeConfig(QString profile) return; } - // Prepare the OpenMW config - QString config = QString::fromStdString((mCfgMgr.getLocalPath() / "openmw.cfg").string()); - QFile file(config); - - if (!file.exists()) { - config = QString::fromStdString((mCfgMgr.getUserPath() / "openmw.cfg").string()); - } - - // Open the config as a QFile - file.setFileName(config); + // Open the OpenMW config as a QFile + QFile file(QString::fromStdString((mCfgMgr.getUserPath() / "openmw.cfg").string())); if (!file.open(QIODevice::ReadWrite | QIODevice::Text)) { // File cannot be opened or created From 73a1b256a880d69dbd0de24c35be4752223b16e0 Mon Sep 17 00:00:00 2001 From: Pieter van der Kloet Date: Thu, 22 Mar 2012 12:42:08 +0100 Subject: [PATCH 16/19] Changed warning dialog text to be less ambiguous --- apps/launcher/datafilespage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/launcher/datafilespage.cpp b/apps/launcher/datafilespage.cpp index 6d8c1f19dd..c15274e749 100644 --- a/apps/launcher/datafilespage.cpp +++ b/apps/launcher/datafilespage.cpp @@ -225,7 +225,7 @@ void DataFilesPage::setupDataFiles() msgBox.setIcon(QMessageBox::Warning); msgBox.setStandardButtons(QMessageBox::Cancel); msgBox.setText(tr("
Could not find the Data Files location

\ - The directory containing the Data Files was not found.

\ + The directory containing the data files was not found.

\ Press \"Browse...\" to specify the location manually.
")); QAbstractButton *dirSelectButton = From 6df6cbc71a002480f37f0f3296b4715c01d02891 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Thu, 22 Mar 2012 14:12:43 +0100 Subject: [PATCH 17/19] updated changelog once more --- readme.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.txt b/readme.txt index 8f360235fd..4c265c4624 100644 --- a/readme.txt +++ b/readme.txt @@ -144,6 +144,7 @@ Bug #207: Ogre.log not written Bug #209: Sounds do not play Bug #210: Ogre crash at Dren plantation Bug #214: Unsupported file format version +Bug #222: Launcher is writing openmw.cfg file to wrong location Feature #9: NPC Dialogue Window Feature #16/42: New sky/weather implementation Feature #40: Fading From dcdc75971990d09252cbe51744b9cb7a75d76654 Mon Sep 17 00:00:00 2001 From: "Alexander \"Ace\" Olofsson" Date: Fri, 23 Mar 2012 13:02:07 +0100 Subject: [PATCH 18/19] Adding readme to windows builds --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index a454f211b2..7a1b983358 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -347,6 +347,7 @@ if(WIN32) FILE(GLOB files "${OpenMW_BINARY_DIR}/Release/*.*") INSTALL(FILES ${files} DESTINATION ".") INSTALL(FILES "${OpenMW_BINARY_DIR}/openmw.cfg.install" DESTINATION "." RENAME "openmw.cfg") + INSTALL(FILES "${OpenMW_SOURCE_DIR}/readme.txt" DESTINATION ".") INSTALL(DIRECTORY "${OpenMW_BINARY_DIR}/resources" DESTINATION ".") SET(CPACK_GENERATOR "NSIS") @@ -357,6 +358,7 @@ if(WIN32) SET(CPACK_PACKAGE_VERSION_MINOR ${OPENMW_VERSION_MINO}) SET(CPACK_PACKAGE_VERSION_PATCH ${OPENMW_VERSION_RELEASE}) SET(CPACK_PACKAGE_EXECUTABLES "openmw;OpenMW;esmtool;Esmtool;omwlauncher;OpenMW Launcher") + set(CPACK_NSIS_CREATE_ICONS_EXTRA "CreateShortCut '\$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Readme.lnk' '\$INSTDIR\\\\readme.txt'") SET(CPACK_PACKAGE_DESCRIPTION_FILE "${OpenMW_SOURCE_DIR}/readme.txt") SET(CPACK_RESOURCE_FILE_LICENSE "${OpenMW_SOURCE_DIR}/GPL3.txt") SET(CPACK_NSIS_EXECUTABLES_DIRECTORY ".") From 8e76451cda571ae4c58a795a3c8a18e5fa9bdcc5 Mon Sep 17 00:00:00 2001 From: Nikolay Kasyanov Date: Sun, 25 Mar 2012 02:00:49 +0400 Subject: [PATCH 19/19] Fix launcher style installation on OS X again --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7a1b983358..d5f0bffa8f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -501,6 +501,7 @@ if (APPLE) install(FILES "${OpenMW_BINARY_DIR}/openmw.cfg.install" RENAME "openmw.cfg" DESTINATION "${INSTALL_SUBDIR}" COMPONENT Runtime) install(FILES "${OpenMW_BINARY_DIR}/plugins.cfg" DESTINATION "${INSTALL_SUBDIR}" COMPONENT Runtime) + install(FILES "${OpenMW_BINARY_DIR}/launcher.qss" DESTINATION "${INSTALL_SUBDIR}" COMPONENT Runtime) set(CPACK_GENERATOR "DragNDrop") set(CPACK_PACKAGE_VERSION ${OPENMW_VERSION})