Added a label to WEditorProperties to present some basic information on the selected instance

This commit is contained in:
parax0 2016-02-10 17:35:36 -07:00
parent e13868921c
commit 6d55444cc2
9 changed files with 45 additions and 36 deletions

View File

@ -8,6 +8,11 @@ WEditorProperties::WEditorProperties(QWidget *pParent /*= 0*/)
, mpDisplayNode(nullptr)
, mHasEditedName(false)
{
mpInstanceInfoLabel = new QLabel;
mpInstanceInfoLabel->setText("<i>No selection</i>");
mpInstanceInfoLayout = new QHBoxLayout;
mpInstanceInfoLayout->addWidget(mpInstanceInfoLabel);
mpActiveCheckBox = new QCheckBox;
mpActiveCheckBox->setToolTip("Active");
mpInstanceNameLineEdit = new QLineEdit;
@ -26,6 +31,7 @@ WEditorProperties::WEditorProperties(QWidget *pParent /*= 0*/)
mpLayersLayout->addWidget(mpLayersComboBox);
mpMainLayout = new QVBoxLayout;
mpMainLayout->addLayout(mpInstanceInfoLayout);
mpMainLayout->addLayout(mpNameLayout);
mpMainLayout->addLayout(mpLayersLayout);
mpMainLayout->setContentsMargins(6, 6, 6, 0);
@ -36,6 +42,7 @@ WEditorProperties::WEditorProperties(QWidget *pParent /*= 0*/)
QFont Font = font();
Font.setPointSize(10);
setFont(Font);
mpInstanceInfoLabel->setFont(Font);
mpInstanceNameLineEdit->setFont(Font);
mpLayersLabel->setFont(Font);
@ -103,15 +110,29 @@ void WEditorProperties::OnSelectionModified()
mpInstanceNameLineEdit->setEnabled(false);
if (rkSelection.empty())
{
mpInstanceInfoLabel->setText("<i>[No selection]</i>");
mpInstanceNameLineEdit->clear();
}
else if (mpDisplayNode)
{
mpInstanceInfoLabel->setText("[Light]");
mpInstanceNameLineEdit->setText(TO_QSTRING(mpDisplayNode->Name()));
}
else
mpInstanceNameLineEdit->setText(QString("[%1 objects selected]").arg(rkSelection.size()));
{
mpInstanceInfoLabel->setText(QString("<i>[%1 objects selected]</i>").arg(rkSelection.size()));
mpInstanceNameLineEdit->clear();
}
}
else
{
CScriptNode *pScript = static_cast<CScriptNode*>(mpDisplayNode);
TString InstanceID = TString::HexString(pScript->Object()->InstanceID(), false, true, 8);
TString ObjectType = pScript->Template()->Name();
mpInstanceInfoLabel->setText(QString("[%1] [%2]").arg( TO_QSTRING(ObjectType) ).arg( TO_QSTRING(InstanceID) ));
UpdatePropertyValues();
}

View File

@ -19,6 +19,9 @@ class WEditorProperties : public QWidget
QVBoxLayout *mpMainLayout;
QLabel *mpInstanceInfoLabel;
QHBoxLayout *mpInstanceInfoLayout;
QCheckBox *mpActiveCheckBox;
QLineEdit *mpInstanceNameLineEdit;
QHBoxLayout *mpNameLayout;

View File

@ -4782,7 +4782,7 @@
<property ID="0x6B016DB2" name="STRG"/>
<property ID="0x6B08E2E5" name="Unknown"/>
<property ID="0x6B08F2F2" name="Unknown"/>
<property ID="0x6B1FBC3A" name="Echo Visor model"/>
<property ID="0x6B1FBC3A" name="Echo Visor Model"/>
<property ID="0x6B20BDB0" name="Unknown"/>
<property ID="0x6B32E09E" name="Unknown"/>
<property ID="0x6B40ACEF" name="Unknown"/>
@ -7051,7 +7051,7 @@
<property ID="0x9EEF71C2" name="WPSC"/>
<property ID="0x9EF4A101" name="DamageInfo"/>
<property ID="0x9EF6B290" name="WPSC"/>
<property ID="0x9F027D91" name="Unknown"/>
<property ID="0x9F027D91" name="Dark Visor Skin"/>
<property ID="0x9F0677D6" name="Unknown"/>
<property ID="0x9F0E3E0B" name="PART"/>
<property ID="0x9F0FF852" name="Unknown"/>
@ -8583,7 +8583,7 @@
<property ID="0xC08E06AC" name="Unknown"/>
<property ID="0xC0A86488" name="Unknown"/>
<property ID="0xC0AC271E" name="Unknown"/>
<property ID="0xC0BA9E18" name="Dark Visor model"/>
<property ID="0xC0BA9E18" name="Dark Visor Model"/>
<property ID="0xC0BD8A5E" name="Unknown"/>
<property ID="0xC0C31785" name="Unknown"/>
<property ID="0xC0CB3936" name="Unknown"/>
@ -10495,7 +10495,7 @@
<property ID="0xEB03168D" name="Unknown"/>
<property ID="0xEB12BEE4" name="DamageInfo"/>
<property ID="0xEB1B90C2" name="Unknown"/>
<property ID="0xEB1D06BE" name="Unknown"/>
<property ID="0xEB1D06BE" name="Echo Visor Skin"/>
<property ID="0xEB250A0B" name="Unknown"/>
<property ID="0xEB300034" name="Unknown"/>
<property ID="0xEB383668" name="Unknown"/>

