void CSoundPage::browse()
{
    std::vector<NLMISC::TStringId> names;


    NLSOUND::UAudioMixer *audioMixer = Modules::sound().getAudioMixer();
    if (audioMixer)
    {
        audioMixer->getSoundNames(names);
    }

    // TODO: create CPickSound dialog
    QStringList items;
    items << tr("");
    for(size_t i = 0; i < names.size(); ++i)
        items << QString(names[i]->c_str());

    bool ok;
    QString item = QInputDialog::getItem(this, tr("Select your sound"),
                                         tr("Sound:"), items, 0, false, &ok);
    if (ok)
    {
        _ui.soundNameLineEdit->setText(item);
        updateModifiedFlag();
    }
}
void CParticleTextureAnimWidget::setMultitexturing(bool enabled)
{
	if (_MTP->isMultiTextureEnabled() != enabled)
	{
		_MTP->enableMultiTexture(enabled);
		updateModifiedFlag();
	}
}
void CSoundPage::setMute(bool state)
{
    if (state != _Sound->getMute())
    {
        _Sound->setMute(state);
        updateModifiedFlag();
    }
}
Beispiel #4
0
void CLocatedPage::setParametricMotion(bool state)
{
	if (state != _Located->isParametricMotionEnabled())
	{
		_Located->enableParametricMotion(state);
		updateModifiedFlag();
	}
}
Beispiel #5
0
void CLocatedPage::setDisgradeWithLod(bool state)
{
	if (state != _Located->hasLODDegradation())
	{
		_Located->forceLODDegradation(state);
		updateModifiedFlag();
	}
}
Beispiel #6
0
void CLocatedPage::setTriggerOnDeath(bool state)
{
	if (state != _Located->isTriggerOnDeathEnabled())
	{
		_Located->enableTriggerOnDeath(state);
		updateTriggerOnDeath();
		updateModifiedFlag();
	}
}
Beispiel #7
0
void CLocatedPage::setMatrixMode(int index)
{
	nlassert(_Located);
	if (index != _Located->getMatrixMode())
	{
		_Located->setMatrixMode((NL3D::TPSMatrixMode) index);
		updateIntegrable();
		updateModifiedFlag();
	}
}
Beispiel #8
0
void CLocatedPage::editTriggerOnDeath()
{
	bool ok;
	int i = QInputDialog::getInt(this, tr("Set the extern ID"),
								 tr("0 means no extern access."),
								 _Located->getTriggerEmitterID(), 0, 9999, 1, &ok);
	if (ok)
	{
		_Located->setTriggerEmitterID(uint32(i));
		updateModifiedFlag();
	}
}
Beispiel #9
0
void CLocatedPage::setLimitedLifeTime(bool state)
{
	if (state != _Located->getLastForever()) return;
	if (!state)
	{
		bool forceApplied = false;
		// check that no force are applied on the located
		std::vector<NL3D::CPSTargetLocatedBindable *> targeters;
		_Located->getOwner()->getTargeters(_Located, targeters);
		for(uint k = 0; k < targeters.size(); ++k)
		{
			if (targeters[k]->getType() == NL3D::PSForce)
			{
				forceApplied = true;
				break;
			}
		}
		if (forceApplied)
		{
			int ret = QMessageBox::critical(this, tr("NeL particle system editor"),
											tr("The object has force(s) applied on it. If it last forever, "
											   "its motion can become instable after a while. Continue anyway ? (clue : you've been warned ..)"),
											QMessageBox::Ok | QMessageBox::Cancel);

			if (ret == QMessageBox::Cancel)
			{
				_ui.limitedLifeTimeCheckBox->setChecked(true);
				return;
			}
		}
		if (_Located->setLastForever())
		{
			_ui.lifeWidget->setEnabled(false);
		}
		else
		{
			QMessageBox::critical(this, tr("NeL particle system editor"),
								  tr("Can't perform operation : the system is flagged with 'No max nb steps' or uses the preset 'Spell FX', "
									 "and thus, should have a finite duration. Please remove that flag first."),
								  QMessageBox::Ok);
			_ui.limitedLifeTimeCheckBox->setChecked(true);
		}
	}
	else
	{
		_Located->setInitialLife(_Located->getInitialLife());
		_ui.lifeWidget->setEnabled(true);
	}
	updateTriggerOnDeath();
	Modules::psEdit().resetAutoCount(_Node);
	updateModifiedFlag();
}
Beispiel #10
0
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();
}
void CSoundPage::setKeepPitch(bool state)
{
    bool hadScheme = _PitchWrapper.getScheme() != NULL;
    if (state != _Sound->getUseOriginalPitchFlag())
    {
        _Sound->setUseOriginalPitchFlag(state);
        updateModifiedFlag();
    }
    if (state)
    {
        if (hadScheme) _ui.pitchWidget->updateUi();
        ///!!!!!
        ///_PitchDlg->closeEditWindow();
    }
    _ui.pitchWidget->setEnabled(!state);
}
void CMeshWidget::setMorphMesh(bool state)
{
    NL3D::CPSConstraintMesh *cm = NLMISC::safe_cast<NL3D::CPSConstraintMesh *>(_ShapeParticle);
    if (!cm) return;
    if (state != (cm->getNumShapes() > 1))
    {
        if (state)
        {
            // morphing enabled
            std::string currName[2] = { cm->getShape(), cm->getShape() };
            cm->setShapes(currName, 2);
        }
        else
        {
            // morphing disabled
            std::string currName = cm->getShape(0);
            cm->setShape(currName);
        }
        updateModifiedFlag();
    }
    updateForMorph();
}
void CParticleTextureAnimWidget::setEnabledTexAnim(bool state)
{
  	if (state)
	{
		if (_MTP)
			_ui.multitexturingCheckBox->setChecked(false);

		// When you try to load a dummy texture, remove alternative paths, an assertion is thrown otherwise
		NLMISC::CPath::removeAllAlternativeSearchPath();
		
		// put a dummy texture as a first texture
		NLMISC::CSmartPtr<NL3D::ITexture> tex = (NL3D::ITexture *) new NL3D::CTextureFile(std::string(""));
		NL3D::CTextureGrouped *tg = new NL3D::CTextureGrouped;
		tg->setTextures(&tex, 1);
		_EditedParticle->setTextureGroup(tg);
		_EditedParticle->setTextureIndex(0);
	}
	else
	{
		_EditedParticle->setTexture(NULL);
	}
	updateTexAnimState(state);
	updateModifiedFlag();
}
void CSoundPage::setEmissionPercent(float value)
{
	_Sound->setEmissionPercent(value);
	updateModifiedFlag();
}
Beispiel #15
0
void CLocatedPage::setCurrentCount()
{
	// set new max size
	_ui.maxNumParticleWidget->setValue(_Located->getSize());
	updateModifiedFlag();
}