Merge branch 'storyline/s2e0' into yubo

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

@ -458,11 +458,12 @@ void CGameContextMenu::update()
if (pLeafFame != NULL)
fameValue = pLeafFame->getValue8();
}
if (_TextNews)
_TextNews->setActive(selection && !canAttack() && selection->isNPC() && fameValue >= -30);
_TextNews->setActive(!UserEntity->isFighting() && !UserEntity->isRiding() && selection && !canAttack() && selection->isNPC() && fameValue >= -30);
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)

@ -215,29 +215,34 @@ void CChatWindow::displayMessage(const ucstring &msg, NLMISC::CRGBA col, CChatGr
CChatTextManager &ctm = getChatTextMngr();
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
if (!_Chat->isOpen())
CViewBase *child = ctm.createMsgText(msg, col);
if (child)
{
if (numBlinks) _Chat->enableBlink(numBlinks);
}
if (_ParentBlink)
{
CGroupContainer *father = dynamic_cast<CGroupContainer *>(_Chat->getParent());
if (father && !father->isOpen())
if (gl) gl->addChild(child);
// 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();
}
/*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 prefix;
CViewBase *child = NULL;
if (gl != NULL)
{
gl->addChild(ctm.createMsgText(newmsg, col));
if (!gl->getParent()->getActive())
if (tab != NULL)
tab->setTextColorNormal(newMsgColor);
child = ctm.createMsgText(newmsg, col);
if (child)
{
gl->addChild(child);
if (!gl->getParent()->getActive())
if (tab != NULL)
tab->setTextColorNormal(newMsgColor);
}
}
// *** Display the message in the UserChat (special case)
@ -635,31 +645,37 @@ void CChatGroupWindow::displayMessage(const ucstring &msg, NLMISC::CRGBA col, CC
if (gl != NULL)
{
gl->addChild(ctm.createMsgText(newmsg, col));
if (!gl->getParent()->getActive())
if (tab != NULL)
tab->setTextColorNormal(newMsgColor);
child = ctm.createMsgText(newmsg, col);
if (child)
{
gl->addChild(child);
if (!gl->getParent()->getActive())
if (tab != NULL)
tab->setTextColorNormal(newMsgColor);
}
}
}
// *** Blink and visibility event
// if the group is closed, make it blink
if (!_Chat->isOpen())
{
if (numBlinks) _Chat->enableBlink(numBlinks);
}
if (_ParentBlink)
if (child)
{
CGroupContainer *father = dynamic_cast<CGroupContainer *>(_Chat->getParent());
if (father && !father->isOpen())
// *** Blink and visibility event
// 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.");
return;
}
gl->addChild(getChatTextMngr().createMsgText(msg, col));
CViewBase *child = getChatTextMngr().createMsgText(msg, col);
if (child)
gl->addChild(child);
}
//=================================================================================

@ -480,17 +480,21 @@ void CPeopleList::displayLocalPlayerTell(const ucstring &receiver, uint index, c
ucstring s = CI18N::get("youTellPlayer");
strFindReplace(s, "%name", receiver);
strFindReplace(finalMsg, CI18N::get("youTell"), s);
gl->addChild(getChatTextMngr().createMsgText(finalMsg, prop.getRGBA()));
CInterfaceManager::getInstance()->log(finalMsg, CChatGroup::groupTypeToString(CChatGroup::tell));
// if the group is closed, make it blink
if (!gc->isOpen())
{
if (numBlinks) gc->enableBlink(numBlinks);
}
if (_BaseContainer && !_BaseContainer->isOpen())
CViewBase *child = getChatTextMngr().createMsgText(finalMsg, prop.getRGBA());
if (child)
{
_BaseContainer->enableBlink(numBlinks);
gl->addChild(child);
CInterfaceManager::getInstance()->log(finalMsg, CChatGroup::groupTypeToString(CChatGroup::tell));
// if the group is closed, make it blink
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.");
return;
}
gl->addChild(getChatTextMngr().createMsgText(msg, col));
CViewBase *child = getChatTextMngr().createMsgText(msg, col);
if (child)
gl->addChild(child);
}

Loading…
Cancel
Save