コード例 #1
0
ファイル: floaterao.cpp プロジェクト: N3X15/Luna-Viewer
void LLFloaterAO::onComboBoxCommit(LLUICtrl* ctrl, void* userdata)
{
	LLComboBox* box = (LLComboBox*)ctrl;
	if(box)
	{
		if (box->getName() == "stand")
		{
			stand_iterator = box->getCurrentIndex();
			if (mAOStandTimer) mAOStandTimer->reset();
			ChangeStand(TRUE);
		}
		else
		{
			std::string stranim = box->getValue().asString();

			for (std::vector<struct_combobox>::iterator iter = mComboBoxes.begin(); iter != mComboBoxes.end(); ++iter)
			{
				if (box->getName() == iter->name)
				{
					gSavedPerAccountSettings.setString("PhoenixAODefault"+iter->name,stranim);
					int boxstate = iter->state;

					for (std::vector<struct_default_anims>::iterator iter = mAODefaultAnims.begin(); iter != mAODefaultAnims.end(); ++iter)
					{
						if (boxstate == iter->state)
						{
							iter->ao_id = GetAnimIDByName(stranim);
							if (getAnimationState() == boxstate) // only play anim for the current state, change sits for example
							{
								startAOMotion(iter->ao_id,TRUE,TRUE);
							}
							return;
						}
					}
				}
			}
		}
	}
}