Merge branch 'storyline/s2e0' into yubo

merge-requests/7/merge
Ulukyn 4 years ago
commit c66a536457

@ -451,18 +451,19 @@ void CGameContextMenu::update()
else if (continent == "lepaysmalade.continent") else if (continent == "lepaysmalade.continent")
fameIndex = CStaticFames::getInstance().getFactionIndex("zorai"); fameIndex = CStaticFames::getInstance().getFactionIndex("zorai");
if (fameIndex != CStaticFames::INVALID_FACTION_INDEX) if (fameIndex != CStaticFames::INVALID_FACTION_INDEX)
{ {
CCDBNodeLeaf *pLeafFame = NLGUI::CDBManager::getInstance()->getDbProp(toString("SERVER:FAME:PLAYER%d:VALUE", fameIndex), false); CCDBNodeLeaf *pLeafFame = NLGUI::CDBManager::getInstance()->getDbProp(toString("SERVER:FAME:PLAYER%d:VALUE", fameIndex), false);
if (pLeafFame != NULL) if (pLeafFame != NULL)
fameValue = pLeafFame->getValue8(); fameValue = pLeafFame->getValue8();
} }
if (_TextNews) if (_TextNews)
_TextNews->setActive(selection && !canAttack() && selection->isNPC() && fameValue >= -30); _TextNews->setActive(!UserEntity->isFighting() && !UserEntity->isRiding() && selection && !canAttack() && selection->isNPC() && fameValue >= -30);
if (_TextNewsAgressive) if (_TextNewsAgressive)
_TextNewsAgressive->setActive(selection && !canAttack() && selection->isNPC() && fameValue < -30); _TextNewsAgressive->setActive(!UserEntity->isFighting() && !UserEntity->isRiding() && selection && !canAttack() && selection->isNPC() && fameValue < -30);
if (_TextDuel && _TextUnDuel) if (_TextDuel && _TextUnDuel)