View File

@ -14,7 +14,7 @@
<object ID="ADMG" template="Script/AreaDamage.xml"/>
<object ID="ARNO" template="Script/AreaNode.xml"/>
<object ID="ARPA" template="Script/AreaPath.xml"/>
<object ID="ASAS" template="Script/ASAS.xml"/>
<object ID="ASAS" template="Script/AssignedAudioStream.xml"/>
<object ID="AOCL" template="Script/AudioOccluder.xml"/>
<object ID="AVIS" template="Script/AVIS.xml"/>
<object ID="BABL" template="Script/BarrelBalloon.xml"/>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<ScriptTemplate version="4">
<name>ASAS</name>
<name>AssignedAudioStream</name>
<properties>
<struct ID="0x255A4580" template="Structs/EditorProperties.xml"/>
<enum ID="0xE7D8D823" template="Enums/MusicEnumB.xml">

View File

@ -17,6 +17,7 @@
</properties>
<assets/>
<rotation_type>enabled</rotation_type>
<scale_type>enabled</scale_type>
<scale_type>volume</scale_type>
<preview_volume shape="Box"/>
</editor>
</ScriptTemplate>

View File

@ -7,10 +7,10 @@
<property ID="0x00" name="SCAN" type="file" extensions="SCAN"/>
</properties>
</struct>
<property ID="0x02" name="X-Ray model" type="file" extensions="CMDL"/>
<property ID="0x03" name="X-Ray skin" type="file" extensions="CSKR"/>
<property ID="0x04" name="Thermal model" type="file" extensions="CMDL"/>
<property ID="0x05" name="Thermal skin" type="file" extensions="CSKR"/>
<property ID="0x02" name="X-Ray Visor Model" type="file" extensions="CMDL"/>
<property ID="0x03" name="X-Ray Visor Skin" type="file" extensions="CSKR"/>
<property ID="0x04" name="Thermal Visor Model" type="file" extensions="CMDL"/>
<property ID="0x05" name="Thermal Visor Skin" type="file" extensions="CSKR"/>
<property ID="0x06" name="Unknown 1" type="bool"/>
<property ID="0x07" name="Unknown 2" type="float"/>
<property ID="0x08" name="Unknown 3" type="float"/>

View File

@ -3,18 +3,10 @@
<properties>
<struct ID="0xB028DB0E" template="Structs/LightParameters.xml"/>
<struct ID="0x375BFD7C" template="Structs/ScannableParameters.xml"/>
<property ID="0xC0BA9E18" type="long">
<default>-1</default>
</property>
<property ID="0x9F027D91" type="long">
<default>-1</default>
</property>
<property ID="0x6B1FBC3A" type="long">
<default>-1</default>
</property>
<property ID="0xEB1D06BE" type="long">
<default>-1</default>
</property>
<property ID="0xC0BA9E18" type="file" extensions="CMDL"/>
<property ID="0x9F027D91" type="file" extensions="CSKR"/>
<property ID="0x6B1FBC3A" type="file" extensions="CMDL"/>
<property ID="0xEB1D06BE" type="file" extensions="CSKR"/>
<property ID="0x1499803C" type="bool">
<default>true</default>
</property>

View File

@ -3,18 +3,10 @@
<properties>
<struct ID="0xB028DB0E" template="Structs/LightParameters.xml"/>
<struct ID="0x375BFD7C" template="Structs/ScannableParameters.xml"/>
<property ID="0xC0BA9E18" type="long">
<default>-1</default>
</property>
<property ID="0x9F027D91" type="long">
<default>-1</default>
</property>
<property ID="0x6B1FBC3A" type="long">
<default>-1</default>
</property>
<property ID="0xEB1D06BE" type="long">
<default>-1</default>
</property>
<property ID="0xC0BA9E18" type="file" extensions="CMDL"/>
<property ID="0x9F027D91" type="file" extensions="CSKR"/>
<property ID="0x6B1FBC3A" type="file" extensions="CMDL"/>
<property ID="0xEB1D06BE" type="file" extensions="CSKR"/>
<property ID="0x1499803C" type="bool">
<default>true</default>
</property>