本文整理汇总了C++中CClientChatManager::getDynamicChannelNameFromDbIndex方法的典型用法代码示例。如果您正苦于以下问题:C++ CClientChatManager::getDynamicChannelNameFromDbIndex方法的具体用法?C++ CClientChatManager::getDynamicChannelNameFromDbIndex怎么用?C++ CClientChatManager::getDynamicChannelNameFromDbIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CClientChatManager
的用法示例。
在下文中一共展示了CClientChatManager::getDynamicChannelNameFromDbIndex方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateChatModeAndButton
//-----------------------------------------------
// updateChatModeAndButton
//
//-----------------------------------------------
void CClientChatManager::updateChatModeAndButton(uint mode, uint32 dynamicChannelDbIndex)
{
// Check if USER chat is active
bool userActive = false;
CChatGroupWindow *pCGW = PeopleInterraction.getChatGroupWindow();
if (pCGW)
{
CInterfaceGroup* pIG = pCGW->getContainer()->getGroup("content:cb:user");
if (pIG)
userActive = pIG->getActive();
}
CChatGroup::TGroupType m = (CChatGroup::TGroupType)mode;
if (userActive)
{
// Change the button of the user chat to the corresponding chat target
if (pCGW)
{
CCtrlTextButton *pUserBut = dynamic_cast<CCtrlTextButton*>(pCGW->getContainer()->getCtrl("content:but_user"));
CCtrlTextButton *pEmoteBut = dynamic_cast<CCtrlTextButton*>(pCGW->getContainer()->getCtrl("content:but_emote"));
CInterfaceGroup *pEditBox = dynamic_cast<CInterfaceGroup*>(pCGW->getContainer()->getGroup("content:ebw"));
CInterfaceManager *pIM = CInterfaceManager::getInstance();
const bool teamActive = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:GROUP:0:PRESENT")->getValueBool();
const bool guildActive = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:GUILD:NAME")->getValueBool();
if (m == CChatGroup::team && ! teamActive)
m = PeopleInterraction.TheUserChat.Filter.getTargetGroup();
if (m == CChatGroup::guild && ! guildActive)
m = PeopleInterraction.TheUserChat.Filter.getTargetGroup();
if (pUserBut)
{
switch(m)
{
default:
case CChatGroup::arround:
case CChatGroup::say: pUserBut->setHardText("uiFilterAround"); break;
case CChatGroup::region: pUserBut->setHardText("uiFilterRegion"); break;
case CChatGroup::universe: pUserBut->setHardText("uiFilterUniverse"); break;
case CChatGroup::team: if (teamActive) pUserBut->setHardText("uiFilterTeam"); break;
case CChatGroup::guild: if (guildActive) pUserBut->setHardText("uiFilterGuild"); break;
case CChatGroup::dyn_chat:
uint32 textId = ChatMngr.getDynamicChannelNameFromDbIndex(dynamicChannelDbIndex);
ucstring title;
STRING_MANAGER::CStringManagerClient::instance()->getDynString(textId, title);
if (title.empty())
{
// Dyn channel does not exist, don't change
m = PeopleInterraction.TheUserChat.Filter.getTargetGroup();
dynamicChannelDbIndex = PeopleInterraction.TheUserChat.Filter.getTargetDynamicChannelDbIndex();
}
else
{
pUserBut->setHardText(title.toUtf8());
}
break;
// NB: user chat cannot have yubo_chat target
}
pUserBut->setActive(true);
pUserBut->getParent()->updateCoords();
pUserBut->updateCoords();
}
if (pEmoteBut)
{
pEmoteBut->setActive(true);
pEmoteBut->updateCoords();
}
if (pEditBox && pUserBut && pEmoteBut)
{
pEditBox->setW(-pUserBut->getWReal()-pEmoteBut->getWReal()-8);
pEditBox->setX(pUserBut->getWReal()+4);
}
PeopleInterraction.TheUserChat.Filter.setTargetGroup(m, dynamicChannelDbIndex);
PeopleInterraction.ChatGroup.Filter.setTargetGroup(m, dynamicChannelDbIndex);
}
}
}