Use lua and messages to set the room titles in the screen headers

This commit is contained in:
Josh Allen
2008-05-24 01:07:56 +00:00
parent 48dbf58a67
commit 79b57b5dce
4 changed files with 11 additions and 26 deletions
+9 -23
View File
@@ -11,8 +11,6 @@
#include "InputEventPlus.h"
#include "LocalizedString.h"
#define TITLEBG_WIDTH THEME->GetMetricF(m_sName,"TitleBGWidth")
#define TITLEBG_HEIGHT THEME->GetMetricF(m_sName,"TitleBGHeight")
#define ROOMSBG_WIDTH THEME->GetMetricF(m_sName,"RoomsBGWidth")
#define ROOMSBG_HEIGHT THEME->GetMetricF(m_sName,"RoomsBGHeight")
#define SELECTION_WIDTH THEME->GetMetricF(m_sName,"SelectionWidth")
@@ -46,20 +44,6 @@ void ScreenNetRoom::Init()
m_iRoomPlace = 0;
m_sprTitleBG.Load( THEME->GetPathG( m_sName, "TitleBG" ) );
m_sprTitleBG.SetName( "TitleBG" );
m_sprTitleBG.SetWidth( TITLEBG_WIDTH );
m_sprTitleBG.SetHeight( TITLEBG_HEIGHT );
LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_sprTitleBG );
this->AddChild( &m_sprTitleBG);
m_textTitle.LoadFromFont( THEME->GetPathF(m_sName,"wheel") );
m_textTitle.SetShadowLength( 0 );
m_textTitle.SetName( "Title" );
m_textTitle.SetMaxWidth( TITLEBG_WIDTH );
LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_textTitle );
this->AddChild( &m_textTitle);
m_RoomWheel.SetName( "RoomWheel" );
m_RoomWheel.Load( "RoomWheel" );
m_RoomWheel.BeginScreen();
@@ -117,10 +101,15 @@ void ScreenNetRoom::HandleScreenMessage( const ScreenMessage SM )
{
case 0: //Room title Change
{
RString titleSub;
titleSub = NSMAN->m_SMOnlinePacket.ReadNT() + "\n";
titleSub += NSMAN->m_SMOnlinePacket.ReadNT();
m_textTitle.SetText( titleSub );
RString title, subtitle;
title = NSMAN->m_SMOnlinePacket.ReadNT();
subtitle = NSMAN->m_SMOnlinePacket.ReadNT();
Message msg( MessageIDToString(Message_UpdateScreenHeader) );
msg.SetParam( "Header", title );
msg.SetParam( "Subheader", subtitle );
MESSAGEMAN->Broadcast( msg );
if ( NSMAN->m_SMOnlinePacket.Read1() != 0 )
{
RString SMOnlineSelectScreen = THEME->GetMetric( m_sName, "MusicSelectScreen" );
@@ -209,9 +198,6 @@ void ScreenNetRoom::HandleScreenMessage( const ScreenMessage SM )
void ScreenNetRoom::TweenOffScreen()
{
OFF_COMMAND( m_textTitle );
OFF_COMMAND( m_sprTitleBG );
NSMAN->ReportNSSOnOff( 6 );
}