@ -215,29 +215,34 @@ void CChatWindow::displayMessage(const ucstring &msg, NLMISC::CRGBA col, CChatGr
CChatTextManager &ctm = getChatTextMngr(); CChatTextManager &ctm = getChatTextMngr();
gl = dynamic_cast<CGroupList *>(_Chat->getGroup("cb:text_list")); gl = dynamic_cast<CGroupList *>(_Chat->getGroup("cb:text_list"));
if (gl) gl->addChild(ctm.createMsgText(msg, col));
// if the group is closed, make it blink CViewBase *child = ctm.createMsgText(msg, col);
if (!_Chat->isOpen()) if (child)
{ {
if (numBlinks) _Chat->enableBlink(numBlinks); if (gl) gl->addChild(child);
}
if (_ParentBlink) // if the group is closed, make it blink
{ if (!_Chat->isOpen())
CGroupContainer *father = dynamic_cast<CGroupContainer *>(_Chat->getParent());
if (father && !father->isOpen())
{ {
father->enableBlink(numBlinks); if (numBlinks) _Chat->enableBlink(numBlinks);
} }
if (_ParentBlink)
{
CGroupContainer *father = dynamic_cast<CGroupContainer *>(_Chat->getParent());
if (father && !father->isOpen())
{
father->enableBlink(numBlinks);
}
}
if (windowVisible != NULL)
{
*windowVisible = isVisible();
}
/*for(std::vector<IObserver *>::iterator it = _Observers.begin(); it != _Observers.end(); ++it)
{
(*it)->displayMessage(this, msg, col, numBlinks);
}*/
} }
if (windowVisible != NULL)
{
*windowVisible = isVisible();
}
/*for(std::vector<IObserver *>::iterator it = _Observers.begin(); it != _Observers.end(); ++it)
{
(*it)->displayMessage(this, msg, col, numBlinks);
}*/
} }
//================================================================================= //=================================================================================
@ -563,12 +568,17 @@ void CChatGroupWindow::displayMessage(const ucstring &msg, NLMISC::CRGBA col, CC
ucstring newmsg = msg; ucstring newmsg = msg;
ucstring prefix; ucstring prefix;
CViewBase *child = NULL;
if (gl != NULL) if (gl != NULL)
{ {
gl->addChild(ctm.createMsgText(newmsg, col)); child = ctm.createMsgText(newmsg, col);
if (!gl->getParent()->getActive()) if (child)
if (tab != NULL) {
tab->setTextColorNormal(newMsgColor); gl->addChild(child);
if (!gl->getParent()->getActive())
if (tab != NULL)
tab->setTextColorNormal(newMsgColor);
}
} }
// *** Display the message in the UserChat (special case) // *** Display the message in the UserChat (special case)
@ -590,7 +600,7 @@ void CChatGroupWindow::displayMessage(const ucstring &msg, NLMISC::CRGBA col, CC
case CChatGroup::guild: if (ci.Guild.isListeningWindow(cw)) gl = gl2; break; case CChatGroup::guild: if (ci.Guild.isListeningWindow(cw)) gl = gl2; break;
case CChatGroup::system: if (ci.SystemInfo.isListeningWindow(cw)) gl = gl2; break; case CChatGroup::system: if (ci.SystemInfo.isListeningWindow(cw)) gl = gl2; break;
case CChatGroup::universe: if (ci.Universe.isListeningWindow(cw)) gl = gl2; break; case CChatGroup::universe: if (ci.Universe.isListeningWindow(cw)) gl = gl2; break;
case CChatGroup::dyn_chat: case CChatGroup::dyn_chat:
if (ci.DynamicChat[dynamicChatDbIndex].isListeningWindow(cw)) if (ci.DynamicChat[dynamicChatDbIndex].isListeningWindow(cw))
{ {
gl = gl2; gl = gl2;
@ -608,7 +618,7 @@ void CChatGroupWindow::displayMessage(const ucstring &msg, NLMISC::CRGBA col, CC
pos = newmsg.find(ucstring("}")); pos = newmsg.find(ucstring("}"));
prefix += " "; prefix += " ";
} }
if (pos == ucstring::npos) if (pos == ucstring::npos)
newmsg = prefix + newmsg; newmsg = prefix + newmsg;
else else
@ -635,31 +645,37 @@ void CChatGroupWindow::displayMessage(const ucstring &msg, NLMISC::CRGBA col, CC
if (gl != NULL) if (gl != NULL)
{ {
gl->addChild(ctm.createMsgText(newmsg, col)); child = ctm.createMsgText(newmsg, col);
if (!gl->getParent()->getActive()) if (child)
if (tab != NULL) {
tab->setTextColorNormal(newMsgColor); gl->addChild(child);
if (!gl->getParent()->getActive())
if (tab != NULL)
tab->setTextColorNormal(newMsgColor);
}
} }
} }
if (child)
// *** Blink and visibility event
// if the group is closed, make it blink
if (!_Chat->isOpen())
{
if (numBlinks) _Chat->enableBlink(numBlinks);
}
if (_ParentBlink)
{ {
CGroupContainer *father = dynamic_cast<CGroupContainer *>(_Chat->getParent()); // *** Blink and visibility event
if (father && !father->isOpen()) // if the group is closed, make it blink
if (!_Chat->isOpen())
{ {
father->enableBlink(numBlinks); if (numBlinks) _Chat->enableBlink(numBlinks);
}
if (_ParentBlink)
{
CGroupContainer *father = dynamic_cast<CGroupContainer *>(_Chat->getParent());
if (father && !father->isOpen())
{
father->enableBlink(numBlinks);
}
}
if (windowVisible != NULL)
{
*windowVisible = isVisible();
} }
}
if (windowVisible != NULL)
{
*windowVisible = isVisible();
} }
} }
@ -685,8 +701,9 @@ void CChatGroupWindow::displayTellMessage(const ucstring &msg, NLMISC::CRGBA col
nlwarning("<CChatGroupWindow::displayTellMessage> can't get text_list."); nlwarning("<CChatGroupWindow::displayTellMessage> can't get text_list.");
return; return;
} }
CViewBase *child = getChatTextMngr().createMsgText(msg, col);
gl->addChild(getChatTextMngr().createMsgText(msg, col)); if (child)
gl->addChild(child);
} }
//================================================================================= //=================================================================================

