mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-12-21 00:18:43 +00:00
Changed: #1193 If switch between the zone properties in a workspace erroneously marked that the particle system has been changed.
This commit is contained in:
parent
fb8dff80cf
commit
03ed1919f9
2 changed files with 12 additions and 18 deletions
|
@ -36,11 +36,12 @@ CZonePage::CZonePage(QWidget *parent)
|
|||
_ui.setupUi(this);
|
||||
|
||||
_ui.bounceFactorWidget->setRange(0.f, 1.f);
|
||||
_ui.bounceFactorWidget->setWrapper(&_BounceFactorWrapper);
|
||||
|
||||
|
||||
connect(_ui.toTargetsPushButton, SIGNAL(clicked()), this, SLOT(addTarget()));
|
||||
connect(_ui.toAvaibleTargetsPushButton, SIGNAL(clicked()), this, SLOT(removeTarget()));
|
||||
connect(_ui.bounceComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(setBounce(int)));
|
||||
|
||||
connect(_ui.bounceFactorWidget, SIGNAL(valueChanged(float)), this, SLOT(setBounceFactor(float)));
|
||||
}
|
||||
|
||||
CZonePage::~CZonePage()
|
||||
|
@ -54,12 +55,7 @@ void CZonePage::setEditedItem(CWorkspaceNode *ownerNode, NL3D::CPSLocatedBindabl
|
|||
_Zone = dynamic_cast<NL3D::CPSZone *>(_LBTarget);
|
||||
|
||||
updateTargets();
|
||||
|
||||
_BounceFactorWrapper.OwnerNode = _Node;
|
||||
_BounceFactorWrapper.Z = _Zone;
|
||||
|
||||
_ui.bounceFactorWidget->updateUi();
|
||||
|
||||
_ui.bounceFactorWidget->setValue(_Zone->getBounceFactor() ,false);
|
||||
_ui.bounceComboBox->setCurrentIndex( _Zone->getCollisionBehaviour());
|
||||
}
|
||||
|
||||
|
@ -108,6 +104,12 @@ void CZonePage::setBounce(int index)
|
|||
Modules::psEdit().resetAutoCount(_Node);
|
||||
}
|
||||
|
||||
void CZonePage::setBounceFactor(float value)
|
||||
{
|
||||
_Zone->setBounceFactor(value);
|
||||
updateModifiedFlag();
|
||||
}
|
||||
|
||||
void CZonePage::updateTargets()
|
||||
{
|
||||
uint k;
|
||||
|
|
|
@ -48,17 +48,9 @@ private Q_SLOTS:
|
|||
void removeTarget();
|
||||
void setBounce(int index);
|
||||
|
||||
private:
|
||||
|
||||
/// wrapper to set the bounce factor of a collision zone
|
||||
struct CBounceFactorWrapper : public IPSWrapperFloat
|
||||
{
|
||||
// the zone being wrapped
|
||||
NL3D::CPSZone *Z ;
|
||||
float get(void) const { return Z->getBounceFactor() ; }
|
||||
void set(const float &v) { Z->setBounceFactor(v) ; }
|
||||
} _BounceFactorWrapper ;
|
||||
void setBounceFactor(float value);
|
||||
|
||||
private:
|
||||
void updateTargets();
|
||||
|
||||
void updateModifiedFlag() { if (_Node) _Node->setModified(true); }
|
||||
|
|
Loading…
Reference in a new issue