Changed many places that used RageException to use ReportScriptError instead. Wrote ScreenOptionsExample.ini as documentation example for the OptionRow system. Rewrote gamecommands.txt to include all GameCommands. Fixed Commands::GetOriginalCommandString to insert the semicolons that separated the original commands. Changed nonsensical boolean |= true statements in GameCommand.cpp to just use =. Added protection to ReportScriptError to keep it from recursing through itself when an error occurs in error reporting. Added UseAbort option to ReportScriptError for places that want to use an AbortRetryIgnore dialog to query the user. Added ScriptErrorMessage for places that need to handle the warning/dialog part separately. Added logging flag to MESSAGEMAN so that all messages broadcast can be logged when desired. Changed OptionRowHandler::LoadInternal to return a boolean success value as part of error handling.

This commit is contained in:
Kyzentun
2014-07-12 14:59:10 -06:00
parent 63311ab62f
commit fb1a251b7a
29 changed files with 593 additions and 246 deletions
+18 -14
View File
@@ -52,8 +52,10 @@ void ScreenSelect::Init()
}
}
if( !m_aGameCommands.size() )
RageException::Throw( "Screen \"%s\" does not set any choices.", m_sName.c_str() );
if(m_aGameCommands.empty())
{
LuaHelpers::ReportScriptErrorFmt("Screen \"%s\" does not set any choices.", m_sName.c_str());
}
}
void ScreenSelect::BeginScreen()
@@ -157,25 +159,27 @@ void ScreenSelect::HandleScreenMessage( const ScreenMessage SM )
}
}
if( bAllPlayersChoseTheSame )
if(!m_aGameCommands.empty())
{
const GameCommand &gc = m_aGameCommands[iMastersIndex];
m_sNextScreen = gc.m_sScreen;
if( !gc.m_bInvalid )
gc.ApplyToAllPlayers();
}
else
{
FOREACH_HumanPlayer( p )
if( bAllPlayersChoseTheSame )
{
int iIndex = this->GetSelectionIndex(p);
const GameCommand &gc = m_aGameCommands[iIndex];
const GameCommand &gc = m_aGameCommands[iMastersIndex];
m_sNextScreen = gc.m_sScreen;
if( !gc.m_bInvalid )
gc.ApplyToAllPlayers();
}
else
{
FOREACH_HumanPlayer( p )
{
int iIndex = this->GetSelectionIndex(p);
const GameCommand &gc = m_aGameCommands[iIndex];
m_sNextScreen = gc.m_sScreen;
if( !gc.m_bInvalid )
gc.Apply( p );
}
}
}
StopTimer();
SCREENMAN->RefreshCreditsMessages();