Fixed chatting issue.

This commit is contained in:
Charles Lohr
2004-08-27 14:18:42 +00:00
parent 75b77ad650
commit 16013b0723
2 changed files with 19 additions and 17 deletions
+16 -15
View File
@@ -3,21 +3,18 @@
#include "ScreenManager.h" #include "ScreenManager.h"
#include "GameSoundManager.h" #include "GameSoundManager.h"
#include "GameConstantsAndTypes.h" #include "GameConstantsAndTypes.h"
#include "PrefsManager.h"
#include "ThemeManager.h" #include "ThemeManager.h"
#include "GameState.h" #include "GameState.h"
#include "Style.h" #include "Style.h"
#include "InputMapper.h"
#include "CodeDetector.h"
#include "Steps.h" #include "Steps.h"
#include "RageTimer.h" #include "RageTimer.h"
#include "ActorUtil.h" #include "ActorUtil.h"
#include "Actor.h" #include "Actor.h"
#include "RageTextureManager.h"
#include "AnnouncerManager.h" #include "AnnouncerManager.h"
#include "MenuTimer.h" #include "MenuTimer.h"
#include "NetworkSyncManager.h" #include "NetworkSyncManager.h"
#include "StepsUtil.h" #include "StepsUtil.h"
#include "RageUtil.h"
#define CHATINPUT_WIDTH THEME->GetMetricF("ScreenNetSelectMusic","ChatInputBoxWidth") #define CHATINPUT_WIDTH THEME->GetMetricF("ScreenNetSelectMusic","ChatInputBoxWidth")
#define CHATINPUT_HEIGHT THEME->GetMetricF("ScreenNetSelectMusic","ChatInputBoxHeight") #define CHATINPUT_HEIGHT THEME->GetMetricF("ScreenNetSelectMusic","ChatInputBoxHeight")
@@ -89,12 +86,15 @@ ScreenNetSelectMusic::ScreenNetSelectMusic( CString sName ) : ScreenWithMenuElem
SET_XY_AND_ON_COMMAND( m_textChatInput ); SET_XY_AND_ON_COMMAND( m_textChatInput );
this->AddChild( &m_textChatInput ); this->AddChild( &m_textChatInput );
m_textOutHidden.LoadFromFont( THEME->GetPathF(m_sName,"chat") );
m_textOutHidden.SetWrapWidthPixels( (int)(CHATOUTPUT_WIDTH * 2) );
m_textChatOutput.LoadFromFont( THEME->GetPathF(m_sName,"chat") ); m_textChatOutput.LoadFromFont( THEME->GetPathF(m_sName,"chat") );
m_textChatOutput.SetHorizAlign( align_left ); m_textChatOutput.SetHorizAlign( align_left );
m_textChatOutput.SetVertAlign( align_top ); m_textChatOutput.SetVertAlign( align_bottom );
m_textChatOutput.SetShadowLength( 0 ); m_textChatOutput.SetShadowLength( 0 );
m_textChatOutput.SetName( "ChatOutput" ); m_textChatOutput.SetName( "ChatOutput" );
m_textChatOutput.SetMaxWidth( (int)(CHATOUTPUT_WIDTH * 2) );
SET_XY_AND_ON_COMMAND( m_textChatOutput ); SET_XY_AND_ON_COMMAND( m_textChatOutput );
this->AddChild( &m_textChatOutput ); this->AddChild( &m_textChatOutput );
@@ -325,16 +325,17 @@ void ScreenNetSelectMusic::HandleScreenMessage( const ScreenMessage SM )
break; break;
case SM_AddToChat: case SM_AddToChat:
{ {
CString OutText = ""; //This SHOULD be done with cropping, but I cant seem to get
m_vChatText.push_back ( NSMAN->m_WaitingChat ); //text to crop properly.
m_sChatText += NSMAN->m_WaitingChat + " \n "; //Forced newline
NSMAN->m_WaitingChat = ""; NSMAN->m_WaitingChat = "";
m_textOutHidden.SetText( m_sChatText );
for ( unsigned i= max( m_vChatText.size() - SHOW_CHAT_LINES, unsigned(0) ); vector <wstring> wLines;
i<m_vChatText.size() ; ++i ) m_textOutHidden.GetLines( wLines );
{ CString actualText = "";
OutText+=m_vChatText[i]+'\n'; for (int i = max( int(wLines.size() - SHOW_CHAT_LINES), 0 ) ; i < wLines.size() ; i++)
} actualText += WStringToCString(wLines[i])+'\n';
m_textChatOutput.SetText( OutText ); m_textChatOutput.SetText( actualText );
break; break;
} }
case SM_ChangeSong: case SM_ChangeSong:
+2 -1
View File
@@ -58,10 +58,11 @@ protected:
//Chatting //Chatting
BitmapText m_textChatInput; BitmapText m_textChatInput;
BitmapText m_textChatOutput; BitmapText m_textChatOutput;
BitmapText m_textOutHidden;
Quad m_rectChatInputBox; Quad m_rectChatInputBox;
Quad m_rectChatOutputBox; Quad m_rectChatOutputBox;
CString m_sTextInput; CString m_sTextInput;
vector <CString> m_vChatText; CString m_sChatText;
//Selection //Selection
Quad m_rectSelection; Quad m_rectSelection;