|
|
@ -311,6 +311,8 @@ void CPeopleInterraction::release()
|
|
|
|
ChatInput.Tell.removeListeningPeopleList(&TeamList);
|
|
|
|
ChatInput.Tell.removeListeningPeopleList(&TeamList);
|
|
|
|
ChatInput.Team.removeListeningPeopleList(&TeamList);
|
|
|
|
ChatInput.Team.removeListeningPeopleList(&TeamList);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FriendList.saveContactGroups();
|
|
|
|
|
|
|
|
|
|
|
|
CChatWindowManager &cwm = getChatWndMgr();
|
|
|
|
CChatWindowManager &cwm = getChatWndMgr();
|
|
|
|
|
|
|
|
|
|
|
|
AroundMe.release();
|
|
|
|
AroundMe.release();
|
|
|
@ -333,7 +335,7 @@ void CPeopleInterraction::release()
|
|
|
|
SystemInfo = NULL;
|
|
|
|
SystemInfo = NULL;
|
|
|
|
TellWindow = NULL;
|
|
|
|
TellWindow = NULL;
|
|
|
|
DebugInfo = NULL;
|
|
|
|
DebugInfo = NULL;
|
|
|
|
// TellWindow = NULL;
|
|
|
|
// TellWindow = NULL;
|
|
|
|
|
|
|
|
|
|
|
|
for(uint i=0;i<CChatGroup::MaxDynChanPerPlayer;i++)
|
|
|
|
for(uint i=0;i<CChatGroup::MaxDynChanPerPlayer;i++)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -390,7 +392,7 @@ void CPeopleInterraction::removeAllPartyChat()
|
|
|
|
//===========================================================================================================
|
|
|
|
//===========================================================================================================
|
|
|
|
bool CPeopleInterraction::isUserChat(CChatWindow *cw) const
|
|
|
|
bool CPeopleInterraction::isUserChat(CChatWindow *cw) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// if (cw == MainChat.Window) return true;
|
|
|
|
// if (cw == MainChat.Window) return true;
|
|
|
|
if (cw == ChatGroup.Window) return true;
|
|
|
|
if (cw == ChatGroup.Window) return true;
|
|
|
|
for(uint k = 0; k < MaxNumUserChats; ++k)
|
|
|
|
for(uint k = 0; k < MaxNumUserChats; ++k)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -1266,6 +1268,9 @@ void CPeopleInterraction::initContactLists( const std::vector<uint32> &vFriendLi
|
|
|
|
addContactInList(contactIdPool++, vFriendListName[i], vFriendListOnline[i], 0);
|
|
|
|
addContactInList(contactIdPool++, vFriendListName[i], vFriendListOnline[i], 0);
|
|
|
|
for (uint i = 0; i < vIgnoreListName.size(); ++i)
|
|
|
|
for (uint i = 0; i < vIgnoreListName.size(); ++i)
|
|
|
|
addContactInList(contactIdPool++, vIgnoreListName[i], ccs_offline, 1);
|
|
|
|
addContactInList(contactIdPool++, vIgnoreListName[i], ccs_offline, 1);
|
|
|
|
|
|
|
|
FriendList.readContactGroups();
|
|
|
|
|
|
|
|
CPeopleList::TSortOrder order = (CPeopleList::TSortOrder)(NLGUI::CDBManager::getInstance()->getDbProp("UI:SAVE:CONTACT_LIST:SORT_ORDER")->getValue32());
|
|
|
|
|
|
|
|
FriendList.sortEx(order);
|
|
|
|
updateAllFreeTellerHeaders();
|
|
|
|
updateAllFreeTellerHeaders();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1278,6 +1283,8 @@ void CPeopleInterraction::addContactInList(uint32 contactId, const ucstring &nam
|
|
|
|
// remove the shard name if possible
|
|
|
|
// remove the shard name if possible
|
|
|
|
ucstring name= CEntityCL::removeShardFromName(nameIn);
|
|
|
|
ucstring name= CEntityCL::removeShardFromName(nameIn);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// add the contact to this list
|
|
|
|
// add the contact to this list
|
|
|
|
sint index = pl.getIndexFromName(name);
|
|
|
|
sint index = pl.getIndexFromName(name);
|
|
|
|
// try to create if not found
|
|
|
|
// try to create if not found
|
|
|
@ -1742,7 +1749,7 @@ bool CPeopleInterraction::loadUserChatsInfos(NLMISC::IStream &f)
|
|
|
|
f.serialCheck(NELID("TAHC"));
|
|
|
|
f.serialCheck(NELID("TAHC"));
|
|
|
|
if (ver>=1)
|
|
|
|
if (ver>=1)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// CChatGroupWindow *pCGW = PeopleInterraction.getChatGroupWindow();
|
|
|
|
// CChatGroupWindow *pCGW = PeopleInterraction.getChatGroupWindow();
|
|
|
|
sint32 index;
|
|
|
|
sint32 index;
|
|
|
|
f.serial(index);
|
|
|
|
f.serial(index);
|
|
|
|
/* Yoyo: decide to always start with the default channel (user) activated
|
|
|
|
/* Yoyo: decide to always start with the default channel (user) activated
|
|
|
@ -2307,6 +2314,56 @@ public:
|
|
|
|
};
|
|
|
|
};
|
|
|
|
REGISTER_ACTION_HANDLER( CHandlerMoveContact, "move_contact");
|
|
|
|
REGISTER_ACTION_HANDLER( CHandlerMoveContact, "move_contact");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
uint lastPeopleIndexChangeGroup;
|
|
|
|
|
|
|
|
//=================================================================================================================
|
|
|
|
|
|
|
|
class CHandlerChangeContactGroupBegin : public IActionHandler
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
void execute (CCtrlBase * pCaller, const std::string &sParams)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
// retrieve the index of the people
|
|
|
|
|
|
|
|
CPeopleList *srcList;
|
|
|
|
|
|
|
|
if (PeopleInterraction.getPeopleFromCurrentMenu(srcList, lastPeopleIndexChangeGroup))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
string groupName= getParam(sParams, "group");
|
|
|
|
|
|
|
|
CInterfaceGroup *gc = dynamic_cast<CInterfaceGroup *>(CWidgetManager::getInstance()->getElementFromId(groupName));
|
|
|
|
|
|
|
|
if (gc)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
CGroupEditBox *geb = dynamic_cast<CGroupEditBox *>(gc->getGroup("change_contact_group_eb:eb"));
|
|
|
|
|
|
|
|
geb->setInputString(ucstring(""));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
CAHManager::getInstance()->runActionHandler("enter_modal", pCaller, sParams);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
REGISTER_ACTION_HANDLER( CHandlerChangeContactGroupBegin, "change_contact_group_begin");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//=================================================================================================================
|
|
|
|
|
|
|
|
// Change the group of a contact in the list
|
|
|
|
|
|
|
|
class CHandlerChangeContactGroup : public IActionHandler
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
void execute (CCtrlBase *pCaller, const std::string &/* sParams */)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
CInterfaceManager *pIM = CInterfaceManager::getInstance();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (pCaller)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
// Get the modal edit box
|
|
|
|
|
|
|
|
CGroupEditBox *geb = dynamic_cast<CGroupEditBox *>(CWidgetManager::getInstance()->getElementFromId("ui:interface:change_contact_group:change_contact_group_eb:eb"));
|
|
|
|
|
|
|
|
if (geb)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PeopleInterraction.FriendList.changeGroup(lastPeopleIndexChangeGroup, geb->getInputString());
|
|
|
|
|
|
|
|
geb->setInputString(ucstring(""));
|
|
|
|
|
|
|
|
CPeopleList::TSortOrder order = (CPeopleList::TSortOrder)(NLGUI::CDBManager::getInstance()->getDbProp("UI:SAVE:CONTACT_LIST:SORT_ORDER")->getValue32());
|
|
|
|
|
|
|
|
PeopleInterraction.FriendList.sortEx(order);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
CAHManager::getInstance()->runActionHandler("leave_modal", pCaller, "");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
REGISTER_ACTION_HANDLER( CHandlerChangeContactGroup, "change_contact_group");
|
|
|
|
|
|
|
|
|
|
|
|
//=================================================================================================================
|
|
|
|
//=================================================================================================================
|
|
|
|
class CHandlerSortContacts : public IActionHandler
|
|
|
|
class CHandlerSortContacts : public IActionHandler
|
|
|
@ -2488,7 +2545,7 @@ class CHandlerAddAllTeamMembersToPartyChat : public IActionHandler
|
|
|
|
{
|
|
|
|
{
|
|
|
|
void execute (CCtrlBase * /* pCaller */, const std::string &/* sParams */)
|
|
|
|
void execute (CCtrlBase * /* pCaller */, const std::string &/* sParams */)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// CChatWindow *chat = getChatWndMgr().getChatWindowFromCaller(CWidgetManager::getInstance()->getCtrlLaunchingModal());
|
|
|
|
// CChatWindow *chat = getChatWndMgr().getChatWindowFromCaller(CWidgetManager::getInstance()->getCtrlLaunchingModal());
|
|
|
|
// TODO GAMEDEV : add all team members
|
|
|
|
// TODO GAMEDEV : add all team members
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
@ -2501,7 +2558,7 @@ class CHandlerRemoveAllTeamMembersToPartyChat : public IActionHandler
|
|
|
|
{
|
|
|
|
{
|
|
|
|
void execute (CCtrlBase * /* pCaller */, const std::string &/* sParams */)
|
|
|
|
void execute (CCtrlBase * /* pCaller */, const std::string &/* sParams */)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// CChatWindow *chat = getChatWndMgr().getChatWindowFromCaller(CWidgetManager::getInstance()->getCtrlLaunchingModal());
|
|
|
|
// CChatWindow *chat = getChatWndMgr().getChatWindowFromCaller(CWidgetManager::getInstance()->getCtrlLaunchingModal());
|
|
|
|
// TODO GAMEDEV : remove all team members
|
|
|
|
// TODO GAMEDEV : remove all team members
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
@ -2514,7 +2571,7 @@ class CHandlerAddAllGuildMembersToPartyChat : public IActionHandler
|
|
|
|
{
|
|
|
|
{
|
|
|
|
void execute (CCtrlBase * /* pCaller */, const std::string &/* sParams */)
|
|
|
|
void execute (CCtrlBase * /* pCaller */, const std::string &/* sParams */)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// CChatWindow *chat = getChatWndMgr().getChatWindowFromCaller(CWidgetManager::getInstance()->getCtrlLaunchingModal());
|
|
|
|
// CChatWindow *chat = getChatWndMgr().getChatWindowFromCaller(CWidgetManager::getInstance()->getCtrlLaunchingModal());
|
|
|
|
// TODO GAMEDEV : add all guild members
|
|
|
|
// TODO GAMEDEV : add all guild members
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
@ -2527,7 +2584,7 @@ class CHandlerRemoveAllGuildMembersToPartyChat : public IActionHandler
|
|
|
|
{
|
|
|
|
{
|
|
|
|
void execute (CCtrlBase * /* pCaller */, const std::string &/* sParams */)
|
|
|
|
void execute (CCtrlBase * /* pCaller */, const std::string &/* sParams */)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// CChatWindow *chat = getChatWndMgr().getChatWindowFromCaller(CWidgetManager::getInstance()->getCtrlLaunchingModal());
|
|
|
|
// CChatWindow *chat = getChatWndMgr().getChatWindowFromCaller(CWidgetManager::getInstance()->getCtrlLaunchingModal());
|
|
|
|
// TODO_GAMEDEV : remove all guild members
|
|
|
|
// TODO_GAMEDEV : remove all guild members
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
@ -2603,7 +2660,7 @@ public:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CInterfaceManager *pIM = CInterfaceManager::getInstance();
|
|
|
|
CInterfaceManager *pIM = CInterfaceManager::getInstance();
|
|
|
|
cw = PeopleInterraction.TheUserChat.Window;
|
|
|
|
cw = PeopleInterraction.TheUserChat.Window;
|
|
|
|
// CChatStdInput &ci = PeopleInterraction.ChatInput;
|
|
|
|
// CChatStdInput &ci = PeopleInterraction.ChatInput;
|
|
|
|
CGroupMenu *pMenu = dynamic_cast<CGroupMenu*>(CWidgetManager::getInstance()->getElementFromId("ui:interface:user_chat_target_menu"));
|
|
|
|
CGroupMenu *pMenu = dynamic_cast<CGroupMenu*>(CWidgetManager::getInstance()->getElementFromId("ui:interface:user_chat_target_menu"));
|
|
|
|
CViewTextMenu *pMenuAround = dynamic_cast<CViewTextMenu*>(pMenu->getElement("ui:interface:user_chat_target_menu:around"));
|
|
|
|
CViewTextMenu *pMenuAround = dynamic_cast<CViewTextMenu*>(pMenu->getElement("ui:interface:user_chat_target_menu:around"));
|
|
|
|
CViewTextMenu *pMenuRegion = dynamic_cast<CViewTextMenu*>(pMenu->getElement("ui:interface:user_chat_target_menu:region"));
|
|
|
|
CViewTextMenu *pMenuRegion = dynamic_cast<CViewTextMenu*>(pMenu->getElement("ui:interface:user_chat_target_menu:region"));
|
|
|
@ -3186,80 +3243,80 @@ NLMISC_COMMAND(ignore, "add or remove a player from the ignore list", "<player n
|
|
|
|
} // ignore //
|
|
|
|
} // ignore //
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
****
|
|
|
|
****
|
|
|
|
Yoyo: Party chat is not ended: DON'T LET THOSE COMMANDS AVAILABLE!
|
|
|
|
Yoyo: Party chat is not ended: DON'T LET THOSE COMMANDS AVAILABLE!
|
|
|
|
they made the client crash (cf createNewPartyChat)...
|
|
|
|
they made the client crash (cf createNewPartyChat)...
|
|
|
|
****
|
|
|
|
****
|
|
|
|
|
|
|
|
|
|
|
|
// create a new party chat with the given name
|
|
|
|
// create a new party chat with the given name
|
|
|
|
NLMISC_COMMAND(party_chat, "Create a new party chat", "<party_chat_name>")
|
|
|
|
NLMISC_COMMAND(party_chat, "Create a new party chat", "<party_chat_name>")
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (args.size() != 1)
|
|
|
|
if (args.size() != 1)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
displayVisibleSystemMsg(CI18N::get("uiPartyChatCmd"));
|
|
|
|
displayVisibleSystemMsg(CI18N::get("uiPartyChatCmd"));
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
CPeopleInterraction &pi = PeopleInterraction;
|
|
|
|
CPeopleInterraction &pi = PeopleInterraction;
|
|
|
|
ucstring title = args[0];
|
|
|
|
ucstring title = args[0];
|
|
|
|
|
|
|
|
|
|
|
|
if (!pi.testValidPartyChatName(title))
|
|
|
|
if (!pi.testValidPartyChatName(title))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
displayVisibleSystemMsg(CI18N::get("uiInvalidPartyChatName"));
|
|
|
|
displayVisibleSystemMsg(CI18N::get("uiInvalidPartyChatName"));
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
PeopleInterraction.createNewPartyChat(title);
|
|
|
|
PeopleInterraction.createNewPartyChat(title);
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Remove the party chat with the given name
|
|
|
|
// Remove the party chat with the given name
|
|
|
|
NLMISC_COMMAND(remove_party_chat, "Remove a party chat", "<party_chat_name>")
|
|
|
|
NLMISC_COMMAND(remove_party_chat, "Remove a party chat", "<party_chat_name>")
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (args.size() != 1)
|
|
|
|
if (args.size() != 1)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
displayVisibleSystemMsg(CI18N::get("uiRemovePartyChatCmd"));
|
|
|
|
displayVisibleSystemMsg(CI18N::get("uiRemovePartyChatCmd"));
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ucstring title = ucstring(args[0]);
|
|
|
|
ucstring title = ucstring(args[0]);
|
|
|
|
CChatWindow *chat = getChatWndMgr().getChatWindow(title);
|
|
|
|
CChatWindow *chat = getChatWndMgr().getChatWindow(title);
|
|
|
|
if (!chat)
|
|
|
|
if (!chat)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
displayVisibleSystemMsg(title + ucstring(" : ") + CI18N::get("uiBadPartyChatName"));
|
|
|
|
displayVisibleSystemMsg(title + ucstring(" : ") + CI18N::get("uiBadPartyChatName"));
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!PeopleInterraction.removePartyChat(chat))
|
|
|
|
if (!PeopleInterraction.removePartyChat(chat))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
displayVisibleSystemMsg(title + ucstring(" : ") + CI18N::get("uiCantRemovePartyChat"));
|
|
|
|
displayVisibleSystemMsg(title + ucstring(" : ") + CI18N::get("uiCantRemovePartyChat"));
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Join a party chat whose name is known
|
|
|
|
// Join a party chat whose name is known
|
|
|
|
NLMISC_COMMAND(add_to_party_chat, "Join the given party chat", "<party_chat_name>")
|
|
|
|
NLMISC_COMMAND(add_to_party_chat, "Join the given party chat", "<party_chat_name>")
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (args.size() != 1)
|
|
|
|
if (args.size() != 1)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
displayVisibleSystemMsg(CI18N::get("uiAddPartyChatCmd"));
|
|
|
|
displayVisibleSystemMsg(CI18N::get("uiAddPartyChatCmd"));
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// TODO GAMEDEV : join the party chat
|
|
|
|
// TODO GAMEDEV : join the party chat
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Invite someone in a party chat
|
|
|
|
// Invite someone in a party chat
|
|
|
|
NLMISC_COMMAND(invite, "Invite someone to a party chat", "<people_name> <party_chat_name>")
|
|
|
|
NLMISC_COMMAND(invite, "Invite someone to a party chat", "<people_name> <party_chat_name>")
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (args.size() != 2)
|
|
|
|
if (args.size() != 2)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
displayVisibleSystemMsg(CI18N::get("uiInviteCmd"));
|
|
|
|
displayVisibleSystemMsg(CI18N::get("uiInviteCmd"));
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// TODO GAMEDEV : Send invite message to the server
|
|
|
|
// TODO GAMEDEV : Send invite message to the server
|
|
|
|
// Check that the inviter has created the chat ?
|
|
|
|
// Check that the inviter has created the chat ?
|
|
|
|
// The people being invited should receive a popup to announce that he is being invited
|
|
|
|
// The people being invited should receive a popup to announce that he is being invited
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|