コード例 #1
0
ファイル: ao.cpp プロジェクト: gabeharms/firestorm
// virtual
BOOL FloaterAO::handleDragAndDrop(S32 x,S32 y,MASK mask,BOOL drop,EDragAndDropType type,void* data,
									EAcceptance* accept,std::string& tooltipMsg)
{
	// no drag & drop on small interface
	if(!mMore)
	{
		tooltipMsg=getString("ao_dnd_only_on_full_interface");
		*accept=ACCEPT_NO;
		return TRUE;
	}

	LLInventoryItem* item=(LLInventoryItem*) data;

	if(type==DAD_NOTECARD)
	{
		if(mImportRunning)
		{
			*accept=ACCEPT_NO;
			return TRUE;
		}
		*accept=ACCEPT_YES_SINGLE;
		if(item && drop)
		{
			if(AOEngine::instance().importNotecard(item))
			{
				reloading(TRUE);
				mReloadButton->setEnabled(FALSE);
				mImportRunning=TRUE;
			}
		}
	}
	else if(type==DAD_ANIMATION)
	{
		if(!drop && (!mSelectedSet || !mSelectedState || !mCanDragAndDrop))
		{
			*accept=ACCEPT_NO;
			return TRUE;
		}
		*accept=ACCEPT_YES_MULTI;
		if(item && drop)
		{
			if(AOEngine::instance().addAnimation(mSelectedSet,mSelectedState,item))
			{
				addAnimation(item->getName());

				// TODO: this would be the right thing to do, but it blocks multi drop
				// before final release this must be resolved
				reloading(TRUE);
			}
		}
	}
	else
		*accept=ACCEPT_NO;

	return TRUE;
}
コード例 #2
0
ファイル: Weapon.cpp プロジェクト: jhaslowh/UFO_Attack
// Reload the gun 
void Weapon::reload(){
	if (!reloading() && clip != clipCapacity){
		cReloadTime = reloadTime;
		cTimeBetweenShots = 0.0f;
		clip = 0;
	}
}
コード例 #3
0
ファイル: ao.cpp プロジェクト: gabeharms/firestorm
BOOL FloaterAO::newSetCallback(const LLSD& notification,const LLSD& response)
{
	std::string newSetName=response["message"].asString();
	S32 option=LLNotificationsUtil::getSelectedOption(notification,response);

	LLStringUtil::trim(newSetName);

	if(newSetName.empty())
		return FALSE;
	else if(newSetName.find_first_of(":|")!=std::string::npos)
	{
		LLSD args;
		args["AO_SET_NAME"]=newSetName;
		LLNotificationsUtil::add("NewAOCantContainColon",args);
		return FALSE;
	}

	if(option==0)
	{
		if(AOEngine::instance().addSet(newSetName).notNull())
		{
			reloading(TRUE);
			return TRUE;
		}
	}
	return FALSE;
}
コード例 #4
0
ファイル: ao.cpp プロジェクト: gabeharms/firestorm
void FloaterAO::onRenameSet()
{
	if(!mSelectedSet)
	{
		LL_WARNS("AOEngine") << "Rename AO set without set selected." << LL_ENDL;
		return;
	}

	std::string name=mSetSelector->getSimple();
	LLStringUtil::trim(name);

	if(!name.empty())
	{
		if(name.find_first_of(":|")==std::string::npos)
		{
			if(AOEngine::instance().renameSet(mSelectedSet,name))
			{
				reloading(TRUE);
				return;
			}
		}
		else
		{
			LLSD args;
			args["AO_SET_NAME"]=name;
			LLNotificationsUtil::add("RenameAOCantContainColon",args);
		}
	}
	mSetSelector->setSimple(mSelectedSet->getName());
}
コード例 #5
0
void IngredientCheckListView::stateChange(IngredientCheckListItem *it,bool on)
{
	if ( !reloading() ) {
		if ( on )
			m_selections.append(it->ingredient());
		else
			m_selections.removeAll(it->ingredient());
	}
}
コード例 #6
0
ファイル: ao.cpp プロジェクト: gabeharms/firestorm
void FloaterAO::onClickReload()
{
	reloading(TRUE);

	mSelectedSet=0;
	mSelectedState=0;

	AOEngine::instance().reload(false);
	updateList();
}
コード例 #7
0
ファイル: ao.cpp プロジェクト: gabeharms/firestorm
void FloaterAO::updateList()
{
	mReloadButton->setEnabled(TRUE);
	mImportRunning=FALSE;

	std::string currentSetName=mSetSelector->getSelectedItemLabel();
	if(currentSetName.empty())
		currentSetName=AOEngine::instance().getCurrentSetName();

	mSetList=AOEngine::instance().getSetList();
	mSetSelector->removeall();
	mSetSelectorSmall->removeall();
	mSetSelector->clear();
	mSetSelectorSmall->clear();

	mAnimationList->deleteAllItems();
	mCurrentBoldItem=NULL;
	reloading(FALSE);

	if(mSetList.empty())
	{
		LL_DEBUGS("AOEngine") << "empty set list" << LL_ENDL;
		mSetSelector->add(getString("ao_no_sets_loaded"));
		mSetSelectorSmall->add(getString("ao_no_sets_loaded"));
		mSetSelector->selectNthItem(0);
		mSetSelectorSmall->selectNthItem(0);
		enableSetControls(FALSE);
		return;
	}

	for(U32 index=0;index<mSetList.size();index++)
	{
		std::string setName=mSetList[index]->getName();
		mSetSelector->add(setName,&mSetList[index],ADD_BOTTOM,TRUE);
		mSetSelectorSmall->add(setName,&mSetList[index],ADD_BOTTOM,TRUE);
		if(setName.compare(currentSetName)==0)
		{
			mSelectedSet=AOEngine::instance().selectSetByName(currentSetName);
			mSetSelector->selectNthItem(index);
			mSetSelectorSmall->selectNthItem(index);
			updateSetParameters();
			updateAnimationList();
		}
	}
	enableSetControls(TRUE);
}
コード例 #8
0
ファイル: ao.cpp プロジェクト: gabeharms/firestorm
BOOL FloaterAO::removeSetCallback(const LLSD& notification,const LLSD& response)
{
	std::string newSetName=response["message"].asString();
	S32 option=LLNotificationsUtil::getSelectedOption(notification,response);

	if(option==0)
	{
		if(AOEngine::instance().removeSet(mSelectedSet))
		{
			reloading(TRUE);
			// to prevent snapping back to deleted set
			mSetSelector->removeall();
			mSetSelectorSmall->removeall();
			// visually indicate there are no items left
			mSetSelector->clear();
			mSetSelectorSmall->clear();
			mAnimationList->deleteAllItems();
			mCurrentBoldItem=NULL;
			return TRUE;
		}
	}
	return FALSE;
}
コード例 #9
0
ファイル: ao.cpp プロジェクト: gabeharms/firestorm
BOOL FloaterAO::postBuild()
{
	LLPanel* aoPanel=getChild<LLPanel>("animation_overrider_outer_panel");
	mMainInterfacePanel=aoPanel->getChild<LLPanel>("animation_overrider_panel");
	mSmallInterfacePanel=aoPanel->getChild<LLPanel>("animation_overrider_panel_small");
	mReloadCoverPanel=aoPanel->getChild<LLPanel>("ao_reload_cover");

	mSetSelector=mMainInterfacePanel->getChild<LLComboBox>("ao_set_selection_combo");
	mActivateSetButton=mMainInterfacePanel->getChild<LLButton>("ao_activate");
	mAddButton=mMainInterfacePanel->getChild<LLButton>("ao_add");
	mRemoveButton=mMainInterfacePanel->getChild<LLButton>("ao_remove");
	mDefaultCheckBox=mMainInterfacePanel->getChild<LLCheckBoxCtrl>("ao_default");
	mOverrideSitsCheckBox=mMainInterfacePanel->getChild<LLCheckBoxCtrl>("ao_sit_override");
	mSmartCheckBox=mMainInterfacePanel->getChild<LLCheckBoxCtrl>("ao_smart");
	mDisableMouselookCheckBox=mMainInterfacePanel->getChild<LLCheckBoxCtrl>("ao_disable_stands_in_mouselook");

	mStateSelector=mMainInterfacePanel->getChild<LLComboBox>("ao_state_selection_combo");
	mAnimationList=mMainInterfacePanel->getChild<LLScrollListCtrl>("ao_state_animation_list");
	mMoveUpButton=mMainInterfacePanel->getChild<LLButton>("ao_move_up");
	mMoveDownButton=mMainInterfacePanel->getChild<LLButton>("ao_move_down");
	mTrashButton=mMainInterfacePanel->getChild<LLButton>("ao_trash");
	mCycleCheckBox=mMainInterfacePanel->getChild<LLCheckBoxCtrl>("ao_cycle");
	mRandomizeCheckBox=mMainInterfacePanel->getChild<LLCheckBoxCtrl>("ao_randomize");
	mCycleTimeTextLabel=mMainInterfacePanel->getChild<LLTextBox>("ao_cycle_time_seconds_label");
	mCycleTimeSpinner=mMainInterfacePanel->getChild<LLSpinCtrl>("ao_cycle_time");

	mReloadButton=mMainInterfacePanel->getChild<LLButton>("ao_reload");
	mPreviousButton=mMainInterfacePanel->getChild<LLButton>("ao_previous");
	mNextButton=mMainInterfacePanel->getChild<LLButton>("ao_next");
	mLessButton=mMainInterfacePanel->getChild<LLButton>("ao_less");

	mSetSelectorSmall=mSmallInterfacePanel->getChild<LLComboBox>("ao_set_selection_combo_small");
	mMoreButton=mSmallInterfacePanel->getChild<LLButton>("ao_more");
	mPreviousButtonSmall=mSmallInterfacePanel->getChild<LLButton>("ao_previous_small");
	mNextButtonSmall=mSmallInterfacePanel->getChild<LLButton>("ao_next_small");
	mOverrideSitsCheckBoxSmall=mSmallInterfacePanel->getChild<LLCheckBoxCtrl>("ao_sit_override_small");

	mSetSelector->setCommitCallback(boost::bind(&FloaterAO::onSelectSet,this));
	mActivateSetButton->setCommitCallback(boost::bind(&FloaterAO::onClickActivate,this));
	mAddButton->setCommitCallback(boost::bind(&FloaterAO::onClickAdd,this));
	mRemoveButton->setCommitCallback(boost::bind(&FloaterAO::onClickRemove,this));
	mDefaultCheckBox->setCommitCallback(boost::bind(&FloaterAO::onCheckDefault,this));
	mOverrideSitsCheckBox->setCommitCallback(boost::bind(&FloaterAO::onCheckOverrideSits,this));
	mSmartCheckBox->setCommitCallback(boost::bind(&FloaterAO::onCheckSmart,this));
	mDisableMouselookCheckBox->setCommitCallback(boost::bind(&FloaterAO::onCheckDisableStands,this));

	mAnimationList->setCommitOnSelectionChange(TRUE);

	mStateSelector->setCommitCallback(boost::bind(&FloaterAO::onSelectState,this));
	mAnimationList->setCommitCallback(boost::bind(&FloaterAO::onChangeAnimationSelection,this));
	mMoveUpButton->setCommitCallback(boost::bind(&FloaterAO::onClickMoveUp,this));
	mMoveDownButton->setCommitCallback(boost::bind(&FloaterAO::onClickMoveDown,this));
	mTrashButton->setCommitCallback(boost::bind(&FloaterAO::onClickTrash,this));
	mCycleCheckBox->setCommitCallback(boost::bind(&FloaterAO::onCheckCycle,this));
	mRandomizeCheckBox->setCommitCallback(boost::bind(&FloaterAO::onCheckRandomize,this));
	mCycleTimeSpinner->setCommitCallback(boost::bind(&FloaterAO::onChangeCycleTime,this));

	mReloadButton->setCommitCallback(boost::bind(&FloaterAO::onClickReload,this));
	mPreviousButton->setCommitCallback(boost::bind(&FloaterAO::onClickPrevious,this));
	mNextButton->setCommitCallback(boost::bind(&FloaterAO::onClickNext,this));
	mLessButton->setCommitCallback(boost::bind(&FloaterAO::onClickLess,this));
	mOverrideSitsCheckBoxSmall->setCommitCallback(boost::bind(&FloaterAO::onCheckOverrideSitsSmall,this));

	mSetSelectorSmall->setCommitCallback(boost::bind(&FloaterAO::onSelectSetSmall,this));
	mMoreButton->setCommitCallback(boost::bind(&FloaterAO::onClickMore,this));
	mPreviousButtonSmall->setCommitCallback(boost::bind(&FloaterAO::onClickPrevious,this));
	mNextButtonSmall->setCommitCallback(boost::bind(&FloaterAO::onClickNext,this));

	updateSmart();

	AOEngine::instance().setReloadCallback(boost::bind(&FloaterAO::updateList,this));
	AOEngine::instance().setAnimationChangedCallback(boost::bind(&FloaterAO::onAnimationChanged,this,_1));

	onChangeAnimationSelection();
	mMainInterfacePanel->setVisible(TRUE);
	mSmallInterfacePanel->setVisible(FALSE);
	reloading(TRUE);

	updateList();

	if(gSavedPerAccountSettings.getBOOL("UseFullAOInterface"))
		onClickMore();
	else
		onClickLess();

	return LLDockableFloater::postBuild();
}