1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-21 10:53:51 +00:00
This commit is contained in:
vorenon 2013-03-12 19:22:49 +01:00
commit 398d63a53f
14 changed files with 115 additions and 65 deletions

View file

@ -15,7 +15,7 @@ include (OpenMWMacros)
# Version # Version
set (OPENMW_VERSION_MAJOR 0) set (OPENMW_VERSION_MAJOR 0)
set (OPENMW_VERSION_MINOR 21) set (OPENMW_VERSION_MINOR 22)
set (OPENMW_VERSION_RELEASE 0) set (OPENMW_VERSION_RELEASE 0)
set (OPENMW_VERSION "${OPENMW_VERSION_MAJOR}.${OPENMW_VERSION_MINOR}.${OPENMW_VERSION_RELEASE}") set (OPENMW_VERSION "${OPENMW_VERSION_MAJOR}.${OPENMW_VERSION_MINOR}.${OPENMW_VERSION_RELEASE}")

View file

@ -12,7 +12,7 @@ set(LAUNCHER
utils/checkablemessagebox.cpp utils/checkablemessagebox.cpp
utils/textinputdialog.cpp utils/textinputdialog.cpp
launcher.rc ${CMAKE_SOURCE_DIR}/files/launcher/launcher.rc
) )
set(LAUNCHER_HEADER set(LAUNCHER_HEADER
@ -43,10 +43,10 @@ set(LAUNCHER_HEADER_MOC
) )
set(LAUNCHER_UI set(LAUNCHER_UI
../../files/ui/datafilespage.ui ${CMAKE_SOURCE_DIR}/files/ui/datafilespage.ui
../../files/ui/graphicspage.ui ${CMAKE_SOURCE_DIR}/files/ui/graphicspage.ui
../../files/ui/mainwindow.ui ${CMAKE_SOURCE_DIR}/files/ui/mainwindow.ui
../../files/ui/playpage.ui ${CMAKE_SOURCE_DIR}/files/ui/playpage.ui
) )
source_group(launcher FILES ${LAUNCHER} ${LAUNCHER_HEADER}) source_group(launcher FILES ${LAUNCHER} ${LAUNCHER_HEADER})

View file

@ -1,6 +1,9 @@
#include "datafilespage.hpp" #include "datafilespage.hpp"
#include <QtGui> #include <QPushButton>
#include <QMessageBox>
#include <QCheckBox>
#include <QMenu>
#include <components/files/configurationmanager.hpp> #include <components/files/configurationmanager.hpp>
@ -97,7 +100,7 @@ DataFilesPage::DataFilesPage(Files::ConfigurationManager &cfg, GameSettings &gam
connect(mastersTable, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showContextMenu(QPoint))); connect(mastersTable, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showContextMenu(QPoint)));
connect(mDataFilesModel, SIGNAL(layoutChanged()), this, SLOT(updateViews())); connect(mDataFilesModel, SIGNAL(layoutChanged()), this, SLOT(updateViews()));
connect(filterLineEdit, SIGNAL(textChanged(QString)), this, SLOT(filterChanged(QString))); connect(filterLineEdit, SIGNAL(textChanged(QString)), this, SLOT(filterChanged(QString)));
connect(splitter, SIGNAL(splitterMoved(int,int)), this, SLOT(updateSplitter())); connect(splitter, SIGNAL(splitterMoved(int,int)), this, SLOT(updateSplitter()));

View file

@ -1,6 +1,8 @@
#include "graphicspage.hpp" #include "graphicspage.hpp"
#include <QtGui> #include <QDesktopWidget>
#include <QMessageBox>
#include <QDir>
#include <cstdlib> #include <cstdlib>

View file

