simplify SystemMessage
This commit is contained in:
@@ -23,17 +23,13 @@ local t = Def.ActorFrame {
|
||||
OnCommand=cmd(maxwidth,750;finishtweening;horizalign,left;vertalign,top;x,SCREEN_LEFT+20;y,SCREEN_TOP+20;zoom,0.8;shadowlength,2;diffusealpha,1;addx,-SCREEN_WIDTH;linear,0.5;addx,SCREEN_WIDTH);
|
||||
OffCommand=cmd(sleep,5;linear,0.5;diffusealpha,0);
|
||||
|
||||
SystemMessageMessageCommand = function(self)
|
||||
SystemMessageMessageCommand = function(self, params)
|
||||
self:visible(true);
|
||||
self:settext( SCREENMAN:GetCurrentSystemMessage() );
|
||||
self:settext( params.Message );
|
||||
self:playcommand( "On" );
|
||||
self:playcommand( "Off" );
|
||||
end;
|
||||
SystemMessageNoAnimateMessageCommand = function(self)
|
||||
self:visible(true);
|
||||
self:settext( SCREENMAN:GetCurrentSystemMessage() );
|
||||
self:playcommand( "On" );
|
||||
self:FinishTweening();
|
||||
if params.NoAnimate then
|
||||
self:finishtweening();
|
||||
end
|
||||
self:playcommand( "Off" );
|
||||
end;
|
||||
HideSystemMessageMessageCommand = cmd(visible,false);
|
||||
|
||||
@@ -750,16 +750,20 @@ void ScreenManager::SendMessageToTopScreen( ScreenMessage SM )
|
||||
|
||||
void ScreenManager::SystemMessage( const RString &sMessage )
|
||||
{
|
||||
m_sSystemMessage = sMessage;
|
||||
LOG->Trace( "%s", sMessage.c_str() );
|
||||
MESSAGEMAN->Broadcast( "SystemMessage" );
|
||||
Message msg( "SystemMessage" );
|
||||
msg.SetParam( "Message", sMessage );
|
||||
msg.SetParam( "NoAnimate", false );
|
||||
MESSAGEMAN->Broadcast( msg );
|
||||
}
|
||||
|
||||
void ScreenManager::SystemMessageNoAnimate( const RString &sMessage )
|
||||
{
|
||||
// LOG->Trace( "%s", sMessage.c_str() ); // don't log because the caller is likely calling us every frame
|
||||
m_sSystemMessage = sMessage;
|
||||
MESSAGEMAN->Broadcast( "SystemMessageNoAnimate" );
|
||||
Message msg( "SystemMessage" );
|
||||
msg.SetParam( "Message", sMessage );
|
||||
msg.SetParam( "NoAnimate", true );
|
||||
MESSAGEMAN->Broadcast( msg );
|
||||
}
|
||||
|
||||
void ScreenManager::HideSystemMessage()
|
||||
@@ -847,7 +851,6 @@ public:
|
||||
}
|
||||
static int SystemMessage( T* p, lua_State *L ) { p->SystemMessage( SArg(1) ); return 0; }
|
||||
static int ScreenIsPrepped( T* p, lua_State *L ) { lua_pushboolean( L, ScreenManagerUtil::ScreenIsPrepped( SArg(1) ) ); return 1; }
|
||||
static int GetCurrentSystemMessage( T* p, lua_State *L ){ LuaHelpers::Push( L, p->GetCurrentSystemMessage() ); return 1; }
|
||||
|
||||
LunaScreenManager()
|
||||
{
|
||||
@@ -855,7 +858,6 @@ public:
|
||||
ADD_METHOD( GetTopScreen );
|
||||
ADD_METHOD( SystemMessage );
|
||||
ADD_METHOD( ScreenIsPrepped );
|
||||
ADD_METHOD( GetCurrentSystemMessage );
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -40,7 +40,6 @@ public:
|
||||
void SystemMessage( const RString &sMessage );
|
||||
void SystemMessageNoAnimate( const RString &sMessage );
|
||||
void HideSystemMessage();
|
||||
RString GetCurrentSystemMessage() const { return m_sSystemMessage; }
|
||||
|
||||
// Screen messages
|
||||
void PostMessageToTopScreen( ScreenMessage SM, float fDelay );
|
||||
@@ -63,8 +62,6 @@ public:
|
||||
private:
|
||||
Screen *m_pInputFocus; // NULL = top of m_ScreenStack
|
||||
|
||||
RString m_sSystemMessage;
|
||||
|
||||
// Screen loads, removals, and concurrent prepares are delayed until the next update.
|
||||
RString m_sDelayedScreen;
|
||||
RString m_sDelayedConcurrentPrepare;
|
||||
|
||||
Reference in New Issue
Block a user