From 75f86f3a855b52432a0d4811674311c50fb4cab4 Mon Sep 17 00:00:00 2001 From: pvdk Date: Tue, 12 Mar 2013 01:03:15 +0100 Subject: [PATCH 01/10] Some changes to the stylesheet and other small GUI improvements --- files/ui/mainwindow.ui | 2 +- files/ui/playpage.ui | 16 +++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/files/ui/mainwindow.ui b/files/ui/mainwindow.ui index 8143fa24d..a1dfb172b 100644 --- a/files/ui/mainwindow.ui +++ b/files/ui/mainwindow.ui @@ -5,7 +5,7 @@ 575 - 525 + 535 diff --git a/files/ui/playpage.ui b/files/ui/playpage.ui index 6b8b66b20..c0320de1e 100644 --- a/files/ui/playpage.ui +++ b/files/ui/playpage.ui @@ -19,6 +19,9 @@ QFrame::Plain + + 0 + 30 @@ -40,10 +43,14 @@ border-color: rgba(0, 0, 0, 125); border-style: solid; border-radius: 2px; + + font-size: 12pt; + font-family: "EB Garamond", "EB Garamond 08"; + color: black; } /*QComboBox gets the "on" state when the popup is open */ -#profilesComboBox:!editable:on, #ProfilesComboBox::drop-down:editable:on { +#profilesComboBox:!editable:on { background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 rgba(0, 0, 0, 75), stop:0.1 rgba(0, 0, 0, 15), @@ -52,13 +59,9 @@ border: 1px solid rgba(0, 0, 0, 55); } -#profilesComboBox { /* shift the text when the popup opens */ +#profilesComboBox:on { /* shift the text when the popup opens */ padding-top: 3px; padding-left: 4px; - - font-size: 12pt; - font-family: "EB Garamond", "EB Garamond 08"; - color: black; } #profilesComboBox::drop-down { @@ -82,7 +85,6 @@ left: 1px; } - #profilesComboBox QAbstractItemView { border: 0px; } From 81604613b5b1c97f9862f1c9efa4925db69dd114 Mon Sep 17 00:00:00 2001 From: pvdk Date: Tue, 12 Mar 2013 01:29:13 +0100 Subject: [PATCH 02/10] Narrowed down includes to improve compile time --- apps/launcher/datafilespage.cpp | 7 +++++-- apps/launcher/graphicspage.cpp | 4 +++- apps/launcher/maindialog.cpp | 9 ++++++++- apps/launcher/playpage.cpp | 6 +++++- 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/apps/launcher/datafilespage.cpp b/apps/launcher/datafilespage.cpp index 444d05b2a..512c4b2f8 100644 --- a/apps/launcher/datafilespage.cpp +++ b/apps/launcher/datafilespage.cpp @@ -1,6 +1,9 @@ #include "datafilespage.hpp" -#include +#include +#include +#include +#include #include @@ -97,7 +100,7 @@ DataFilesPage::DataFilesPage(Files::ConfigurationManager &cfg, GameSettings &gam connect(mastersTable, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showContextMenu(QPoint))); connect(mDataFilesModel, SIGNAL(layoutChanged()), this, SLOT(updateViews())); - + connect(filterLineEdit, SIGNAL(textChanged(QString)), this, SLOT(filterChanged(QString))); connect(splitter, SIGNAL(splitterMoved(int,int)), this, SLOT(updateSplitter())); diff --git a/apps/launcher/graphicspage.cpp b/apps/launcher/graphicspage.cpp index 3caae2c36..8d09cf3c0 100644 --- a/apps/launcher/graphicspage.cpp +++ b/apps/launcher/graphicspage.cpp @@ -1,6 +1,8 @@ #include "graphicspage.hpp" -#include +#include +#include +#include #include diff --git a/apps/launcher/maindialog.cpp b/apps/launcher/maindialog.cpp index 5d11421d0..c478d17fd 100644 --- a/apps/launcher/maindialog.cpp +++ b/apps/launcher/maindialog.cpp @@ -1,6 +1,13 @@ #include "maindialog.hpp" -#include +#include +#include +#include +#include +#include +#include +#include +#include #include "utils/checkablemessagebox.hpp" diff --git a/apps/launcher/playpage.cpp b/apps/launcher/playpage.cpp index d6d25d71d..46900c595 100644 --- a/apps/launcher/playpage.cpp +++ b/apps/launcher/playpage.cpp @@ -1,6 +1,10 @@ #include "playpage.hpp" -#include +#include + +#ifdef Q_OS_MAC +#include +#endif PlayPage::PlayPage(QWidget *parent) : QWidget(parent) { From 543f57373919ac50140810bdf840f698dbb03b1c Mon Sep 17 00:00:00 2001 From: scrawl Date: Tue, 12 Mar 2013 02:02:59 +0100 Subject: [PATCH 03/10] Fix the firstguard armor mod --- apps/openmw/mwworld/actionequip.cpp | 38 ++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/apps/openmw/mwworld/actionequip.cpp b/apps/openmw/mwworld/actionequip.cpp index 2d257aa61..797085267 100644 --- a/apps/openmw/mwworld/actionequip.cpp +++ b/apps/openmw/mwworld/actionequip.cpp @@ -47,9 +47,9 @@ namespace MWWorld // Beast races cannot equip shoes / boots, or full helms (head part vs hair part) if(npcRace == "argonian" || npcRace == "khajiit") { - if(*slot == MWWorld::InventoryStore::Slot_Helmet){ + if(*slot == MWWorld::InventoryStore::Slot_Helmet) + { std::vector parts; - if(it.getType() == MWWorld::ContainerStore::Type_Clothing) parts = it->get()->mBase->mParts.mParts; else @@ -74,19 +74,35 @@ namespace MWWorld if (*slot == MWWorld::InventoryStore::Slot_Boots) { - // Only notify the player, not npcs - if(actor == MWBase::Environment::get().getWorld()->getPlayer().getPlayer() ) + bool allow = true; + std::vector parts; + if(it.getType() == MWWorld::ContainerStore::Type_Clothing) + parts = it->get()->mBase->mParts.mParts; + else + parts = it->get()->mBase->mParts.mParts; + for(std::vector::iterator itr = parts.begin(); itr != parts.end(); ++itr) { - if(it.getType() == MWWorld::ContainerStore::Type_Clothing){ // It's shoes - MWBase::Environment::get().getWindowManager()->messageBox ("#{sNotifyMessage15}", std::vector()); - } - - else // It's boots + if((*itr).mPart == ESM::PRT_LFoot || (*itr).mPart == ESM::PRT_RFoot) { - MWBase::Environment::get().getWindowManager()->messageBox ("#{sNotifyMessage14}", std::vector()); + allow = false; + // Only notify the player, not npcs + if(actor == MWBase::Environment::get().getWorld()->getPlayer().getPlayer() ) + { + if(it.getType() == MWWorld::ContainerStore::Type_Clothing){ // It's shoes + MWBase::Environment::get().getWindowManager()->messageBox ("#{sNotifyMessage15}", std::vector()); + } + + else // It's boots + { + MWBase::Environment::get().getWindowManager()->messageBox ("#{sNotifyMessage14}", std::vector()); + } + } + break; } } - break; + + if(!allow) + break; } } From eeb60edb65bf0870284e9702f16c90247b020c36 Mon Sep 17 00:00:00 2001 From: scrawl Date: Tue, 12 Mar 2013 02:09:54 +0100 Subject: [PATCH 04/10] Properly check for the Beast flag instead of hardcoding beast races --- apps/openmw/mwworld/actionequip.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwworld/actionequip.cpp b/apps/openmw/mwworld/actionequip.cpp index 797085267..eb2ae9dca 100644 --- a/apps/openmw/mwworld/actionequip.cpp +++ b/apps/openmw/mwworld/actionequip.cpp @@ -45,7 +45,8 @@ namespace MWWorld { // Beast races cannot equip shoes / boots, or full helms (head part vs hair part) - if(npcRace == "argonian" || npcRace == "khajiit") + const ESM::Race* race = MWBase::Environment::get().getWorld()->getStore().get().find(npcRace); + if(race->mData.mFlags & ESM::Race::Beast) { if(*slot == MWWorld::InventoryStore::Slot_Helmet) { From 46d8f3ce5a80ff98db466b6a73713b5ded503120 Mon Sep 17 00:00:00 2001 From: scrawl Date: Tue, 12 Mar 2013 02:44:03 +0100 Subject: [PATCH 05/10] Fix hardcoded race IDs --- apps/openmw/mwworld/worldimp.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index 1d1ece78a..7b7560082 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -940,19 +940,16 @@ namespace MWWorld if (Misc::StringUtils::ciEqual(record.mId, "player")) { - static const char *sRaces[] = - { - "Argonian", "Breton", "Dark Elf", "High Elf", "Imperial", "Khajiit", "Nord", "Orc", "Redguard", - "Woodelf", 0 - }; + std::vector ids; + getStore().get().listIdentifier(ids); - int i=0; + unsigned int i=0; - for (; sRaces[i]; ++i) - if (Misc::StringUtils::ciEqual (sRaces[i], record.mRace)) + for (; isetInt ("pcrace", sRaces[i] ? i+1 : 0); + mGlobalVariables->setInt ("pcrace", (i == ids.size()) ? 0 : i+1); const ESM::NPC *player = mPlayer->getPlayer().get()->mBase; From 41a958cd4ef8a68d82823caac8717dc943c91ae3 Mon Sep 17 00:00:00 2001 From: scrawl Date: Tue, 12 Mar 2013 02:50:23 +0100 Subject: [PATCH 06/10] Fix hardcoded beast races in MWClass::Npc::getModel --- apps/openmw/mwclass/npc.cpp | 9 +++------ apps/openmw/mwworld/worldimp.cpp | 3 +-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/apps/openmw/mwclass/npc.cpp b/apps/openmw/mwclass/npc.cpp index f074d0368..d4e5e5cd6 100644 --- a/apps/openmw/mwclass/npc.cpp +++ b/apps/openmw/mwclass/npc.cpp @@ -183,13 +183,10 @@ namespace MWClass std::string bodyRaceID = headID.substr(0, end); std::string model = "meshes\\base_anim.nif"; - if (bodyRaceID == "b_n_khajiit_m_" || - bodyRaceID == "b_n_khajiit_f_" || - bodyRaceID == "b_n_argonian_m_" || - bodyRaceID == "b_n_argonian_f_") - { + const ESM::Race* race = MWBase::Environment::get().getWorld()->getStore().get().find(ref->mBase->mRace); + if(race->mData.mFlags & ESM::Race::Beast) model = "meshes\\base_animkna.nif"; - } + return model; } diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index 7b7560082..a933713dd 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -233,8 +233,6 @@ namespace MWWorld mPlayer = new MWWorld::Player (mStore.get().find ("player"), *this); mRendering->attachCameraTo(mPlayer->getPlayer()); - mPhysics->addActor(mPlayer->getPlayer()); - // global variables mGlobalVariables = new Globals (mStore); @@ -1315,6 +1313,7 @@ namespace MWWorld void World::renderPlayer() { mRendering->renderPlayer(mPlayer->getPlayer()); + mPhysics->addActor(mPlayer->getPlayer()); } void World::setupExternalRendering (MWRender::ExternalRendering& rendering) From f574c37e93d42faa6e820894990075dea79b32eb Mon Sep 17 00:00:00 2001 From: pvdk Date: Tue, 12 Mar 2013 04:00:43 +0100 Subject: [PATCH 07/10] Added encoding flag to ini importer arguments --- apps/launcher/maindialog.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/apps/launcher/maindialog.cpp b/apps/launcher/maindialog.cpp index c478d17fd..e435bd391 100644 --- a/apps/launcher/maindialog.cpp +++ b/apps/launcher/maindialog.cpp @@ -9,6 +9,8 @@ #include #include +#include + #include "utils/checkablemessagebox.hpp" #include "playpage.hpp" @@ -210,10 +212,15 @@ bool MainDialog::showFirstRunDialog() // Construct the arguments to run the importer QStringList arguments; - if (msgBox.isChecked()) - arguments.append(QString("-g")); + if (msgBox.isChecked()) + arguments.append(QString("--game-files")); + + arguments.append(QString("--encoding")); + arguments.append(mGameSettings.value(QString("encoding"), QString("win1252"))); + arguments.append(QString("--ini")); arguments.append(iniPaths.first()); + arguments.append(QString("--cfg")); arguments.append(path); if (!startProgram(QString("mwiniimport"), arguments, false)) @@ -666,7 +673,7 @@ bool MainDialog::startProgram(const QString &name, const QStringList &arguments, return false; } - if (process.exitCode() != 0) { + if (process.exitCode() != 0 || process.exitStatus() == QProcess::CrashExit) { QString error(process.readAllStandardError()); error.append(tr("\nArguments:\n")); error.append(arguments.join(" ")); From b2d522aa4d0678017d6cff46f06790196e529783 Mon Sep 17 00:00:00 2001 From: pvdk Date: Tue, 12 Mar 2013 04:01:05 +0100 Subject: [PATCH 08/10] Added support for non-latin characters in esx metadata --- .../fileorderlist/model/datafilesmodel.cpp | 41 +++++++++++++------ 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/components/fileorderlist/model/datafilesmodel.cpp b/components/fileorderlist/model/datafilesmodel.cpp index b33e2e12a..316534124 100644 --- a/components/fileorderlist/model/datafilesmodel.cpp +++ b/components/fileorderlist/model/datafilesmodel.cpp @@ -1,4 +1,6 @@ #include +#include +#include #include #include @@ -157,7 +159,7 @@ Qt::ItemFlags DataFilesModel::flags(const QModelIndex &index) const if (!file) return Qt::NoItemFlags; - if (canBeChecked(file)) { + if (canBeChecked(file)) { if (index.column() == 0) { return Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsSelectable; } else { @@ -226,7 +228,7 @@ bool lessThanEsmFile(const EsmFile *e1, const EsmFile *e2) return true; if (!e1->fileName().endsWith(".esm") && e2->fileName().endsWith(".esm")) return false; - + return e1->fileName().toLower() < e2->fileName().toLower(); } @@ -237,10 +239,6 @@ bool lessThanDate(const EsmFile *e1, const EsmFile *e2) } else { return false; } -// if (!e1->fileName().endsWith(".esm") && e2->fileName().endsWith(".esm")) -// return false; - -// return e1->fileName().toLower() < e2->fileName().toLower(); } void DataFilesModel::sort(int column, Qt::SortOrder order) @@ -270,17 +268,32 @@ void DataFilesModel::addFiles(const QString &path) filters << "*.esp" << "*.esm"; dir.setNameFilters(filters); + // Create a decoder for non-latin characters in esx metadata + QTextCodec *codec; + + if (mEncoding == QLatin1String("win1252")) { + codec = QTextCodec::codecForName("windows-1252"); + } else if (mEncoding == QLatin1String("win1251")) { + codec = QTextCodec::codecForName("windows-1251"); + } else if (mEncoding == QLatin1String("win1250")) { + codec = QTextCodec::codecForName("windows-1250"); + } else { + return; // This should never happen; + } + + QTextDecoder *decoder = codec->makeDecoder(); + foreach (const QString &path, dir.entryList()) { QFileInfo info(dir.absoluteFilePath(path)); EsmFile *file = new EsmFile(path); - try { ESM::ESMReader fileReader; - ToUTF8::Utf8Encoder encoder (ToUTF8::calculateEncoding(mEncoding.toStdString())); + ToUTF8::Utf8Encoder encoder(ToUTF8::calculateEncoding(mEncoding.toStdString())); fileReader.setEncoder(&encoder); fileReader.open(dir.absoluteFilePath(path).toStdString()); + ESM::ESMReader::MasterList mlist = fileReader.getMasters(); QStringList masters; @@ -289,13 +302,13 @@ void DataFilesModel::addFiles(const QString &path) masters.append(master); } - file->setAuthor(QString::fromStdString(fileReader.getAuthor())); + file->setAuthor(decoder->toUnicode(fileReader.getAuthor().c_str())); file->setSize(info.size()); file->setDates(info.lastModified(), info.lastRead()); file->setVersion(fileReader.getFVer()); file->setPath(info.absoluteFilePath()); file->setMasters(masters); - file->setDescription(QString::fromStdString(fileReader.getDesc())); + file->setDescription(decoder->toUnicode(fileReader.getDesc().c_str())); // Put the file in the table @@ -308,6 +321,8 @@ void DataFilesModel::addFiles(const QString &path) } } + + delete decoder; } QModelIndex DataFilesModel::indexFromItem(EsmFile *item) const @@ -369,10 +384,10 @@ QStringList DataFilesModel::checkedItems() QStringList DataFilesModel::checkedItemsPaths() { QStringList list; - + QList::ConstIterator it; QList::ConstIterator itEnd = mFiles.constEnd(); - + int i = 0; for (it = mFiles.constBegin(); it != itEnd; ++it) { EsmFile *file = item(i); @@ -381,7 +396,7 @@ QStringList DataFilesModel::checkedItemsPaths() if (mCheckStates[file->fileName()] == Qt::Checked && canBeChecked(file)) list << file->path(); } - + return list; } From 31ba332647e74e1955909d1dd57a7b7c8409de17 Mon Sep 17 00:00:00 2001 From: pvdk Date: Tue, 12 Mar 2013 04:05:14 +0100 Subject: [PATCH 09/10] Moved Windows icon to files/launcher --- apps/launcher/CMakeLists.txt | 10 +++++----- {apps => files}/launcher/launcher.rc | 0 2 files changed, 5 insertions(+), 5 deletions(-) rename {apps => files}/launcher/launcher.rc (100%) diff --git a/apps/launcher/CMakeLists.txt b/apps/launcher/CMakeLists.txt index a63898c0e..eb93d71e7 100644 --- a/apps/launcher/CMakeLists.txt +++ b/apps/launcher/CMakeLists.txt @@ -12,7 +12,7 @@ set(LAUNCHER utils/checkablemessagebox.cpp utils/textinputdialog.cpp - launcher.rc + ${CMAKE_SOURCE_DIR}/files/launcher/launcher.rc ) set(LAUNCHER_HEADER @@ -43,10 +43,10 @@ set(LAUNCHER_HEADER_MOC ) set(LAUNCHER_UI - ../../files/ui/datafilespage.ui - ../../files/ui/graphicspage.ui - ../../files/ui/mainwindow.ui - ../../files/ui/playpage.ui + ${CMAKE_SOURCE_DIR}/files/ui/datafilespage.ui + ${CMAKE_SOURCE_DIR}/files/ui/graphicspage.ui + ${CMAKE_SOURCE_DIR}/files/ui/mainwindow.ui + ${CMAKE_SOURCE_DIR}/files/ui/playpage.ui ) source_group(launcher FILES ${LAUNCHER} ${LAUNCHER_HEADER}) diff --git a/apps/launcher/launcher.rc b/files/launcher/launcher.rc similarity index 100% rename from apps/launcher/launcher.rc rename to files/launcher/launcher.rc From d6a5915bbd0039acd74a99db5a77f06662114292 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Tue, 12 Mar 2013 14:56:11 +0100 Subject: [PATCH 10/10] updated version to 0.22.0 --- CMakeLists.txt | 2 +- readme.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2bdd8b21c..9aabd6055 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,7 +15,7 @@ include (OpenMWMacros) # Version set (OPENMW_VERSION_MAJOR 0) -set (OPENMW_VERSION_MINOR 21) +set (OPENMW_VERSION_MINOR 22) set (OPENMW_VERSION_RELEASE 0) set (OPENMW_VERSION "${OPENMW_VERSION_MAJOR}.${OPENMW_VERSION_MINOR}.${OPENMW_VERSION_RELEASE}") diff --git a/readme.txt b/readme.txt index 228278a91..f5997cd25 100644 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ OpenMW: A reimplementation of The Elder Scrolls III: Morrowind OpenMW is an attempt at recreating the engine for the popular role-playing game Morrowind by Bethesda Softworks. You need to own and install the original game for OpenMW to work. -Version: 0.21.0 +Version: 0.22.0 License: GPL (see GPL3.txt for more information) Website: http://www.openmw.org