forked from teamnwah/openmw-tes3coop
parent
8da9eecea7
commit
8ae7c63c45
5 changed files with 18 additions and 12 deletions
|
@ -82,7 +82,6 @@ bool CSMWorld::ColumnBase::isId (Display display)
|
|||
Display_EffectId,
|
||||
Display_PartRefType,
|
||||
Display_AiPackageType,
|
||||
Display_YesNo,
|
||||
Display_InfoCondFunc,
|
||||
Display_InfoCondVar,
|
||||
Display_InfoCondComp,
|
||||
|
|
|
@ -118,7 +118,6 @@ namespace CSMWorld
|
|||
Display_EffectId,
|
||||
Display_PartRefType,
|
||||
Display_AiPackageType,
|
||||
Display_YesNo,
|
||||
Display_InfoCondFunc,
|
||||
Display_InfoCondVar,
|
||||
Display_InfoCondComp,
|
||||
|
|
|
@ -198,7 +198,7 @@ CSMWorld::RefIdCollection::RefIdCollection()
|
|||
mColumns.back().addColumn(
|
||||
new RefIdColumn (Columns::ColumnId_AiWanderIdle, CSMWorld::ColumnBase::Display_Integer));
|
||||
mColumns.back().addColumn(
|
||||
new RefIdColumn (Columns::ColumnId_AiWanderRepeat, CSMWorld::ColumnBase::Display_YesNo));
|
||||
new RefIdColumn (Columns::ColumnId_AiWanderRepeat, CSMWorld::ColumnBase::Display_Boolean));
|
||||
mColumns.back().addColumn(
|
||||
new RefIdColumn (Columns::ColumnId_AiActivateName, CSMWorld::ColumnBase::Display_String));
|
||||
mColumns.back().addColumn(
|
||||
|
|
|
@ -103,7 +103,7 @@ CSVDoc::ViewManager::ViewManager (CSMDoc::DocumentManager& documentManager)
|
|||
{ CSMWorld::ColumnBase::Display_EffectId, CSMWorld::Columns::ColumnId_EffectId, false },
|
||||
{ CSMWorld::ColumnBase::Display_PartRefType, CSMWorld::Columns::ColumnId_PartRefType, false },
|
||||
{ CSMWorld::ColumnBase::Display_AiPackageType, CSMWorld::Columns::ColumnId_AiPackageType, false },
|
||||
{ CSMWorld::ColumnBase::Display_YesNo, CSMWorld::Columns::ColumnId_AiWanderRepeat, false },
|
||||
{ CSMWorld::ColumnBase::Display_Boolean, CSMWorld::Columns::ColumnId_AiWanderRepeat, false },
|
||||
{ CSMWorld::ColumnBase::Display_InfoCondFunc, CSMWorld::Columns::ColumnId_InfoCondFunc, false },
|
||||
{ CSMWorld::ColumnBase::Display_InfoCondComp, CSMWorld::Columns::ColumnId_InfoCondComp, false },
|
||||
{ CSMWorld::ColumnBase::Display_RaceSkill, CSMWorld::Columns::ColumnId_RaceSkill, true },
|
||||
|
|
|
@ -740,13 +740,15 @@ CSVWorld::SimpleDialogueSubView::SimpleDialogueSubView (const CSMWorld::Universa
|
|||
mMainLayout = new QVBoxLayout(mainWidget);
|
||||
setWidget (mainWidget);
|
||||
|
||||
int idColumn = getTable().findColumnIndex (CSMWorld::Columns::ColumnId_Id);
|
||||
|
||||
mEditWidget = new EditWidget(mainWidget,
|
||||
mTable->getModelIndex(getUniversalId().getId(), 0).row(), mTable, mCommandDispatcher, document, false);
|
||||
mTable->getModelIndex(getUniversalId().getId(), idColumn).row(), mTable, mCommandDispatcher, document, false);
|
||||
|
||||
mMainLayout->addWidget(mEditWidget);
|
||||
mEditWidget->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
|
||||
|
||||
dataChanged(mTable->getModelIndex (getUniversalId().getId(), 0));
|
||||
dataChanged(mTable->getModelIndex (getUniversalId().getId(), idColumn));
|
||||
|
||||
connect(mEditWidget,
|
||||
SIGNAL(editIdRequest(const CSMWorld::UniversalId &, const std::string &)),
|
||||
|
@ -759,8 +761,9 @@ void CSVWorld::SimpleDialogueSubView::setEditLock (bool locked)
|
|||
if (!mEditWidget) // hack to indicate that getUniversalId().getId() is no longer valid
|
||||
return;
|
||||
|
||||
int idColumn = getTable().findColumnIndex (CSMWorld::Columns::ColumnId_Id);
|
||||
mLocked = locked;
|
||||
QModelIndex currentIndex(mTable->getModelIndex(getUniversalId().getId(), 0));
|
||||
QModelIndex currentIndex(mTable->getModelIndex(getUniversalId().getId(), idColumn));
|
||||
|
||||
if (currentIndex.isValid())
|
||||
{
|
||||
|
@ -775,7 +778,8 @@ void CSVWorld::SimpleDialogueSubView::setEditLock (bool locked)
|
|||
|
||||
void CSVWorld::SimpleDialogueSubView::dataChanged (const QModelIndex & index)
|
||||
{
|
||||
QModelIndex currentIndex(mTable->getModelIndex(getUniversalId().getId(), 0));
|
||||
int idColumn = getTable().findColumnIndex (CSMWorld::Columns::ColumnId_Id);
|
||||
QModelIndex currentIndex(mTable->getModelIndex(getUniversalId().getId(), idColumn));
|
||||
|
||||
if (currentIndex.isValid() &&
|
||||
(index.parent().isValid() ? index.parent().row() : index.row()) == currentIndex.row())
|
||||
|
@ -808,7 +812,8 @@ void CSVWorld::SimpleDialogueSubView::dataChanged (const QModelIndex & index)
|
|||
|
||||
void CSVWorld::SimpleDialogueSubView::rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end)
|
||||
{
|
||||
QModelIndex currentIndex(mTable->getModelIndex(getUniversalId().getId(), 0));
|
||||
int idColumn = getTable().findColumnIndex (CSMWorld::Columns::ColumnId_Id);
|
||||
QModelIndex currentIndex(mTable->getModelIndex(getUniversalId().getId(), idColumn));
|
||||
|
||||
if (!currentIndex.isValid())
|
||||
{
|
||||
|
@ -906,7 +911,8 @@ void CSVWorld::DialogueSubView::updateUserSetting (const QString& name, const QS
|
|||
|
||||
void CSVWorld::DialogueSubView::showPreview ()
|
||||
{
|
||||
QModelIndex currentIndex (getTable().getModelIndex (getUniversalId().getId(), 0));
|
||||
int idColumn = getTable().findColumnIndex (CSMWorld::Columns::ColumnId_Id);
|
||||
QModelIndex currentIndex (getTable().getModelIndex (getUniversalId().getId(), idColumn));
|
||||
|
||||
if (currentIndex.isValid() &&
|
||||
getTable().getFeatures() & CSMWorld::IdTable::Feature_Preview &&
|
||||
|
@ -918,7 +924,8 @@ void CSVWorld::DialogueSubView::showPreview ()
|
|||
|
||||
void CSVWorld::DialogueSubView::viewRecord ()
|
||||
{
|
||||
QModelIndex currentIndex (getTable().getModelIndex (getUniversalId().getId(), 0));
|
||||
int idColumn = getTable().findColumnIndex (CSMWorld::Columns::ColumnId_Id);
|
||||
QModelIndex currentIndex (getTable().getModelIndex (getUniversalId().getId(), idColumn));
|
||||
|
||||
if (currentIndex.isValid() &&
|
||||
currentIndex.row() < getTable().rowCount())
|
||||
|
@ -953,7 +960,8 @@ void CSVWorld::DialogueSubView::switchToRow (int row)
|
|||
|
||||
void CSVWorld::DialogueSubView::requestFocus (const std::string& id)
|
||||
{
|
||||
QModelIndex index = getTable().getModelIndex (id, 0);
|
||||
int idColumn = getTable().findColumnIndex (CSMWorld::Columns::ColumnId_Id);
|
||||
QModelIndex index = getTable().getModelIndex (id, idColumn);
|
||||
|
||||
if (index.isValid())
|
||||
switchToRow (index.row());
|
||||
|
|
Loading…
Reference in a new issue