Etterna 0.74.4
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
78 void ChangeSteps(PlayerNumber pn, int dir);
79 // Lua
80 void PushSelf(lua_State* L) override;
81
82 protected:
83 virtual bool GenericTweenOn() const { return true; }
84 virtual bool GenericTweenOff() const { return true; }
85 void UpdateSelectButton(PlayerNumber pn, bool bBeingPressed);
86
87 void AfterStepsOrTrailChange();
88 void SwitchToPreferredDifficulty();
89 void AfterMusicChange();
90
91 Song* m_pSongAwaitingDeletionConfirmation;
92 void OnConfirmSongDeletion();
93
94 void CheckBackgroundRequests(bool bForce);
95 bool DetectCodes(const InputEventPlus& input);
96
97 std::vector<Steps*> m_vpSteps;
98 int m_iSelection;
99
100 RageTimer m_timerIdleComment;
101 ThemeMetric<float> IDLE_COMMENT_SECONDS;
102
103 ThemeMetric<std::string> PLAYER_OPTIONS_SCREEN;
104 ThemeMetric<float> SAMPLE_MUSIC_DELAY_INIT;
105 ThemeMetric<float> SAMPLE_MUSIC_DELAY;
106 ThemeMetric<bool> SAMPLE_MUSIC_LOOPS;
107 ThemeMetric<SampleMusicPreviewMode> SAMPLE_MUSIC_PREVIEW_MODE;
108 ThemeMetric<float> SAMPLE_MUSIC_FALLBACK_FADE_IN_SECONDS;
109 ThemeMetric<float> SAMPLE_MUSIC_FADE_OUT_SECONDS;
110 ThemeMetric<bool> DO_ROULETTE_ON_MENU_TIMER;
111 ThemeMetric<float> ROULETTE_TIMER_SECONDS;
112 ThemeMetric<bool> ALIGN_MUSIC_BEATS;
114 ThemeMetric<std::string> MUSIC_WHEEL_TYPE;
115 ThemeMetric<bool> OPTIONS_MENU_AVAILABLE;
116 ThemeMetric<bool> SELECT_MENU_AVAILABLE;
117 ThemeMetric<bool> MODE_MENU_AVAILABLE;
118 ThemeMetric<bool> USE_OPTIONS_LIST;
119 ThemeMetric<float> OPTIONS_LIST_TIMEOUT;
120 ThemeMetric<bool> USE_PLAYER_SELECT_MENU;
121 ThemeMetric<std::string> SELECT_MENU_NAME;
122 ThemeMetric<bool> SELECT_MENU_CHANGES_DIFFICULTY;
123 ThemeMetric<bool> WRAP_CHANGE_STEPS;
124 ThemeMetric<bool> CHANGE_STEPS_WITH_GAME_BUTTONS;
125 ThemeMetric<bool> CHANGE_GROUPS_WITH_GAME_BUTTONS;
126 ThemeMetric<std::string> NULL_SCORE_STRING;
127 ThemeMetric<bool> PLAY_SOUND_ON_ENTERING_OPTIONS_MENU;
128
129 bool CanChangeSong() const
130 {
131 return m_SelectionState == SelectionState_SelectingSong;
132 }
133 SelectionState GetNextSelectionState() const
134 {
135 switch (m_SelectionState) {
136 case SelectionState_SelectingSong:
137 return SelectionState_Finalized;
138 default:
139 return SelectionState_Finalized;
140 }
141 }
142
143 GameButton m_GameButtonPreviousSong;
144 GameButton m_GameButtonNextSong;
145 GameButton m_GameButtonPreviousDifficulty;
146 GameButton m_GameButtonNextDifficulty;
147 GameButton m_GameButtonPreviousGroup;
148 GameButton m_GameButtonNextGroup;
149
150 std::string m_sSectionMusicPath;
151 std::string m_sSortMusicPath;
152 std::string m_sRouletteMusicPath;
153 std::string m_sRandomMusicPath;
154 std::string m_sCourseMusicPath;
155 std::string m_sLoopMusicPath;
156 std::string m_sFallbackCDTitlePath;
157
158 MusicWheel m_MusicWheel;
159 OptionsList m_OptionsList;
160
161 SelectionState m_SelectionState;
162 bool m_bStepsChosen; // only used in SelectionState_SelectingSteps
163 bool m_bGoToOptions;
164 std::string m_sSampleMusicToPlay;
165 TimingData* m_pSampleMusicTimingData;
166 float m_fSampleStartSeconds, m_fSampleLengthSeconds;
167 bool m_bAllowOptionsMenu, m_bAllowOptionsMenuRepeat;
168 bool m_bSelectIsDown;
169 bool m_bAcceptSelectRelease;
170
171 RageSound m_soundStart;
172 RageSound m_soundDifficultyEasier;
173 RageSound m_soundDifficultyHarder;
174 RageSound m_soundOptionsChange;
175 RageSound m_soundLocked;
176};
177
178#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:130
Definition RageTimer.h:9
Definition ScreenSelectMusic.h:30
void BeginScreen() override
This is called immediately before the screen is used.
Definition ScreenSelectMusic.cpp:198
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:96