Etterna 0.74.4
Loading...
Searching...
No Matches
DifficultyList.h
1/* StepsDisplayList - Shows all available difficulties for a Song */
2#ifndef DIFFICULTY_LIST_H
3#define DIFFICULTY_LIST_H
4
5#include "Etterna/Actor/Base/ActorFrame.h"
6#include "Etterna/Models/Misc/PlayerNumber.h"
7#include "Etterna/Actor/GameplayAndMenus/StepsDisplay.h"
8#include "Etterna/Models/Misc/ThemeMetric.h"
9
10class Song;
11class Steps;
12
13class StepsDisplayList final : public ActorFrame
14{
15 public:
17 ~StepsDisplayList() override;
18 StepsDisplayList* Copy() const override;
19 void LoadFromNode(const XNode* pNode) override;
20
21 void HandleMessage(const Message& msg) override;
22
23 void SetFromGameState();
24 void TweenOnScreen();
25 void TweenOffScreen();
26 void Hide();
27 void Show();
28 int GetCurrentRowIndex(PlayerNumber pn) const;
29 // Lua
30 void PushSelf(lua_State* L) override;
31
32 private:
33 void UpdatePositions();
34 void PositionItems();
35 void HideRows();
36
37 ThemeMetric<float> ITEMS_SPACING_Y;
38 ThemeMetric<int> NUM_SHOWN_ITEMS;
39 ThemeMetric<bool> CAPITALIZE_DIFFICULTY_NAMES;
41
42 AutoActor m_Cursors;
43 ActorFrame m_CursorFrames; // contains Cursor so that color can
44 // fade independent of other tweens
45
46 struct Lines
47 {
48 std::vector<std::unique_ptr<StepsDisplay>> lines;
49
50 Lines() = default;
51 Lines(const Lines& other) {
52 for (auto& x : other.lines)
53 this->lines.push_back(std::make_unique<StepsDisplay>(*x));
54 }
55 Lines& operator=(const Lines& other)
56 {
57 for (auto& x : other.lines)
58 this->lines.push_back(std::make_unique<StepsDisplay>(*x));
59 return *this;
60 }
61 };
62 Lines m_Lines;
63
64 const Song* m_CurSong;
65 bool m_bShown;
66
67 struct Row
68 {
69 Row()
70 {
71 m_Steps = nullptr;
72 m_dc = Difficulty_Invalid;
73 m_fY = 0;
74 m_bHidden = false;
75 }
76
77 const Steps* m_Steps;
78 Difficulty m_dc;
79 float m_fY;
80 bool m_bHidden; // currently off screen
81 };
82
83 std::vector<Row> m_Rows;
84};
85
86#endif
A container for other Actors.
Definition ActorFrame.h:8
A smart pointer for Actor.
Definition AutoActor.h:13
Holds all music metadata and steps for one song.
Definition Song.h:65
Definition DifficultyList.h:14
Holds note information for a Song.
Definition Steps.h:42
The theme specific data.
Definition ThemeMetric.h:52
Definition XmlFile.h:95
Definition MessageManager.h:96