Etterna 0.75.1
Loading...
Searching...
No Matches
ScreenSelectMusic.h
1/* ScreenSelectMusic - Choose a Song and Steps. */
2
3#ifndef SCREEN_SELECT_MUSIC_H
4#define SCREEN_SELECT_MUSIC_H
5
6#include "Etterna/Models/Misc/GameConstantsAndTypes.h"
7#include "Etterna/Models/Misc/GameInput.h"
8#include "Etterna/Actor/Menus/MusicWheel.h"
9#include "Etterna/Actor/Menus/OptionsList.h"
10#include "ScreenWithMenuElements.h"
11#include "Etterna/Actor/Base/Sprite.h"
12#include "Etterna/Models/Misc/ThemeMetric.h"
13#include "Etterna/Models/Misc/TimingData.h"
14#include "Etterna/Models/HighScore/HighScore.h"
15#include "Etterna/Models/NoteData/NoteData.h"
16#include "Etterna/Actor/Gameplay/Player.h"
17#include "Etterna/Actor/Gameplay/NoteField.h"
18
19enum SelectionState
20{
21 SelectionState_SelectingSong,
22 SelectionState_SelectingSteps,
23 SelectionState_Finalized,
24 NUM_SelectionState,
25};
26const std::string&
27SelectionStateToString(SelectionState ss);
28
30{
31 public:
32 ~ScreenSelectMusic() override;
33 void Init() override;
34 void BeginScreen() override;
35
36 void Update(float fDeltaTime) override;
37 bool Input(const InputEventPlus& input) override;
38 void HandleMessage(const Message& msg) override;
39 void HandleScreenMessage(const ScreenMessage& SM) override;
40 bool AllowLateJoin() const override { return true; }
41
42 bool MenuStart(const InputEventPlus& input) override;
43 bool MenuBack(const InputEventPlus& input) override;
44 bool SelectCurrent(PlayerNumber pn,
45 GameplayMode mode = GameplayMode_Normal);
46
47 // ScreenWithMenuElements override: never play music here; we do it ourself.
48 void StartPlayingMusic() override {}
49
50 virtual void OpenOptions();
51 bool GetGoToOptions() const { return m_bGoToOptions; }
52 MusicWheel* GetMusicWheel() { return &m_MusicWheel; }
53
54 void OpenOptionsList(PlayerNumber pn);
55
56 bool can_open_options_list(PlayerNumber pn);
57
58 virtual void DifferentialReload();
59
60 void PlayReplay(HighScore* score);
61
62 int GetSelectionState();
63
64 void SetSampleMusicPosition(float);
65 void PauseSampleMusic();
66 bool DeleteCurrentSong();
67 bool ReloadCurrentSong();
68 bool ReloadCurrentPack();
69 bool ToggleCurrentFavorite();
70 bool ToggleCurrentPermamirror();
71 bool GoalFromCurrentChart();
72 bool AddCurrentChartToActivePlaylist();
73 bool CachePackForRanking(const std::string& pack);
74 void PlayCurrentSongSampleMusic(bool bForcePlay,
75 bool bForceAccurate = false,
76 bool bExtended = false);
77 void PlayLoopMusic();
78
79 void ChangeSteps(PlayerNumber pn, int dir);
80 // Lua
81 void PushSelf(lua_State* L) override;
82
83 protected:
84 virtual bool GenericTweenOn() const { return true; }
85 virtual bool GenericTweenOff() const { return true; }
86 void UpdateSelectButton(PlayerNumber pn, bool bBeingPressed);
87
88 void AfterStepsOrTrailChange();
89 void SwitchToPreferredDifficulty();
90 void AfterMusicChange();
91
92 Song* m_pSongAwaitingDeletionConfirmation;
93 void OnConfirmSongDeletion();
94
95 void CheckBackgroundRequests(bool bForce);
96 bool DetectCodes(const InputEventPlus& input);
97
98 std::vector<Steps*> m_vpSteps;
99 int m_iSelection;
100
101 RageTimer m_timerIdleComment;
102 ThemeMetric<float> IDLE_COMMENT_SECONDS;
103
104 ThemeMetric<std::string> PLAYER_OPTIONS_SCREEN;
105 ThemeMetric<float> SAMPLE_MUSIC_DELAY_INIT;
106 ThemeMetric<float> SAMPLE_MUSIC_DELAY;
107 ThemeMetric<bool> SAMPLE_MUSIC_LOOPS;
108 ThemeMetric<SampleMusicPreviewMode> SAMPLE_MUSIC_PREVIEW_MODE;
109 ThemeMetric<float> SAMPLE_MUSIC_FALLBACK_FADE_IN_SECONDS;
110 ThemeMetric<float> SAMPLE_MUSIC_FADE_OUT_SECONDS;
111 ThemeMetric<bool> DO_ROULETTE_ON_MENU_TIMER;
112 ThemeMetric<float> ROULETTE_TIMER_SECONDS;
113 ThemeMetric<bool> ALIGN_MUSIC_BEATS;
115 ThemeMetric<std::string> MUSIC_WHEEL_TYPE;
116 ThemeMetric<bool> OPTIONS_MENU_AVAILABLE;
117 ThemeMetric<bool> SELECT_MENU_AVAILABLE;
118 ThemeMetric<bool> MODE_MENU_AVAILABLE;
119 ThemeMetric<bool> USE_OPTIONS_LIST;
120 ThemeMetric<float> OPTIONS_LIST_TIMEOUT;
121 ThemeMetric<bool> USE_PLAYER_SELECT_MENU;
122 ThemeMetric<std::string> SELECT_MENU_NAME;
123 ThemeMetric<bool> SELECT_MENU_CHANGES_DIFFICULTY;
124 ThemeMetric<bool> WRAP_CHANGE_STEPS;
125 ThemeMetric<bool> CHANGE_STEPS_WITH_GAME_BUTTONS;
126 ThemeMetric<bool> CHANGE_GROUPS_WITH_GAME_BUTTONS;
127 ThemeMetric<std::string> NULL_SCORE_STRING;
128 ThemeMetric<bool> PLAY_SOUND_ON_ENTERING_OPTIONS_MENU;
129
130 bool CanChangeSong() const
131 {
132 return m_SelectionState == SelectionState_SelectingSong;
133 }
134 SelectionState GetNextSelectionState() const
135 {
136 switch (m_SelectionState) {
137 case SelectionState_SelectingSong:
138 return SelectionState_Finalized;
139 default:
140 return SelectionState_Finalized;
141 }
142 }
143
144 GameButton m_GameButtonPreviousSong;
145 GameButton m_GameButtonNextSong;
146 GameButton m_GameButtonPreviousDifficulty;
147 GameButton m_GameButtonNextDifficulty;
148 GameButton m_GameButtonPreviousGroup;
149 GameButton m_GameButtonNextGroup;
150
151 std::string m_sSectionMusicPath;
152 std::string m_sSortMusicPath;
153 std::string m_sRouletteMusicPath;
154 std::string m_sRandomMusicPath;
155 std::string m_sCourseMusicPath;
156 std::string m_sLoopMusicPath;
157 std::string m_sFallbackCDTitlePath;
158
159 MusicWheel m_MusicWheel;
160 OptionsList m_OptionsList;
161
162 SelectionState m_SelectionState;
163 bool m_bStepsChosen; // only used in SelectionState_SelectingSteps
164 bool m_bGoToOptions;
165 std::string m_sSampleMusicToPlay;
166 TimingData* m_pSampleMusicTimingData;
167 bool m_bSampleMusicIsBGM = false;
168 float m_fSampleStartSeconds, m_fSampleLengthSeconds;
169 bool m_bAllowOptionsMenu, m_bAllowOptionsMenuRepeat;
170 bool m_bSelectIsDown;
171 bool m_bAcceptSelectRelease;
172
173 RageSound m_soundStart;
174 RageSound m_soundDifficultyEasier;
175 RageSound m_soundDifficultyHarder;
176 RageSound m_soundOptionsChange;
177 RageSound m_soundLocked;
178};
179
180#endif
Holds a device input plus Game/Menu translations.
Definition InputEventPlus.h:9
Definition MusicWheel.h:17
A popup options list.
Definition OptionsList.h:37
Definition RageSound.h:135
Definition RageTimer.h:9
Definition ScreenSelectMusic.h:30
void BeginScreen() override
This is called immediately before the screen is used.
Definition ScreenSelectMusic.cpp:200
bool AllowLateJoin() const override
Determine if we allow extra players to join in on this screen.
Definition ScreenSelectMusic.h:40
void Init() override
This is called immediately after construction, to allow initializing after all derived classes exist.
Definition ScreenSelectMusic.cpp:84
Definition ScreenWithMenuElements.h:12
Holds all music metadata and steps for one song.
Definition Song.h:65
The theme specific data.
Definition ThemeMetric.h:52
Holds data for translating beats<->seconds.
Definition TimingData.h:54
The high score that is earned by a player.
Definition HighScore.h:18
Definition MessageManager.h:101