本文整理汇总了C++中LLGestureStep::getType方法的典型用法代码示例。如果您正苦于以下问题:C++ LLGestureStep::getType方法的具体用法?C++ LLGestureStep::getType怎么用?C++ LLGestureStep::getType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLGestureStep
的用法示例。
在下文中一共展示了LLGestureStep::getType方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: hasLoadingAssets
// static
bool LLGestureMgr::hasLoadingAssets(LLMultiGesture* gesture)
{
LLGestureMgr& self = LLGestureMgr::instance();
for (std::vector<LLGestureStep*>::iterator steps_it = gesture->mSteps.begin();
steps_it != gesture->mSteps.end();
++steps_it)
{
LLGestureStep* step = *steps_it;
switch(step->getType())
{
case STEP_ANIMATION:
{
LLGestureStepAnimation* anim_step = (LLGestureStepAnimation*)step;
const LLUUID& anim_id = anim_step->mAnimAssetID;
if (!(anim_id.isNull()
|| anim_step->mFlags & ANIM_FLAG_STOP
|| self.mLoadingAssets.find(anim_id) == self.mLoadingAssets.end()))
{
return true;
}
break;
}
case STEP_SOUND:
{
LLGestureStepSound* sound_step = (LLGestureStepSound*)step;
const LLUUID& sound_id = sound_step->mSoundAssetID;
if (!(sound_id.isNull()
|| self.mLoadingAssets.find(sound_id) == self.mLoadingAssets.end()))
{
return true;
}
break;
}
case STEP_CHAT:
case STEP_WAIT:
case STEP_EOF:
{
break;
}
default:
{
LL_WARNS() << "Unknown gesture step type: " << step->getType() << LL_ENDL;
}
}
}
return false;
}
示例2: onCommitWait
// static
void LLPreviewGesture::onCommitWait(LLUICtrl* ctrl, void* data)
{
LLPreviewGesture* self = (LLPreviewGesture*)data;
LLScrollListItem* step_item = self->mStepList->getFirstSelected();
if (!step_item) return;
LLGestureStep* step = (LLGestureStep*)step_item->getUserdata();
if (step->getType() != STEP_WAIT) return;
LLGestureStepWait* wait_step = (LLGestureStepWait*)step;
U32 flags = 0x0;
if (self->mWaitAnimCheck->get()) flags |= WAIT_FLAG_ALL_ANIM;
if (self->mWaitTimeCheck->get()) flags |= WAIT_FLAG_TIME;
wait_step->mFlags = flags;
{
LLLocale locale(LLLocale::USER_LOCALE);
F32 wait_seconds = (F32)atof(self->mWaitTimeEditor->getText().c_str());
if (wait_seconds < 0.f) wait_seconds = 0.f;
if (wait_seconds > 3600.f) wait_seconds = 3600.f;
wait_step->mWaitSeconds = wait_seconds;
}
// Enable the input area if necessary
self->mWaitTimeEditor->setEnabled(self->mWaitTimeCheck->get());
// Update the UI label in the list
updateLabel(step_item);
self->mDirty = TRUE;
self->refresh();
}
示例3: onCommitAnimationTrigger
// static
void LLPreviewGesture::onCommitAnimationTrigger(LLUICtrl* ctrl, void *data)
{
LLPreviewGesture* self = (LLPreviewGesture*)data;
LLScrollListItem* step_item = self->mStepList->getFirstSelected();
if (step_item)
{
LLGestureStep* step = (LLGestureStep*)step_item->getUserdata();
if (step->getType() == STEP_ANIMATION)
{
LLGestureStepAnimation* anim_step = (LLGestureStepAnimation*)step;
if (self->mAnimationRadio->getSelectedIndex() == 0)
{
// start
anim_step->mFlags &= ~ANIM_FLAG_STOP;
}
else
{
// stop
anim_step->mFlags |= ANIM_FLAG_STOP;
}
// Update the UI label in the list
updateLabel(step_item);
self->mDirty = TRUE;
self->refresh();
}
}
}
示例4: onCommitAnimation
// static
void LLPreviewGesture::onCommitAnimation(LLUICtrl* ctrl, void* data)
{
LLPreviewGesture* self = (LLPreviewGesture*)data;
LLScrollListItem* step_item = self->mStepList->getFirstSelected();
if (step_item)
{
LLGestureStep* step = (LLGestureStep*)step_item->getUserdata();
if (step->getType() == STEP_ANIMATION)
{
// Assign the animation name
LLGestureStepAnimation* anim_step = (LLGestureStepAnimation*)step;
if (self->mAnimationCombo->getCurrentIndex() == 0)
{
anim_step->mAnimName.clear();
anim_step->mAnimAssetID.setNull();
}
else
{
anim_step->mAnimName = self->mAnimationCombo->getSimple();
anim_step->mAnimAssetID = self->mAnimationCombo->getCurrentID();
}
//anim_step->mFlags = 0x0;
// Update the UI label in the list
updateLabel(step_item);
self->mDirty = TRUE;
self->refresh();
}
}
}
示例5: onCommitWaitTime
void LLPreviewGesture::onCommitWaitTime()
{
LLScrollListItem* step_item = mStepList->getFirstSelected();
if (!step_item) return;
LLGestureStep* step = (LLGestureStep*)step_item->getUserdata();
if (step->getType() != STEP_WAIT) return;
mWaitTimeCheck->set(TRUE);
onCommitWait();
}
示例6: onCommitWaitTime
// static
void LLPreviewGesture::onCommitWaitTime(LLUICtrl* ctrl, void* data)
{
LLPreviewGesture* self = (LLPreviewGesture*)data;
LLScrollListItem* step_item = self->mStepList->getFirstSelected();
if (!step_item) return;
LLGestureStep* step = (LLGestureStep*)step_item->getUserdata();
if (step->getType() != STEP_WAIT) return;
self->mWaitTimeCheck->set(TRUE);
onCommitWait(ctrl, data);
}
示例7: onCommitChat
void LLPreviewGesture::onCommitChat()
{
LLScrollListItem* step_item = mStepList->getFirstSelected();
if (!step_item) return;
LLGestureStep* step = (LLGestureStep*)step_item->getUserdata();
if (step->getType() != STEP_CHAT) return;
LLGestureStepChat* chat_step = (LLGestureStepChat*)step;
chat_step->mChatText = mChatEditor->getText();
chat_step->mFlags = 0x0;
// Update the UI label in the list
updateLabel(step_item);
mDirty = TRUE;
refresh();
}
示例8: onCommitSound
void LLPreviewGesture::onCommitSound()
{
LLScrollListItem* step_item = mStepList->getFirstSelected();
if (step_item)
{
LLGestureStep* step = (LLGestureStep*)step_item->getUserdata();
if (step->getType() == STEP_SOUND)
{
// Assign the sound name
LLGestureStepSound* sound_step = (LLGestureStepSound*)step;
sound_step->mSoundName = mSoundCombo->getSimple();
sound_step->mSoundAssetID = mSoundCombo->getCurrentID();
sound_step->mFlags = 0x0;
// Update the UI label in the list
updateLabel(step_item);
mDirty = TRUE;
refresh();
}
}
}
示例9: serialize
BOOL LLMultiGesture::serialize(LLDataPacker& dp) const
{
dp.packS32(GESTURE_VERSION, "version");
dp.packU8(mKey, "key");
dp.packU32(mMask, "mask");
dp.packString(mTrigger, "trigger");
dp.packString(mReplaceText, "replace");
S32 count = (S32)mSteps.size();
dp.packS32(count, "step_count");
S32 i;
for (i = 0; i < count; ++i)
{
LLGestureStep* step = mSteps[i];
dp.packS32(step->getType(), "step_type");
BOOL ok = step->serialize(dp);
if (!ok)
{
return FALSE;
}
}
return TRUE;
}
示例10: loadUIFromGesture
void LLPreviewGesture::loadUIFromGesture(LLMultiGesture* gesture)
{
/*LLInventoryItem* item = getItem();
if (item)
{
LLLineEditor* descEditor = LLUICtrlFactory::getLineEditorByName(this, "desc");
descEditor->setText(item->getDescription());
}*/
mTriggerEditor->setText(gesture->mTrigger);
mReplaceEditor->setText(gesture->mReplaceText);
switch (gesture->mMask)
{
default:
case MASK_NONE:
mModifierCombo->setSimple( NONE_LABEL );
break;
case MASK_SHIFT:
mModifierCombo->setSimple( SHIFT_LABEL );
break;
case MASK_CONTROL:
mModifierCombo->setSimple( CTRL_LABEL );
break;
}
mKeyCombo->setCurrentByIndex(0);
if (gesture->mKey != KEY_NONE)
{
mKeyCombo->setSimple(LLKeyboard::stringFromKey(gesture->mKey));
}
// Make UI steps for each gesture step
S32 i;
S32 count = gesture->mSteps.size();
for (i = 0; i < count; ++i)
{
LLGestureStep* step = gesture->mSteps[i];
LLGestureStep* new_step = NULL;
switch(step->getType())
{
case STEP_ANIMATION:
{
LLGestureStepAnimation* anim_step = (LLGestureStepAnimation*)step;
LLGestureStepAnimation* new_anim_step =
new LLGestureStepAnimation(*anim_step);
new_step = new_anim_step;
break;
}
case STEP_SOUND:
{
LLGestureStepSound* sound_step = (LLGestureStepSound*)step;
LLGestureStepSound* new_sound_step =
new LLGestureStepSound(*sound_step);
new_step = new_sound_step;
break;
}
case STEP_CHAT:
{
LLGestureStepChat* chat_step = (LLGestureStepChat*)step;
LLGestureStepChat* new_chat_step =
new LLGestureStepChat(*chat_step);
new_step = new_chat_step;
break;
}
case STEP_WAIT:
{
LLGestureStepWait* wait_step = (LLGestureStepWait*)step;
LLGestureStepWait* new_wait_step =
new LLGestureStepWait(*wait_step);
new_step = new_wait_step;
break;
}
default:
{
break;
}
}
if (!new_step) continue;
// Create an enabled item with this step
LLSD row;
row["columns"][0]["value"] = new_step->getLabel();
row["columns"][0]["font"] = "SANSSERIF_SMALL";
LLScrollListItem* item = mStepList->addElement(row);
item->setUserdata(new_step);
}
}
示例11: refresh
void LLPreviewGesture::refresh()
{
// If previewing or item is incomplete, all controls are disabled
LLViewerInventoryItem* item = (LLViewerInventoryItem*)getItem();
bool is_complete = (item && item->isComplete()) ? true : false;
if (mPreviewGesture || !is_complete)
{
childSetEnabled("desc", FALSE);
//mDescEditor->setEnabled(FALSE);
mTriggerEditor->setEnabled(FALSE);
mReplaceText->setEnabled(FALSE);
mReplaceEditor->setEnabled(FALSE);
mModifierCombo->setEnabled(FALSE);
mKeyCombo->setEnabled(FALSE);
mLibraryList->setEnabled(FALSE);
mAddBtn->setEnabled(FALSE);
mUpBtn->setEnabled(FALSE);
mDownBtn->setEnabled(FALSE);
mDeleteBtn->setEnabled(FALSE);
mStepList->setEnabled(FALSE);
mOptionsText->setEnabled(FALSE);
mAnimationCombo->setEnabled(FALSE);
mAnimationRadio->setEnabled(FALSE);
mSoundCombo->setEnabled(FALSE);
mChatEditor->setEnabled(FALSE);
mWaitAnimCheck->setEnabled(FALSE);
mWaitTimeCheck->setEnabled(FALSE);
mWaitTimeEditor->setEnabled(FALSE);
mActiveCheck->setEnabled(FALSE);
mSaveBtn->setEnabled(FALSE);
// Make sure preview button is enabled, so we can stop it
mPreviewBtn->setEnabled(TRUE);
return;
}
BOOL modifiable = item->getPermissions().allowModifyBy(gAgent.getID());
childSetEnabled("desc", modifiable);
mTriggerEditor->setEnabled(TRUE);
mLibraryList->setEnabled(modifiable);
mStepList->setEnabled(modifiable);
mOptionsText->setEnabled(modifiable);
mAnimationCombo->setEnabled(modifiable);
mAnimationRadio->setEnabled(modifiable);
mSoundCombo->setEnabled(modifiable);
mChatEditor->setEnabled(modifiable);
mWaitAnimCheck->setEnabled(modifiable);
mWaitTimeCheck->setEnabled(modifiable);
mWaitTimeEditor->setEnabled(modifiable);
mActiveCheck->setEnabled(TRUE);
const std::string& trigger = mTriggerEditor->getText();
BOOL have_trigger = !trigger.empty();
const std::string& replace = mReplaceEditor->getText();
BOOL have_replace = !replace.empty();
LLScrollListItem* library_item = mLibraryList->getFirstSelected();
BOOL have_library = (library_item != NULL);
LLScrollListItem* step_item = mStepList->getFirstSelected();
S32 step_index = mStepList->getFirstSelectedIndex();
S32 step_count = mStepList->getItemCount();
BOOL have_step = (step_item != NULL);
mReplaceText->setEnabled(have_trigger || have_replace);
mReplaceEditor->setEnabled(have_trigger || have_replace);
mModifierCombo->setEnabled(TRUE);
mKeyCombo->setEnabled(TRUE);
mAddBtn->setEnabled(modifiable && have_library);
mUpBtn->setEnabled(modifiable && have_step && step_index > 0);
mDownBtn->setEnabled(modifiable && have_step && step_index < step_count-1);
mDeleteBtn->setEnabled(modifiable && have_step);
// Assume all not visible
mAnimationCombo->setVisible(FALSE);
mAnimationRadio->setVisible(FALSE);
mSoundCombo->setVisible(FALSE);
mChatEditor->setVisible(FALSE);
mWaitAnimCheck->setVisible(FALSE);
mWaitTimeCheck->setVisible(FALSE);
mWaitTimeEditor->setVisible(FALSE);
if (have_step)
{
// figure out the type, show proper options, update text
LLGestureStep* step = (LLGestureStep*)step_item->getUserdata();
EStepType type = step->getType();
switch(type)
{
case STEP_ANIMATION:
{
LLGestureStepAnimation* anim_step = (LLGestureStepAnimation*)step;
mOptionsText->setText("Animation to play:");
mAnimationCombo->setVisible(TRUE);
mAnimationRadio->setVisible(TRUE);
//.........这里部分代码省略.........
示例12: createGesture
LLMultiGesture* LLPreviewGesture::createGesture()
{
LLMultiGesture* gesture = new LLMultiGesture();
gesture->mTrigger = mTriggerEditor->getText();
gesture->mReplaceText = mReplaceEditor->getText();
const std::string& modifier = mModifierCombo->getSimple();
if (modifier == CTRL_LABEL)
{
gesture->mMask = MASK_CONTROL;
}
else if (modifier == SHIFT_LABEL)
{
gesture->mMask = MASK_SHIFT;
}
else
{
gesture->mMask = MASK_NONE;
}
if (mKeyCombo->getCurrentIndex() == 0)
{
gesture->mKey = KEY_NONE;
}
else
{
const std::string& key_string = mKeyCombo->getSimple();
LLKeyboard::keyFromString(key_string, &(gesture->mKey));
}
std::vector<LLScrollListItem*> data_list = mStepList->getAllData();
std::vector<LLScrollListItem*>::iterator data_itor;
for (data_itor = data_list.begin(); data_itor != data_list.end(); ++data_itor)
{
LLScrollListItem* item = *data_itor;
LLGestureStep* step = (LLGestureStep*)item->getUserdata();
switch(step->getType())
{
case STEP_ANIMATION:
{
// Copy UI-generated step into actual gesture step
LLGestureStepAnimation* anim_step = (LLGestureStepAnimation*)step;
LLGestureStepAnimation* new_anim_step =
new LLGestureStepAnimation(*anim_step);
gesture->mSteps.push_back(new_anim_step);
break;
}
case STEP_SOUND:
{
// Copy UI-generated step into actual gesture step
LLGestureStepSound* sound_step = (LLGestureStepSound*)step;
LLGestureStepSound* new_sound_step =
new LLGestureStepSound(*sound_step);
gesture->mSteps.push_back(new_sound_step);
break;
}
case STEP_CHAT:
{
// Copy UI-generated step into actual gesture step
LLGestureStepChat* chat_step = (LLGestureStepChat*)step;
LLGestureStepChat* new_chat_step =
new LLGestureStepChat(*chat_step);
gesture->mSteps.push_back(new_chat_step);
break;
}
case STEP_WAIT:
{
// Copy UI-generated step into actual gesture step
LLGestureStepWait* wait_step = (LLGestureStepWait*)step;
LLGestureStepWait* new_wait_step =
new LLGestureStepWait(*wait_step);
gesture->mSteps.push_back(new_wait_step);
break;
}
default:
{
break;
}
}
}
return gesture;
}
示例13: playGesture
void LLGestureMgr::playGesture(LLMultiGesture* gesture, bool local)
{
if (!gesture) return;
// Reset gesture to first step
gesture->mCurrentStep = 0;
// Add to list of playing
gesture->mPlaying = TRUE;
gesture->mLocal = local;
mPlaying.push_back(gesture);
// Load all needed assets to minimize the delays
// when gesture is playing.
for (std::vector<LLGestureStep*>::iterator steps_it = gesture->mSteps.begin();
steps_it != gesture->mSteps.end();
++steps_it)
{
LLGestureStep* step = *steps_it;
switch(step->getType())
{
case STEP_ANIMATION:
{
LLGestureStepAnimation* anim_step = (LLGestureStepAnimation*)step;
const LLUUID& anim_id = anim_step->mAnimAssetID;
// Don't request the animation if this step stops it or if it is already in Static VFS
if (!(anim_id.isNull()
|| anim_step->mFlags & ANIM_FLAG_STOP
|| gAssetStorage->hasLocalAsset(anim_id, LLAssetType::AT_ANIMATION)))
{
//Singu note: Don't attempt to fetch expressions/emotes.
const char* emote_name = gAnimLibrary.animStateToString(anim_id);
if(emote_name && strstr(emote_name,"express_")==emote_name)
{
break;
}
mLoadingAssets.insert(anim_id);
LLUUID* id = new LLUUID(gAgentID);
gAssetStorage->getAssetData(anim_id,
LLAssetType::AT_ANIMATION,
onAssetLoadComplete,
(void *)id,
TRUE);
}
break;
}
case STEP_SOUND:
{
LLGestureStepSound* sound_step = (LLGestureStepSound*)step;
const LLUUID& sound_id = sound_step->mSoundAssetID;
if (!(sound_id.isNull()
|| gAssetStorage->hasLocalAsset(sound_id, LLAssetType::AT_SOUND)))
{
mLoadingAssets.insert(sound_id);
gAssetStorage->getAssetData(sound_id,
LLAssetType::AT_SOUND,
onAssetLoadComplete,
NULL,
TRUE);
}
break;
}
case STEP_CHAT:
case STEP_WAIT:
case STEP_EOF:
{
break;
}
default:
{
LL_WARNS() << "Unknown gesture step type: " << step->getType() << LL_ENDL;
}
}
}
// And get it going
stepGesture(gesture);
notifyObservers();
}