BOOL LLFloaterAO::postBuild(void) { LLComboBox* combo; LLScrollListCtrl* list; childSetAction("btn_save", onClickSave, this); childSetAction("btn_load", onClickLoad, this); combo = getChild<LLComboBox>( "combo_anim_type"); combo->setCommitCallback(onCommitType); combo->setCallbackUserData(this); combo->selectFirstItem(); mAnimTypeCombo = combo; mCurrentAnimType = mAnimTypeCombo->getValue().asString(); combo = getChild<LLComboBox>( "combo_anim_list"); mAnimListCombo = combo; childSetAction("combo_anim_add", onClickAnimAdd, this); childSetAction("combo_anim_delete", onClickAnimRemove, this); list = getChild<LLScrollListCtrl>("active_anim_list"); mAnimationList = list; addAnimations(); refresh(); return TRUE; }
void AmmoView::initRessources() { switch(type) { case BULLET : setTexture(textures[BULLET]); addAnimations(animations_list[BULLET]); sounds[BULLET]->play(); break; case HEAVY_BULLET : setTexture(textures[BULLET]); addAnimations(animations_list[BULLET]); sounds[HEAVY_BULLET]->play(); break; case LIGHT_BULLET : setTexture(textures[BULLET]); addAnimations(animations_list[BULLET]); sounds[BULLET]->play(); break; case FLAME : setTexture(textures[FLAME]); addAnimations(animations_list[FLAME]); sounds[FLAME]->play(); break; case GRENADE : setTexture(textures[GRENADE]); // Provisoire, besoin d'un sprite de grenade addAnimations(animations_list[GRENADE]); break; } changeAnimation(1,false); changeAnimation(0,false); updateIntRect(); }
EnemyView::EnemyView(Int2 pos, TypeEnemy t, bool AI) :Enemy(pos,t,AI) { /* REBEL */ if(type == REBEL) { loadRessources(REBEL); initSounds(); setTexture(textures[REBEL]); addAnimations(animations_list[REBEL]); changeAnimation(REBEL_WATCH); updateIntRect(); } /* BOWSER */ else if(type == BOWSER) { loadRessources(BOWSER); initSounds(); setTexture(textures[BOWSER]); addAnimations(animations_list[BOWSER]); changeAnimation(BOWSER_STAND); updateIntRect(); } /* FLYING */ else if(type == FLYING) { loadRessources(FLYING); initSounds(); setTexture(textures[FLYING]); addAnimations(animations_list[FLYING]); changeAnimation(FLYING_FLY); updateIntRect(); } body.setSize(Vector2f(size.x,size.y)); }
qSslChat :: qSslChat() { setupUi(this); messageList -> setDisabled(true); messageList -> setAcceptDrops(true); msgEdit -> setDisabled(true); sendButton -> setDisabled(true); smileyButton -> setDisabled(true); cinfoButton -> setDisabled(true); portBox -> setRange(1024,65535); portBox -> setValue(7752); setWindowTitle("Buddies SSL Chat"); setWindowIcon(QIcon(":/icons/Logo.png")); mode=0; server=0; cinfoButton -> setIcon(QIcon(":/icons/encrypted.png")); cinfoButton -> setIconSize(QSize(20,20)); cinfoButton -> setToolTip(tr("Display certificate info")); connect(cinfoButton,SIGNAL(clicked()),this,SLOT(displayCertificateInfo())); smileyButton -> setIcon(QIcon(":/emoticons/01.gif")); smileyButton -> setIconSize(QSize(20,20)); connect(smileyButton,SIGNAL(clicked()),this,SLOT(selectSmiley())); emoSelector = new EmoticonSelector(this); emoSelector -> hide(); emoSelector -> alignTo(smileyButton); connect(emoSelector,SIGNAL(smileySelected(QString,QString)),this,SLOT(insertSmiley(QString,QString))); tableFormat.setBorder(0); //systray = new systemTray(this); addAnimations(); QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF8")); QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF8")); connect(hostButton,SIGNAL(clicked()),this,SLOT(hostConnection())); connect(connectButton,SIGNAL(clicked()),this,SLOT(connectToHost())); connect(disconnectButton,SIGNAL(clicked()),this,SLOT(endConnection())); connect(messageList,SIGNAL(fileSendInitiated(QString,int,int)),this,SLOT(sendFile(QString,int,int))); }
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); mAnimationRadio->setSelectedIndex((anim_step->mFlags & ANIM_FLAG_STOP) ? 1 : 0); mAnimationCombo->setCurrentByID(anim_step->mAnimAssetID); break; } case STEP_SOUND: { LLGestureStepSound* sound_step = (LLGestureStepSound*)step; mOptionsText->setText("Sound to play:"); mSoundCombo->setVisible(TRUE); mSoundCombo->setCurrentByID(sound_step->mSoundAssetID); break; } case STEP_CHAT: { LLGestureStepChat* chat_step = (LLGestureStepChat*)step; mOptionsText->setText("Chat to say:"); mChatEditor->setVisible(TRUE); mChatEditor->setText(chat_step->mChatText); break; } case STEP_WAIT: { LLGestureStepWait* wait_step = (LLGestureStepWait*)step; mOptionsText->setText("Wait:"); mWaitAnimCheck->setVisible(TRUE); mWaitAnimCheck->set(wait_step->mFlags & WAIT_FLAG_ALL_ANIM); mWaitTimeCheck->setVisible(TRUE); mWaitTimeCheck->set(wait_step->mFlags & WAIT_FLAG_TIME); mWaitTimeEditor->setVisible(TRUE); char buffer[16]; /*Flawfinder: ignore*/ snprintf(buffer, sizeof(buffer), "%.1f", (double)wait_step->mWaitSeconds); /* Flawfinder: ignore */ mWaitTimeEditor->setText(buffer); break; } default: break; } } else { // no gesture mOptionsText->setText(""); } BOOL active = gGestureManager.isGestureActive(mItemUUID); mActiveCheck->set(active); // Can only preview if there are steps mPreviewBtn->setEnabled(step_count > 0); // And can only save if changes have been made mSaveBtn->setEnabled(mDirty); addAnimations(); addSounds(); }
BOOL LLPreviewGesture::postBuild() { LLLineEditor* edit; LLComboBox* combo; LLButton* btn; LLScrollListCtrl* list; LLTextBox* text; LLCheckBoxCtrl* check; edit = LLViewerUICtrlFactory::getLineEditorByName(this, "trigger_editor"); edit->setKeystrokeCallback(onKeystrokeCommit); edit->setCommitCallback(onCommitSetDirty); edit->setCommitOnFocusLost(TRUE); edit->setCallbackUserData(this); edit->setIgnoreTab(TRUE); mTriggerEditor = edit; text = LLViewerUICtrlFactory::getTextBoxByName(this, "replace_text"); text->setEnabled(FALSE); mReplaceText = text; edit = LLViewerUICtrlFactory::getLineEditorByName(this, "replace_editor"); edit->setEnabled(FALSE); edit->setKeystrokeCallback(onKeystrokeCommit); edit->setCommitCallback(onCommitSetDirty); edit->setCommitOnFocusLost(TRUE); edit->setCallbackUserData(this); edit->setIgnoreTab(TRUE); mReplaceEditor = edit; combo = LLViewerUICtrlFactory::getComboBoxByName(this, "modifier_combo"); combo->setCommitCallback(onCommitSetDirty); combo->setCallbackUserData(this); mModifierCombo = combo; combo = LLViewerUICtrlFactory::getComboBoxByName(this, "key_combo"); combo->setCommitCallback(onCommitSetDirty); combo->setCallbackUserData(this); mKeyCombo = combo; list = LLViewerUICtrlFactory::getScrollListByName(this, "library_list"); list->setCommitCallback(onCommitLibrary); list->setDoubleClickCallback(onClickAdd); list->setCallbackUserData(this); mLibraryList = list; btn = LLViewerUICtrlFactory::getButtonByName(this, "add_btn"); btn->setClickedCallback(onClickAdd); btn->setCallbackUserData(this); btn->setEnabled(FALSE); mAddBtn = btn; btn = LLViewerUICtrlFactory::getButtonByName(this, "up_btn"); btn->setClickedCallback(onClickUp); btn->setCallbackUserData(this); btn->setEnabled(FALSE); mUpBtn = btn; btn = LLViewerUICtrlFactory::getButtonByName(this, "down_btn"); btn->setClickedCallback(onClickDown); btn->setCallbackUserData(this); btn->setEnabled(FALSE); mDownBtn = btn; btn = LLViewerUICtrlFactory::getButtonByName(this, "delete_btn"); btn->setClickedCallback(onClickDelete); btn->setCallbackUserData(this); btn->setEnabled(FALSE); mDeleteBtn = btn; list = LLViewerUICtrlFactory::getScrollListByName(this, "step_list"); list->setCommitCallback(onCommitStep); list->setCallbackUserData(this); mStepList = list; // Options text = LLViewerUICtrlFactory::getTextBoxByName(this, "options_text"); text->setBorderVisible(TRUE); mOptionsText = text; combo = LLViewerUICtrlFactory::getComboBoxByName(this, "animation_list"); combo->setVisible(FALSE); combo->setCommitCallback(onCommitAnimation); combo->setCallbackUserData(this); mAnimationCombo = combo; LLRadioGroup* group; group = LLViewerUICtrlFactory::getRadioGroupByName(this, "animation_trigger_type"); group->setVisible(FALSE); group->setCommitCallback(onCommitAnimationTrigger); group->setCallbackUserData(this); mAnimationRadio = group; combo = LLViewerUICtrlFactory::getComboBoxByName(this, "sound_list"); combo->setVisible(FALSE); combo->setCommitCallback(onCommitSound); combo->setCallbackUserData(this); mSoundCombo = combo; edit = LLViewerUICtrlFactory::getLineEditorByName(this, "chat_editor"); edit->setVisible(FALSE); edit->setCommitCallback(onCommitChat); //edit->setKeystrokeCallback(onKeystrokeCommit); edit->setCommitOnFocusLost(TRUE); edit->setCallbackUserData(this); edit->setIgnoreTab(TRUE); mChatEditor = edit; check = LLViewerUICtrlFactory::getCheckBoxByName(this, "wait_anim_check"); check->setVisible(FALSE); check->setCommitCallback(onCommitWait); check->setCallbackUserData(this); mWaitAnimCheck = check; check = LLViewerUICtrlFactory::getCheckBoxByName(this, "wait_time_check"); check->setVisible(FALSE); check->setCommitCallback(onCommitWait); check->setCallbackUserData(this); mWaitTimeCheck = check; edit = LLViewerUICtrlFactory::getLineEditorByName(this, "wait_time_editor"); edit->setEnabled(FALSE); edit->setVisible(FALSE); edit->setPrevalidate(LLLineEditor::prevalidateFloat); // edit->setKeystrokeCallback(onKeystrokeCommit); edit->setCommitOnFocusLost(TRUE); edit->setCommitCallback(onCommitWaitTime); edit->setCallbackUserData(this); edit->setIgnoreTab(TRUE); mWaitTimeEditor = edit; // Buttons at the bottom check = LLViewerUICtrlFactory::getCheckBoxByName(this, "active_check"); check->setCommitCallback(onCommitActive); check->setCallbackUserData(this); mActiveCheck = check; btn = LLViewerUICtrlFactory::getButtonByName(this, "save_btn"); btn->setClickedCallback(onClickSave); btn->setCallbackUserData(this); mSaveBtn = btn; btn = LLViewerUICtrlFactory::getButtonByName(this, "preview_btn"); btn->setClickedCallback(onClickPreview); btn->setCallbackUserData(this); mPreviewBtn = btn; // Populate the comboboxes addModifiers(); addKeys(); addAnimations(); addSounds(); const LLInventoryItem* item = getItem(); if (item) { childSetCommitCallback("desc", LLPreview::onText, this); childSetText("desc", item->getDescription()); childSetPrevalidate("desc", &LLLineEditor::prevalidatePrintableNotPipe); } return TRUE; }