00001 /* ScreenPrompt - Displays a prompt on top of another screen. Use by calling SCREENMAN->AddScreenToTop( new ScreenPrompt(...) ); */ 00002 00003 #ifndef SCREEN_PROMPT_H 00004 #define SCREEN_PROMPT_H 00005 00006 #include "Screen.h" 00007 #include "BitmapText.h" 00008 #include "Transition.h" 00009 #include "Quad.h" 00010 #include "RandomSample.h" 00011 #include "BGAnimation.h" 00012 00013 00014 class ScreenPrompt : public Screen 00015 { 00016 public: 00017 ScreenPrompt( CString sName ); 00018 ScreenPrompt( CString sText, bool bYesNoPrompt=false, bool bDefaultAnswer = false, void(*OnYes)(void*) = NULL, void(*OnNo)(void*) = NULL, void* pCallbackData = NULL ); 00019 00020 virtual void Update( float fDeltaTime ); 00021 virtual void DrawPrimitives(); 00022 virtual void Input( const DeviceInput& DeviceI, const InputEventType type, const GameInput &GameI, const MenuInput &MenuI, const StyleInput &StyleI ); 00023 virtual void HandleScreenMessage( const ScreenMessage SM ); 00024 00025 static bool s_bLastAnswer; 00026 00027 protected: 00028 void MenuLeft( PlayerNumber pn ); 00029 void MenuRight( PlayerNumber pn ); 00030 void MenuBack( PlayerNumber pn ); 00031 void MenuStart( PlayerNumber pn ); 00032 00033 00034 BGAnimation m_Background; 00035 BitmapText m_textQuestion; 00036 Quad m_rectAnswerBox; 00037 BitmapText m_textAnswer[2]; // "YES" or "NO" 00038 bool m_bYesNoPrompt; // false = OK prompt, true = YES/NO prompt 00039 bool m_bAnswer; // true = "YES", false = "NO"; 00040 ScreenMessage m_SMSendWhenDone; 00041 void(*m_pOnYes)(void*); 00042 void(*m_pOnNo)(void*); 00043 void* m_pCallbackData; 00044 Transition m_In; 00045 Transition m_Out; 00046 }; 00047 00048 #endif 00049 00050 /* 00051 * (c) 2001-2004 Chris Danford 00052 * All rights reserved. 00053 * 00054 * Permission is hereby granted, free of charge, to any person obtaining a 00055 * copy of this software and associated documentation files (the 00056 * "Software"), to deal in the Software without restriction, including 00057 * without limitation the rights to use, copy, modify, merge, publish, 00058 * distribute, and/or sell copies of the Software, and to permit persons to 00059 * whom the Software is furnished to do so, provided that the above 00060 * copyright notice(s) and this permission notice appear in all copies of 00061 * the Software and that both the above copyright notice(s) and this 00062 * permission notice appear in supporting documentation. 00063 * 00064 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 00065 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00066 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF 00067 * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS 00068 * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT 00069 * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS 00070 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 00071 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 00072 * PERFORMANCE OF THIS SOFTWARE. 00073 */