# Makefile for Irrlicht Examples\r
# It's usually sufficient to change just the target name and source file list\r
# and be sure that CXX is set to a valid compiler\r
-SOURCE_FILES = materials.cpp guiTextInputMenu.cpp guiInventoryMenu.cpp irrlichtwrapper.cpp guiPauseMenu.cpp defaultsettings.cpp mapnode.cpp tile.cpp voxel.cpp mapblockobject.cpp inventory.cpp debug.cpp serialization.cpp light.cpp filesys.cpp connection.cpp environment.cpp client.cpp server.cpp socket.cpp mapblock.cpp mapsector.cpp heightmap.cpp map.cpp player.cpp utility.cpp main.cpp test.cpp\r
+SOURCE_FILES = guiMessageMenu.cpp materials.cpp guiTextInputMenu.cpp guiInventoryMenu.cpp irrlichtwrapper.cpp guiPauseMenu.cpp defaultsettings.cpp mapnode.cpp tile.cpp voxel.cpp mapblockobject.cpp inventory.cpp debug.cpp serialization.cpp light.cpp filesys.cpp connection.cpp environment.cpp client.cpp server.cpp socket.cpp mapblock.cpp mapsector.cpp heightmap.cpp map.cpp player.cpp utility.cpp main.cpp test.cpp\r
\r
DEBUG_TARGET = debugtest\r
DEBUG_SOURCES = $(addprefix src/, $(SOURCE_FILES))\r
#include "guiInventoryMenu.h"\r
#include "guiTextInputMenu.h"\r
#include "materials.h"\r
+//#include "guiMessageMenu.h"\r
\r
IrrlichtWrapper *g_irrlicht;\r
\r
// Test the text input system\r
/*(new GUITextInputMenu(guienv, guiroot, -1, &g_active_menu_count,\r
NULL))->drop();*/\r
- \r
+ /*GUIMessageMenu *menu =\r
+ new GUIMessageMenu(guienv, guiroot, -1, \r
+ &g_active_menu_count,\r
+ L"Asd");\r
+ menu->drop();*/\r
+ \r
// Launch pause menu\r
- (new GUIPauseMenu(guienv, guiroot, -1, g_device,\r
- &g_active_menu_count))->drop();\r
+ /*(new GUIPauseMenu(guienv, guiroot, -1, g_device,\r
+ &g_active_menu_count))->drop();*/\r
\r
// First line of debug text\r
gui::IGUIStaticText *guitext = guienv->addStaticText(\r
L"Chat here\nOther line\nOther line\nOther line\nOther line",\r
core::rect<s32>(70, 60, 795, 150),\r
false, true);\r
+ chat_guitext->setBackgroundColor(video::SColor(96,0,0,0));\r
core::list<ChatLine> chat_lines;\r
\r
/*\r
u32 beginscenetime = 0;\r
u32 scenetime = 0;\r
u32 endscenetime = 0;\r
+ \r
+ // A test\r
+ //throw con::PeerNotFoundException("lol");\r
\r
/*\r
Main loop\r
i != chat_lines.end(); i++)\r
{\r
(*i).age += dtime;\r
- if((*i).age > 60.0)\r
+ if((*i).age > 300.0)\r
{\r
to_be_removed_count++;\r
continue;\r
catch(con::PeerNotFoundException &e)\r
{\r
dstream<<DTIME<<"Connection timed out."<<std::endl;\r
+ \r
+ /*if(g_device)\r
+ {\r
+ GUIMessageMenu *menu =\r
+ new GUIMessageMenu(guienv, guiroot, -1, \r
+ &g_active_menu_count,\r
+ L"Connection timed out");\r
+\r
+ video::IVideoDriver* driver = g_device->getVideoDriver();\r
+ \r
+ dstream<<"Created menu"<<std::endl;\r
+\r
+ while(g_device->run() && menu->getStatus() == false)\r
+ {\r
+ driver->beginScene(true, true, video::SColor(255,0,0,0));\r
+ guienv->drawAll();\r
+ driver->endScene();\r
+ }\r
+ \r
+ dstream<<"Dropping menu"<<std::endl;\r
+\r
+ menu->drop();\r
+ }*/\r
}\r
#if CATCH_UNHANDLED_EXCEPTIONS\r
/*\r
dstream<<"CHAT: "<<wide_to_narrow(message)<<std::endl;
+ // Get player name of this client
+ std::wstring name = narrow_to_wide(player->getName());
+
+ std::wstring line = std::wstring(L"<")+name+L"> "+message;
+
/*
Send the message to all other clients
*/
if(peer_id == client->peer_id)
continue;
- // Get player name of this client
- std::wstring name = L"unknown";
- Player *player = m_env.getPlayer(client->peer_id);
- if(player != NULL)
- name = narrow_to_wide(player->getName());
-
- SendChatMessage(client->peer_id,
- std::wstring(L"<")+name+L"> "+message);
+ SendChatMessage(client->peer_id, line);
}
}
else