1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Chat console, including a number of rebases and modifications.

Defaults modified from original: alpha=200, key=F10
This commit is contained in:
Kahrl 2011-12-03 09:01:14 +01:00 committed by Perttu Ahola
parent 0053651814
commit 967f25461b
17 changed files with 1941 additions and 146 deletions

View file

@ -2036,7 +2036,21 @@ void Client::printDebugInfo(std::ostream &os)
//<<", m_opt_not_found_history.size()="<<m_opt_not_found_history.size()
<<std::endl;*/
}
core::list<std::wstring> Client::getConnectedPlayerNames()
{
core::list<Player*> players = m_env.getPlayers(true);
core::list<std::wstring> playerNames;
for(core::list<Player*>::Iterator
i = players.begin();
i != players.end(); i++)
{
Player *player = *i;
playerNames.push_back(narrow_to_wide(player->getName()));
}
return playerNames;
}
u32 Client::getDayNightRatio()
{
//JMutexAutoLock envlock(m_env_mutex); //bulk comment-out
@ -2084,6 +2098,39 @@ void Client::clearTempMod(v3s16 p)
}
}
bool Client::getChatMessage(std::wstring &message)
{
if(m_chat_queue.size() == 0)
return false;
message = m_chat_queue.pop_front();
return true;
}
void Client::typeChatMessage(const std::wstring &message)
{
// Discard empty line
if(message == L"")
return;
// Send to others
sendChatMessage(message);
// Show locally
if (message[0] == L'/')
{
m_chat_queue.push_back(
(std::wstring)L"issued command: "+message);
}
else
{
LocalPlayer *player = m_env.getLocalPlayer();
assert(player != NULL);
std::wstring name = narrow_to_wide(player->getName());
m_chat_queue.push_back(
(std::wstring)L"<"+name+L"> "+message);
}
}
void Client::addUpdateMeshTask(v3s16 p, bool ack_to_server)
{
/*infostream<<"Client::addUpdateMeshTask(): "