Changed: #1135 Reverted some changes from next Ryzom patch
This commit is contained in:
parent
be50f0afdb
commit
a98974d660
9 changed files with 29 additions and 163 deletions
|
@ -2960,18 +2960,12 @@ This MUST follow the Enum MISSION_DESC::TIconId
|
|||
<variable entry="UI:SAVE:CHAT:COLORS:TELL"
|
||||
type="rgba"
|
||||
value="170 170 170 255" />
|
||||
<variable entry="UI:SAVE:CHAT:COLORS:DYN"
|
||||
type="rgba"
|
||||
value="162 255 173 255" />
|
||||
<variable entry="UI:SAVE:CHAT:ENTER_DONT_QUIT_CB"
|
||||
type="bool"
|
||||
value="false" />
|
||||
<variable entry="UI:SAVE:CHAT:SHOW_TIMES_IN_CHAT_CB"
|
||||
type="bool"
|
||||
value="false" />
|
||||
<variable entry="UI:SAVE:CHAT:SHOW_DYN_CHANNEL_NAME_IN_CHAT_CB"
|
||||
type="bool"
|
||||
value="false" />
|
||||
<!-- ***************************** -->
|
||||
<!-- * SYSTEM INFO COLORS * -->
|
||||
<!-- ***************************** -->
|
||||
|
|
|
@ -1605,23 +1605,14 @@
|
|||
posparent="cc_univ"
|
||||
x="0"
|
||||
y="-4" />
|
||||
<instance template="tgcw_color"
|
||||
id="cc_dyn"
|
||||
text="uiDynColor"
|
||||
title="uiCCDDyn"
|
||||
tooltip="uittChooseDynColor"
|
||||
posref="BL TL"
|
||||
posparent="cc_shout"
|
||||
x="0"
|
||||
y="-4" />
|
||||
<instance template="tgcw_checkbox"
|
||||
id="enter_dontquit_cb"
|
||||
text="uiEnterDontQuitCB"
|
||||
tooltip="uittChatEnter"
|
||||
posparent="cc_dyn"
|
||||
posparent="cc_univ"
|
||||
posref="BL TL"
|
||||
x="0"
|
||||
y="-8" />
|
||||
y="-25" />
|
||||
<instance template="tgcw_checkbox"
|
||||
id="show_times_in_chat_cb"
|
||||
text="uiShowTimesInChatCB"
|
||||
|
@ -1630,27 +1621,17 @@
|
|||
posref="BL TL"
|
||||
x="0"
|
||||
y="-8" />
|
||||
<instance template="tgcw_checkbox"
|
||||
id="show_dyn_channel_name_in_chat_cb"
|
||||
text="uiShowDynChannelNameInChatCB"
|
||||
tooltip="uittShowDynChannelNameInChat"
|
||||
posparent="show_times_in_chat_cb"
|
||||
posref="BL TL"
|
||||
x="0"
|
||||
y="-8" />
|
||||
<instance template="tgcw_scrollbarint"
|
||||
id="font_size"
|
||||
text="uiFontSize"
|
||||
posref="BL TL"
|
||||
posparent="show_dyn_channel_name_in_chat_cb"
|
||||
posparent="show_times_in_chat_cb"
|
||||
x="0"
|
||||
y="-8" />
|
||||
<link expr="@UI:SAVE:CHAT:ENTER_DONT_QUIT_CB"
|
||||
target="enter_dontquit_cb:c:pushed" />
|
||||
<link expr="@UI:SAVE:CHAT:SHOW_TIMES_IN_CHAT_CB"
|
||||
target="show_times_in_chat_cb:c:pushed" />
|
||||
<link expr="@UI:SAVE:CHAT:SHOW_DYN_CHANNEL_NAME_IN_CHAT_CB"
|
||||
target="show_dyn_channel_name_in_chat_cb:c:pushed" />
|
||||
</group>
|
||||
<ctrl style="skin_scroll"
|
||||
id="sb_chat_colors"
|
||||
|
@ -3081,11 +3062,6 @@
|
|||
widget="colbut"
|
||||
link="UI:SAVE:CHAT:COLORS:SHOUT"
|
||||
realtime="true" />
|
||||
<param ui="chat_colors:cc_dyn:c"
|
||||
type="db"
|
||||
widget="colbut"
|
||||
link="UI:SAVE:CHAT:COLORS:DYN"
|
||||
realtime="true" />
|
||||
<!--
|
||||
<param ui="chat_colors:cc_shout:c" type="db" widget="colbut" link="UI:SAVE:CHAT:COLORS:SHOUT" realtime="true" />
|
||||
<param ui="chat_colors:cc_civi:c" type="db" widget="colbut" link="UI:SAVE:CHAT:COLORS:CIVILIZATION" realtime="true" />
|
||||
|
@ -3101,11 +3077,6 @@
|
|||
widget="boolbut"
|
||||
link="UI:SAVE:CHAT:SHOW_TIMES_IN_CHAT_CB"
|
||||
realtime="true" />
|
||||
<param ui="chat_colors:show_dyn_channel_name_in_chat_cb:c"
|
||||
type="db"
|
||||
widget="boolbut"
|
||||
link="UI:SAVE:CHAT:SHOW_DYN_CHANNEL_NAME_IN_CHAT_CB"
|
||||
realtime="true" />
|
||||
<param ui="chat_colors:font_size:c"
|
||||
type="db"
|
||||
widget="sbint"
|
||||
|
|
|
@ -379,7 +379,7 @@ void CChatTargetFilter::setTargetGroup(CChatGroup::TGroupType groupType, uint32
|
|||
const bool guildActive = pIM->getDbProp("SERVER:GUILD:NAME")->getValueBool();
|
||||
switch(groupType)
|
||||
{
|
||||
case CChatGroup::dyn_chat: entry+="DYN"; break;
|
||||
case CChatGroup::dyn_chat: // dyn_chat takes the color of say
|
||||
case CChatGroup::say: entry+="SAY"; break;
|
||||
case CChatGroup::shout: entry+="SHOUT"; break;
|
||||
case CChatGroup::team: if(!teamActive) return; entry+="GROUP"; break;
|
||||
|
|
|
@ -199,7 +199,7 @@ bool CChatWindow::isVisible() const
|
|||
}
|
||||
|
||||
//=================================================================================
|
||||
void CChatWindow::displayMessage(const ucstring &msg, NLMISC::CRGBA col, CChatGroup::TGroupType gt, uint32 dynamicChatDbIndex, uint numBlinks /* = 0*/, bool *windowVisible /*= NULL*/)
|
||||
void CChatWindow::displayMessage(const ucstring &msg, NLMISC::CRGBA col, CChatGroup::TGroupType /* gt */, uint32 /* dynamicChatDbIndex */, uint numBlinks /* = 0*/, bool *windowVisible /*= NULL*/)
|
||||
{
|
||||
if (!_Chat)
|
||||
{
|
||||
|
@ -210,26 +210,8 @@ void CChatWindow::displayMessage(const ucstring &msg, NLMISC::CRGBA col, CChatGr
|
|||
|
||||
CChatTextManager &ctm = getChatTextMngr();
|
||||
|
||||
ucstring newmsg = msg;
|
||||
ucstring prefix;
|
||||
if (gt == CChatGroup::dyn_chat)
|
||||
{
|
||||
prefix = "[" + NLMISC::toString(dynamicChatDbIndex) + "]";
|
||||
// Find position to put the new string
|
||||
// After timestamp?
|
||||
size_t pos = msg.find(ucstring("]"));
|
||||
if (pos == ucstring::npos)
|
||||
{
|
||||
// No timestamp, so put it right after the color and add a space
|
||||
pos = msg.find(ucstring("}"));
|
||||
prefix += " ";
|
||||
}
|
||||
newmsg = msg.substr(0, pos + 1) + prefix + msg.substr(pos + 1);
|
||||
prefix.clear();
|
||||
}
|
||||
|
||||
gl = dynamic_cast<CGroupList *>(_Chat->getGroup("cb:text_list"));
|
||||
if (gl) gl->addChild(ctm.createMsgText(newmsg, col));
|
||||
if (gl) gl->addChild(ctm.createMsgText(msg, col));
|
||||
|
||||
// if the group is closed, make it blink
|
||||
if (!_Chat->isOpen())
|
||||
|
@ -575,27 +557,9 @@ void CChatGroupWindow::displayMessage(const ucstring &msg, NLMISC::CRGBA col, CC
|
|||
CInterfaceManager *pIM= CInterfaceManager::getInstance();
|
||||
CRGBA newMsgColor= stringToRGBA(pIM->getDefine("chat_group_tab_color_newmsg").c_str());
|
||||
|
||||
ucstring newmsg = msg;
|
||||
ucstring prefix;
|
||||
if (gt == CChatGroup::dyn_chat)
|
||||
{
|
||||
prefix = "[" + NLMISC::toString(dynamicChatDbIndex) + "]";
|
||||
// Find position to put the new string
|
||||
// After timestamp?
|
||||
size_t pos = msg.find(ucstring("]"));
|
||||
if (pos == ucstring::npos)
|
||||
{
|
||||
// No timestamp, so put it right after the color and add a space
|
||||
pos = msg.find(ucstring("}"));
|
||||
prefix += " ";
|
||||
}
|
||||
newmsg = msg.substr(0, pos + 1) + prefix + msg.substr(pos + 1);
|
||||
prefix.clear();
|
||||
}
|
||||
|
||||
if (gl != NULL)
|
||||
{
|
||||
gl->addChild(ctm.createMsgText(newmsg, col));
|
||||
gl->addChild(ctm.createMsgText(msg, col));
|
||||
if (!gl->getParent()->getActive())
|
||||
if (tab != NULL)
|
||||
tab->setTextColorNormal(newMsgColor);
|
||||
|
@ -620,36 +584,14 @@ void CChatGroupWindow::displayMessage(const ucstring &msg, NLMISC::CRGBA col, CC
|
|||
case CChatGroup::guild: if (ci.Guild.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::dyn_chat:
|
||||
if (ci.DynamicChat[dynamicChatDbIndex].isListeningWindow(cw))
|
||||
{
|
||||
gl = gl2;
|
||||
|
||||
// Add dynchannel number and optionally name before text if user channel
|
||||
if (CInterfaceManager::getInstance()->getDbProp("UI:SAVE:CHAT:SHOW_DYN_CHANNEL_NAME_IN_CHAT_CB", false)->getValueBool())
|
||||
{
|
||||
uint32 textId = ChatMngr.getDynamicChannelNameFromDbIndex(dynamicChatDbIndex);
|
||||
ucstring title;
|
||||
STRING_MANAGER::CStringManagerClient::instance()->getDynString(textId, title);
|
||||
if ( ! title.empty())
|
||||
{
|
||||
prefix = " " + title;
|
||||
}
|
||||
}
|
||||
|
||||
// Put the new prefix in the correct position
|
||||
size_t pos = newmsg.find(ucstring("] "));
|
||||
newmsg = newmsg.substr(0, pos) + prefix + newmsg.substr(pos);
|
||||
}
|
||||
break;
|
||||
|
||||
// NB: the yubo chat cannot be in a user chat
|
||||
// NB: the yubo chat and dyn_chat cannot be in a user chat
|
||||
case CChatGroup::yubo_chat: gl = NULL; break;
|
||||
case CChatGroup::dyn_chat: gl = NULL; break;
|
||||
}
|
||||
|
||||
if (gl != NULL)
|
||||
{
|
||||
gl->addChild(ctm.createMsgText(newmsg, col));
|
||||
gl->addChild(ctm.createMsgText(msg, col));
|
||||
if (!gl->getParent()->getActive())
|
||||
if (tab != NULL)
|
||||
tab->setTextColorNormal(newMsgColor);
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
//===================================================================================
|
||||
void CFilteredChatSummary::serial(NLMISC::IStream &f) throw(NLMISC::EStream)
|
||||
{
|
||||
sint ver = f.serialVersion(3);
|
||||
sint ver= f.serialVersion(2);
|
||||
f.serialCheck((uint32) 'USHC');
|
||||
f.serial(SrcGuild);
|
||||
f.serial(SrcTeam);
|
||||
|
@ -36,12 +36,4 @@ void CFilteredChatSummary::serial(NLMISC::IStream &f) throw(NLMISC::EStream)
|
|||
|
||||
if(ver>=2)
|
||||
f.serial(SrcRegion);
|
||||
|
||||
if (ver >= 3)
|
||||
{
|
||||
for (uint8 i = 0; i < CChatGroup::MaxDynChanPerPlayer; i++) {
|
||||
f.serial(SrcDynChat[i]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -33,7 +33,6 @@ public:
|
|||
bool SrcSystemInfo;
|
||||
bool SrcRegion;
|
||||
bool SrcUniverse;
|
||||
bool SrcDynChat[CChatGroup::MaxDynChanPerPlayer];
|
||||
// output
|
||||
CChatGroup::TGroupType Target;
|
||||
public:
|
||||
|
|
|
@ -6380,20 +6380,26 @@ bool CInterfaceManager::parseTokens(ucstring& ucstr)
|
|||
vector<ucstring> token_vector;
|
||||
vector<ucstring> param_vector;
|
||||
splitUCString(token_string, ucstring("."), token_vector);
|
||||
if (token_vector.size() == 0)
|
||||
{
|
||||
// Wrong formatting; give up on this one.
|
||||
start_pos = end_pos;
|
||||
continue;
|
||||
}
|
||||
token_subject = token_vector[0];
|
||||
if (token_vector.size() == 1)
|
||||
{
|
||||
splitUCString(token_subject, ucstring("/"), param_vector);
|
||||
token_subject = param_vector[0];
|
||||
token_subject = (param_vector.size() > 0) ? param_vector[0] : ucstring("");
|
||||
token_param = ucstring("name");
|
||||
}
|
||||
else
|
||||
else if (token_vector.size() > 1)
|
||||
{
|
||||
token_param = token_vector[1];
|
||||
if (token_param.luabind_substr(0, 3) != ucstring("gs("))
|
||||
{
|
||||
splitUCString(token_vector[1], ucstring("/"), param_vector);
|
||||
token_param = param_vector[0];
|
||||
token_param = (param_vector.size() > 0) ? param_vector[0] : ucstring("");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6537,7 +6543,7 @@ bool CInterfaceManager::parseTokens(ucstring& ucstr)
|
|||
continue;
|
||||
}
|
||||
|
||||
// Only care about gender if it's a humanoid.
|
||||
// We only care about the gender if the subject is humanoid.
|
||||
GSGENDER::EGender gender = GSGENDER::neutral;
|
||||
if (pTokenSubjectEntity->isUser() || pTokenSubjectEntity->isPlayer() || pTokenSubjectEntity->isNPC())
|
||||
{
|
||||
|
@ -6548,8 +6554,7 @@ bool CInterfaceManager::parseTokens(ucstring& ucstr)
|
|||
}
|
||||
}
|
||||
|
||||
// Neuter part is optional.
|
||||
// Fallback to male if something is wrong.
|
||||
// The neuter part is optional. Fallback to male if something is wrong.
|
||||
GSGENDER::EGender g = ((uint)gender >= strList.size()) ? GSGENDER::male : gender;
|
||||
token_replacement = strList[g];
|
||||
}
|
||||
|
@ -6565,11 +6570,10 @@ bool CInterfaceManager::parseTokens(ucstring& ucstr)
|
|||
return false;
|
||||
}
|
||||
|
||||
|
||||
// Replace token
|
||||
size_t token_whole_pos = str.find(token_whole);
|
||||
|
||||
// Only do extra replacement if using default
|
||||
// Only do extra replacement spaces if using default
|
||||
extra_replacement = (token_replacement == token_default) ? extra_replacement : 0;
|
||||
if (str.find(token_whole, start_pos) != string::npos)
|
||||
{
|
||||
|
|
|
@ -487,6 +487,9 @@ void CPeopleInterraction::initStdInputs()
|
|||
if (YuboChat)
|
||||
ChatInput.YuboChat.addListeningWindow(YuboChat);
|
||||
|
||||
// NB: The universe channel can only be seen from the user chat (and hence chat group)
|
||||
// There is no Special universe window
|
||||
|
||||
if (TheUserChat.Window)
|
||||
{
|
||||
ChatInput.AroundMe.addListeningWindow(TheUserChat.Window);
|
||||
|
@ -495,11 +498,6 @@ void CPeopleInterraction::initStdInputs()
|
|||
ChatInput.Guild.addListeningWindow(TheUserChat.Window);
|
||||
ChatInput.Universe.addListeningWindow (TheUserChat.Window);
|
||||
// Don't add the system info by default
|
||||
// Dynamic chats
|
||||
for(i = 0; i < CChatGroup::MaxDynChanPerPlayer; i++)
|
||||
{
|
||||
ChatInput.DynamicChat[i].addListeningWindow(TheUserChat.Window);
|
||||
}
|
||||
}
|
||||
|
||||
ChatInput.Tell.addListeningPeopleList(&FriendList);
|
||||
|
@ -1584,11 +1582,6 @@ void CPeopleInterraction::buildFilteredChatSummary(const CFilteredChat &src, CFi
|
|||
{
|
||||
fcs.Target = src.Filter.getTargetGroup();
|
||||
}
|
||||
|
||||
for (uint8 i = 0; i < CChatGroup::MaxDynChanPerPlayer; i++)
|
||||
{
|
||||
fcs.SrcDynChat[i] = ChatInput.DynamicChat[i].isListeningWindow(src.Window);
|
||||
}
|
||||
}
|
||||
|
||||
//=================================================================================================================
|
||||
|
@ -1733,11 +1726,6 @@ void CPeopleInterraction::setupUserChatFromSummary(const CFilteredChatSummary &s
|
|||
ChatInput.Tell.setWindowState(dest.Window, summary.SrcTell);
|
||||
ChatInput.Region.setWindowState(dest.Window, summary.SrcRegion);
|
||||
ChatInput.Universe.setWindowState(dest.Window, summary.SrcUniverse);
|
||||
|
||||
for (uint8 i = 0; i < CChatGroup::MaxDynChanPerPlayer; i++)
|
||||
{
|
||||
ChatInput.DynamicChat[i].setWindowState(dest.Window, summary.SrcDynChat[i]);
|
||||
}
|
||||
}
|
||||
|
||||
//=================================================================================================================
|
||||
|
@ -2504,7 +2492,7 @@ public:
|
|||
for (uint i = 0; i < CChatGroup::MaxDynChanPerPlayer; i++)
|
||||
{
|
||||
string s = toString(i);
|
||||
uint32 textId = ChatMngr.getDynamicChannelNameFromDbIndex(i);
|
||||
uint32 textId = im->getDbProp("SERVER:DYN_CHAT:CHANNEL"+s+":NAME")->getValue32();
|
||||
bool active = (textId != 0);
|
||||
if (active)
|
||||
{
|
||||
|
@ -2691,7 +2679,7 @@ class CHandlerSelectChatSource : public IActionHandler
|
|||
CViewTextMenu *pVTM = dynamic_cast<CViewTextMenu *>(im->getElementFromId(MAIN_CHAT_SOURCE_MENU+":tab:dyn"+s));
|
||||
if (pVTM)
|
||||
{
|
||||
uint32 textId = ChatMngr.getDynamicChannelNameFromDbIndex(i);
|
||||
uint32 textId = im->getDbProp("SERVER:DYN_CHAT:CHANNEL"+s+":NAME")->getValue32();
|
||||
bool active = (textId != 0);
|
||||
pVTM->setActive(active);
|
||||
if (active)
|
||||
|
@ -2812,22 +2800,6 @@ class CHandlerSelectChatSource : public IActionHandler
|
|||
++ insertionIndex;
|
||||
}
|
||||
}
|
||||
|
||||
// Add all existing dynamic channels and set the names
|
||||
for (uint8 i = 0; i < CChatGroup::MaxDynChanPerPlayer; i++)
|
||||
{
|
||||
string s = toString(i);
|
||||
uint32 textId = ChatMngr.getDynamicChannelNameFromDbIndex(i);
|
||||
bool active = (textId != 0);
|
||||
if (active)
|
||||
{
|
||||
ucstring title;
|
||||
STRING_MANAGER::CStringManagerClient::instance()->getDynString(textId, title);
|
||||
menu->addLineAtIndex(insertionIndex, "["+s+"] " + title, FILTER_TOGGLE, "dyn"+s);
|
||||
menu->setUserGroupLeft(insertionIndex, createMenuCheckBox(FILTER_TOGGLE, "dyn"+s, pi.ChatInput.DynamicChat[i].isListeningWindow(cw)));
|
||||
++insertionIndex;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -2936,14 +2908,6 @@ class CHandlerChatSourceSelected : public IActionHandler
|
|||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
if (nlstricmp(sParams.substr(0, 3), "dyn") == 0)
|
||||
{
|
||||
uint8 i = 0;
|
||||
fromString(sParams.substr(3), i);
|
||||
if (ci.DynamicChat[i].isListeningWindow(cw)) ci.DynamicChat[i].removeListeningWindow(cw);
|
||||
else ci.DynamicChat[i].addListeningWindow(cw);
|
||||
}
|
||||
}
|
||||
};
|
||||
REGISTER_ACTION_HANDLER( CHandlerChatSourceSelected, "chat_source_selected");
|
||||
|
|
|
@ -666,7 +666,7 @@ void CInterfaceChatDisplayer::displayChat(TDataSetIndex compressedSenderIndex, c
|
|||
string entry="UI:SAVE:CHAT:COLORS:";
|
||||
switch(mode)
|
||||
{
|
||||
case CChatGroup::dyn_chat: entry+="DYN"; break;
|
||||
case CChatGroup::dyn_chat: // dyn_chat takes the color of say
|
||||
case CChatGroup::say: entry+="SAY"; break;
|
||||
case CChatGroup::shout: entry+="SHOUT"; break;
|
||||
case CChatGroup::team: entry+="GROUP"; break;
|
||||
|
|
Loading…
Reference in a new issue