00001 /* JukeboxMenu - UI on ScreenJukeboxMenu. */ 00002 00003 #ifndef JUKEBOX_MENU_H 00004 #define JUKEBOX_MENU_H 00005 00006 #include "ActorFrame.h" 00007 #include "Banner.h" 00008 #include "GameConstantsAndTypes.h" 00009 #include "RandomSample.h" 00010 #include "BitmapText.h" 00011 #include "Difficulty.h" 00012 00013 class Style; 00014 00015 class JukeboxMenu: public ActorFrame 00016 { 00017 public: 00018 JukeboxMenu(); 00019 ~JukeboxMenu(); 00020 virtual void DrawPrimitives(); 00021 00022 bool CanGoUp(); 00023 bool CanGoDown(); 00024 bool CanGoLeft(); 00025 bool CanGoRight(); 00026 00027 void Up(); 00028 void Down(); 00029 void Left(); 00030 void Right(); 00031 00032 enum Row 00033 { 00034 ROW_STYLE, 00035 ROW_GROUP, 00036 ROW_DIFFICULTY, 00037 ROW_MODIFIERS, 00038 NUM_ROWS 00039 } m_SelectedRow; 00040 CString RowToString( Row r ) 00041 { 00042 const CString s[NUM_ROWS] = 00043 { 00044 "Style", 00045 "Group", 00046 "Difficulty", 00047 "Modifiers", 00048 }; 00049 return s[r]; 00050 } 00051 00052 00053 const Style* GetSelectedStyle() { return m_Styles[m_iSelection[ROW_STYLE]]; } 00054 CString GetSelectedGroup() { return m_sGroups[m_iSelection[ROW_GROUP]]; } 00055 CString GetSelectedDifficultyString() { return m_sDifficulties[m_iSelection[ROW_DIFFICULTY]]; } 00056 Difficulty GetSelectedDifficulty() { return StringToDifficulty( GetSelectedDifficultyString() ); } 00057 bool GetSelectedModifiers() { return m_iSelection[ROW_MODIFIERS] != 0; } 00058 00059 private: 00060 Sprite m_sprArrows[2]; 00061 00062 int m_iSelection[NUM_ROWS]; 00063 BitmapText m_textLabel[NUM_ROWS]; 00064 BitmapText m_textValue[NUM_ROWS]; 00065 00066 vector<const Style*> m_Styles; 00067 CStringArray m_sGroups; 00068 vector<string> m_sDifficulties; 00069 CStringArray m_sModifiers; 00070 00071 void OnRowValueChanged( Row row ); 00072 void ChangeToRow( Row newRow ); 00073 00074 RandomSample m_soundChangeRow; 00075 RandomSample m_soundChangeValue; 00076 }; 00077 00078 #endif 00079 00080 /* 00081 * (c) 2003 Chris Danford 00082 * All rights reserved. 00083 * 00084 * Permission is hereby granted, free of charge, to any person obtaining a 00085 * copy of this software and associated documentation files (the 00086 * "Software"), to deal in the Software without restriction, including 00087 * without limitation the rights to use, copy, modify, merge, publish, 00088 * distribute, and/or sell copies of the Software, and to permit persons to 00089 * whom the Software is furnished to do so, provided that the above 00090 * copyright notice(s) and this permission notice appear in all copies of 00091 * the Software and that both the above copyright notice(s) and this 00092 * permission notice appear in supporting documentation. 00093 * 00094 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 00095 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00096 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF 00097 * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS 00098 * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT 00099 * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS 00100 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 00101 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 00102 * PERFORMANCE OF THIS SOFTWARE. 00103 */