Merge branch 'master' into tgm
|
@ -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
|
||||
)
|
||||
|
||||
|
|
|
@ -19,7 +19,12 @@ int CSMTools::BirthsignCheckStage::setup()
|
|||
|
||||
void CSMTools::BirthsignCheckStage::perform (int stage, std::vector<std::string>& messages)
|
||||
{
|
||||
const ESM::BirthSign& birthsign = mBirthsigns.getRecord (stage).get();
|
||||
const CSMWorld::Record<ESM::BirthSign>& record = mBirthsigns.getRecord (stage);
|
||||
|
||||
if (record.isDeleted())
|
||||
return;
|
||||
|
||||
const ESM::BirthSign& birthsign = record.get();
|
||||
|
||||
CSMWorld::UniversalId id (CSMWorld::UniversalId::Type_Birthsign, birthsign.mId);
|
||||
|
||||
|
|
|
@ -20,7 +20,12 @@ int CSMTools::ClassCheckStage::setup()
|
|||
|
||||
void CSMTools::ClassCheckStage::perform (int stage, std::vector<std::string>& messages)
|
||||
{
|
||||
const ESM::Class& class_= mClasses.getRecord (stage).get();
|
||||
const CSMWorld::Record<ESM::Class>& record = mClasses.getRecord (stage);
|
||||
|
||||
if (record.isDeleted())
|
||||
return;
|
||||
|
||||
const ESM::Class& class_ = record.get();
|
||||
|
||||
CSMWorld::UniversalId id (CSMWorld::UniversalId::Type_Class, class_.mId);
|
||||
|
||||
|
|
|
@ -20,7 +20,12 @@ int CSMTools::FactionCheckStage::setup()
|
|||
|
||||
void CSMTools::FactionCheckStage::perform (int stage, std::vector<std::string>& messages)
|
||||
{
|
||||
const ESM::Faction& faction = mFactions.getRecord (stage).get();
|
||||
const CSMWorld::Record<ESM::Faction>& record = mFactions.getRecord (stage);
|
||||
|
||||
if (record.isDeleted())
|
||||
return;
|
||||
|
||||
const ESM::Faction& faction = record.get();
|
||||
|
||||
CSMWorld::UniversalId id (CSMWorld::UniversalId::Type_Faction, faction.mId);
|
||||
|
||||
|
|
|
@ -9,7 +9,12 @@
|
|||
|
||||
void CSMTools::RaceCheckStage::performPerRecord (int stage, std::vector<std::string>& messages)
|
||||
{
|
||||
const ESM::Race& race = mRaces.getRecord (stage).get();
|
||||
const CSMWorld::Record<ESM::Race>& record = mRaces.getRecord (stage);
|
||||
|
||||
if (record.isDeleted())
|
||||
return;
|
||||
|
||||
const ESM::Race& race = record.get();
|
||||
|
||||
CSMWorld::UniversalId id (CSMWorld::UniversalId::Type_Race, race.mId);
|
||||
|
||||
|
|
|
@ -19,7 +19,12 @@ int CSMTools::RegionCheckStage::setup()
|
|||
|
||||
void CSMTools::RegionCheckStage::perform (int stage, std::vector<std::string>& messages)
|
||||
{
|
||||
const ESM::Region& region = mRegions.getRecord (stage).get();
|
||||
const CSMWorld::Record<ESM::Region>& record = mRegions.getRecord (stage);
|
||||
|
||||
if (record.isDeleted())
|
||||
return;
|
||||
|
||||
const ESM::Region& region = record.get();
|
||||
|
||||
CSMWorld::UniversalId id (CSMWorld::UniversalId::Type_Region, region.mId);
|
||||
|
||||
|
|
|
@ -18,7 +18,12 @@ int CSMTools::SkillCheckStage::setup()
|
|||
|
||||
void CSMTools::SkillCheckStage::perform (int stage, std::vector<std::string>& messages)
|
||||
{
|
||||
const ESM::Skill& skill = mSkills.getRecord (stage).get();
|
||||
const CSMWorld::Record<ESM::Skill>& record = mSkills.getRecord (stage);
|
||||
|
||||
if (record.isDeleted())
|
||||
return;
|
||||
|
||||
const ESM::Skill& skill = record.get();
|
||||
|
||||
CSMWorld::UniversalId id (CSMWorld::UniversalId::Type_Skill, skill.mId);
|
||||
|
||||
|
|
|
@ -18,7 +18,12 @@ int CSMTools::SoundCheckStage::setup()
|
|||
|
||||
void CSMTools::SoundCheckStage::perform (int stage, std::vector<std::string>& messages)
|
||||
{
|
||||
const ESM::Sound& sound = mSounds.getRecord (stage).get();
|
||||
const CSMWorld::Record<ESM::Sound>& record = mSounds.getRecord (stage);
|
||||
|
||||
if (record.isDeleted())
|
||||
return;
|
||||
|
||||
const ESM::Sound& sound = record.get();
|
||||
|
||||
CSMWorld::UniversalId id (CSMWorld::UniversalId::Type_Sound, sound.mId);
|
||||
|
||||
|
|
|
@ -19,7 +19,12 @@ int CSMTools::SpellCheckStage::setup()
|
|||
|
||||
void CSMTools::SpellCheckStage::perform (int stage, std::vector<std::string>& messages)
|
||||
{
|
||||
const ESM::Spell& spell = mSpells.getRecord (stage).get();
|
||||
const CSMWorld::Record<ESM::Spell>& record = mSpells.getRecord (stage);
|
||||
|
||||
if (record.isDeleted())
|
||||
return;
|
||||
|
||||
const ESM::Spell& spell = record.get();
|
||||
|
||||
CSMWorld::UniversalId id (CSMWorld::UniversalId::Type_Spell, spell.mId);
|
||||
|
||||
|
|
|
@ -1216,6 +1216,74 @@ namespace CSMWorld
|
|||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
template<typename ESXRecordT>
|
||||
struct PosColumn : public Column<ESXRecordT>
|
||||
{
|
||||
ESM::Position ESXRecordT::* mPosition;
|
||||
int mIndex;
|
||||
|
||||
PosColumn (ESM::Position ESXRecordT::* position, int index, bool door)
|
||||
: Column<ESXRecordT> (
|
||||
(door ? Columns::ColumnId_DoorPositionXPos : Columns::ColumnId_PositionXPos)+index,
|
||||
ColumnBase::Display_Float), mPosition (position), mIndex (index) {}
|
||||
|
||||
virtual QVariant get (const Record<ESXRecordT>& record) const
|
||||
{
|
||||
const ESM::Position& position = record.get().*mPosition;
|
||||
return position.pos[mIndex];
|
||||
}
|
||||
|
||||
virtual void set (Record<ESXRecordT>& 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<typename ESXRecordT>
|
||||
struct RotColumn : public Column<ESXRecordT>
|
||||
{
|
||||
ESM::Position ESXRecordT::* mPosition;
|
||||
int mIndex;
|
||||
|
||||
RotColumn (ESM::Position ESXRecordT::* position, int index, bool door)
|
||||
: Column<ESXRecordT> (
|
||||
(door ? Columns::ColumnId_DoorPositionXRot : Columns::ColumnId_PositionXRot)+index,
|
||||
ColumnBase::Display_Float), mPosition (position), mIndex (index) {}
|
||||
|
||||
virtual QVariant get (const Record<ESXRecordT>& record) const
|
||||
{
|
||||
const ESM::Position& position = record.get().*mPosition;
|
||||
return position.rot[mIndex];
|
||||
}
|
||||
|
||||
virtual void set (Record<ESXRecordT>& 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
|
||||
|
|
|
@ -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" },
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include <components/esm/esmreader.hpp>
|
||||
#include <components/esm/defs.hpp>
|
||||
#include <components/esm/loadglob.hpp>
|
||||
#include <components/esm/cellref.hpp>
|
||||
|
||||
#include "idtable.hpp"
|
||||
#include "columnimp.hpp"
|
||||
|
@ -153,6 +154,12 @@ CSMWorld::Data::Data() : mRefs (mCells)
|
|||
mRefs.addColumn (new RecordStateColumn<CellRef>);
|
||||
mRefs.addColumn (new CellColumn<CellRef>);
|
||||
mRefs.addColumn (new IdColumn<CellRef>);
|
||||
mRefs.addColumn (new PosColumn<CellRef> (&CellRef::mPos, 0, false));
|
||||
mRefs.addColumn (new PosColumn<CellRef> (&CellRef::mPos, 1, false));
|
||||
mRefs.addColumn (new PosColumn<CellRef> (&CellRef::mPos, 2, false));
|
||||
mRefs.addColumn (new RotColumn<CellRef> (&CellRef::mPos, 0, false));
|
||||
mRefs.addColumn (new RotColumn<CellRef> (&CellRef::mPos, 1, false));
|
||||
mRefs.addColumn (new RotColumn<CellRef> (&CellRef::mPos, 2, false));
|
||||
mRefs.addColumn (new ScaleColumn<CellRef>);
|
||||
mRefs.addColumn (new OwnerColumn<CellRef>);
|
||||
mRefs.addColumn (new SoulColumn<CellRef>);
|
||||
|
@ -163,6 +170,12 @@ CSMWorld::Data::Data() : mRefs (mCells)
|
|||
mRefs.addColumn (new GoldValueColumn<CellRef>);
|
||||
mRefs.addColumn (new TeleportColumn<CellRef>);
|
||||
mRefs.addColumn (new TeleportCellColumn<CellRef>);
|
||||
mRefs.addColumn (new PosColumn<CellRef> (&CellRef::mDoorDest, 0, true));
|
||||
mRefs.addColumn (new PosColumn<CellRef> (&CellRef::mDoorDest, 1, true));
|
||||
mRefs.addColumn (new PosColumn<CellRef> (&CellRef::mDoorDest, 2, true));
|
||||
mRefs.addColumn (new RotColumn<CellRef> (&CellRef::mDoorDest, 0, true));
|
||||
mRefs.addColumn (new RotColumn<CellRef> (&CellRef::mDoorDest, 1, true));
|
||||
mRefs.addColumn (new RotColumn<CellRef> (&CellRef::mDoorDest, 2, true));
|
||||
mRefs.addColumn (new LockLevelColumn<CellRef>);
|
||||
mRefs.addColumn (new KeyColumn<CellRef>);
|
||||
mRefs.addColumn (new TrapColumn<CellRef>);
|
||||
|
|
|
@ -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
|
||||
};
|
||||
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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()));
|
||||
|
|
|
@ -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);
|
||||
|
|
46
apps/opencs/view/world/idtypedelegate.cpp
Executable file
|
@ -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<CSMWorld::UniversalId::NumberOfTypes; ++i)
|
||||
{
|
||||
CSMWorld::UniversalId id (static_cast<CSMWorld::UniversalId::Type> (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);
|
||||
}
|
|
@ -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 <CSMWorld::UniversalId::Type, QString> > 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;
|
||||
|
||||
};
|
||||
}
|
||||
|
|
@ -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<CSMWorld::UniversalId::Type> types = CSMWorld::UniversalId::listReferenceableTypes();
|
||||
|
||||
for (std::vector<CSMWorld::UniversalId::Type>::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;
|
||||
}
|
|
@ -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)
|
||||
|
|
|
@ -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"])
|
||||
|
|
|
@ -585,7 +585,7 @@ namespace MWInput
|
|||
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()
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
BIN
files/opencs/GMST.png
Normal file
After Width: | Height: | Size: 820 B |
BIN
files/opencs/Info.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
files/opencs/LandTexture.png
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
files/opencs/PathGrid.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
files/opencs/activator.png
Executable file → Normal file
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 862 B After Width: | Height: | Size: 615 B |
0
files/opencs/apparatus.png
Executable file → Normal file
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
0
files/opencs/armor.png
Executable file → Normal file
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
BIN
files/opencs/attribute.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
files/opencs/birthsign.png
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
files/opencs/body-part.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
files/opencs/book.png
Executable file → Normal file
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.6 KiB |
BIN
files/opencs/cell.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
files/opencs/class.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
0
files/opencs/clothing.png
Executable file → Normal file
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
0
files/opencs/container.png
Executable file → Normal file
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
0
files/opencs/creature.png
Executable file → Normal file
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
BIN
files/opencs/dialogoue-info.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
files/opencs/dialogoue-journal.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
files/opencs/dialogoue-regular.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
files/opencs/dialogue-greeting.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
files/opencs/dialogue-persuasion.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
files/opencs/dialogue-speech.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
0
files/opencs/door.png
Executable file → Normal file
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
BIN
files/opencs/enchantment.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
files/opencs/faction.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
files/opencs/filter.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
files/opencs/globvar.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
BIN
files/opencs/ingredient.png
Executable file → Normal file
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
BIN
files/opencs/land.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
files/opencs/landpaint.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
0
files/opencs/leveled-creature.png
Executable file → Normal file
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
BIN
files/opencs/light.png
Executable file → Normal file
Before Width: | Height: | Size: 747 B After Width: | Height: | Size: 1.2 KiB |
0
files/opencs/lockpick.png
Executable file → Normal file
Before Width: | Height: | Size: 671 B After Width: | Height: | Size: 671 B |
BIN
files/opencs/magic-effect.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
files/opencs/magicrabbit.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
files/opencs/map.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
0
files/opencs/miscellaneous.png
Executable file → Normal file
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 1.3 KiB |
0
files/opencs/npc.png
Executable file → Normal file
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
0
files/opencs/potion.png
Executable file → Normal file
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
0
files/opencs/probe.png
Executable file → Normal file
Before Width: | Height: | Size: 587 B After Width: | Height: | Size: 587 B |
BIN
files/opencs/race.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
files/opencs/random-item.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
files/opencs/random.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.2 KiB |
0
files/opencs/repair.png
Executable file → Normal file
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
@ -1,30 +1,61 @@
|
|||
<RCC>
|
||||
<qresource prefix="/">
|
||||
<file>opencs.png</file>
|
||||
<file>added.png</file>
|
||||
<file>modified.png</file>
|
||||
<file>removed.png</file>
|
||||
<file>base.png</file>
|
||||
<file>activator.png</file>
|
||||
<file>apparatus.png</file>
|
||||
<file>armor.png</file>
|
||||
<file>book.png</file>
|
||||
<file>clothing.png</file>
|
||||
<file>container.png</file>
|
||||
<file>creature.png</file>
|
||||
<file>door.png</file>
|
||||
<file>ingredient.png</file>
|
||||
<file>leveled-creature.png</file>
|
||||
<file>leveled-item.png</file>
|
||||
<file>light.png</file>
|
||||
<file>lockpick.png</file>
|
||||
<file>miscellaneous.png</file>
|
||||
<file>npc.png</file>
|
||||
<file>potion.png</file>
|
||||
<file>probe.png</file>
|
||||
<file>repair.png</file>
|
||||
<file>static.png</file>
|
||||
<file>weapon.png</file>
|
||||
<file>added.png</file>
|
||||
<file>apparatus.png</file>
|
||||
<file>armor.png</file>
|
||||
<file>attribute.png</file>
|
||||
<file>base.png</file>
|
||||
<file>birthsign.png</file>
|
||||
<file>body-part.png</file>
|
||||
<file>book.png</file>
|
||||
<file>cell.png</file>
|
||||
<file>class.png</file>
|
||||
<file>clothing.png</file>
|
||||
<file>container.png</file>
|
||||
<file>creature.png</file>
|
||||
<file>dialogoue-info.png</file>
|
||||
<file>dialogoue-journal.png</file>
|
||||
<file>dialogoue-regular.png</file>
|
||||
<file>dialogue-greeting.png</file>
|
||||
<file>dialogue-persuasion.png</file>
|
||||
<file>dialogue-speech.png</file>
|
||||
<file>door.png</file>
|
||||
<file>enchantment.png</file>
|
||||
<file>faction.png</file>
|
||||
<file>filter.png</file>
|
||||
<file>globvar.png</file>
|
||||
<file>GMST.png</file>
|
||||
<file>Info.png</file>
|
||||
<file>ingredient.png</file>
|
||||
<file>landpaint.png</file>
|
||||
<file>land.png</file>
|
||||
<file>LandTexture.png</file>
|
||||
<file>leveled-creature.png</file>
|
||||
<file>light.png</file>
|
||||
<file>lockpick.png</file>
|
||||
<file>magic-effect.png</file>
|
||||
<file>magicrabbit.png</file>
|
||||
<file>map.png</file>
|
||||
<file>miscellaneous.png</file>
|
||||
<file>modified.png</file>
|
||||
<file>npc.png</file>
|
||||
<file>PathGrid.png</file>
|
||||
<file>potion.png</file>
|
||||
<file>probe.png</file>
|
||||
<file>race.png</file>
|
||||
<file>random-item.png</file>
|
||||
<file>random.png</file>
|
||||
<file>removed.png</file>
|
||||
<file>repair.png</file>
|
||||
<file>script.png</file>
|
||||
<file>skill.png</file>
|
||||
<file>soundgen.png</file>
|
||||
<file>sound.png</file>
|
||||
<file>spell.png</file>
|
||||
<file>static.png</file>
|
||||
<file>weapon.png</file>
|
||||
<file alias="startup/create-addon">raster/startup/big/create-addon.png</file>
|
||||
<file alias="startup/create-game">raster/startup/big/new-game.png</file>
|
||||
<file alias="startup/edit-content">raster/startup/big/edit-content.png</file>
|
||||
|
|
BIN
files/opencs/script.png
Normal file
After Width: | Height: | Size: 952 B |
BIN
files/opencs/skill.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
files/opencs/sound.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
files/opencs/soundgen.png
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
files/opencs/spell.png
Normal file
After Width: | Height: | Size: 2 KiB |
BIN
files/opencs/static.png
Executable file → Normal file
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.3 KiB |
0
files/opencs/weapon.png
Executable file → Normal file
Before Width: | Height: | Size: 1,003 B After Width: | Height: | Size: 1,003 B |
1
issue912
Normal file
|
@ -0,0 +1 @@
|
|||
branch for issue912
|