@ -199,7 +199,7 @@ bool CPeopleList::sortExByName(const CPeople& a, const CPeople& b)
{ {
ucstring name_a = toUpper(a.getName()); ucstring name_a = toUpper(a.getName());
ucstring name_b = toUpper(b.getName()); ucstring name_b = toUpper(b.getName());
return (name_a < name_b); return (name_a < name_b);
} }
@ -208,7 +208,7 @@ bool CPeopleList::sortExByOnline(const CPeople& a, const CPeople& b)
{ {
ucstring name_a = toUpper(a.getName()); ucstring name_a = toUpper(a.getName());
ucstring name_b = toUpper(b.getName()); ucstring name_b = toUpper(b.getName());
// We want order: online/alpha, offworld/alpha, offline/alpha // We want order: online/alpha, offworld/alpha, offline/alpha
if (a.Online == b.Online) if (a.Online == b.Online)
{ {
@ -249,7 +249,7 @@ void CPeopleList::sortEx(TSortOrder order)
{ {
_BaseContainer->detachContainer(_Peoples[k].Container); _BaseContainer->detachContainer(_Peoples[k].Container);
} }
switch (order) switch (order)
{ {
default: default:
@ -480,17 +480,21 @@ void CPeopleList::displayLocalPlayerTell(const ucstring &receiver, uint index, c
ucstring s = CI18N::get("youTellPlayer"); ucstring s = CI18N::get("youTellPlayer");
strFindReplace(s, "%name", receiver); strFindReplace(s, "%name", receiver);
strFindReplace(finalMsg, CI18N::get("youTell"), s); strFindReplace(finalMsg, CI18N::get("youTell"), s);
gl->addChild(getChatTextMngr().createMsgText(finalMsg, prop.getRGBA())); CViewBase *child = getChatTextMngr().createMsgText(finalMsg, prop.getRGBA());
CInterfaceManager::getInstance()->log(finalMsg, CChatGroup::groupTypeToString(CChatGroup::tell)); if (child)
// if the group is closed, make it blink
if (!gc->isOpen())
{ {
if (numBlinks) gc->enableBlink(numBlinks); gl->addChild(child);
} CInterfaceManager::getInstance()->log(finalMsg, CChatGroup::groupTypeToString(CChatGroup::tell));
if (_BaseContainer && !_BaseContainer->isOpen())
{ // if the group is closed, make it blink
_BaseContainer->enableBlink(numBlinks); if (!gc->isOpen())
{
if (numBlinks) gc->enableBlink(numBlinks);
}
if (_BaseContainer && !_BaseContainer->isOpen())
{
_BaseContainer->enableBlink(numBlinks);
}
} }
} }
@ -539,8 +543,9 @@ void CPeopleList::displayMessage(uint index, const ucstring &msg, NLMISC::CRGBA
nlwarning("<CPeopleList::displayMessage> can't get text_list."); nlwarning("<CPeopleList::displayMessage> can't get text_list.");
return; return;
} }
CViewBase *child = getChatTextMngr().createMsgText(msg, col);
gl->addChild(getChatTextMngr().createMsgText(msg, col)); if (child)
gl->addChild(child);
} }
@ -777,7 +782,7 @@ void CPeopleList::setOnline(uint index, TCharConnectionState online)
CCtrlBase *chatButton = hc->getCtrl("chat_button"); CCtrlBase *chatButton = hc->getCtrl("chat_button");
if (chatButton != NULL) if (chatButton != NULL)
chatButton->setActive(online != ccs_offline); chatButton->setActive(online != ccs_offline);
CCtrlBase *inviteButton = hc->getCtrl("invite_button"); CCtrlBase *inviteButton = hc->getCtrl("invite_button");
if (inviteButton != NULL) if (inviteButton != NULL)
inviteButton->setActive(online != ccs_offline); inviteButton->setActive(online != ccs_offline);

Loading…
Cancel
Save