[Gcblue-commits] gcb_wx/src/sim Game.cpp,1.66,1.67 tcNetworkView.cpp,1.4,1.5
Status: Alpha
Brought to you by:
ddcforge
|
From: <ddc...@us...> - 2004-03-02 03:03:43
|
Update of /cvsroot/gcblue/gcb_wx/src/sim In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13312/src/sim Modified Files: Game.cpp tcNetworkView.cpp Log Message: Index: Game.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/Game.cpp,v retrieving revision 1.66 retrieving revision 1.67 diff -C2 -d -r1.66 -r1.67 *** Game.cpp 29 Feb 2004 22:51:36 -0000 1.66 --- Game.cpp 2 Mar 2004 02:52:15 -0000 1.67 *************** *** 1018,1021 **** --- 1018,1022 ---- tcMultiplayerInterface::Get().Update(); + tcMultiplayerInterface::Get().Update(); startView->mbPlayEnabled = mcSimState.msScenarioInfo.mbLoaded; Index: tcNetworkView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/sim/tcNetworkView.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tcNetworkView.cpp 29 Feb 2004 22:51:36 -0000 1.4 --- tcNetworkView.cpp 2 Mar 2004 02:52:15 -0000 1.5 *************** *** 31,34 **** --- 31,35 ---- #include "tcButton.h" #include "tcEditBox.h" + #include "tcConsoleBox.h" #include "tcXMLFile.h" #include "network/tcMultiplayerInterface.h" *************** *** 42,45 **** --- 43,47 ---- EVT_COMMAND(ID_CHATTEXT, wxEVT_COMMAND_BUTTON_CLICKED , tcNetworkView::SendChatText) EVT_COMMAND(1, wxEVT_COMMAND_TEXT_UPDATED, tcNetworkView::SetIPText) + EVT_COMMAND(2, wxEVT_COMMAND_TEXT_UPDATED, tcNetworkView::SendChatText) END_EVENT_TABLE() *************** *** 65,68 **** --- 67,76 ---- DrawStatusBox(pGraphics); + if (tcMultiplayerInterface::Get().IsChatTextAvail()) + { + chatBox->Print(tcMultiplayerInterface::Get().GetChatText().c_str()); + } + + ReleaseGraphics(pGraphics); *************** *** 89,94 **** std::string connectionStatus = tcMultiplayerInterface::Get().GetConnectionStatus(n); DrawText(graphics, font8, mpBrush, connectionStatus.c_str(), x, y); - } } --- 97,102 ---- std::string connectionStatus = tcMultiplayerInterface::Get().GetConnectionStatus(n); DrawText(graphics, font8, mpBrush, connectionStatus.c_str(), x, y); } + } *************** *** 112,116 **** void tcNetworkView::SendChatText(wxCommandEvent& event) { ! std::string chatText = "This is some test chat text."; unsigned nConnections = tcMultiplayerInterface::Get().GetNumConnections(); --- 120,124 ---- void tcNetworkView::SendChatText(wxCommandEvent& event) { ! std::string chatText = event.GetString().c_str(); unsigned nConnections = tcMultiplayerInterface::Get().GetNumConnections(); *************** *** 119,123 **** { int connId = tcMultiplayerInterface::Get().GetConnectionId(n); ! tcMultiplayerInterface::Get().SendTestMessage(connId, chatText); } --- 127,131 ---- { int connId = tcMultiplayerInterface::Get().GetConnectionId(n); ! tcMultiplayerInterface::Get().SendChatText(connId, chatText); } *************** *** 172,180 **** --- 180,191 ---- tcXMLNode root = config->GetRootNode(); + // add IP edit box tcXMLNode current = root.GetChildMatching("EditIP"); ipEdit = new tcEditBox(this, ¤t); ipEdit->SetCommand(1); + ipEdit->SetClearOnReturn(false); ipEdit->SetBuffer(""); + // read status box parameters current = root.GetChildMatching("StatusBox"); statusBoxBounds.x = current.GetChildMatching("X").GetAsInt(); *************** *** 183,186 **** --- 194,207 ---- statusBoxBounds.height = current.GetChildMatching("Height").GetAsInt(); + // add chat text console + current = root.GetChildMatching("ChatBox"); + chatBox = new tcConsoleBox(this, ¤t); + + // add chat text edit box + current = root.GetChildMatching("ChatEntry"); + chatEntry = new tcEditBox(this, ¤t); + chatEntry->SetCommand(2); + chatEntry->SetClearOnReturn(true); + chatEntry->SetBuffer("Enter chat text here"); } |