@ -1,6 +1,15 @@
#include "maindialog.hpp" #include "maindialog.hpp"
#include <QtGui> #include <QFontDatabase>
#include <QInputDialog>
#include <QFileDialog>
#include <QCloseEvent>
#include <QTextCodec>
#include <QProcess>
#include <QFile>
#include <QDir>
#include <QDebug>
#include "utils/checkablemessagebox.hpp" #include "utils/checkablemessagebox.hpp"
@ -203,10 +212,15 @@ bool MainDialog::showFirstRunDialog()
// Construct the arguments to run the importer // Construct the arguments to run the importer
QStringList arguments; 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(iniPaths.first());
arguments.append(QString("--cfg"));
arguments.append(path); arguments.append(path);
if (!startProgram(QString("mwiniimport"), arguments, false)) if (!startProgram(QString("mwiniimport"), arguments, false))
@ -659,7 +673,7 @@ bool MainDialog::startProgram(const QString &name, const QStringList &arguments,
return false; return false;
} }
if (process.exitCode() != 0) { if (process.exitCode() != 0 || process.exitStatus() == QProcess::CrashExit) {
QString error(process.readAllStandardError()); QString error(process.readAllStandardError());
error.append(tr("\nArguments:\n")); error.append(tr("\nArguments:\n"));
error.append(arguments.join(" ")); error.append(arguments.join(" "));

View file

@ -1,6 +1,10 @@
#include "playpage.hpp" #include "playpage.hpp"
#include <QtGui> #include <QListView>
#ifdef Q_OS_MAC
#include <QPlastiqueStyle>
#endif
PlayPage::PlayPage(QWidget *parent) : QWidget(parent) PlayPage::PlayPage(QWidget *parent) : QWidget(parent)
{ {

View file

@ -183,13 +183,10 @@ namespace MWClass
std::string bodyRaceID = headID.substr(0, end); std::string bodyRaceID = headID.substr(0, end);
std::string model = "meshes\\base_anim.nif"; std::string model = "meshes\\base_anim.nif";
if (bodyRaceID == "b_n_khajiit_m_" || const ESM::Race* race = MWBase::Environment::get().getWorld()->getStore().get<ESM::Race>().find(ref->mBase->mRace);
bodyRaceID == "b_n_khajiit_f_" || if(race->mData.mFlags & ESM::Race::Beast)
bodyRaceID == "b_n_argonian_m_" ||
bodyRaceID == "b_n_argonian_f_")
{
model = "meshes\\base_animkna.nif"; model = "meshes\\base_animkna.nif";
}
return model; return model;
} }

View file

@ -45,11 +45,12 @@ namespace MWWorld
{ {
// Beast races cannot equip shoes / boots, or full helms (head part vs hair part) // 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<ESM::Race>().find(npcRace);
if(race->mData.mFlags & ESM::Race::Beast)
{ {
if(*slot == MWWorld::InventoryStore::Slot_Helmet){ if(*slot == MWWorld::InventoryStore::Slot_Helmet)
{
std::vector<ESM::PartReference> parts; std::vector<ESM::PartReference> parts;
if(it.getType() == MWWorld::ContainerStore::Type_Clothing) if(it.getType() == MWWorld::ContainerStore::Type_Clothing)
parts = it->get<ESM::Clothing>()->mBase->mParts.mParts; parts = it->get<ESM::Clothing>()->mBase->mParts.mParts;
else else
@ -74,19 +75,35 @@ namespace MWWorld
if (*slot == MWWorld::InventoryStore::Slot_Boots) if (*slot == MWWorld::InventoryStore::Slot_Boots)
{ {
// Only notify the player, not npcs bool allow = true;
if(actor == MWBase::Environment::get().getWorld()->getPlayer().getPlayer() ) std::vector<ESM::PartReference> parts;
if(it.getType() == MWWorld::ContainerStore::Type_Clothing)
parts = it->get<ESM::Clothing>()->mBase->mParts.mParts;
else
parts = it->get<ESM::Armor>()->mBase->mParts.mParts;
for(std::vector<ESM::PartReference>::iterator itr = parts.begin(); itr != parts.end(); ++itr)
{ {
if(it.getType() == MWWorld::ContainerStore::Type_Clothing){ // It's shoes if((*itr).mPart == ESM::PRT_LFoot || (*itr).mPart == ESM::PRT_RFoot)
MWBase::Environment::get().getWindowManager()->messageBox ("#{sNotifyMessage15}", std::vector<std::string>());
}
else // It's boots
{ {
MWBase::Environment::get().getWindowManager()->messageBox ("#{sNotifyMessage14}", std::vector<std::string>()); 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<std::string>());
}
else // It's boots
{
MWBase::Environment::get().getWindowManager()->messageBox ("#{sNotifyMessage14}", std::vector<std::string>());
}
}
break;
} }
} }
break;
if(!allow)
break;
} }
} }

View file

@ -233,8 +233,6 @@ namespace MWWorld
mPlayer = new MWWorld::Player (mStore.get<ESM::NPC>().find ("player"), *this); mPlayer = new MWWorld::Player (mStore.get<ESM::NPC>().find ("player"), *this);
mRendering->attachCameraTo(mPlayer->getPlayer()); mRendering->attachCameraTo(mPlayer->getPlayer());
mPhysics->addActor(mPlayer->getPlayer());
// global variables // global variables
mGlobalVariables = new Globals (mStore); mGlobalVariables = new Globals (mStore);
@ -940,19 +938,16 @@ namespace MWWorld
if (Misc::StringUtils::ciEqual(record.mId, "player")) if (Misc::StringUtils::ciEqual(record.mId, "player"))
{ {
static const char *sRaces[] = std::vector<std::string> ids;
{ getStore().get<ESM::Race>().listIdentifier(ids);
"Argonian", "Breton", "Dark Elf", "High Elf", "Imperial", "Khajiit", "Nord", "Orc", "Redguard",
"Woodelf", 0
};
int i=0; unsigned int i=0;
for (; sRaces[i]; ++i) for (; i<ids.size(); ++i)
if (Misc::StringUtils::ciEqual (sRaces[i], record.mRace)) if (Misc::StringUtils::ciEqual (ids[i], record.mRace))
break; break;
mGlobalVariables->setInt ("pcrace", sRaces[i] ? i+1 : 0); mGlobalVariables->setInt ("pcrace", (i == ids.size()) ? 0 : i+1);
const ESM::NPC *player = const ESM::NPC *player =
mPlayer->getPlayer().get<ESM::NPC>()->mBase; mPlayer->getPlayer().get<ESM::NPC>()->mBase;
@ -1318,6 +1313,7 @@ namespace MWWorld
void World::renderPlayer() void World::renderPlayer()
{ {
mRendering->renderPlayer(mPlayer->getPlayer()); mRendering->renderPlayer(mPlayer->getPlayer());
mPhysics->addActor(mPlayer->getPlayer());
} }
void World::setupExternalRendering (MWRender::ExternalRendering& rendering) void World::setupExternalRendering (MWRender::ExternalRendering& rendering)

View file

@ -1,4 +1,6 @@
#include <QDebug> #include <QDebug>
#include <QTextDecoder>
#include <QTextCodec>
#include <QFileInfo> #include <QFileInfo>
#include <QDir> #include <QDir>
@ -157,7 +159,7 @@ Qt::ItemFlags DataFilesModel::flags(const QModelIndex &index) const
if (!file) if (!file)
return Qt::NoItemFlags; return Qt::NoItemFlags;
if (canBeChecked(file)) { if (canBeChecked(file)) {
if (index.column() == 0) { if (index.column() == 0) {
return Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsSelectable; return Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsSelectable;
} else { } else {
@ -226,7 +228,7 @@ bool lessThanEsmFile(const EsmFile *e1, const EsmFile *e2)
return true; return true;
if (!e1->fileName().endsWith(".esm") && e2->fileName().endsWith(".esm")) if (!e1->fileName().endsWith(".esm") && e2->fileName().endsWith(".esm"))
return false; return false;
return e1->fileName().toLower() < e2->fileName().toLower(); return e1->fileName().toLower() < e2->fileName().toLower();
} }
@ -237,10 +239,6 @@ bool lessThanDate(const EsmFile *e1, const EsmFile *e2)
} else { } else {
return false; 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) void DataFilesModel::sort(int column, Qt::SortOrder order)
@ -270,17 +268,32 @@ void DataFilesModel::addFiles(const QString &path)
filters << "*.esp" << "*.esm"; filters << "*.esp" << "*.esm";
dir.setNameFilters(filters); 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()) { foreach (const QString &path, dir.entryList()) {
QFileInfo info(dir.absoluteFilePath(path)); QFileInfo info(dir.absoluteFilePath(path));
EsmFile *file = new EsmFile(path); EsmFile *file = new EsmFile(path);
try { try {
ESM::ESMReader fileReader; ESM::ESMReader fileReader;
ToUTF8::Utf8Encoder encoder (ToUTF8::calculateEncoding(mEncoding.toStdString())); ToUTF8::Utf8Encoder encoder(ToUTF8::calculateEncoding(mEncoding.toStdString()));
fileReader.setEncoder(&encoder); fileReader.setEncoder(&encoder);
fileReader.open(dir.absoluteFilePath(path).toStdString()); fileReader.open(dir.absoluteFilePath(path).toStdString());
ESM::ESMReader::MasterList mlist = fileReader.getMasters(); ESM::ESMReader::MasterList mlist = fileReader.getMasters();
QStringList masters; QStringList masters;
@ -289,13 +302,13 @@ void DataFilesModel::addFiles(const QString &path)
masters.append(master); masters.append(master);
} }
file->setAuthor(QString::fromStdString(fileReader.getAuthor())); file->setAuthor(decoder->toUnicode(fileReader.getAuthor().c_str()));
file->setSize(info.size()); file->setSize(info.size());
file->setDates(info.lastModified(), info.lastRead()); file->setDates(info.lastModified(), info.lastRead());
file->setVersion(fileReader.getFVer()); file->setVersion(fileReader.getFVer());
file->setPath(info.absoluteFilePath()); file->setPath(info.absoluteFilePath());
file->setMasters(masters); file->setMasters(masters);
file->setDescription(QString::fromStdString(fileReader.getDesc())); file->setDescription(decoder->toUnicode(fileReader.getDesc().c_str()));
// Put the file in the table // Put the file in the table
@ -308,6 +321,8 @@ void DataFilesModel::addFiles(const QString &path)
} }
} }
delete decoder;
} }
QModelIndex DataFilesModel::indexFromItem(EsmFile *item) const QModelIndex DataFilesModel::indexFromItem(EsmFile *item) const
@ -369,10 +384,10 @@ QStringList DataFilesModel::checkedItems()
QStringList DataFilesModel::checkedItemsPaths() QStringList DataFilesModel::checkedItemsPaths()
{ {
QStringList list; QStringList list;
QList<EsmFile *>::ConstIterator it; QList<EsmFile *>::ConstIterator it;
QList<EsmFile *>::ConstIterator itEnd = mFiles.constEnd(); QList<EsmFile *>::ConstIterator itEnd = mFiles.constEnd();
int i = 0; int i = 0;
for (it = mFiles.constBegin(); it != itEnd; ++it) { for (it = mFiles.constBegin(); it != itEnd; ++it) {
EsmFile *file = item(i); EsmFile *file = item(i);
@ -381,7 +396,7 @@ QStringList DataFilesModel::checkedItemsPaths()
if (mCheckStates[file->fileName()] == Qt::Checked && canBeChecked(file)) if (mCheckStates[file->fileName()] == Qt::Checked && canBeChecked(file))
list << file->path(); list << file->path();
} }
return list; return list;
} }

View file

@ -5,7 +5,7 @@
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>575</width> <width>575</width>
<height>525</height> <height>535</height>
</size> </size>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">

View file

@ -19,6 +19,9 @@
<property name="frameShadow"> <property name="frameShadow">
<enum>QFrame::Plain</enum> <enum>QFrame::Plain</enum>
</property> </property>
<property name="lineWidth">
<number>0</number>
</property>
<layout class="QGridLayout" name="gridLayout"> <layout class="QGridLayout" name="gridLayout">
<property name="leftMargin"> <property name="leftMargin">
<number>30</number> <number>30</number>
@ -40,10 +43,14 @@
border-color: rgba(0, 0, 0, 125); border-color: rgba(0, 0, 0, 125);
border-style: solid; border-style: solid;
border-radius: 2px; border-radius: 2px;
font-size: 12pt;
font-family: &quot;EB Garamond&quot;, &quot;EB Garamond 08&quot;;
color: black;
} }
/*QComboBox gets the &quot;on&quot; state when the popup is open */ /*QComboBox gets the &quot;on&quot; 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, background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
stop:0 rgba(0, 0, 0, 75), stop:0 rgba(0, 0, 0, 75),
stop:0.1 rgba(0, 0, 0, 15), stop:0.1 rgba(0, 0, 0, 15),
@ -52,13 +59,9 @@
border: 1px solid rgba(0, 0, 0, 55); 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-top: 3px;
padding-left: 4px; padding-left: 4px;
font-size: 12pt;
font-family: &quot;EB Garamond&quot;, &quot;EB Garamond 08&quot;;
color: black;
} }
#profilesComboBox::drop-down { #profilesComboBox::drop-down {
@ -82,7 +85,6 @@
left: 1px; left: 1px;
} }
#profilesComboBox QAbstractItemView { #profilesComboBox QAbstractItemView {
border: 0px; border: 0px;
}</string> }</string>

View file

@ -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 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. 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) License: GPL (see GPL3.txt for more information)
Website: http://www.openmw.org Website: http://www.openmw.org