Beispiel #1
0
void CGroupSkills::CSkillsObs::update (ICDBNode *node)
{
	CInterfaceManager *pIM = CInterfaceManager::getInstance();

	CCDBNodeLeaf *leaf = NLMISC::safe_cast<CCDBNodeLeaf *>(node);

	// Rebuild all only if new skill (previously level 0)
	if (leaf->getOldValue32() == 0)
		Owner->_MustRebuild= true;

	// Popup a message if previous was not 0
	if ((leaf->getOldValue32() != 0) &&
		(leaf->getValue32() != 0)) // prevent displaying FX when resetData() is called during a Far TP
	{
		CGroupSkills::InhibitSkillUpFX = false;

		ICDBNode *skill = node->getParent();
		if (skill)
		{
			ICDBNode *skillParent = skill->getParent();
			if (skillParent)
			{
				uint skillId;
				if (skillParent->getNodeIndex (skill, skillId))
				{
					CAHManager::getInstance()->runActionHandler("skill_popup", NULL, "skillId="+toString(skillId)+"|delta="+toString(leaf->getValue32()-leaf->getOldValue32()));

					// Context help
					contextHelp ("skill");
				}
			}
		}
	}
	else
	{
		if( !CGroupSkills::InhibitSkillUpFX ) // TODO: couldn't this be replaced by IngameDbMngr.initInProgress()?
		{
			UserEntity->skillUp();
		}
	}

	// Check if this skill canunblock title
	CSkillManager *pSM = CSkillManager::getInstance();
	string sTmp = leaf->getFullName();
	sTmp = sTmp.substr(0, sTmp.rfind(':'));
	sTmp = sTmp.substr(sTmp.rfind(':')+1,sTmp.size());
	sint32 eSkills;
	fromString(sTmp, eSkills);
	pSM->tryToUnblockTitleFromSkill((SKILLS::ESkills)eSkills, leaf->getValue32());
}
uint8 getOutpostSelection()
{
	uint8 nOutpost = 0;
	CCDBNodeLeaf *pNL = NLGUI::CDBManager::getInstance()->getDbProp("UI:TEMP:OUTPOST:SELECTION",false);
	if (pNL != NULL)
		nOutpost = (uint8)pNL->getValue32();
	return nOutpost;
}
uint32 getOutpostSheet()
{
	uint32	sheet= 0;
	uint8	outpostSel= getOutpostSelection();
	CCDBNodeLeaf *pNL = NLGUI::CDBManager::getInstance()->getDbProp(toString("SERVER:GUILD:OUTPOST:O%d:SHEET", outpostSel),false);
	if (pNL != NULL)
		sheet = pNL->getValue32();
	return sheet;
}
// ***************************************************************************************
void CBotChatPageMission::selectMission(CDBCtrlSheet *missionSheet)
{
	if (!missionSheet) return;
	if (missionSheet->getGrayed()) return;
	// show the dialog with good infos
	CInterfaceManager *im = CInterfaceManager::getInstance();
	CGroupContainer *gc = dynamic_cast<CGroupContainer *>(im->getElementFromId(WIN_BOT_CHAT_ACCEPT_MISSION));

	// copy text id for title
	{
		CCDBNodeLeaf *titleTextLeaf = dynamic_cast<CCDBNodeLeaf *>(missionSheet->getRootBranch()->getNode(ICDBNode::CTextId("TEXT")));
		//
		CViewTextID	*viewTitleTextID = dynamic_cast<CViewTextID *>(gc->getView("text_title_id"));
		if (viewTitleTextID && titleTextLeaf)
			viewTitleTextID->setTextId(titleTextLeaf->getValue32());
	}

	// copy text id for details
	CCDBNodeLeaf *detailTextLeaf = dynamic_cast<CCDBNodeLeaf *>(missionSheet->getRootBranch()->getNode(ICDBNode::CTextId("DETAIL_TEXT")));
	//
	CViewTextID	*viewTextID = dynamic_cast<CViewTextID *>(gc->getView("text_id"));
	if(viewTextID && detailTextLeaf)
	{
		viewTextID->setTextId(detailTextLeaf->getValue32());
	}
	// copy icon
	CCDBNodeLeaf *iconLeaf = im->getDbProp("UI:TEMP:MISSION:ICON");
	if (iconLeaf)
	{
		iconLeaf->setValue32(missionSheet->getSheetId());
	}
	//
	if (!gc) return;
	im->setTopWindow(gc);
	gc->setActive(true);
	gc->updateCoords();
	gc->center();
	gc->setModalParentList(WIN_BOT_CHAT_PAGE_MISSION);
	_CurrSel = missionSheet;
}
Beispiel #5
0
	virtual void update(ICDBNode *node)
	{
		if (!On) return;
		if (!AlphaChooserTarget) return;
		CCDBNodeLeaf *leaf = safe_cast<CCDBNodeLeaf *>(node);
		switch(Target)
		{
			case ContentAlpha:  AlphaChooserTarget->setContentAlpha((uint8) leaf->getValue32()); break;
			case BgAlpha:	    AlphaChooserTarget->setContainerAlpha((uint8) leaf->getValue32()); break;
			case RolloverAlphaContent: AlphaChooserTarget->setRolloverAlphaContent((uint8) (255 - (uint8) leaf->getValue32())); break;
			case RolloverAlphaBG: AlphaChooserTarget->setRolloverAlphaContainer((uint8) (255 - (uint8) leaf->getValue32())); break;
		}
	}
