mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-21 11:23:51 +00:00
Merge pull request #8 from cc9cii/minor-enhancements
Minor enhancements
This commit is contained in:
commit
8acc2f31ff
13 changed files with 222 additions and 80 deletions
|
@ -159,15 +159,23 @@ std::pair<Files::PathContainer, std::vector<std::string> > CS::Editor::readConfi
|
||||||
}
|
}
|
||||||
|
|
||||||
dataDirs.insert (dataDirs.end(), dataLocal.begin(), dataLocal.end());
|
dataDirs.insert (dataDirs.end(), dataLocal.begin(), dataLocal.end());
|
||||||
|
Files::PathContainer canonicalPaths;
|
||||||
|
|
||||||
//iterate the data directories and add them to the file dialog for loading
|
//iterate the data directories and add them to the file dialog for loading
|
||||||
for (Files::PathContainer::const_iterator iter = dataDirs.begin(); iter != dataDirs.end(); ++iter)
|
for (Files::PathContainer::const_iterator iter = dataDirs.begin(); iter != dataDirs.end(); ++iter)
|
||||||
{
|
{
|
||||||
|
boost::filesystem::path p = boost::filesystem::canonical(*iter);
|
||||||
|
Files::PathContainer::iterator it = std::find(canonicalPaths.begin(), canonicalPaths.end(), p);
|
||||||
|
if (it == canonicalPaths.end())
|
||||||
|
canonicalPaths.push_back(p);
|
||||||
|
else
|
||||||
|
continue;
|
||||||
|
|
||||||
QString path = QString::fromUtf8 (iter->string().c_str());
|
QString path = QString::fromUtf8 (iter->string().c_str());
|
||||||
mFileDialog.addFiles(path);
|
mFileDialog.addFiles(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
return std::make_pair (dataDirs, variables["fallback-archive"].as<std::vector<std::string> >());
|
return std::make_pair (canonicalPaths, variables["fallback-archive"].as<std::vector<std::string> >());
|
||||||
}
|
}
|
||||||
|
|
||||||
void CS::Editor::createGame()
|
void CS::Editor::createGame()
|
||||||
|
|
|
@ -553,6 +553,14 @@ CSMWorld::Data::Data (ToUTF8::FromType encoding, const ResourcesManager& resourc
|
||||||
mMetaData.addColumn (new AuthorColumn<MetaData>);
|
mMetaData.addColumn (new AuthorColumn<MetaData>);
|
||||||
mMetaData.addColumn (new FileDescriptionColumn<MetaData>);
|
mMetaData.addColumn (new FileDescriptionColumn<MetaData>);
|
||||||
|
|
||||||
|
mLandTextures.addColumn (new StringIdColumn<LandTexture>);
|
||||||
|
mLandTextures.addColumn (new RecordStateColumn<LandTexture>);
|
||||||
|
mLandTextures.addColumn (new FixedRecordTypeColumn<LandTexture> (UniversalId::Type_LandTexture));
|
||||||
|
|
||||||
|
mLand.addColumn (new StringIdColumn<Land>);
|
||||||
|
mLand.addColumn (new RecordStateColumn<Land>);
|
||||||
|
mLand.addColumn (new FixedRecordTypeColumn<Land> (UniversalId::Type_Land));
|
||||||
|
|
||||||
addModel (new IdTable (&mGlobals), UniversalId::Type_Global);
|
addModel (new IdTable (&mGlobals), UniversalId::Type_Global);
|
||||||
addModel (new IdTable (&mGmsts), UniversalId::Type_Gmst);
|
addModel (new IdTable (&mGmsts), UniversalId::Type_Gmst);
|
||||||
addModel (new IdTable (&mSkills), UniversalId::Type_Skill);
|
addModel (new IdTable (&mSkills), UniversalId::Type_Skill);
|
||||||
|
@ -594,6 +602,8 @@ CSMWorld::Data::Data (ToUTF8::FromType encoding, const ResourcesManager& resourc
|
||||||
addModel (new ResourceTable (&mResourcesManager.get (UniversalId::Type_Videos)),
|
addModel (new ResourceTable (&mResourcesManager.get (UniversalId::Type_Videos)),
|
||||||
UniversalId::Type_Video);
|
UniversalId::Type_Video);
|
||||||
addModel (new IdTable (&mMetaData), UniversalId::Type_MetaData);
|
addModel (new IdTable (&mMetaData), UniversalId::Type_MetaData);
|
||||||
|
addModel (new IdTable (&mLand), UniversalId::Type_Land);
|
||||||
|
addModel (new IdTable (&mLandTextures), UniversalId::Type_LandTexture);
|
||||||
|
|
||||||
// for autocalc updates when gmst/race/class/skils tables change
|
// for autocalc updates when gmst/race/class/skils tables change
|
||||||
CSMWorld::IdTable *gmsts =
|
CSMWorld::IdTable *gmsts =
|
||||||
|
@ -1419,8 +1429,14 @@ CSMWorld::NpcStats* CSMWorld::Data::npcAutoCalculate(const ESM::NPC& npc) const
|
||||||
if (cachedStats)
|
if (cachedStats)
|
||||||
return cachedStats;
|
return cachedStats;
|
||||||
|
|
||||||
const ESM::Race *race = &mRaces.getRecord(npc.mRace).get();
|
int raceIndex = mRaces.searchId(npc.mRace);
|
||||||
const ESM::Class *class_ = &mClasses.getRecord(npc.mClass).get();
|
int classIndex = mClasses.searchId(npc.mClass);
|
||||||
|
// this can happen when creating a new game from scratch
|
||||||
|
if (raceIndex == -1 || classIndex == -1)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
const ESM::Race *race = &mRaces.getRecord(raceIndex).get();
|
||||||
|
const ESM::Class *class_ = &mClasses.getRecord(classIndex).get();
|
||||||
|
|
||||||
bool autoCalc = npc.mNpdtType == ESM::NPC::NPC_WITH_AUTOCALCULATED_STATS;
|
bool autoCalc = npc.mNpdtType == ESM::NPC::NPC_WITH_AUTOCALCULATED_STATS;
|
||||||
short level = npc.mNpdt52.mLevel;
|
short level = npc.mNpdt52.mLevel;
|
||||||
|
|
|
@ -638,6 +638,11 @@ void CSMWorld::NpcRefIdAdapter::setData (const RefIdColumn *column, RefIdData& d
|
||||||
if (npc.mNpdtType == ESM::NPC::NPC_WITH_AUTOCALCULATED_STATS)
|
if (npc.mNpdtType == ESM::NPC::NPC_WITH_AUTOCALCULATED_STATS)
|
||||||
{
|
{
|
||||||
CSMWorld::NpcStats *stats = mData.npcAutoCalculate(npc);
|
CSMWorld::NpcStats *stats = mData.npcAutoCalculate(npc);
|
||||||
|
if (!stats)
|
||||||
|
{
|
||||||
|
record.setModified (npc);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// update npc
|
// update npc
|
||||||
npc.mNpdtType = ESM::NPC::NPC_DEFAULT;
|
npc.mNpdtType = ESM::NPC::NPC_DEFAULT;
|
||||||
|
@ -755,6 +760,8 @@ QVariant CSMWorld::NpcAttributesRefIdAdapter::getNestedData (const RefIdColumn *
|
||||||
if (npc.mNpdtType == ESM::NPC::NPC_WITH_AUTOCALCULATED_STATS)
|
if (npc.mNpdtType == ESM::NPC::NPC_WITH_AUTOCALCULATED_STATS)
|
||||||
{
|
{
|
||||||
CSMWorld::NpcStats *stats = mData.npcAutoCalculate(npc);
|
CSMWorld::NpcStats *stats = mData.npcAutoCalculate(npc);
|
||||||
|
if (!stats)
|
||||||
|
return QVariant();
|
||||||
|
|
||||||
switch (subRowIndex)
|
switch (subRowIndex)
|
||||||
{
|
{
|
||||||
|
@ -885,6 +892,9 @@ QVariant CSMWorld::NpcSkillsRefIdAdapter::getNestedData (const RefIdColumn *colu
|
||||||
if (npc.mNpdtType == ESM::NPC::NPC_WITH_AUTOCALCULATED_STATS)
|
if (npc.mNpdtType == ESM::NPC::NPC_WITH_AUTOCALCULATED_STATS)
|
||||||
{
|
{
|
||||||
CSMWorld::NpcStats *stats = mData.npcAutoCalculate(npc);
|
CSMWorld::NpcStats *stats = mData.npcAutoCalculate(npc);
|
||||||
|
if (!stats)
|
||||||
|
return QVariant();
|
||||||
|
|
||||||
return static_cast<int>(stats->getBaseSkill(subRowIndex));
|
return static_cast<int>(stats->getBaseSkill(subRowIndex));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -981,17 +991,23 @@ QVariant CSMWorld::NpcMiscRefIdAdapter::getNestedData (const RefIdColumn *column
|
||||||
}
|
}
|
||||||
case 2:
|
case 2:
|
||||||
{
|
{
|
||||||
UserInt i(stats->getHealth());
|
UserInt i(0);
|
||||||
|
if (stats)
|
||||||
|
i = UserInt(stats->getHealth());
|
||||||
return QVariant(QVariant::fromValue(i));
|
return QVariant(QVariant::fromValue(i));
|
||||||
}
|
}
|
||||||
case 3:
|
case 3:
|
||||||
{
|
{
|
||||||
UserInt i(stats->getMana());
|
UserInt i(0);
|
||||||
|
if (stats)
|
||||||
|
i = UserInt(stats->getMana());
|
||||||
return QVariant(QVariant::fromValue(i));
|
return QVariant(QVariant::fromValue(i));
|
||||||
}
|
}
|
||||||
case 4:
|
case 4:
|
||||||
{
|
{
|
||||||
UserInt i(stats->getFatigue());
|
UserInt i(0);
|
||||||
|
if (stats)
|
||||||
|
i = UserInt(stats->getFatigue());
|
||||||
return QVariant(QVariant::fromValue(i));
|
return QVariant(QVariant::fromValue(i));
|
||||||
}
|
}
|
||||||
case 5: return static_cast<int>(record.get().mNpdt12.mDisposition);
|
case 5: return static_cast<int>(record.get().mNpdt12.mDisposition);
|
||||||
|
@ -1164,6 +1180,54 @@ void CSMWorld::WeaponRefIdAdapter::setData (const RefIdColumn *column, RefIdData
|
||||||
namespace CSMWorld
|
namespace CSMWorld
|
||||||
{
|
{
|
||||||
|
|
||||||
|
template<>
|
||||||
|
QVariant ActorRefIdAdapter<ESM::NPC>::getData (const RefIdColumn *column, const RefIdData& data,
|
||||||
|
int index) const
|
||||||
|
{
|
||||||
|
const Record<ESM::NPC>& record = static_cast<const Record<ESM::NPC>&> (
|
||||||
|
data.getRecord (RefIdData::LocalIndex (index, BaseRefIdAdapter<ESM::NPC>::getType())));
|
||||||
|
|
||||||
|
if (column==mActors.mHasAi)
|
||||||
|
return record.get().mHasAI!=0;
|
||||||
|
|
||||||
|
if (column==mActors.mHello)
|
||||||
|
return record.get().mAiData.mHello;
|
||||||
|
|
||||||
|
if (column==mActors.mFlee)
|
||||||
|
return record.get().mAiData.mFlee;
|
||||||
|
|
||||||
|
if (column==mActors.mFight)
|
||||||
|
return record.get().mAiData.mFight;
|
||||||
|
|
||||||
|
if (column==mActors.mAlarm)
|
||||||
|
return record.get().mAiData.mAlarm;
|
||||||
|
|
||||||
|
if (column==mActors.mInventory)
|
||||||
|
return true; // to show nested tables in dialogue subview, see IdTree::hasChildren()
|
||||||
|
|
||||||
|
if (column==mActors.mSpells)
|
||||||
|
{
|
||||||
|
if ((record.get().mFlags & ESM::NPC::Autocalc) != 0)
|
||||||
|
return QVariant(QVariant::UserType);
|
||||||
|
else
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (column==mActors.mDestinations)
|
||||||
|
return true; // to show nested tables in dialogue subview, see IdTree::hasChildren()
|
||||||
|
|
||||||
|
if (column==mActors.mAiPackages)
|
||||||
|
return true; // to show nested tables in dialogue subview, see IdTree::hasChildren()
|
||||||
|
|
||||||
|
std::map<const RefIdColumn *, unsigned int>::const_iterator iter =
|
||||||
|
mActors.mServices.find (column);
|
||||||
|
|
||||||
|
if (iter!=mActors.mServices.end())
|
||||||
|
return (record.get().mAiData.mServices & iter->second)!=0;
|
||||||
|
|
||||||
|
return NameRefIdAdapter<ESM::NPC>::getData (column, data, index);
|
||||||
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
void NestedSpellRefIdAdapter<ESM::NPC>::addNestedRow (const RefIdColumn *column,
|
void NestedSpellRefIdAdapter<ESM::NPC>::addNestedRow (const RefIdColumn *column,
|
||||||
RefIdData& data, int index, int position) const
|
RefIdData& data, int index, int position) const
|
||||||
|
@ -1259,7 +1323,11 @@ QVariant NestedSpellRefIdAdapter<ESM::NPC>::getNestedData (const RefIdColumn *co
|
||||||
const Record<ESM::NPC>& record =
|
const Record<ESM::NPC>& record =
|
||||||
static_cast<const Record<ESM::NPC>&> (data.getRecord (RefIdData::LocalIndex (index, mType)));
|
static_cast<const Record<ESM::NPC>&> (data.getRecord (RefIdData::LocalIndex (index, mType)));
|
||||||
|
|
||||||
const std::vector<SpellInfo>& spells = mData.npcAutoCalculate(record.get())->spells();
|
CSMWorld::NpcStats *stats = mData.npcAutoCalculate(record.get());
|
||||||
|
if (!stats)
|
||||||
|
return QVariant();
|
||||||
|
|
||||||
|
const std::vector<SpellInfo>& spells = stats->spells();
|
||||||
|
|
||||||
if (subRowIndex < 0 || subRowIndex >= static_cast<int> (spells.size()))
|
if (subRowIndex < 0 || subRowIndex >= static_cast<int> (spells.size()))
|
||||||
throw std::runtime_error ("index out of range");
|
throw std::runtime_error ("index out of range");
|
||||||
|
@ -1289,8 +1357,54 @@ int NestedSpellRefIdAdapter<ESM::NPC>::getNestedRowsCount(const RefIdColumn *col
|
||||||
const Record<ESM::NPC>& record =
|
const Record<ESM::NPC>& record =
|
||||||
static_cast<const Record<ESM::NPC>&> (data.getRecord (RefIdData::LocalIndex (index, mType)));
|
static_cast<const Record<ESM::NPC>&> (data.getRecord (RefIdData::LocalIndex (index, mType)));
|
||||||
|
|
||||||
const std::vector<SpellInfo> spells = mData.npcAutoCalculate(record.get())->spells();
|
CSMWorld::NpcStats *stats = mData.npcAutoCalculate(record.get());
|
||||||
return static_cast<int>(spells.size());
|
if (!stats)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return static_cast<int>(stats->spells().size());
|
||||||
|
}
|
||||||
|
|
||||||
|
template<>
|
||||||
|
QVariant ActorRefIdAdapter<ESM::Creature>::getData (const RefIdColumn *column, const RefIdData& data,
|
||||||
|
int index) const
|
||||||
|
{
|
||||||
|
const Record<ESM::Creature>& record = static_cast<const Record<ESM::Creature>&> (
|
||||||
|
data.getRecord (RefIdData::LocalIndex (index, BaseRefIdAdapter<ESM::Creature>::getType())));
|
||||||
|
|
||||||
|
if (column==mActors.mHasAi)
|
||||||
|
return record.get().mHasAI!=0;
|
||||||
|
|
||||||
|
if (column==mActors.mHello)
|
||||||
|
return record.get().mAiData.mHello;
|
||||||
|
|
||||||
|
if (column==mActors.mFlee)
|
||||||
|
return record.get().mAiData.mFlee;
|
||||||
|
|
||||||
|
if (column==mActors.mFight)
|
||||||
|
return record.get().mAiData.mFight;
|
||||||
|
|
||||||
|
if (column==mActors.mAlarm)
|
||||||
|
return record.get().mAiData.mAlarm;
|
||||||
|
|
||||||
|
if (column==mActors.mInventory)
|
||||||
|
return true; // to show nested tables in dialogue subview, see IdTree::hasChildren()
|
||||||
|
|
||||||
|
if (column==mActors.mSpells)
|
||||||
|
return true; // to show nested tables in dialogue subview, see IdTree::hasChildren()
|
||||||
|
|
||||||
|
if (column==mActors.mDestinations)
|
||||||
|
return true; // to show nested tables in dialogue subview, see IdTree::hasChildren()
|
||||||
|
|
||||||
|
if (column==mActors.mAiPackages)
|
||||||
|
return true; // to show nested tables in dialogue subview, see IdTree::hasChildren()
|
||||||
|
|
||||||
|
std::map<const RefIdColumn *, unsigned int>::const_iterator iter =
|
||||||
|
mActors.mServices.find (column);
|
||||||
|
|
||||||
|
if (iter!=mActors.mServices.end())
|
||||||
|
return (record.get().mAiData.mServices & iter->second)!=0;
|
||||||
|
|
||||||
|
return NameRefIdAdapter<ESM::Creature>::getData (column, data, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
|
|
|
@ -523,49 +523,6 @@ namespace CSMWorld
|
||||||
: NameRefIdAdapter<RecordT> (type, columns), mActors (columns)
|
: NameRefIdAdapter<RecordT> (type, columns), mActors (columns)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
template<typename RecordT>
|
|
||||||
QVariant ActorRefIdAdapter<RecordT>::getData (const RefIdColumn *column, const RefIdData& data,
|
|
||||||
int index) const
|
|
||||||
{
|
|
||||||
const Record<RecordT>& record = static_cast<const Record<RecordT>&> (
|
|
||||||
data.getRecord (RefIdData::LocalIndex (index, BaseRefIdAdapter<RecordT>::getType())));
|
|
||||||
|
|
||||||
if (column==mActors.mHasAi)
|
|
||||||
return record.get().mHasAI!=0;
|
|
||||||
|
|
||||||
if (column==mActors.mHello)
|
|
||||||
return record.get().mAiData.mHello;
|
|
||||||
|
|
||||||
if (column==mActors.mFlee)
|
|
||||||
return record.get().mAiData.mFlee;
|
|
||||||
|
|
||||||
if (column==mActors.mFight)
|
|
||||||
return record.get().mAiData.mFight;
|
|
||||||
|
|
||||||
if (column==mActors.mAlarm)
|
|
||||||
return record.get().mAiData.mAlarm;
|
|
||||||
|
|
||||||
if (column==mActors.mInventory)
|
|
||||||
return true; // to show nested tables in dialogue subview, see IdTree::hasChildren()
|
|
||||||
|
|
||||||
if (column==mActors.mSpells)
|
|
||||||
return true; // to show nested tables in dialogue subview, see IdTree::hasChildren()
|
|
||||||
|
|
||||||
if (column==mActors.mDestinations)
|
|
||||||
return true; // to show nested tables in dialogue subview, see IdTree::hasChildren()
|
|
||||||
|
|
||||||
if (column==mActors.mAiPackages)
|
|
||||||
return true; // to show nested tables in dialogue subview, see IdTree::hasChildren()
|
|
||||||
|
|
||||||
std::map<const RefIdColumn *, unsigned int>::const_iterator iter =
|
|
||||||
mActors.mServices.find (column);
|
|
||||||
|
|
||||||
if (iter!=mActors.mServices.end())
|
|
||||||
return (record.get().mAiData.mServices & iter->second)!=0;
|
|
||||||
|
|
||||||
return NameRefIdAdapter<RecordT>::getData (column, data, index);
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename RecordT>
|
template<typename RecordT>
|
||||||
void ActorRefIdAdapter<RecordT>::setData (const RefIdColumn *column, RefIdData& data, int index,
|
void ActorRefIdAdapter<RecordT>::setData (const RefIdColumn *column, RefIdData& data, int index,
|
||||||
const QVariant& value) const
|
const QVariant& value) const
|
||||||
|
|
|
@ -57,6 +57,8 @@ namespace
|
||||||
{ CSMWorld::UniversalId::Class_RecordList, CSMWorld::UniversalId::Type_Pathgrids, "Pathgrids", 0 },
|
{ CSMWorld::UniversalId::Class_RecordList, CSMWorld::UniversalId::Type_Pathgrids, "Pathgrids", 0 },
|
||||||
{ CSMWorld::UniversalId::Class_RecordList, CSMWorld::UniversalId::Type_StartScripts, "Start Scripts", 0 },
|
{ CSMWorld::UniversalId::Class_RecordList, CSMWorld::UniversalId::Type_StartScripts, "Start Scripts", 0 },
|
||||||
{ CSMWorld::UniversalId::Class_RecordList, CSMWorld::UniversalId::Type_MetaDatas, "Meta Data Table", 0 },
|
{ CSMWorld::UniversalId::Class_RecordList, CSMWorld::UniversalId::Type_MetaDatas, "Meta Data Table", 0 },
|
||||||
|
{ CSMWorld::UniversalId::Class_RecordList, CSMWorld::UniversalId::Type_LandTextures, "Land Texture Table", 0 },
|
||||||
|
{ CSMWorld::UniversalId::Class_RecordList, CSMWorld::UniversalId::Type_Lands, "Land Table", 0 },
|
||||||
|
|
||||||
{ CSMWorld::UniversalId::Class_None, CSMWorld::UniversalId::Type_None, 0, 0 } // end marker
|
{ CSMWorld::UniversalId::Class_None, CSMWorld::UniversalId::Type_None, 0, 0 } // end marker
|
||||||
};
|
};
|
||||||
|
@ -122,6 +124,8 @@ namespace
|
||||||
{ CSMWorld::UniversalId::Class_Record, CSMWorld::UniversalId::Type_Pathgrid, "Pathgrid", 0 },
|
{ CSMWorld::UniversalId::Class_Record, CSMWorld::UniversalId::Type_Pathgrid, "Pathgrid", 0 },
|
||||||
{ CSMWorld::UniversalId::Class_Record, CSMWorld::UniversalId::Type_StartScript, "Start Script", 0 },
|
{ CSMWorld::UniversalId::Class_Record, CSMWorld::UniversalId::Type_StartScript, "Start Script", 0 },
|
||||||
{ CSMWorld::UniversalId::Class_Record, CSMWorld::UniversalId::Type_MetaData, "Meta Data", 0 },
|
{ CSMWorld::UniversalId::Class_Record, CSMWorld::UniversalId::Type_MetaData, "Meta Data", 0 },
|
||||||
|
{ CSMWorld::UniversalId::Class_Record, CSMWorld::UniversalId::Type_LandTexture, "Land Texture", 0 },
|
||||||
|
{ CSMWorld::UniversalId::Class_Record, CSMWorld::UniversalId::Type_Land, "Land", 0 },
|
||||||
|
|
||||||
{ CSMWorld::UniversalId::Class_None, CSMWorld::UniversalId::Type_None, 0, 0 } // end marker
|
{ CSMWorld::UniversalId::Class_None, CSMWorld::UniversalId::Type_None, 0, 0 } // end marker
|
||||||
};
|
};
|
||||||
|
|
|
@ -133,6 +133,10 @@ namespace CSMWorld
|
||||||
Type_Search,
|
Type_Search,
|
||||||
Type_MetaDatas,
|
Type_MetaDatas,
|
||||||
Type_MetaData,
|
Type_MetaData,
|
||||||
|
Type_LandTextures,
|
||||||
|
Type_LandTexture,
|
||||||
|
Type_Lands,
|
||||||
|
Type_Land,
|
||||||
Type_RunLog
|
Type_RunLog
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -169,6 +169,10 @@ void CSVDoc::View::setupWorldMenu()
|
||||||
connect (grid, SIGNAL (triggered()), this, SLOT (addPathgridSubView()));
|
connect (grid, SIGNAL (triggered()), this, SLOT (addPathgridSubView()));
|
||||||
world->addAction (grid);
|
world->addAction (grid);
|
||||||
|
|
||||||
|
QAction *land = new QAction (tr ("Lands"), this);
|
||||||
|
connect (land, SIGNAL (triggered()), this, SLOT (addLandSubView()));
|
||||||
|
world->addAction (land);
|
||||||
|
|
||||||
world->addSeparator(); // items that don't represent single record lists follow here
|
world->addSeparator(); // items that don't represent single record lists follow here
|
||||||
|
|
||||||
QAction *regionMap = new QAction (tr ("Region Map"), this);
|
QAction *regionMap = new QAction (tr ("Region Map"), this);
|
||||||
|
@ -288,6 +292,10 @@ void CSVDoc::View::setupAssetsMenu()
|
||||||
connect (textures, SIGNAL (triggered()), this, SLOT (addTexturesSubView()));
|
connect (textures, SIGNAL (triggered()), this, SLOT (addTexturesSubView()));
|
||||||
assets->addAction (textures);
|
assets->addAction (textures);
|
||||||
|
|
||||||
|
QAction *land = new QAction (tr ("Land Textures"), this);
|
||||||
|
connect (land, SIGNAL (triggered()), this, SLOT (addLandTextureSubView()));
|
||||||
|
assets->addAction (land);
|
||||||
|
|
||||||
QAction *videos = new QAction (tr ("Videos"), this);
|
QAction *videos = new QAction (tr ("Videos"), this);
|
||||||
connect (videos, SIGNAL (triggered()), this, SLOT (addVideosSubView()));
|
connect (videos, SIGNAL (triggered()), this, SLOT (addVideosSubView()));
|
||||||
assets->addAction (videos);
|
assets->addAction (videos);
|
||||||
|
@ -838,6 +846,16 @@ void CSVDoc::View::addPathgridSubView()
|
||||||
addSubView (CSMWorld::UniversalId::Type_Pathgrids);
|
addSubView (CSMWorld::UniversalId::Type_Pathgrids);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CSVDoc::View::addLandTextureSubView()
|
||||||
|
{
|
||||||
|
addSubView (CSMWorld::UniversalId::Type_LandTextures);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CSVDoc::View::addLandSubView()
|
||||||
|
{
|
||||||
|
addSubView (CSMWorld::UniversalId::Type_Lands);
|
||||||
|
}
|
||||||
|
|
||||||
void CSVDoc::View::addStartScriptsSubView()
|
void CSVDoc::View::addStartScriptsSubView()
|
||||||
{
|
{
|
||||||
addSubView (CSMWorld::UniversalId::Type_StartScripts);
|
addSubView (CSMWorld::UniversalId::Type_StartScripts);
|
||||||
|
|
|
@ -228,6 +228,10 @@ namespace CSVDoc
|
||||||
|
|
||||||
void addPathgridSubView();
|
void addPathgridSubView();
|
||||||
|
|
||||||
|
void addLandTextureSubView();
|
||||||
|
|
||||||
|
void addLandSubView();
|
||||||
|
|
||||||
void addStartScriptsSubView();
|
void addStartScriptsSubView();
|
||||||
|
|
||||||
void addSearchSubView();
|
void addSearchSubView();
|
||||||
|
|
|
@ -22,6 +22,8 @@ CSVWorld::NestedTable::NestedTable(CSMDoc::Document& document,
|
||||||
mEditIdAction(0),
|
mEditIdAction(0),
|
||||||
mModel(model)
|
mModel(model)
|
||||||
{
|
{
|
||||||
|
mDispatcher = new CSMWorld::CommandDispatcher (document, id, this);
|
||||||
|
|
||||||
setSelectionBehavior (QAbstractItemView::SelectRows);
|
setSelectionBehavior (QAbstractItemView::SelectRows);
|
||||||
setSelectionMode (QAbstractItemView::ExtendedSelection);
|
setSelectionMode (QAbstractItemView::ExtendedSelection);
|
||||||
|
|
||||||
|
@ -34,13 +36,6 @@ CSVWorld::NestedTable::NestedTable(CSMDoc::Document& document,
|
||||||
|
|
||||||
int columns = model->columnCount(QModelIndex());
|
int columns = model->columnCount(QModelIndex());
|
||||||
|
|
||||||
setModel(model);
|
|
||||||
|
|
||||||
setAcceptDrops(true);
|
|
||||||
|
|
||||||
if (editable)
|
|
||||||
{
|
|
||||||
mDispatcher = new CSMWorld::CommandDispatcher (document, id, this);
|
|
||||||
for(int i = 0 ; i < columns; ++i)
|
for(int i = 0 ; i < columns; ++i)
|
||||||
{
|
{
|
||||||
CSMWorld::ColumnBase::Display display = static_cast<CSMWorld::ColumnBase::Display> (
|
CSMWorld::ColumnBase::Display display = static_cast<CSMWorld::ColumnBase::Display> (
|
||||||
|
@ -54,6 +49,10 @@ CSVWorld::NestedTable::NestedTable(CSMDoc::Document& document,
|
||||||
setItemDelegateForColumn(i, delegate);
|
setItemDelegateForColumn(i, delegate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setModel(model);
|
||||||
|
|
||||||
|
if (editable)
|
||||||
|
{
|
||||||
mAddNewRowAction = new QAction (tr ("Add new row"), this);
|
mAddNewRowAction = new QAction (tr ("Add new row"), this);
|
||||||
|
|
||||||
connect(mAddNewRowAction, SIGNAL(triggered()),
|
connect(mAddNewRowAction, SIGNAL(triggered()),
|
||||||
|
|
|
@ -43,6 +43,8 @@ void CSVWorld::addSubViewFactories (CSVDoc::SubViewFactoryManager& manager)
|
||||||
CSMWorld::UniversalId::Type_BodyParts,
|
CSMWorld::UniversalId::Type_BodyParts,
|
||||||
CSMWorld::UniversalId::Type_SoundGens,
|
CSMWorld::UniversalId::Type_SoundGens,
|
||||||
CSMWorld::UniversalId::Type_Pathgrids,
|
CSMWorld::UniversalId::Type_Pathgrids,
|
||||||
|
CSMWorld::UniversalId::Type_LandTextures,
|
||||||
|
CSMWorld::UniversalId::Type_Lands,
|
||||||
CSMWorld::UniversalId::Type_StartScripts,
|
CSMWorld::UniversalId::Type_StartScripts,
|
||||||
|
|
||||||
CSMWorld::UniversalId::Type_None // end marker
|
CSMWorld::UniversalId::Type_None // end marker
|
||||||
|
|
|
@ -291,7 +291,8 @@ bool Config::GameSettings::writeFileWithComments(QFile &file)
|
||||||
if (!comments.empty() && index != -1 && settingRegex.captureCount() >= 2 &&
|
if (!comments.empty() && index != -1 && settingRegex.captureCount() >= 2 &&
|
||||||
mUserSettings.find(settingRegex.cap(1)) != mUserSettings.end())
|
mUserSettings.find(settingRegex.cap(1)) != mUserSettings.end())
|
||||||
{
|
{
|
||||||
for (std::vector<QString>::const_iterator it = comments.begin(); it != comments.end(); ++it)
|
for (std::vector<QString>::const_iterator it = comments.begin();
|
||||||
|
it != comments.end() && commentStart != fileCopy.end(); ++it)
|
||||||
{
|
{
|
||||||
*commentStart = *it;
|
*commentStart = *it;
|
||||||
++commentStart;
|
++commentStart;
|
||||||
|
|
|
@ -77,8 +77,13 @@ namespace ESM
|
||||||
break;
|
break;
|
||||||
case ESM::FourCC<'S','C','D','T'>::value:
|
case ESM::FourCC<'S','C','D','T'>::value:
|
||||||
// compiled script
|
// compiled script
|
||||||
|
if (mData.mScriptDataSize)
|
||||||
|
{
|
||||||
mScriptData.resize(mData.mScriptDataSize);
|
mScriptData.resize(mData.mScriptDataSize);
|
||||||
esm.getHExact(&mScriptData[0], mScriptData.size());
|
esm.getHExact(&mScriptData[0], mScriptData.size());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
esm.skipHSub();
|
||||||
break;
|
break;
|
||||||
case ESM::FourCC<'S','C','T','X'>::value:
|
case ESM::FourCC<'S','C','T','X'>::value:
|
||||||
mScriptText = esm.getHString();
|
mScriptText = esm.getHString();
|
||||||
|
|
|
@ -57,14 +57,24 @@ void ConfigurationManager::readConfiguration(boost::program_options::variables_m
|
||||||
bool silent = mSilent;
|
bool silent = mSilent;
|
||||||
mSilent = quiet;
|
mSilent = quiet;
|
||||||
|
|
||||||
|
boost::filesystem::path pUser = boost::filesystem::canonical(mFixedPath.getUserConfigPath());
|
||||||
|
boost::filesystem::path pLocal = boost::filesystem::canonical(mFixedPath.getLocalPath());
|
||||||
|
boost::filesystem::path pGlobal = boost::filesystem::canonical(mFixedPath.getGlobalConfigPath());
|
||||||
|
|
||||||
loadConfig(mFixedPath.getUserConfigPath(), variables, description);
|
loadConfig(mFixedPath.getUserConfigPath(), variables, description);
|
||||||
boost::program_options::notify(variables);
|
boost::program_options::notify(variables);
|
||||||
|
|
||||||
|
if (pLocal != pUser)
|
||||||
|
{
|
||||||
loadConfig(mFixedPath.getLocalPath(), variables, description);
|
loadConfig(mFixedPath.getLocalPath(), variables, description);
|
||||||
boost::program_options::notify(variables);
|
boost::program_options::notify(variables);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pGlobal != pUser && pGlobal != pLocal)
|
||||||
|
{
|
||||||
loadConfig(mFixedPath.getGlobalConfigPath(), variables, description);
|
loadConfig(mFixedPath.getGlobalConfigPath(), variables, description);
|
||||||
boost::program_options::notify(variables);
|
boost::program_options::notify(variables);
|
||||||
|
}
|
||||||
mSilent = silent;
|
mSilent = silent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue