diff --git a/apps/opencs/CMakeLists.txt b/apps/opencs/CMakeLists.txt index a719750c6..00547a2ba 100644 --- a/apps/opencs/CMakeLists.txt +++ b/apps/opencs/CMakeLists.txt @@ -64,7 +64,7 @@ opencs_units (view/world opencs_units_noqt (view/world dialoguesubview subviews - enumdelegate vartypedelegate recordstatusdelegate refidtypedelegate datadisplaydelegate + enumdelegate vartypedelegate recordstatusdelegate idtypedelegate datadisplaydelegate scripthighlighter idvalidator ) diff --git a/apps/opencs/model/tools/birthsigncheck.cpp b/apps/opencs/model/tools/birthsigncheck.cpp index b673c93de..59c65086e 100644 --- a/apps/opencs/model/tools/birthsigncheck.cpp +++ b/apps/opencs/model/tools/birthsigncheck.cpp @@ -19,7 +19,12 @@ int CSMTools::BirthsignCheckStage::setup() void CSMTools::BirthsignCheckStage::perform (int stage, std::vector& messages) { - const ESM::BirthSign& birthsign = mBirthsigns.getRecord (stage).get(); + const CSMWorld::Record& record = mBirthsigns.getRecord (stage); + + if (record.isDeleted()) + return; + + const ESM::BirthSign& birthsign = record.get(); CSMWorld::UniversalId id (CSMWorld::UniversalId::Type_Birthsign, birthsign.mId); diff --git a/apps/opencs/model/tools/classcheck.cpp b/apps/opencs/model/tools/classcheck.cpp index da2e9f19a..6923b3153 100644 --- a/apps/opencs/model/tools/classcheck.cpp +++ b/apps/opencs/model/tools/classcheck.cpp @@ -20,7 +20,12 @@ int CSMTools::ClassCheckStage::setup() void CSMTools::ClassCheckStage::perform (int stage, std::vector& messages) { - const ESM::Class& class_= mClasses.getRecord (stage).get(); + const CSMWorld::Record& record = mClasses.getRecord (stage); + + if (record.isDeleted()) + return; + + const ESM::Class& class_ = record.get(); CSMWorld::UniversalId id (CSMWorld::UniversalId::Type_Class, class_.mId); diff --git a/apps/opencs/model/tools/factioncheck.cpp b/apps/opencs/model/tools/factioncheck.cpp index af26904ef..c219e5610 100644 --- a/apps/opencs/model/tools/factioncheck.cpp +++ b/apps/opencs/model/tools/factioncheck.cpp @@ -20,7 +20,12 @@ int CSMTools::FactionCheckStage::setup() void CSMTools::FactionCheckStage::perform (int stage, std::vector& messages) { - const ESM::Faction& faction = mFactions.getRecord (stage).get(); + const CSMWorld::Record& record = mFactions.getRecord (stage); + + if (record.isDeleted()) + return; + + const ESM::Faction& faction = record.get(); CSMWorld::UniversalId id (CSMWorld::UniversalId::Type_Faction, faction.mId); diff --git a/apps/opencs/model/tools/racecheck.cpp b/apps/opencs/model/tools/racecheck.cpp index 1e7a4cab4..413de5ef0 100644 --- a/apps/opencs/model/tools/racecheck.cpp +++ b/apps/opencs/model/tools/racecheck.cpp @@ -9,7 +9,12 @@ void CSMTools::RaceCheckStage::performPerRecord (int stage, std::vector& messages) { - const ESM::Race& race = mRaces.getRecord (stage).get(); + const CSMWorld::Record& record = mRaces.getRecord (stage); + + if (record.isDeleted()) + return; + + const ESM::Race& race = record.get(); CSMWorld::UniversalId id (CSMWorld::UniversalId::Type_Race, race.mId); diff --git a/apps/opencs/model/tools/regioncheck.cpp b/apps/opencs/model/tools/regioncheck.cpp index ac64ac027..4398e00ef 100644 --- a/apps/opencs/model/tools/regioncheck.cpp +++ b/apps/opencs/model/tools/regioncheck.cpp @@ -19,7 +19,12 @@ int CSMTools::RegionCheckStage::setup() void CSMTools::RegionCheckStage::perform (int stage, std::vector& messages) { - const ESM::Region& region = mRegions.getRecord (stage).get(); + const CSMWorld::Record& record = mRegions.getRecord (stage); + + if (record.isDeleted()) + return; + + const ESM::Region& region = record.get(); CSMWorld::UniversalId id (CSMWorld::UniversalId::Type_Region, region.mId); diff --git a/apps/opencs/model/tools/skillcheck.cpp b/apps/opencs/model/tools/skillcheck.cpp index 897aeab47..28fc24fd3 100644 --- a/apps/opencs/model/tools/skillcheck.cpp +++ b/apps/opencs/model/tools/skillcheck.cpp @@ -18,7 +18,12 @@ int CSMTools::SkillCheckStage::setup() void CSMTools::SkillCheckStage::perform (int stage, std::vector& messages) { - const ESM::Skill& skill = mSkills.getRecord (stage).get(); + const CSMWorld::Record& record = mSkills.getRecord (stage); + + if (record.isDeleted()) + return; + + const ESM::Skill& skill = record.get(); CSMWorld::UniversalId id (CSMWorld::UniversalId::Type_Skill, skill.mId); diff --git a/apps/opencs/model/tools/soundcheck.cpp b/apps/opencs/model/tools/soundcheck.cpp index 52834e659..dce2d2b6f 100644 --- a/apps/opencs/model/tools/soundcheck.cpp +++ b/apps/opencs/model/tools/soundcheck.cpp @@ -18,7 +18,12 @@ int CSMTools::SoundCheckStage::setup() void CSMTools::SoundCheckStage::perform (int stage, std::vector& messages) { - const ESM::Sound& sound = mSounds.getRecord (stage).get(); + const CSMWorld::Record& record = mSounds.getRecord (stage); + + if (record.isDeleted()) + return; + + const ESM::Sound& sound = record.get(); CSMWorld::UniversalId id (CSMWorld::UniversalId::Type_Sound, sound.mId); diff --git a/apps/opencs/model/tools/spellcheck.cpp b/apps/opencs/model/tools/spellcheck.cpp index 3adee0a4e..a2cc7c8d2 100644 --- a/apps/opencs/model/tools/spellcheck.cpp +++ b/apps/opencs/model/tools/spellcheck.cpp @@ -19,7 +19,12 @@ int CSMTools::SpellCheckStage::setup() void CSMTools::SpellCheckStage::perform (int stage, std::vector& messages) { - const ESM::Spell& spell = mSpells.getRecord (stage).get(); + const CSMWorld::Record& record = mSpells.getRecord (stage); + + if (record.isDeleted()) + return; + + const ESM::Spell& spell = record.get(); CSMWorld::UniversalId id (CSMWorld::UniversalId::Type_Spell, spell.mId); diff --git a/apps/opencs/model/world/columnimp.hpp b/apps/opencs/model/world/columnimp.hpp index 1a2bf9df1..a13ac9a8a 100644 --- a/apps/opencs/model/world/columnimp.hpp +++ b/apps/opencs/model/world/columnimp.hpp @@ -1216,6 +1216,74 @@ namespace CSMWorld return true; } }; + + template + struct PosColumn : public Column + { + ESM::Position ESXRecordT::* mPosition; + int mIndex; + + PosColumn (ESM::Position ESXRecordT::* position, int index, bool door) + : Column ( + (door ? Columns::ColumnId_DoorPositionXPos : Columns::ColumnId_PositionXPos)+index, + ColumnBase::Display_Float), mPosition (position), mIndex (index) {} + + virtual QVariant get (const Record& record) const + { + const ESM::Position& position = record.get().*mPosition; + return position.pos[mIndex]; + } + + virtual void set (Record& record, const QVariant& data) + { + ESXRecordT record2 = record.get(); + + ESM::Position& position = record.get().*mPosition; + + position.pos[mIndex] = data.toFloat(); + + record.setModified (record2); + } + + virtual bool isEditable() const + { + return true; + } + }; + + template + struct RotColumn : public Column + { + ESM::Position ESXRecordT::* mPosition; + int mIndex; + + RotColumn (ESM::Position ESXRecordT::* position, int index, bool door) + : Column ( + (door ? Columns::ColumnId_DoorPositionXRot : Columns::ColumnId_PositionXRot)+index, + ColumnBase::Display_Float), mPosition (position), mIndex (index) {} + + virtual QVariant get (const Record& record) const + { + const ESM::Position& position = record.get().*mPosition; + return position.rot[mIndex]; + } + + virtual void set (Record& record, const QVariant& data) + { + ESXRecordT record2 = record.get(); + + ESM::Position& position = record.get().*mPosition; + + position.rot[mIndex] = data.toFloat(); + + record.setModified (record2); + } + + virtual bool isEditable() const + { + return true; + } + }; } #endif diff --git a/apps/opencs/model/world/columns.cpp b/apps/opencs/model/world/columns.cpp index 5616a4a48..25047807a 100644 --- a/apps/opencs/model/world/columns.cpp +++ b/apps/opencs/model/world/columns.cpp @@ -147,6 +147,18 @@ namespace CSMWorld { ColumnId_Magical, "Magical" }, { ColumnId_Silver, "Silver" }, { ColumnId_Filter, "Filter" }, + { ColumnId_PositionXPos, "Pos X" }, + { ColumnId_PositionYPos, "Pos Y" }, + { ColumnId_PositionZPos, "Pos Z" }, + { ColumnId_PositionXRot, "Rot X" }, + { ColumnId_PositionYRot, "Rot Y" }, + { ColumnId_PositionZRot, "Rot Z" }, + { ColumnId_DoorPositionXPos, "Teleport Pos X" }, + { ColumnId_DoorPositionYPos, "Teleport Pos Y" }, + { ColumnId_DoorPositionZPos, "Teleport Pos Z" }, + { ColumnId_DoorPositionXRot, "Teleport Rot X" }, + { ColumnId_DoorPositionYRot, "Teleport Rot Y" }, + { ColumnId_DoorPositionZRot, "Teleport Rot Z" }, { ColumnId_UseValue1, "Use value 1" }, { ColumnId_UseValue2, "Use value 2" }, diff --git a/apps/opencs/model/world/columns.hpp b/apps/opencs/model/world/columns.hpp index 69b20583a..582f5102b 100644 --- a/apps/opencs/model/world/columns.hpp +++ b/apps/opencs/model/world/columns.hpp @@ -140,6 +140,18 @@ namespace CSMWorld ColumnId_Magical = 107, ColumnId_Silver = 108, ColumnId_Filter = 109, + ColumnId_PositionXPos = 110, + ColumnId_PositionYPos = 111, + ColumnId_PositionZPos = 112, + ColumnId_PositionXRot = 113, + ColumnId_PositionYRot = 114, + ColumnId_PositionZRot = 115, + ColumnId_DoorPositionXPos = 116, + ColumnId_DoorPositionYPos = 117, + ColumnId_DoorPositionZPos = 118, + ColumnId_DoorPositionXRot = 119, + ColumnId_DoorPositionYRot = 120, + ColumnId_DoorPositionZRot = 121, // Allocated to a separate value range, so we don't get a collision should we ever need // to extend the number of use values. diff --git a/apps/opencs/model/world/data.cpp b/apps/opencs/model/world/data.cpp index 7eb96a5c3..1e290d45f 100644 --- a/apps/opencs/model/world/data.cpp +++ b/apps/opencs/model/world/data.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include "idtable.hpp" #include "columnimp.hpp" @@ -153,6 +154,12 @@ CSMWorld::Data::Data() : mRefs (mCells) mRefs.addColumn (new RecordStateColumn); mRefs.addColumn (new CellColumn); mRefs.addColumn (new IdColumn); + mRefs.addColumn (new PosColumn (&CellRef::mPos, 0, false)); + mRefs.addColumn (new PosColumn (&CellRef::mPos, 1, false)); + mRefs.addColumn (new PosColumn (&CellRef::mPos, 2, false)); + mRefs.addColumn (new RotColumn (&CellRef::mPos, 0, false)); + mRefs.addColumn (new RotColumn (&CellRef::mPos, 1, false)); + mRefs.addColumn (new RotColumn (&CellRef::mPos, 2, false)); mRefs.addColumn (new ScaleColumn); mRefs.addColumn (new OwnerColumn); mRefs.addColumn (new SoulColumn); @@ -163,6 +170,12 @@ CSMWorld::Data::Data() : mRefs (mCells) mRefs.addColumn (new GoldValueColumn); mRefs.addColumn (new TeleportColumn); mRefs.addColumn (new TeleportCellColumn); + mRefs.addColumn (new PosColumn (&CellRef::mDoorDest, 0, true)); + mRefs.addColumn (new PosColumn (&CellRef::mDoorDest, 1, true)); + mRefs.addColumn (new PosColumn (&CellRef::mDoorDest, 2, true)); + mRefs.addColumn (new RotColumn (&CellRef::mDoorDest, 0, true)); + mRefs.addColumn (new RotColumn (&CellRef::mDoorDest, 1, true)); + mRefs.addColumn (new RotColumn (&CellRef::mDoorDest, 2, true)); mRefs.addColumn (new LockLevelColumn); mRefs.addColumn (new KeyColumn); mRefs.addColumn (new TrapColumn); diff --git a/apps/opencs/model/world/universalid.cpp b/apps/opencs/model/world/universalid.cpp index d360fde8f..60a8485f8 100644 --- a/apps/opencs/model/world/universalid.cpp +++ b/apps/opencs/model/world/universalid.cpp @@ -43,18 +43,18 @@ namespace static const TypeData sIdArg[] = { - { CSMWorld::UniversalId::Class_Record, CSMWorld::UniversalId::Type_Global, "Global Variable", 0 }, - { CSMWorld::UniversalId::Class_Record, CSMWorld::UniversalId::Type_Gmst, "Game Setting", 0 }, - { CSMWorld::UniversalId::Class_Record, CSMWorld::UniversalId::Type_Skill, "Skill", 0 }, - { CSMWorld::UniversalId::Class_Record, CSMWorld::UniversalId::Type_Class, "Class", 0 }, - { CSMWorld::UniversalId::Class_Record, CSMWorld::UniversalId::Type_Faction, "Faction", 0 }, - { CSMWorld::UniversalId::Class_Record, CSMWorld::UniversalId::Type_Race, "Race", 0 }, - { CSMWorld::UniversalId::Class_Record, CSMWorld::UniversalId::Type_Sound, "Sound", 0 }, - { CSMWorld::UniversalId::Class_Record, CSMWorld::UniversalId::Type_Script, "Script", 0 }, - { CSMWorld::UniversalId::Class_Record, CSMWorld::UniversalId::Type_Region, "Region", 0 }, - { CSMWorld::UniversalId::Class_Record, CSMWorld::UniversalId::Type_Birthsign, "Birthsign", 0 }, - { CSMWorld::UniversalId::Class_Record, CSMWorld::UniversalId::Type_Spell, "Spell", 0 }, - { CSMWorld::UniversalId::Class_Record, CSMWorld::UniversalId::Type_Cell, "Cell", 0 }, + { CSMWorld::UniversalId::Class_Record, CSMWorld::UniversalId::Type_Global, "Global Variable", ":./globvar.png" }, + { CSMWorld::UniversalId::Class_Record, CSMWorld::UniversalId::Type_Gmst, "Game Setting", ":./GMST.png" }, + { CSMWorld::UniversalId::Class_Record, CSMWorld::UniversalId::Type_Skill, "Skill", ":./skill.png" }, + { CSMWorld::UniversalId::Class_Record, CSMWorld::UniversalId::Type_Class, "Class", ":./class.png" }, + { CSMWorld::UniversalId::Class_Record, CSMWorld::UniversalId::Type_Faction, "Faction", ":./faction.png" }, + { CSMWorld::UniversalId::Class_Record, CSMWorld::UniversalId::Type_Race, "Race", ":./race.png" }, + { CSMWorld::UniversalId::Class_Record, CSMWorld::UniversalId::Type_Sound, "Sound", ":./sound.png" }, + { CSMWorld::UniversalId::Class_Record, CSMWorld::UniversalId::Type_Script, "Script", ":./script.png" }, + { CSMWorld::UniversalId::Class_Record, CSMWorld::UniversalId::Type_Region, "Region", ":./land.png" }, + { CSMWorld::UniversalId::Class_Record, CSMWorld::UniversalId::Type_Birthsign, "Birthsign", ":./birthsign.png" }, + { CSMWorld::UniversalId::Class_Record, CSMWorld::UniversalId::Type_Spell, "Spell", ":./spell.png" }, + { CSMWorld::UniversalId::Class_Record, CSMWorld::UniversalId::Type_Cell, "Cell", ":./cell.png" }, { CSMWorld::UniversalId::Class_Record, CSMWorld::UniversalId::Type_Referenceable, "Referenceables", 0 }, { CSMWorld::UniversalId::Class_RefRecord, CSMWorld::UniversalId::Type_Activator, "Activator", ":./activator.png" }, { CSMWorld::UniversalId::Class_RefRecord, CSMWorld::UniversalId::Type_Potion, "Potion", ":./potion.png" }, @@ -80,7 +80,7 @@ namespace { CSMWorld::UniversalId::Class_RefRecord, CSMWorld::UniversalId::Type_Static, "Static", ":./static.png" }, { CSMWorld::UniversalId::Class_RefRecord, CSMWorld::UniversalId::Type_Weapon, "Weapon", ":./weapon.png" }, { CSMWorld::UniversalId::Class_SubRecord, CSMWorld::UniversalId::Type_Reference, "Reference", 0 }, - { CSMWorld::UniversalId::Class_SubRecord, CSMWorld::UniversalId::Type_Filter, "Filter", 0 }, + { CSMWorld::UniversalId::Class_SubRecord, CSMWorld::UniversalId::Type_Filter, "Filter", ":./filter.png" }, { CSMWorld::UniversalId::Class_None, CSMWorld::UniversalId::Type_None, 0, 0 } // end marker }; diff --git a/apps/opencs/view/doc/viewmanager.cpp b/apps/opencs/view/doc/viewmanager.cpp index a5fe6d356..83cd93e5d 100644 --- a/apps/opencs/view/doc/viewmanager.cpp +++ b/apps/opencs/view/doc/viewmanager.cpp @@ -14,7 +14,7 @@ #include "../world/enumdelegate.hpp" #include "../world/vartypedelegate.hpp" #include "../world/recordstatusdelegate.hpp" -#include "../world/refidtypedelegate.hpp" +#include "../world/idtypedelegate.hpp" #include "../settings/usersettingsdialog.hpp" #include "view.hpp" @@ -56,7 +56,7 @@ CSVDoc::ViewManager::ViewManager (CSMDoc::DocumentManager& documentManager) new CSVWorld::RecordStatusDelegateFactory()); mDelegateFactories->add (CSMWorld::ColumnBase::Display_RefRecordType, - new CSVWorld::RefIdTypeDelegateFactory()); + new CSVWorld::IdTypeDelegateFactory()); struct Mapping { diff --git a/apps/opencs/view/tools/reportsubview.cpp b/apps/opencs/view/tools/reportsubview.cpp index fe1be85d7..182d1cdd6 100644 --- a/apps/opencs/view/tools/reportsubview.cpp +++ b/apps/opencs/view/tools/reportsubview.cpp @@ -6,6 +6,8 @@ #include "../../model/tools/reportmodel.hpp" +#include "../../view/world/idtypedelegate.hpp" + CSVTools::ReportSubView::ReportSubView (const CSMWorld::UniversalId& id, CSMDoc::Document& document) : CSVDoc::SubView (id), mModel (document.getReport (id)) { @@ -18,6 +20,11 @@ CSVTools::ReportSubView::ReportSubView (const CSMWorld::UniversalId& id, CSMDoc: mTable->setSelectionBehavior (QAbstractItemView::SelectRows); mTable->setSelectionMode (QAbstractItemView::ExtendedSelection); + mIdTypeDelegate = CSVWorld::IdTypeDelegateFactory().makeDelegate ( + document.getUndoStack(), this); + + mTable->setItemDelegateForColumn (0, mIdTypeDelegate); + connect (mTable, SIGNAL (doubleClicked (const QModelIndex&)), this, SLOT (show (const QModelIndex&))); } @@ -26,6 +33,11 @@ void CSVTools::ReportSubView::setEditLock (bool locked) // ignored. We don't change document state anyway. } +void CSVTools::ReportSubView::updateEditorSetting (const QString& key, const QString& value) +{ + mIdTypeDelegate->updateEditorSetting (key, value); +} + void CSVTools::ReportSubView::show (const QModelIndex& index) { focusId (mModel->getUniversalId (index.row())); diff --git a/apps/opencs/view/tools/reportsubview.hpp b/apps/opencs/view/tools/reportsubview.hpp index 626ceb663..6503ebd27 100644 --- a/apps/opencs/view/tools/reportsubview.hpp +++ b/apps/opencs/view/tools/reportsubview.hpp @@ -16,6 +16,11 @@ namespace CSMTools class ReportModel; } +namespace CSVWorld +{ + class CommandDelegate; +} + namespace CSVTools { class Table; @@ -26,6 +31,7 @@ namespace CSVTools CSMTools::ReportModel *mModel; QTableView *mTable; + CSVWorld::CommandDelegate *mIdTypeDelegate; public: @@ -33,6 +39,8 @@ namespace CSVTools virtual void setEditLock (bool locked); + virtual void updateEditorSetting (const QString&, const QString&); + private slots: void show (const QModelIndex& index); diff --git a/apps/opencs/view/world/idtypedelegate.cpp b/apps/opencs/view/world/idtypedelegate.cpp new file mode 100755 index 000000000..ce4e8f014 --- /dev/null +++ b/apps/opencs/view/world/idtypedelegate.cpp @@ -0,0 +1,46 @@ +#include "idtypedelegate.hpp" + +#include "../../model/world/universalid.hpp" + +CSVWorld::IdTypeDelegate::IdTypeDelegate + (const ValueList &values, const IconList &icons, QUndoStack& undoStack, QObject *parent) + : DataDisplayDelegate (values, icons, undoStack, parent) +{} + +bool CSVWorld::IdTypeDelegate::updateEditorSetting (const QString &settingName, const QString &settingValue) +{ + /// \todo make the setting key a member variable, that is initialised from a constructor argument + if (settingName == "Referenceable ID Type Display") + { + if (settingValue == "Icon and Text") + mDisplayMode = Mode_IconAndText; + + else if (settingValue == "Icon Only") + mDisplayMode = Mode_IconOnly; + + else if (settingValue == "Text Only") + mDisplayMode = Mode_TextOnly; + + return true; + } + + return false; +} + + +CSVWorld::IdTypeDelegateFactory::IdTypeDelegateFactory() +{ + for (int i=0; i (i)); + + DataDisplayDelegateFactory::add (id.getType(), QString::fromUtf8 (id.getTypeName().c_str()), + QString::fromUtf8 (id.getIcon().c_str())); + } +} + +CSVWorld::CommandDelegate *CSVWorld::IdTypeDelegateFactory::makeDelegate (QUndoStack& undoStack, + QObject *parent) const +{ + return new IdTypeDelegate (mValues, mIcons, undoStack, parent); +} diff --git a/apps/opencs/view/world/refidtypedelegate.hpp b/apps/opencs/view/world/idtypedelegate.hpp similarity index 51% rename from apps/opencs/view/world/refidtypedelegate.hpp rename to apps/opencs/view/world/idtypedelegate.hpp index 384aebb98..ea80fd0d9 100755 --- a/apps/opencs/view/world/refidtypedelegate.hpp +++ b/apps/opencs/view/world/idtypedelegate.hpp @@ -1,5 +1,5 @@ -#ifndef REFIDTYPEDELEGATE_HPP -#define REFIDTYPEDELEGATE_HPP +#ifndef IDTYPEDELEGATE_HPP +#define IDTYPEDELEGATE_HPP #include "enumdelegate.hpp" #include "util.hpp" @@ -8,29 +8,23 @@ namespace CSVWorld { - class RefIdTypeDelegate : public DataDisplayDelegate + class IdTypeDelegate : public DataDisplayDelegate { public: - RefIdTypeDelegate (const ValueList &mValues, const IconList &icons, QUndoStack& undoStack, QObject *parent); + IdTypeDelegate (const ValueList &mValues, const IconList &icons, QUndoStack& undoStack, QObject *parent); virtual bool updateEditorSetting (const QString &settingName, const QString &settingValue); }; - class RefIdTypeDelegateFactory : public DataDisplayDelegateFactory + class IdTypeDelegateFactory : public DataDisplayDelegateFactory { - - typedef std::vector < std::pair > UidTypeList; - public: - RefIdTypeDelegateFactory(); + + IdTypeDelegateFactory(); virtual CommandDelegate *makeDelegate (QUndoStack& undoStack, QObject *parent) const; ///< The ownership of the returned CommandDelegate is transferred to the caller. - - private: - UidTypeList buildUidTypeList () const; - }; } diff --git a/apps/opencs/view/world/refidtypedelegate.cpp b/apps/opencs/view/world/refidtypedelegate.cpp deleted file mode 100755 index 7cffbf3dd..000000000 --- a/apps/opencs/view/world/refidtypedelegate.cpp +++ /dev/null @@ -1,62 +0,0 @@ -#include "refidtypedelegate.hpp" - -#include "../../model/world/universalid.hpp" - -CSVWorld::RefIdTypeDelegate::RefIdTypeDelegate - (const ValueList &values, const IconList &icons, QUndoStack& undoStack, QObject *parent) - : DataDisplayDelegate (values, icons, undoStack, parent) -{} - -bool CSVWorld::RefIdTypeDelegate::updateEditorSetting (const QString &settingName, const QString &settingValue) -{ - if (settingName == "Referenceable ID Type Display") - { - if (settingValue == "Icon and Text") - mDisplayMode = Mode_IconAndText; - - else if (settingValue == "Icon Only") - mDisplayMode = Mode_IconOnly; - - else if (settingValue == "Text Only") - mDisplayMode = Mode_TextOnly; - - return true; - } - - return false; -} - - -CSVWorld::RefIdTypeDelegateFactory::RefIdTypeDelegateFactory() -{ - UidTypeList uIdList = buildUidTypeList(); - - for (UidTypeList::const_iterator it = uIdList.begin(); it != uIdList.end(); it++) - { - int i = it->first; - DataDisplayDelegateFactory::add (i, QString::fromStdString(CSMWorld::UniversalId(it->first, "").getTypeName()), it->second); - } -} - -CSVWorld::CommandDelegate *CSVWorld::RefIdTypeDelegateFactory::makeDelegate (QUndoStack& undoStack, - QObject *parent) const -{ - return new RefIdTypeDelegate (mValues, mIcons, undoStack, parent); -} - -CSVWorld::RefIdTypeDelegateFactory::UidTypeList CSVWorld::RefIdTypeDelegateFactory::buildUidTypeList() const -{ - UidTypeList list; - - std::vector types = CSMWorld::UniversalId::listReferenceableTypes(); - - for (std::vector::const_iterator iter (types.begin()); - iter!=types.end(); ++iter) - { - CSMWorld::UniversalId id (*iter, ""); - - list.push_back (std::make_pair (id.getType(), id.getIcon().c_str())); - } - - return list; -} diff --git a/apps/opencs/view/world/table.cpp b/apps/opencs/view/world/table.cpp index 72e78c738..6167c084a 100644 --- a/apps/opencs/view/world/table.cpp +++ b/apps/opencs/view/world/table.cpp @@ -12,8 +12,8 @@ #include "../../model/world/idtableproxymodel.hpp" #include "../../model/world/idtable.hpp" #include "../../model/world/record.hpp" + #include "recordstatusdelegate.hpp" -#include "refidtypedelegate.hpp" #include "util.hpp" void CSVWorld::Table::contextMenuEvent (QContextMenuEvent *event) diff --git a/apps/openmw/mwgui/mainmenu.cpp b/apps/openmw/mwgui/mainmenu.cpp index 88227c751..1db6e9ecd 100644 --- a/apps/openmw/mwgui/mainmenu.cpp +++ b/apps/openmw/mwgui/mainmenu.cpp @@ -70,7 +70,10 @@ namespace MWGui { MWBase::Environment::get().getSoundManager()->playSound("Menu Click", 1.f, 1.f); if (sender == mButtons["return"]) + { + MWBase::Environment::get().getSoundManager ()->resumeSounds (MWBase::SoundManager::Play_TypeSfx); MWBase::Environment::get().getWindowManager ()->removeGuiMode (GM_MainMenu); + } else if (sender == mButtons["options"]) MWBase::Environment::get().getWindowManager ()->pushGuiMode (GM_Settings); else if (sender == mButtons["exitgame"]) diff --git a/apps/openmw/mwinput/inputmanagerimp.cpp b/apps/openmw/mwinput/inputmanagerimp.cpp index 1039a0dce..43f2bcc15 100644 --- a/apps/openmw/mwinput/inputmanagerimp.cpp +++ b/apps/openmw/mwinput/inputmanagerimp.cpp @@ -577,15 +577,15 @@ namespace MWInput rot[0] = -y; rot[1] = 0.0f; rot[2] = x; - - // Only actually turn player when we're not in vanity mode + + // Only actually turn player when we're not in vanity mode if(!MWBase::Environment::get().getWorld()->vanityRotateCamera(rot)) { mPlayer->yaw(x/scale); mPlayer->pitch(-y/scale); } - if (arg.zrel) + if (arg.zrel && mControlSwitch["playerviewswitch"]) //Check to make sure you are allowed to zoomout and there is a change { MWBase::Environment::get().getWorld()->changeVanityModeScale(arg.zrel); MWBase::Environment::get().getWorld()->setCameraDistance(arg.zrel, true, true); @@ -617,9 +617,15 @@ namespace MWInput if (MWBase::Environment::get().getWindowManager()->isGuiMode () && MWBase::Environment::get().getWindowManager()->getMode () == MWGui::GM_Video) MWBase::Environment::get().getWorld ()->stopVideo (); else if (MWBase::Environment::get().getWindowManager()->containsMode(MWGui::GM_MainMenu)) + { MWBase::Environment::get().getWindowManager()->popGuiMode(); + MWBase::Environment::get().getSoundManager()->resumeSounds (MWBase::SoundManager::Play_TypeSfx); + } else + { MWBase::Environment::get().getWindowManager()->pushGuiMode (MWGui::GM_MainMenu); + MWBase::Environment::get().getSoundManager()->pauseSounds (MWBase::SoundManager::Play_TypeSfx); + } } void InputManager::toggleSpell() diff --git a/apps/openmw/mwmechanics/magiceffects.cpp b/apps/openmw/mwmechanics/magiceffects.cpp index 1a7b34817..3ed458c3f 100644 --- a/apps/openmw/mwmechanics/magiceffects.cpp +++ b/apps/openmw/mwmechanics/magiceffects.cpp @@ -151,8 +151,7 @@ namespace MWMechanics for (Collection::const_iterator iter (prev.begin()); iter!=prev.end(); ++iter) { Collection::const_iterator other = now.mCollection.find (iter->first); - - if (other==prev.end()) + if (other==now.end()) { result.add (iter->first, EffectParam() - iter->second); } diff --git a/components/nif/niffile.cpp b/components/nif/niffile.cpp index cb7c2feb0..402eadefb 100644 --- a/components/nif/niffile.cpp +++ b/components/nif/niffile.cpp @@ -425,7 +425,7 @@ void Node::getProperties(const Nif::NiTexturingProperty *&texprop, Ogre::Matrix4 Node::getLocalTransform() const { - Ogre::Matrix4 mat4(Ogre::Matrix4::IDENTITY); + Ogre::Matrix4 mat4 = Ogre::Matrix4(Ogre::Matrix4::IDENTITY); mat4.makeTransform(trafo.pos, Ogre::Vector3(trafo.scale), Ogre::Quaternion(trafo.rotation)); return mat4; } diff --git a/credits.txt b/credits.txt index 9a84c5327..6e8e36612 100644 --- a/credits.txt +++ b/credits.txt @@ -47,6 +47,7 @@ Marc Bouvier (CramitDeFrog) Marcin Hulist (Gohan) Mark Siewert (mark76) Mateusz Kołaczek (PL_kolek) +Michael Hogan (Xethik) Michael Mc Donnell Michael Papageorgiou (werdanith) Michał Bień (Glorf) @@ -61,6 +62,7 @@ Roman Proskuryakov (humbug) Sandy Carter (bwrsandman) Sebastian Wick (swick) Sergey Shambir +sir_herrbatka Sylvain Thesnieres (Garvek) Tom Mason (wheybags) Torben Leif Carrington (TorbenC) diff --git a/files/opencs/GMST.png b/files/opencs/GMST.png new file mode 100644 index 000000000..f24620288 Binary files /dev/null and b/files/opencs/GMST.png differ diff --git a/files/opencs/Info.png b/files/opencs/Info.png new file mode 100644 index 000000000..d7bdad6cb Binary files /dev/null and b/files/opencs/Info.png differ diff --git a/files/opencs/LandTexture.png b/files/opencs/LandTexture.png new file mode 100644 index 000000000..84f729098 Binary files /dev/null and b/files/opencs/LandTexture.png differ diff --git a/files/opencs/PathGrid.png b/files/opencs/PathGrid.png new file mode 100644 index 000000000..23b6b84d7 Binary files /dev/null and b/files/opencs/PathGrid.png differ diff --git a/files/opencs/activator.png b/files/opencs/activator.png old mode 100755 new mode 100644 index 0446af22c..32cc6f8a3 Binary files a/files/opencs/activator.png and b/files/opencs/activator.png differ diff --git a/files/opencs/added.png b/files/opencs/added.png index aff7e25d4..ddd9c2108 100644 Binary files a/files/opencs/added.png and b/files/opencs/added.png differ diff --git a/files/opencs/apparatus.png b/files/opencs/apparatus.png old mode 100755 new mode 100644 diff --git a/files/opencs/armor.png b/files/opencs/armor.png old mode 100755 new mode 100644 diff --git a/files/opencs/attribute.png b/files/opencs/attribute.png new file mode 100644 index 000000000..4aa5dc02e Binary files /dev/null and b/files/opencs/attribute.png differ diff --git a/files/opencs/birthsign.png b/files/opencs/birthsign.png new file mode 100644 index 000000000..8192d2ebf Binary files /dev/null and b/files/opencs/birthsign.png differ diff --git a/files/opencs/body-part.png b/files/opencs/body-part.png new file mode 100644 index 000000000..823e43712 Binary files /dev/null and b/files/opencs/body-part.png differ diff --git a/files/opencs/book.png b/files/opencs/book.png old mode 100755 new mode 100644 index 3afa9e8aa..9d7669bd7 Binary files a/files/opencs/book.png and b/files/opencs/book.png differ diff --git a/files/opencs/cell.png b/files/opencs/cell.png new file mode 100644 index 000000000..c4f00c1f0 Binary files /dev/null and b/files/opencs/cell.png differ diff --git a/files/opencs/class.png b/files/opencs/class.png new file mode 100644 index 000000000..316380363 Binary files /dev/null and b/files/opencs/class.png differ diff --git a/files/opencs/clothing.png b/files/opencs/clothing.png old mode 100755 new mode 100644 diff --git a/files/opencs/container.png b/files/opencs/container.png old mode 100755 new mode 100644 diff --git a/files/opencs/creature.png b/files/opencs/creature.png old mode 100755 new mode 100644 diff --git a/files/opencs/dialogoue-info.png b/files/opencs/dialogoue-info.png new file mode 100644 index 000000000..f6743d43c Binary files /dev/null and b/files/opencs/dialogoue-info.png differ diff --git a/files/opencs/dialogoue-journal.png b/files/opencs/dialogoue-journal.png new file mode 100644 index 000000000..b6a95c538 Binary files /dev/null and b/files/opencs/dialogoue-journal.png differ diff --git a/files/opencs/dialogoue-regular.png b/files/opencs/dialogoue-regular.png new file mode 100644 index 000000000..f9b8d252d Binary files /dev/null and b/files/opencs/dialogoue-regular.png differ diff --git a/files/opencs/dialogue-greeting.png b/files/opencs/dialogue-greeting.png new file mode 100644 index 000000000..a35e1fe6d Binary files /dev/null and b/files/opencs/dialogue-greeting.png differ diff --git a/files/opencs/dialogue-persuasion.png b/files/opencs/dialogue-persuasion.png new file mode 100644 index 000000000..5bc5d6113 Binary files /dev/null and b/files/opencs/dialogue-persuasion.png differ diff --git a/files/opencs/dialogue-speech.png b/files/opencs/dialogue-speech.png new file mode 100644 index 000000000..11eb9f1ca Binary files /dev/null and b/files/opencs/dialogue-speech.png differ diff --git a/files/opencs/door.png b/files/opencs/door.png old mode 100755 new mode 100644 diff --git a/files/opencs/enchantment.png b/files/opencs/enchantment.png new file mode 100644 index 000000000..c90fb27ce Binary files /dev/null and b/files/opencs/enchantment.png differ diff --git a/files/opencs/faction.png b/files/opencs/faction.png new file mode 100644 index 000000000..8ac1f5200 Binary files /dev/null and b/files/opencs/faction.png differ diff --git a/files/opencs/filter.png b/files/opencs/filter.png new file mode 100644 index 000000000..94a57ecd9 Binary files /dev/null and b/files/opencs/filter.png differ diff --git a/files/opencs/globvar.png b/files/opencs/globvar.png new file mode 100644 index 000000000..646145f0f Binary files /dev/null and b/files/opencs/globvar.png differ diff --git a/files/opencs/ingredient.png b/files/opencs/ingredient.png old mode 100755 new mode 100644 index 6b36d008d..564a93047 Binary files a/files/opencs/ingredient.png and b/files/opencs/ingredient.png differ diff --git a/files/opencs/land.png b/files/opencs/land.png new file mode 100644 index 000000000..20dd321dd Binary files /dev/null and b/files/opencs/land.png differ diff --git a/files/opencs/landpaint.png b/files/opencs/landpaint.png new file mode 100644 index 000000000..711c0d8f5 Binary files /dev/null and b/files/opencs/landpaint.png differ diff --git a/files/opencs/leveled-creature.png b/files/opencs/leveled-creature.png old mode 100755 new mode 100644 diff --git a/files/opencs/light.png b/files/opencs/light.png old mode 100755 new mode 100644 index c606fcd98..2765ef1d3 Binary files a/files/opencs/light.png and b/files/opencs/light.png differ diff --git a/files/opencs/lockpick.png b/files/opencs/lockpick.png old mode 100755 new mode 100644 diff --git a/files/opencs/magic-effect.png b/files/opencs/magic-effect.png new file mode 100644 index 000000000..e672ffccb Binary files /dev/null and b/files/opencs/magic-effect.png differ diff --git a/files/opencs/magicrabbit.png b/files/opencs/magicrabbit.png new file mode 100644 index 000000000..d1d7c8270 Binary files /dev/null and b/files/opencs/magicrabbit.png differ diff --git a/files/opencs/map.png b/files/opencs/map.png new file mode 100644 index 000000000..3653797cc Binary files /dev/null and b/files/opencs/map.png differ diff --git a/files/opencs/miscellaneous.png b/files/opencs/miscellaneous.png old mode 100755 new mode 100644 diff --git a/files/opencs/modified.png b/files/opencs/modified.png index d15ad827c..39bd182ac 100644 Binary files a/files/opencs/modified.png and b/files/opencs/modified.png differ diff --git a/files/opencs/npc.png b/files/opencs/npc.png old mode 100755 new mode 100644 diff --git a/files/opencs/potion.png b/files/opencs/potion.png old mode 100755 new mode 100644 diff --git a/files/opencs/probe.png b/files/opencs/probe.png old mode 100755 new mode 100644 diff --git a/files/opencs/race.png b/files/opencs/race.png new file mode 100644 index 000000000..94a2de696 Binary files /dev/null and b/files/opencs/race.png differ diff --git a/files/opencs/random-item.png b/files/opencs/random-item.png new file mode 100644 index 000000000..7b8e68e60 Binary files /dev/null and b/files/opencs/random-item.png differ diff --git a/files/opencs/random.png b/files/opencs/random.png new file mode 100644 index 000000000..2667630f5 Binary files /dev/null and b/files/opencs/random.png differ diff --git a/files/opencs/removed.png b/files/opencs/removed.png index 2ca9e094b..2354bc743 100644 Binary files a/files/opencs/removed.png and b/files/opencs/removed.png differ diff --git a/files/opencs/repair.png b/files/opencs/repair.png old mode 100755 new mode 100644 diff --git a/files/opencs/resources.qrc b/files/opencs/resources.qrc index 56e25b2c1..eadcf9697 100644 --- a/files/opencs/resources.qrc +++ b/files/opencs/resources.qrc @@ -1,30 +1,61 @@ opencs.png - added.png - modified.png - removed.png - base.png activator.png - apparatus.png - armor.png - book.png - clothing.png - container.png - creature.png - door.png - ingredient.png - leveled-creature.png - leveled-item.png - light.png - lockpick.png - miscellaneous.png - npc.png - potion.png - probe.png - repair.png - static.png - weapon.png + added.png + apparatus.png + armor.png + attribute.png + base.png + birthsign.png + body-part.png + book.png + cell.png + class.png + clothing.png + container.png + creature.png + dialogoue-info.png + dialogoue-journal.png + dialogoue-regular.png + dialogue-greeting.png + dialogue-persuasion.png + dialogue-speech.png + door.png + enchantment.png + faction.png + filter.png + globvar.png + GMST.png + Info.png + ingredient.png + landpaint.png + land.png + LandTexture.png + leveled-creature.png + light.png + lockpick.png + magic-effect.png + magicrabbit.png + map.png + miscellaneous.png + modified.png + npc.png + PathGrid.png + potion.png + probe.png + race.png + random-item.png + random.png + removed.png + repair.png + script.png + skill.png + soundgen.png + sound.png + spell.png + static.png + weapon.png raster/startup/big/create-addon.png raster/startup/big/new-game.png raster/startup/big/edit-content.png diff --git a/files/opencs/script.png b/files/opencs/script.png new file mode 100644 index 000000000..297da4021 Binary files /dev/null and b/files/opencs/script.png differ diff --git a/files/opencs/skill.png b/files/opencs/skill.png new file mode 100644 index 000000000..418f4f35c Binary files /dev/null and b/files/opencs/skill.png differ diff --git a/files/opencs/sound.png b/files/opencs/sound.png new file mode 100644 index 000000000..b072acf76 Binary files /dev/null and b/files/opencs/sound.png differ diff --git a/files/opencs/soundgen.png b/files/opencs/soundgen.png new file mode 100644 index 000000000..222fc4c7f Binary files /dev/null and b/files/opencs/soundgen.png differ diff --git a/files/opencs/spell.png b/files/opencs/spell.png new file mode 100644 index 000000000..69c897180 Binary files /dev/null and b/files/opencs/spell.png differ diff --git a/files/opencs/static.png b/files/opencs/static.png old mode 100755 new mode 100644 index b53be12d9..aedf2d30e Binary files a/files/opencs/static.png and b/files/opencs/static.png differ diff --git a/files/opencs/weapon.png b/files/opencs/weapon.png old mode 100755 new mode 100644 diff --git a/issue912 b/issue912 new file mode 100644 index 000000000..604cc392c --- /dev/null +++ b/issue912 @@ -0,0 +1 @@ +branch for issue912