Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

EditMenu.h

Go to the documentation of this file.
00001 /* EditMenu - UI on Edit Menu screen. Create Steps, delete Steps, or launch Steps in editor. */ 00002 00003 #ifndef EDIT_MENU_H 00004 #define EDIT_MENU_H 00005 00006 #include "ActorFrame.h" 00007 #include "Banner.h" 00008 #include "TextBanner.h" 00009 #include "GameConstantsAndTypes.h" 00010 #include "DifficultyMeter.h" 00011 #include "RandomSample.h" 00012 00013 00014 class EditMenu: public ActorFrame 00015 { 00016 public: 00017 EditMenu(); 00018 ~EditMenu(); 00019 virtual void DrawPrimitives(); 00020 00021 bool CanGoUp(); 00022 bool CanGoDown(); 00023 bool CanGoLeft(); 00024 bool CanGoRight(); 00025 00026 void Up(); 00027 void Down(); 00028 void Left(); 00029 void Right(); 00030 00031 enum Row 00032 { 00033 ROW_GROUP, 00034 ROW_SONG, 00035 ROW_STEPS_TYPE, 00036 ROW_DIFFICULTY, 00037 ROW_SOURCE_STEPS_TYPE, 00038 ROW_SOURCE_DIFFICULTY, 00039 ROW_ACTION, 00040 NUM_ROWS 00041 } m_SelectedRow; 00042 CString RowToString( Row r ) 00043 { 00044 const CString s[NUM_ROWS] = 00045 { 00046 "Group", 00047 "Song", 00048 "StepsType", 00049 "Difficulty", 00050 "Source StepsType", 00051 "Source Difficulty", 00052 "Action" 00053 }; 00054 return s[r]; 00055 } 00056 00057 enum Action 00058 { 00059 ACTION_EDIT, 00060 ACTION_DELETE, 00061 ACTION_COPY, 00062 ACTION_AUTOGEN, 00063 ACTION_BLANK, 00064 NUM_ACTIONS 00065 }; 00066 CString ActionToString( Action a ) 00067 { 00068 const CString s[NUM_ACTIONS] = 00069 { 00070 "Edit Existing", 00071 "Delete Existing", 00072 "Create from Source by Copy", 00073 "Create from Souce by AutoGen", 00074 "Create with Blank" 00075 }; 00076 return s[a]; 00077 } 00078 00079 void RefreshNotes(); 00080 00081 00082 CString GetSelectedGroup() const { ASSERT(m_iSelection[ROW_GROUP] < (int)m_sGroups.size()); return m_sGroups[m_iSelection[ROW_GROUP]]; } 00083 Song* GetSelectedSong() const { ASSERT(m_iSelection[ROW_SONG] < (int)m_pSongs.size()); return m_pSongs[m_iSelection[ROW_SONG]]; } 00084 StepsType GetSelectedStepsType() const { ASSERT(m_iSelection[ROW_STEPS_TYPE] < (int)m_StepsTypes.size()); return m_StepsTypes[m_iSelection[ROW_STEPS_TYPE]]; } 00085 Difficulty GetSelectedDifficulty() const { return (Difficulty)m_iSelection[ROW_DIFFICULTY]; } 00086 StepsType GetSelectedSourceStepsType() const { ASSERT(m_iSelection[ROW_SOURCE_STEPS_TYPE] < (int)m_StepsTypes.size()); return m_StepsTypes[m_iSelection[ROW_SOURCE_STEPS_TYPE]]; } 00087 Difficulty GetSelectedSourceDifficulty() const { return (Difficulty)m_iSelection[ROW_SOURCE_DIFFICULTY]; } 00088 Action GetSelectedAction() const { ASSERT(m_iSelection[ROW_ACTION] < (int)m_Actions.size()); return m_Actions[m_iSelection[ROW_ACTION]]; } 00089 00090 Steps* GetSelectedNotes(); 00091 Steps* GetSelectedSourceNotes(); 00092 00093 private: 00094 Sprite m_sprArrows[2]; 00095 00096 int m_iSelection[NUM_ROWS]; 00097 BitmapText m_textLabel[NUM_ROWS]; 00098 BitmapText m_textValue[NUM_ROWS]; 00099 00100 Banner m_GroupBanner; 00101 Banner m_SongBanner; 00102 TextBanner m_SongTextBanner; 00103 DifficultyMeter m_Meter; 00104 DifficultyMeter m_SourceMeter; 00105 00106 CStringArray m_sGroups; 00107 vector<StepsType> m_StepsTypes; 00108 vector<Song*> m_pSongs; 00109 vector<Action> m_Actions; 00110 00111 void OnRowValueChanged( Row row ); 00112 void ChangeToRow( Row newRow ); 00113 00114 RandomSample m_soundChangeRow; 00115 RandomSample m_soundChangeValue; 00116 }; 00117 00118 #endif 00119 00120 /* 00121 * (c) 2001-2004 Chris Danford 00122 * All rights reserved. 00123 * 00124 * Permission is hereby granted, free of charge, to any person obtaining a 00125 * copy of this software and associated documentation files (the 00126 * "Software"), to deal in the Software without restriction, including 00127 * without limitation the rights to use, copy, modify, merge, publish, 00128 * distribute, and/or sell copies of the Software, and to permit persons to 00129 * whom the Software is furnished to do so, provided that the above 00130 * copyright notice(s) and this permission notice appear in all copies of 00131 * the Software and that both the above copyright notice(s) and this 00132 * permission notice appear in supporting documentation. 00133 * 00134 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 00135 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00136 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF 00137 * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS 00138 * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT 00139 * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS 00140 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 00141 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 00142 * PERFORMANCE OF THIS SOFTWARE. 00143 */

Generated on Thu Jan 27 20:57:20 2005 for StepMania by doxygen 1.3.7