// *************************************************************************** void COutpostManager::startPvpJoinProposal(bool playerGuildInConflict, bool playerGuildIsAttacker, uint32 ownerGuildNameId, uint32 attackerGuildNameId, uint32 declTimer) { // reset counter that force player to be neutral (eg: 10 seconds) _EndTickForPvpJoinProposal= NetMngr.getCurrentServerTick() + declTimer; // setup TEMP DB CInterfaceManager *pIM= CInterfaceManager::getInstance(); CCDBNodeLeaf *node= pIM->getDbProp("UI:TEMP:OUTPOST:PVP_PROPOSAL_PLAYER_GUILD_IN_CONFLICT"); if(node) node->setValueBool(playerGuildInConflict); node= pIM->getDbProp("UI:TEMP:OUTPOST:PVP_PROPOSAL_PLAYER_GUILD_IS_ATTACKER"); if(node) node->setValueBool(playerGuildIsAttacker); node= pIM->getDbProp("UI:TEMP:OUTPOST:PVP_PROPOSAL_ATTACKER"); if(node) node->setValue32(attackerGuildNameId); node= pIM->getDbProp("UI:TEMP:OUTPOST:PVP_PROPOSAL_DEFENDER"); if(node) node->setValue32(ownerGuildNameId); node= pIM->getDbProp("UI:TEMP:OUTPOST:PVP_PROPOSAL_TICK_END"); if(node) node->setValue32(_EndTickForPvpJoinProposal); // open Popup CGroupContainer *pGC = dynamic_cast<CGroupContainer*>(pIM->getElementFromId("ui:interface:join_pvp_outpost_proposal")); if (pGC) { pGC->setActive(true); pIM->setTopWindow(pGC); pGC->updateCoords(); pGC->updateCoords(); pGC->center(); pGC->enableBlink(2); } }
// *************************************************************************************** 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; }
// *************************************************************************** void CGuildManager::update() { CInterfaceManager *pIM = CInterfaceManager::getInstance(); STRING_MANAGER::CStringManagerClient *pSMC = STRING_MANAGER::CStringManagerClient::instance(); // *** Need to rebuild the guild data? if (_NeedRebuild) { _NeedUpdate = true; _NeedRebuild = false; // Rebuild transfert the database to the local structure // Guild stuff uint32 oldName = _Guild.NameID; _Guild.NameID = pIM->getDbProp("SERVER:GUILD:NAME")->getValue32(); _Guild.Name = ""; _InGuild = (_Guild.NameID != 0); if (!_InGuild) closeAllInterfaces(); _Guild.Icon = pIM->getDbProp("SERVER:GUILD:ICON")->getValue64(); _Guild.QuitGuildAvailable = true; // Guild Members if(_NeedRebuildMembers) { _NeedUpdateMembers = true; _NeedRebuildMembers = false; _GuildMembers.clear(); for (uint32 i = 0; i < MAX_GUILD_MEMBER; ++i) { sint32 name = pIM->getDbProp("SERVER:GUILD:MEMBERS:"+toString(i)+":NAME")->getValue32(); if (name != 0) { SGuildMember gm; gm.NameID = name; gm.Index = i; gm.Grade = (EGSPD::CGuildGrade::TGuildGrade)(pIM->getDbProp("SERVER:GUILD:MEMBERS:"+toString(i)+":GRADE")->getValue32()); gm.Online = (TCharConnectionState)(pIM->getDbProp("SERVER:GUILD:MEMBERS:"+toString(i)+":ONLINE")->getValue32()); gm.EnterDate = pIM->getDbProp("SERVER:GUILD:MEMBERS:"+toString(i)+":ENTER_DATE")->getValue32(); _GuildMembers.push_back(gm); } } } // Does the player are newcomer ? // Boris 01/09/2006 : removed : now the guild interface is open if // is was active before OR if the EGS ask it to the client bool playerNewToTheGuild = _NewToTheGuild &&(oldName != _Guild.NameID) && _InGuild; if (playerNewToTheGuild) { // reset the flag _NewToTheGuild = false; // Don't pop the guild window in ring mode. // NB nico : this test should not be necessary, as the guild infos should be filled during the init of the db // However, there are situation where this db info is filled after init (should only happen at guild creation time ...) // Maybe an EGS bug ? if (R2::getEditor().getMode() == R2::CEditor::NotInitialized) { CInterfaceElement *pElt; // Open the guild info if we are not in the init phase if (!IngameDbMngr.initInProgress()) { pElt = pIM->getElementFromId(WIN_GUILD); if (pElt != NULL) pElt->setActive(true); } // Browse the forum pElt = pIM->getElementFromId(WIN_GUILD_FORUM":content:html"); if (pElt != NULL) { CGroupHTML *html = dynamic_cast<CGroupHTML*>(pElt); if (html) html->browse("home"); } } } } // *** Need to update Names? if (_NeedUpdate) { bool bAllValid = true; // Update wait until all the name of members, name of the guild and description are valid if (!pSMC->getString (_Guild.NameID, _Guild.Name)) bAllValid = false; for (uint i = 0; i < _GuildMembers.size(); ++i) { if (!pSMC->getString (_GuildMembers[i].NameID, _GuildMembers[i].Name)) bAllValid = false; else _GuildMembers[i].Name = CEntityCL::removeTitleAndShardFromName(_GuildMembers[i].Name); } // If all is valid no more need update and if guild is opened update the interface if (bAllValid) { // Search for UserEntity to find our own grade if ((UserEntity != NULL) && (_GuildMembers.size() > 0)) { uint i; _Grade = EGSPD::CGuildGrade::Member; string sUserName = strlwr(UserEntity->getEntityName().toString()); for (i = 0; i < _GuildMembers.size(); ++i) { if (strlwr(_GuildMembers[i].Name.toString()) == sUserName) { _Grade = _GuildMembers[i].Grade; break; } } } // set this value in the database pIM->getDbProp("UI:VARIABLES:USER:GUILD_GRADE")->setValue32(_Grade); // update the guild display CGroupContainer *pGuild = dynamic_cast<CGroupContainer*>(pIM->getElementFromId(WIN_GUILD)); if (pGuild != NULL) { // if the guild window is visible if (pGuild->isOpen() && pGuild->getActive()) { // Close the modal window if the member list will change if(pIM->getModalWindow()!=NULL && _NeedUpdateMembers) { if (pIM->getModalWindow()->getId() == MENU_GUILD_MEMBER ) pIM->disableModalWindow(); } // Rebuild interface. Rebuild members only if needed pIM->runActionHandler("guild_sheet_open", NULL, toString("update_members=%d", (uint)_NeedUpdateMembers) ); } } // guild updated _NeedUpdate = false; _NeedUpdateMembers= false; } } // *** Join proposal handling if (_JoinPropUpdate) { bool bAllValid = true; if (!pSMC->getDynString (_JoinPropPhraseID, _JoinPropPhrase)) bAllValid = false; // If all is valid no more need update and update the interface if (bAllValid) { _JoinPropUpdate = false; CGroupContainer *pJoinProp = dynamic_cast<CGroupContainer*>(pIM->getElementFromId(WIN_JOIN_PROPOSAL)); if (pJoinProp != NULL) { CViewText *pJoinPropPhraseView = dynamic_cast<CViewText*>(pIM->getElementFromId(VIEW_JOIN_PROPOSAL_PHRASE)); if (pJoinPropPhraseView != NULL) pJoinPropPhraseView->setText(_JoinPropPhrase); pJoinProp->setActive(true); pIM->setTopWindow(pJoinProp); pJoinProp->updateCoords(); pJoinProp->center(); pJoinProp->enableBlink(2); } } } }