Beispiel #1
0
void CTranscendenceWnd::OnCommandIntro (const CString &sCmd, void *pData)

//	OnCommandIntro
//
//	Handle commands from Reanimator, etc.

	{
	if (strEquals(sCmd, CMD_TOGGLE_MUSIC))
		{
		m_pTC->SetOptionBoolean(CGameSettings::noMusic, !m_pTC->GetOptionBoolean(CGameSettings::noMusic));
		SetMusicOption();
		}

	else if (strEquals(sCmd, CMD_TOGGLE_DEBUG))
		{
		m_pTC->GetModel().SetDebugMode(!m_pTC->GetModel().GetDebugMode());
		SetDebugOption();
		}

	else if (strEquals(sCmd, CMD_OPEN_NEWS))
		{
		if (!m_sNewsURL.IsBlank())
			sysOpenURL(m_sNewsURL);
		}
	}
ALERROR CLoginSession::OnCommand (const CString &sCmd, void *pData)

//	OnCommand
//
//	Handle a command

	{
	if (strEquals(sCmd, CMD_ALL_TASKS_DONE))
		{
		StopPerformance(ID_CTRL_WAIT);
		ShowInitialDlg();
		}

	else if (strEquals(sCmd, CMD_CANCEL))
		CmdCancel();

	else if (strEquals(sCmd, CMD_REGISTER))
		CmdRegister();

	else if (strEquals(sCmd, CMD_REGISTER_COMPLETE))
		CmdRegisterComplete((CRegisterUserTask *)pData);

	else if (strEquals(sCmd, CMD_SIGN_IN))
		CmdSignIn();

	else if (strEquals(sCmd, CMD_SIGN_IN_COMPLETE))
		CmdSignInComplete((CSignInUserTask *)pData);

	else if (strEquals(sCmd, CMD_SWITCH_TO_LOGIN))
		{
		StopPerformance(ID_DLG_REGISTER);

		const CVisualPalette &VI = m_HI.GetVisuals();
		IAnimatron *pDlg;

		CreateDlgSignIn(VI, &pDlg);
		m_iCurrent = dlgSignIn;
		StartPerformance(pDlg, ID_DLG_SIGN_IN, CReanimator::SPR_FLAG_DELETE_WHEN_DONE);
		}

	else if (strEquals(sCmd, CMD_SWITCH_TO_REGISTER))
		{
		StopPerformance(ID_DLG_SIGN_IN);

		const CVisualPalette &VI = m_HI.GetVisuals();
		IAnimatron *pDlg;

		CreateDlgRegister(VI, &pDlg);
		m_iCurrent = dlgRegister;
		StartPerformance(pDlg, ID_DLG_REGISTER, CReanimator::SPR_FLAG_DELETE_WHEN_DONE);
		}

	else if (strEquals(sCmd, CMD_PASSWORD_RESET))
		CmdPasswordReset();

	else if (strEquals(sCmd, CMD_TOS))
		sysOpenURL(CONSTLIT("http://www.kronosaur.com/legal/TermsofService.html"));

	return NOERROR;
	}