コード例 #1
0
void UIScreenYesNoDialog::SetParameters(
	bool							PauseGame,
	const SimpleString&				YesNoString,
	const SimpleString&				YesNoDynamicString,
	const HashedString&				YesEvent,
	const HashedString&				NoEvent,
	const SimpleString&				YesCommand,
	const SimpleString&				NoCommand,
	const SUICallback&				YesCallback,
	const SUICallback&				NoCallback,
	const Array<WBAction*>* const	pYesActions,
	const Array<WBAction*>* const	pNoActions )
{
	m_PausesGame = PauseGame;

	// HACKY: Referencing widgets directly by index
	UIWidgetText* pDialog = static_cast< UIWidgetText* >( m_RenderWidgets[1] );
	UIWidgetText* pYes = static_cast< UIWidgetText* >( m_RenderWidgets[2] );
	UIWidgetText* pNo = static_cast< UIWidgetText* >( m_RenderWidgets[3] );

	// NOTE: This bypasses the "IsLiteral" property of the widget and always uses localized
	pDialog->m_String = ConfigManager::GetLocalizedString( YesNoString, "" );
	pDialog->m_DynamicString = ConfigManager::GetLocalizedString( YesNoDynamicString, "" );
	pDialog->InitializeFromDefinition( pDialog->m_Name );

	pYes->m_EventName		= YesEvent;
	pYes->m_Command			= YesCommand;
	pYes->m_Callback		= YesCallback;
	pYes->m_OwnsActions		= false;
	if( pYesActions )
	{
		pYes->m_Actions		= *pYesActions;
	}
	else
	{
		pYes->m_Actions.Clear();
	}

	pNo->m_EventName		= NoEvent;
	pNo->m_Command			= NoCommand;
	pNo->m_Callback			= NoCallback;
	pNo->m_OwnsActions		= false;
	if( pNoActions )
	{
		pNo->m_Actions		= *pNoActions;
	}
	else
	{
		pNo->m_Actions.Clear();
	}
}
コード例 #2
0
void UIScreenWaitDialog::SetParameters(bool PauseGame,
                                       const SimpleString& WaitString,
                                       const SimpleString& WaitDynamicString) {
  m_PausesGame = PauseGame;

  // HACKY: Referencing widgets directly by index
  UIWidgetText* pDialog = static_cast<UIWidgetText*>(m_RenderWidgets[1]);

  // NOTE: This bypasses the "IsLiteral" property of the widget and always uses
  // localized
  pDialog->m_String = ConfigManager::GetLocalizedString(WaitString, "");
  pDialog->m_DynamicString =
      ConfigManager::GetLocalizedString(WaitDynamicString, "");
  pDialog->InitializeFromDefinition(pDialog->m_Name);
}
コード例 #3
0
void UIScreenOKDialog::SetParameters(
	bool				PauseGame,
	const SimpleString&	OKString,
	const SimpleString&	OKDynamicString,
	const HashedString&	OKEvent,
	const SimpleString&	OKCommand,
	const SUICallback&	OKCallback )
{
	m_PausesGame = PauseGame;

	// HACKY: Referencing widgets directly by index
	UIWidgetText* pDialog = static_cast< UIWidgetText* >( m_RenderWidgets[1] );
	UIWidgetText* pOK = static_cast< UIWidgetText* >( m_RenderWidgets[2] );

	// NOTE: This bypasses the "IsLiteral" property of the widget and always uses localized
	pDialog->m_String = ConfigManager::GetLocalizedString( OKString, "" );
	pDialog->m_DynamicString = ConfigManager::GetLocalizedString( OKDynamicString, "" );
	pDialog->InitializeFromDefinition( pDialog->m_Name );

	pOK->m_EventName = OKEvent;
	pOK->m_Command = OKCommand;
	pOK->m_Callback = OKCallback;
}