mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-12-26 02:20:54 +00:00
Changed: #1193 If switch between the located and sound properties in a workspace erroneously marked that the particle system has been changed.
This commit is contained in:
parent
155ea28842
commit
092f9c54c8
4 changed files with 38 additions and 47 deletions
|
@ -55,7 +55,6 @@ CLocatedPage::CLocatedPage(QWidget *parent)
|
|||
|
||||
_ui.maxNumParticleWidget->setRange(1, 501);
|
||||
_ui.maxNumParticleWidget->enableUpperBound(1 << 16, true);
|
||||
_ui.maxNumParticleWidget->setWrapper(&_MaxNbParticlesWrapper);
|
||||
|
||||
connect(_ui.coordSystemComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(setMatrixMode(int)));
|
||||
connect(_ui.disgradeWithLODCheckBox, SIGNAL(toggled(bool)), this, SLOT(setDisgradeWithLod(bool)));
|
||||
|
@ -63,7 +62,9 @@ CLocatedPage::CLocatedPage(QWidget *parent)
|
|||
connect(_ui.trigerOnDeathCheckBox, SIGNAL(toggled(bool)), this, SLOT(setTriggerOnDeath(bool)));
|
||||
connect(_ui.editPushButton, SIGNAL(clicked()), this, SLOT(editTriggerOnDeath()));
|
||||
connect(_ui.limitedLifeTimeCheckBox, SIGNAL(toggled(bool)), this, SLOT(setLimitedLifeTime(bool)));
|
||||
connect(_ui.setCurrentCountPushButton, SIGNAL(clicked()), this, SLOT(setCount()));
|
||||
connect(_ui.setCurrentCountPushButton, SIGNAL(clicked()), this, SLOT(setCurrentCount()));
|
||||
|
||||
connect(_ui.maxNumParticleWidget, SIGNAL(valueChanged(uint32)), this, SLOT(setNewMaxSize(uint32)));
|
||||
}
|
||||
|
||||
CLocatedPage::~CLocatedPage()
|
||||
|
@ -91,9 +92,7 @@ void CLocatedPage::setEditedItem(CWorkspaceNode *ownerNode, NL3D::CPSLocated *lo
|
|||
if (_Located->getOwner())
|
||||
_ui.maxNumParticleWidget->setEnabled(!_Located->getOwner()->getAutoCountFlag());
|
||||
|
||||
_MaxNbParticlesWrapper.Located = _Located;
|
||||
_MaxNbParticlesWrapper.Node = _Node;
|
||||
_ui.maxNumParticleWidget->updateUi();
|
||||
_ui.maxNumParticleWidget->setValue(_Located->getMaxSize(), false);
|
||||
|
||||
_ui.coordSystemComboBox->setCurrentIndex(int(_Located->getMatrixMode()));
|
||||
_ui.limitedLifeTimeCheckBox->setChecked(!_Located->getLastForever());
|
||||
|
@ -217,10 +216,25 @@ void CLocatedPage::setMatrixMode(int index)
|
|||
}
|
||||
}
|
||||
|
||||
void CLocatedPage::setCount()
|
||||
void CLocatedPage::setCurrentCount()
|
||||
{
|
||||
_Located->resize(_Located->getSize()); // set new max size
|
||||
_ui.maxNumParticleWidget->updateUi();
|
||||
// set new max size
|
||||
_ui.maxNumParticleWidget->setValue(_Located->getSize());
|
||||
updateModifiedFlag();
|
||||
}
|
||||
|
||||
void CLocatedPage::setNewMaxSize(uint32 value)
|
||||
{
|
||||
// if the max new size is lower than the current number of instance, we must suppress item
|
||||
// in the CParticleTreeCtrl
|
||||
if (value < _Located->getSize())
|
||||
{
|
||||
nlassert(_Node);
|
||||
/// WARNING:
|
||||
///TreeCtrl->suppressLocatedInstanceNbItem(*Node, v);
|
||||
}
|
||||
_Located->resize(value);
|
||||
|
||||
updateModifiedFlag();
|
||||
}
|
||||
|
||||
|
@ -238,19 +252,6 @@ void CLocatedPage::updateTriggerOnDeath(void)
|
|||
_ui.editPushButton->setEnabled(enable && _Located->isTriggerOnDeathEnabled());
|
||||
}
|
||||
|
||||
void CLocatedPage::CMaxNbParticlesWrapper::set(const uint32 &v)
|
||||
{
|
||||
// if the max new size is lower than the current number of instance, we must suppress item
|
||||
// in the CParticleTreeCtrl
|
||||
if (v < Located->getSize())
|
||||
{
|
||||
nlassert(Node);
|
||||
/// WARNING:
|
||||
///TreeCtrl->suppressLocatedInstanceNbItem(*Node, v);
|
||||
}
|
||||
Located->resize(v);
|
||||
}
|
||||
|
||||
void CLocatedPage::CLifeWrapper::set(const float &v)
|
||||
{
|
||||
Located->setInitialLife(v);
|
||||
|
|
|
@ -61,20 +61,12 @@ private Q_SLOTS:
|
|||
void editTriggerOnDeath();
|
||||
void setTriggerOnDeath(bool state);
|
||||
void setMatrixMode(int index);
|
||||
void setCount();
|
||||
void setCurrentCount();
|
||||
|
||||
void setNewMaxSize(uint32 value);
|
||||
|
||||
private:
|
||||
|
||||
/// wrapper to tune the max number of particles
|
||||
struct CMaxNbParticlesWrapper : public IPSWrapperUInt
|
||||
{
|
||||
CWorkspaceNode *Node;
|
||||
NL3D::CPSLocated *Located;
|
||||
uint32 get(void) const { return Located->getMaxSize(); }
|
||||
void set(const uint32 &v);
|
||||
} _MaxNbParticlesWrapper;
|
||||
|
||||
|
||||
/// wrapper to tune the mass of particles
|
||||
struct CMassWrapper : public IPSWrapperFloat, IPSSchemeWrapperFloat
|
||||
{
|
||||
|
|
|
@ -53,14 +53,15 @@ CSoundPage::CSoundPage(QWidget *parent)
|
|||
|
||||
// setup dialog the percent of sound emissions
|
||||
_ui.emissionWidget->setRange(0.f, 1.f);
|
||||
_ui.emissionWidget->setWrapper(&_EmissionPercentWrapper);
|
||||
|
||||
|
||||
connect(_ui.browsePushButton ,SIGNAL(clicked()), this, SLOT(browse()));
|
||||
connect(_ui.playPushButton ,SIGNAL(clicked()), this, SLOT(play()));
|
||||
connect(_ui.spawnCheckBox ,SIGNAL(toggled(bool)), this, SLOT(setSpawn(bool)));
|
||||
connect(_ui.muteCheckBox ,SIGNAL(toggled(bool)), this, SLOT(setMute(bool)));
|
||||
connect(_ui.keepPitchCheckBox ,SIGNAL(toggled(bool)), this, SLOT(setKeepPitch(bool)));
|
||||
connect(_ui.soundNameLineEdit ,SIGNAL(textChanged(QString)), this, SLOT(setSoundName(QString)));
|
||||
|
||||
connect(_ui.emissionWidget, SIGNAL(valueChanged(float)), this, SLOT(setEmissionPercent(float)));
|
||||
}
|
||||
|
||||
CSoundPage::~CSoundPage()
|
||||
|
@ -73,10 +74,8 @@ void CSoundPage::setEditedItem(CWorkspaceNode *ownerNode, NL3D::CPSLocatedBindab
|
|||
_Node = ownerNode;
|
||||
|
||||
nlassert(_Sound);
|
||||
|
||||
_EmissionPercentWrapper.OwnerNode = _Node;
|
||||
_EmissionPercentWrapper.S = _Sound;
|
||||
_ui.emissionWidget->updateUi();
|
||||
|
||||
_ui.emissionWidget->setValue(_Sound->getEmissionPercent(), false);
|
||||
|
||||
_GainWrapper.S = _Sound;
|
||||
_ui.gainWidget->setWorkspaceNode(_Node);
|
||||
|
@ -165,4 +164,10 @@ void CSoundPage::setSoundName(const QString &text)
|
|||
_Sound->setSoundName(NLMISC::CStringMapper::map(text.toStdString()));
|
||||
}
|
||||
|
||||
void CSoundPage::setEmissionPercent(float value)
|
||||
{
|
||||
_Sound->setEmissionPercent(value);
|
||||
updateModifiedFlag();
|
||||
}
|
||||
|
||||
} /* namespace NLQT */
|
|
@ -62,7 +62,8 @@ private Q_SLOTS:
|
|||
void setMute(bool state);
|
||||
void setKeepPitch(bool state);
|
||||
void setSoundName(const QString &text);
|
||||
|
||||
void setEmissionPercent(float value);
|
||||
|
||||
private:
|
||||
|
||||
/// wrapper to set the gain of sounds
|
||||
|
@ -85,14 +86,6 @@ private:
|
|||
void setScheme(scheme_type *s) { S->setPitchScheme(s); }
|
||||
} _PitchWrapper;
|
||||
|
||||
/// wrapper to set the percentage of sound emissions
|
||||
struct CEmissionPercentWrapper : public IPSWrapperFloat
|
||||
{
|
||||
NL3D::CPSSound *S;
|
||||
float get(void) const { return S->getEmissionPercent(); }
|
||||
void set(const float &v) { S->setEmissionPercent(v); }
|
||||
} _EmissionPercentWrapper;
|
||||
|
||||
void updateModifiedFlag() { if (_Node) _Node->setModified(true); }
|
||||
|
||||
/// the sound being edited
|
||||
|
|
Loading…
Reference in a new issue