forked from mirror/openmw-tes3mp
Fixed the display issues of the nested tables in the dialogue subview. Needs further work but usable for now.
This commit is contained in:
parent
76adb64e20
commit
3d280a6ba5
3 changed files with 109 additions and 74 deletions
|
@ -24,7 +24,6 @@ namespace CSMWorld
|
|||
{ ColumnId_ValueType, "Value Type" },
|
||||
{ ColumnId_Description, "Description" },
|
||||
{ ColumnId_Specialisation, "Specialisation" },
|
||||
{ ColumnId_Skill, "Skill" },
|
||||
{ ColumnId_Attribute, "Attribute" },
|
||||
{ ColumnId_Name, "Name" },
|
||||
{ ColumnId_Playable, "Playable" },
|
||||
|
@ -174,10 +173,11 @@ namespace CSMWorld
|
|||
{ ColumnId_Gender, "Gender" },
|
||||
{ ColumnId_PcRank, "PC Rank" },
|
||||
{ ColumnId_ReferenceableId, "Referenceable ID" },
|
||||
{ ColumnId_NpcDestinations, "Destinations" },
|
||||
|
||||
{ ColumnId_ContainerContent, "Content" },
|
||||
{ ColumnId_ItemCount, "Count" },
|
||||
{ ColumnId_InventoryItemId, "ID"},
|
||||
{ ColumnId_SpellId, "ID"},
|
||||
{ ColumnId_ItemCount, "Count"},
|
||||
|
||||
{ ColumnId_CombatState, "Combat" },
|
||||
{ ColumnId_MagicState, "Magic" },
|
||||
{ ColumnId_StealthState, "Stealth" },
|
||||
|
@ -185,6 +185,22 @@ namespace CSMWorld
|
|||
{ ColumnId_Vampire, "Vampire" },
|
||||
{ ColumnId_BodyPartType, "Bodypart Type" },
|
||||
{ ColumnId_MeshType, "Mesh Type" },
|
||||
|
||||
{ ColumnId_ActorInventory, "Inventory" },
|
||||
{ ColumnId_ActorSpells, "Spells" },
|
||||
{ ColumnId_SpellId, "ID"},
|
||||
|
||||
{ ColumnId_NpcDestinations, "Destinations" },
|
||||
{ ColumnId_DestinationCell, "Cell"},
|
||||
{ ColumnId_PosX, "X"},
|
||||
{ ColumnId_PosY, "Y"},
|
||||
{ ColumnId_PosZ, "Z"},
|
||||
{ ColumnId_RotX, "Rotation X"},
|
||||
{ ColumnId_RotY, "Rotation Y"},
|
||||
{ ColumnId_RotZ, "Rotation Z"},
|
||||
|
||||
{ ColumnId_Skill, "Skill" },
|
||||
|
||||
{ ColumnId_OwnerGlobal, "Owner Global" },
|
||||
{ ColumnId_DefaultProfile, "Default Profile" },
|
||||
{ ColumnId_BypassNewGame, "Bypass New Game" },
|
||||
|
@ -206,14 +222,6 @@ namespace CSMWorld
|
|||
{ ColumnId_HitSound, "Hit Sound" },
|
||||
{ ColumnId_AreaSound, "Area Sound" },
|
||||
{ ColumnId_BoltSound, "Bolt Sound" },
|
||||
|
||||
{ ColumnId_NpcDestinations, "Cell"},
|
||||
{ ColumnId_PosX, "X"},
|
||||
{ ColumnId_PosY, "Y"},
|
||||
{ ColumnId_PosZ, "Z"},
|
||||
{ ColumnId_RotX, "Rotation X"},
|
||||
{ ColumnId_RotY, "Rotation Y"},
|
||||
{ ColumnId_RotZ, "Rotation Z"},
|
||||
|
||||
{ ColumnId_UseValue1, "Use value 1" },
|
||||
{ ColumnId_UseValue2, "Use value 2" },
|
||||
|
|
|
@ -167,50 +167,50 @@ namespace CSMWorld
|
|||
ColumnId_Rank = 152,
|
||||
ColumnId_Gender = 153,
|
||||
ColumnId_PcRank = 154,
|
||||
ColumnId_ReferenceableId = 156,
|
||||
ColumnId_ContainerContent = 157,
|
||||
ColumnId_ItemCount = 158,
|
||||
ColumnId_InventoryItemId = 159,
|
||||
ColumnId_CombatState = 160,
|
||||
ColumnId_MagicState = 161,
|
||||
ColumnId_StealthState = 162,
|
||||
ColumnId_EnchantmentType = 163,
|
||||
ColumnId_Vampire = 164,
|
||||
ColumnId_BodyPartType = 165,
|
||||
ColumnId_MeshType = 166,
|
||||
ColumnId_ActorInventory = 167,
|
||||
ColumnId_ActorSpells = 168,
|
||||
ColumnId_SpellId = 169,
|
||||
ColumnId_NpcDestinations = 170,
|
||||
ColumnId_ReferenceableId = 155,
|
||||
ColumnId_ContainerContent = 156,
|
||||
ColumnId_ItemCount = 157,
|
||||
ColumnId_InventoryItemId = 158,
|
||||
ColumnId_CombatState = 159,
|
||||
ColumnId_MagicState = 160,
|
||||
ColumnId_StealthState = 161,
|
||||
ColumnId_EnchantmentType = 162,
|
||||
ColumnId_Vampire = 163,
|
||||
ColumnId_BodyPartType = 164,
|
||||
ColumnId_MeshType = 165,
|
||||
ColumnId_ActorInventory = 166,
|
||||
ColumnId_ActorSpells = 167,
|
||||
ColumnId_SpellId = 168,
|
||||
ColumnId_NpcDestinations = 169,
|
||||
ColumnId_DestinationCell = 170,
|
||||
ColumnId_PosX = 171,
|
||||
ColumnId_PosY = 172,
|
||||
ColumnId_PosZ = 173,
|
||||
ColumnId_RotX = 174,
|
||||
ColumnId_RotY = 175,
|
||||
ColumnId_RotZ = 176,
|
||||
ColumnId_DestinationCell = 177,
|
||||
ColumnId_Skill = 178,
|
||||
ColumnId_OwnerGlobal = 164,
|
||||
ColumnId_DefaultProfile = 165,
|
||||
ColumnId_BypassNewGame = 166,
|
||||
ColumnId_GlobalProfile = 167,
|
||||
ColumnId_RefNumCounter = 168,
|
||||
ColumnId_RefNum = 169,
|
||||
ColumnId_Creature = 170,
|
||||
ColumnId_SoundGeneratorType = 171,
|
||||
ColumnId_AllowSpellmaking = 172,
|
||||
ColumnId_AllowEnchanting = 173,
|
||||
ColumnId_BaseCost = 174,
|
||||
ColumnId_School = 175,
|
||||
ColumnId_Particle = 176,
|
||||
ColumnId_CastingObject = 177,
|
||||
ColumnId_HitObject = 178,
|
||||
ColumnId_AreaObject = 179,
|
||||
ColumnId_BoltObject = 180,
|
||||
ColumnId_CastingSound = 177,
|
||||
ColumnId_HitSound = 178,
|
||||
ColumnId_AreaSound = 179,
|
||||
ColumnId_BoltSound = 180,
|
||||
ColumnId_Skill = 177,
|
||||
ColumnId_OwnerGlobal = 178,
|
||||
ColumnId_DefaultProfile = 179,
|
||||
ColumnId_BypassNewGame = 180,
|
||||
ColumnId_GlobalProfile = 181,
|
||||
ColumnId_RefNumCounter = 182,
|
||||
ColumnId_RefNum = 183,
|
||||
ColumnId_Creature = 184,
|
||||
ColumnId_SoundGeneratorType = 185,
|
||||
ColumnId_AllowSpellmaking = 186,
|
||||
ColumnId_AllowEnchanting = 187,
|
||||
ColumnId_BaseCost = 188,
|
||||
ColumnId_School = 189,
|
||||
ColumnId_Particle = 190,
|
||||
ColumnId_CastingObject = 191,
|
||||
ColumnId_HitObject = 192,
|
||||
ColumnId_AreaObject = 193,
|
||||
ColumnId_BoltObject = 194,
|
||||
ColumnId_CastingSound = 195,
|
||||
ColumnId_HitSound = 196,
|
||||
ColumnId_AreaSound = 197,
|
||||
ColumnId_BoltSound = 198,
|
||||
// Allocated to a separate value range, so we don't get a collision should we ever need
|
||||
// to extend the number of use values.
|
||||
ColumnId_UseValue1 = 0x10000,
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
#include <QScrollArea>
|
||||
#include <QPushButton>
|
||||
#include <QToolButton>
|
||||
#include <QHeaderView>
|
||||
#include <QDebug>
|
||||
|
||||
#include "../../model/world/nestedtablemodel.hpp"
|
||||
|
@ -139,26 +140,26 @@ void CSVWorld::DialogueDelegateDispatcherProxy::tableMimeDataDropped(const std::
|
|||
CSMWorld::UniversalId::Type type = data[i].getType();
|
||||
if (mDisplay == CSMWorld::ColumnBase::Display_Referenceable)
|
||||
{
|
||||
if ( type == CSMWorld::UniversalId::Type_Activator
|
||||
|| type == CSMWorld::UniversalId::Type_Potion
|
||||
|| type == CSMWorld::UniversalId::Type_Apparatus
|
||||
|| type == CSMWorld::UniversalId::Type_Armor
|
||||
|| type == CSMWorld::UniversalId::Type_Book
|
||||
|| type == CSMWorld::UniversalId::Type_Clothing
|
||||
|| type == CSMWorld::UniversalId::Type_Container
|
||||
|| type == CSMWorld::UniversalId::Type_Creature
|
||||
|| type == CSMWorld::UniversalId::Type_Door
|
||||
|| type == CSMWorld::UniversalId::Type_Ingredient
|
||||
|| type == CSMWorld::UniversalId::Type_CreatureLevelledList
|
||||
|| type == CSMWorld::UniversalId::Type_ItemLevelledList
|
||||
|| type == CSMWorld::UniversalId::Type_Light
|
||||
|| type == CSMWorld::UniversalId::Type_Lockpick
|
||||
|| type == CSMWorld::UniversalId::Type_Miscellaneous
|
||||
|| type == CSMWorld::UniversalId::Type_Npc
|
||||
|| type == CSMWorld::UniversalId::Type_Probe
|
||||
|| type == CSMWorld::UniversalId::Type_Repair
|
||||
|| type == CSMWorld::UniversalId::Type_Static
|
||||
|| type == CSMWorld::UniversalId::Type_Weapon)
|
||||
if (type == CSMWorld::UniversalId::Type_Activator
|
||||
|| type == CSMWorld::UniversalId::Type_Potion
|
||||
|| type == CSMWorld::UniversalId::Type_Apparatus
|
||||
|| type == CSMWorld::UniversalId::Type_Armor
|
||||
|| type == CSMWorld::UniversalId::Type_Book
|
||||
|| type == CSMWorld::UniversalId::Type_Clothing
|
||||
|| type == CSMWorld::UniversalId::Type_Container
|
||||
|| type == CSMWorld::UniversalId::Type_Creature
|
||||
|| type == CSMWorld::UniversalId::Type_Door
|
||||
|| type == CSMWorld::UniversalId::Type_Ingredient
|
||||
|| type == CSMWorld::UniversalId::Type_CreatureLevelledList
|
||||
|| type == CSMWorld::UniversalId::Type_ItemLevelledList
|
||||
|| type == CSMWorld::UniversalId::Type_Light
|
||||
|| type == CSMWorld::UniversalId::Type_Lockpick
|
||||
|| type == CSMWorld::UniversalId::Type_Miscellaneous
|
||||
|| type == CSMWorld::UniversalId::Type_Npc
|
||||
|| type == CSMWorld::UniversalId::Type_Probe
|
||||
|| type == CSMWorld::UniversalId::Type_Repair
|
||||
|| type == CSMWorld::UniversalId::Type_Static
|
||||
|| type == CSMWorld::UniversalId::Type_Weapon)
|
||||
{
|
||||
type = CSMWorld::UniversalId::Type_Referenceable;
|
||||
}
|
||||
|
@ -388,6 +389,12 @@ void CSVWorld::EditWidget::remake(int row)
|
|||
line->setFrameShape(QFrame::HLine);
|
||||
line->setFrameShadow(QFrame::Sunken);
|
||||
|
||||
QFrame* line2 = new QFrame(mMainWidget);
|
||||
line2->setObjectName(QString::fromUtf8("line2"));
|
||||
line2->setGeometry(QRect(320, 150, 118, 3));
|
||||
line2->setFrameShape(QFrame::HLine);
|
||||
line2->setFrameShadow(QFrame::Sunken);
|
||||
|
||||
QVBoxLayout *mainLayout = new QVBoxLayout(mMainWidget);
|
||||
QGridLayout *unlockedLayout = new QGridLayout();
|
||||
QGridLayout *lockedLayout = new QGridLayout();
|
||||
|
@ -396,7 +403,8 @@ void CSVWorld::EditWidget::remake(int row)
|
|||
mainLayout->addLayout(lockedLayout, 0);
|
||||
mainLayout->addWidget(line, 1);
|
||||
mainLayout->addLayout(unlockedLayout, 2);
|
||||
mainLayout->addLayout(tablesLayout, 3);
|
||||
mainLayout->addWidget(line2, 1);
|
||||
mainLayout->addLayout(tablesLayout, 0);
|
||||
mainLayout->addStretch(1);
|
||||
|
||||
int unlocked = 0;
|
||||
|
@ -416,10 +424,28 @@ void CSVWorld::EditWidget::remake(int row)
|
|||
{
|
||||
mNestedModels.push_back(new CSMWorld::NestedTableModel (mTable->index(row, i), display, mTable));
|
||||
|
||||
NestedTable* table = new NestedTable(mDocument, *(mNestedModels.rbegin()), this);
|
||||
NestedTable* table = new NestedTable(mDocument, mNestedModels.back(), this);
|
||||
|
||||
int rows = mNestedModels.back()->rowCount(mTable->index(row, i));
|
||||
if (rows == 0) rows = 1; // FIXME: quick hack
|
||||
int rowHeight = table->rowHeight(0);
|
||||
int tableHeight = (rows * rowHeight)
|
||||
+ table->horizontalHeader()->height() + 2 * table->frameWidth();
|
||||
int tableMaxHeight = (5 * rowHeight)
|
||||
+ table->horizontalHeader()->height() + 2 * table->frameWidth();
|
||||
if (rows > 1 && rows < 5)
|
||||
table->setMinimumHeight(tableHeight);
|
||||
else if (rows > 1)
|
||||
table->setMinimumHeight(tableMaxHeight);
|
||||
|
||||
QLabel* label = new QLabel (mTable->headerData (i, Qt::Horizontal, Qt::DisplayRole).toString(), mMainWidget);
|
||||
|
||||
label->setSizePolicy (QSizePolicy::Fixed, QSizePolicy::Fixed);
|
||||
|
||||
tablesLayout->addWidget(label);
|
||||
tablesLayout->addWidget(table);
|
||||
} else
|
||||
}
|
||||
else
|
||||
{
|
||||
mDispatcher.makeDelegate (display);
|
||||
QWidget* editor = mDispatcher.makeEditor (display, (mTable->index (row, i)));
|
||||
|
@ -438,7 +464,8 @@ void CSVWorld::EditWidget::remake(int row)
|
|||
lockedLayout->addWidget (label, locked, 0);
|
||||
lockedLayout->addWidget (editor, locked, 1);
|
||||
++locked;
|
||||
} else
|
||||
}
|
||||
else
|
||||
{
|
||||
unlockedLayout->addWidget (label, unlocked, 0);
|
||||
unlockedLayout->addWidget (editor, unlocked, 1);
|
||||
|
|
Loading…
Reference in a new issue