Beispiel #6
0
void CPing::update(NLMISC::ICDBNode* node)
{
	CCDBNodeLeaf *leaf = safe_cast<CCDBNodeLeaf *>(node);
	uint32 before = (uint32)leaf->getValue32();
	uint32 current = (uint32)(0xFFFFFFFF & ryzomGetLocalTime());
	if(before > current)
	{
		//nlwarning("DB PING Pb before '%u' after '%u'.", before, current);
		if(ClientCfg.Check)
			nlstop;
	}
	_Ping = current - before;
	_RdyToPing = true;
}
	void execute (CCtrlBase * /* pCaller */, const std::string &sParams)
	{
		// retrieve the sheet of this outpost
		uint32	sheet= 0;
		uint8	outpostSel;
		fromString(sParams, outpostSel);
		CCDBNodeLeaf *pNL = NLGUI::CDBManager::getInstance()->getDbProp(toString("SERVER:GUILD:OUTPOST:O%d:SHEET", outpostSel),false);
		if (pNL == NULL)
			return;
		sheet = pNL->getValue32();

		// send msg to server
		sendMsgToServer("OUTPOST:GIVEUP_OUTPOST", sheet);

		// reset confirm dialog flag
		CInterfaceManager	*pIM= CInterfaceManager::getInstance();
		NLGUI::CDBManager::getInstance()->getDbProp("UI:TEMP:OUTPOST:CONFIRM_DEL_OUTPOST")->setValueBool(false);
	}
Beispiel #8
0
void addWebIGParams (string &url, bool trustedDomain)
{
	if(!UserEntity || !NetMngr.getLoginCookie().isValid()) return;

	uint32 cid = NetMngr.getLoginCookie().getUserId() * 16 + PlayerSelectedSlot;
	url += ((url.find('?') != string::npos) ? "&" : "?") +
		string("shardid=") + toString(CharacterHomeSessionId) +
		string("&name=") + UserEntity->getLoginName().toUtf8() +
		string("&lang=") + CI18N::getCurrentLanguageCode() +
		string("&datasetid=") + toString(UserEntity->dataSetId()) +
		string("&ig=1");
	if (trustedDomain)
	{
		url += string("&cid=") + toString(cid) +
		string("&authkey=") + getWebAuthKey();
		
		if (url.find('$') != string::npos)
		{
			strFindReplace(url, "$gender$", GSGENDER::toString(UserEntity->getGender()));
			strFindReplace(url, "$displayName$", UserEntity->getDisplayName().toString());
			strFindReplace(url, "$posx$", toString(UserEntity->pos().x));
			strFindReplace(url, "$posy$", toString(UserEntity->pos().y));
			strFindReplace(url, "$posz$", toString(UserEntity->pos().z));
			strFindReplace(url, "$post$", toString(atan2(UserEntity->front().y, UserEntity->front().x)));
			
			// Target fields
			const char *dbPath = "UI:VARIABLES:TARGET:SLOT";
			CInterfaceManager *im = CInterfaceManager::getInstance();
			CCDBNodeLeaf *node = im->getDbProp(dbPath, false);
			if (node && (uint8)node->getValue32() != (uint8) CLFECOMMON::INVALID_SLOT)
			{
				CEntityCL *target = EntitiesMngr.entity((uint) node->getValue32());
				if (target)
				{
					strFindReplace(url, "$tdatasetid$", toString(target->dataSetId()));
					strFindReplace(url, "$tdisplayName$", target->getDisplayName().toString());
					strFindReplace(url, "$tposx$", toString(target->pos().x));
					strFindReplace(url, "$tposy$", toString(target->pos().y));
					strFindReplace(url, "$tposz$", toString(target->pos().z));
					strFindReplace(url, "$tpost$", toString(atan2(target->front().y, target->front().x)));
					strFindReplace(url, "$tsheet$", target->sheetId().toString());
					string type;
					if (target->isFauna())
						type = "fauna";
					else if (target->isNPC())
						type = "npc";
					else if (target->isPlayer())
						type = "player";
					else if (target->isUser())
						type = "user";
					strFindReplace(url, "$ttype$", target->sheetId().toString());
				}
				else
				{
					strFindReplace(url, "$tdatasetid$", "");
					strFindReplace(url, "$tdisplayName$", "");
					strFindReplace(url, "$tposx$", "");
					strFindReplace(url, "$tposy$", "");
					strFindReplace(url, "$tposz$", "");
					strFindReplace(url, "$tpost$", "");
					strFindReplace(url, "$tsheet$", "");
					strFindReplace(url, "$ttype$", "");
				}
			}
		}
	}
}