Exemplo n.º 1
0
void HostilReference::addThreat(float pMod)
{
    iThreat += pMod;
    // the threat is changed. Source and target unit have to be availabe
    // if the link was cut before relink it again
    if(!isOnline())
        updateOnlineStatus();
    if(pMod != 0.0f)
    {
        ThreatRefStatusChangeEvent event(UEV_THREAT_REF_THREAT_CHANGE, this, pMod);
        fireStatusChanged(event);
    }

    if(isValid() && pMod >= 0)
    {
        Unit* victim_owner = getTarget()->GetOwner();
        if(victim_owner && victim_owner->isAlive())
            getSource()->addThreat(victim_owner, 0.0f);     // create a threat to the owner of a pet, if the pet attacks
    }
}
Exemplo n.º 2
0
void HostileReference::addThreat(float modThreat)
{
    iThreat += modThreat;
    // the threat is changed. Source and target unit have to be available
    // if the link was cut before relink it again
    if (!isOnline())
        updateOnlineStatus();
    if (modThreat != 0.0f)
    {
        ThreatRefStatusChangeEvent event(UEV_THREAT_REF_THREAT_CHANGE, this, modThreat);
        fireStatusChanged(event);
    }

    if (isValid() && modThreat >= 0.0f)
    {
        Unit* victimOwner = getTarget()->GetCharmerOrOwner();
        if (victimOwner && victimOwner->IsAlive())
            GetSource()->addThreat(victimOwner, 0.0f);     // create a threat to the owner of a pet, if the pet attacks
    }
}
Exemplo n.º 3
0
/*virtual*/ 
void LLPanelProfileView::onOpen(const LLSD& key)
{
	LLUUID id;
	if(key.has("id"))
	{
		id = key["id"];
	}

	if(id.notNull() && getAvatarId() != id)
	{
		setAvatarId(id);
	}

	// Update the avatar name.
	gCacheName->get(getAvatarId(), FALSE,
		boost::bind(&LLPanelProfileView::onAvatarNameCached, this, _1, _2, _3, _4));

	updateOnlineStatus();


	LLPanelProfile::onOpen(key);
}
Exemplo n.º 4
0
void AgentWindow::onCommsConnectionStatusChanged(bool s)
{
	OC_METHODGATE();
	//qDebug() <<"AGENT WINDOW New connection status: "<<(s?"ONLINE":"OFFLINE");
	updateOnlineStatus();
}
Exemplo n.º 5
0
AgentWindow::AgentWindow(Agent *agent, QWidget *parent)
	: QWidget(parent)
	, ui(new Ui::AgentWindow)
	, mAgent(agent)
	, mHexy(nullptr)
	, mCameraAction(new QAction(tr("Camera"), this))
	, mPairingAction(new QAction(tr("Pair"), this))
	, mHardwareAction(new QAction(tr("Configure HW"), this))
	, mPlanAction(new QAction(tr("Plan"), this))
	, mOnlineAction(new QAction(tr("Online"), this))
	, mShowOnlineButtonAction(new QAction(tr("Online Button"), this))
	, mShowFaceAction(new QAction(tr("Show Face"), this))
	, mShowLogAction(new QAction(tr("Show Log"), this))
	, mShowStatsAction(new QAction(tr("Show Stats"), this))
	, mShowBirthCertificateAction(new QAction(tr("Show Birth Certificate"), this))
	, mUnbirthAction(new QAction(tr("Unbirth!"), this))
{
	OC_METHODGATE();
	ui->setupUi(this);

	updateIdentity();

	if(nullptr!=mAgent) {
		//Settings &s=agent->settings();
		ui->widgetHardware->configure(poseMapping());
		//Select correct starting page
		QWidget *startPage=ui->pageRunning;
		ui->widgetDelivery->reset();
		ui->stackedWidget->setCurrentWidget(mAgent->keyStore().fileExists()?startPage:ui->pageDelivery);

		if(!QObject::connect(ui->widgetDelivery, &AgentDeliveryWizard::done, [=](bool pairNow) {
		updateIdentity();
			ui->stackedWidget->setCurrentWidget(pairNow?ui->pagePairing:startPage);
		} ) ) {
			qWarning()<<"ERROR: Could not connect ";
		}

		if(!connect(ui->widgetPairing, &PairingWizard::done, [=]() {
		ui->stackedWidget->setCurrentWidget(startPage);
		} )) {
			qWarning()<<"ERROR: Could not connect ";
		}


		if(!connect(ui->widgetHardware, &HardwareWizard::done, [=]() {
		ui->stackedWidget->setCurrentWidget(startPage);
		} )) {
			qWarning()<<"ERROR: Could not connect ";
		}


		mAgent->setHookCommsSignals(*this, true);
		mAgent->hookColorSignals(*ui->widgetFace);
		ui->widgetFace->hookSignals(*this);
		ui->widgetPlanEditor->configure("agent.plan");
		prepareMenu();
		updateFaceVisibility();

		updateOnlineStatus();
		//QString text="Hello, my name is "+mAgent->name()+". I am an octomy agent. What is your bidding master?";
		//QString text="Hello, my name is Bodhi. I am an octomy agent. What is your bidding master? 00 0 01010 010 010 010 010101 ";		PortableID id=mAgent->localNodeAssociate()->toPortableID();		new OneOffSpeech(id, text);
	}

#ifdef Q_OS_ANDROID
	showFullScreen();
#endif
}