ChatPlexSDK-BS 1.0.1-v6.2.0
C++ ChatPlex BeatSaber SDK
Loading...
Searching...
No Matches
LevelDetail.hpp
1#pragma once
2
3#include "../../CP_SDK/Utils/Il2cpp.hpp"
4#include "../../CP_SDK/Utils/MonoPtr.hpp"
5#include "../../CP_SDK/Utils/Event.hpp"
6#include "../../CP_SDK/UI/Components/CPrimaryButton.hpp"
7#include "../../CP_SDK/UI/Components/CSecondaryButton.hpp"
8#include "../Game/BeatMaps/MapDetail.hpp"
9
10#include <GlobalNamespace/BeatmapDifficultySegmentedControlController.hpp>
11#include <GlobalNamespace/BeatmapCharacteristicSegmentedControlController.hpp>
12#include <GlobalNamespace/BeatmapCharacteristicSO.hpp>
13#include <GlobalNamespace/BeatmapDifficulty.hpp>
14#include <GlobalNamespace/CustomPreviewBeatmapLevel.hpp>
15#include <GlobalNamespace/IDifficultyBeatmap.hpp>
16#include <HMUI/ImageView.hpp>
17#include <HMUI/TextSegmentedControl.hpp>
18#include <HMUI/IconSegmentedControl.hpp>
19#include <TMPro/TextMeshProUGUI.hpp>
20
21namespace CP_SDK_BS::UI {
22
23 namespace _u
24 {
25 using namespace GlobalNamespace;
26 using namespace UnityEngine;
27 using namespace TMPro;
28 }
29 namespace _v
30 {
31 using namespace CP_SDK::UI;
32 using namespace CP_SDK::UI::Components;
33 using namespace CP_SDK::Utils;
34 }
35
38 {
39 CP_SDK_NO_COPYMOVE_CTORS(LevelDetail);
40
41 private:
42 static _v::MonoPtr<_u::GameObject> m_SongDetailViewTemplate;
43
44 public:
46 static void Init();
47
48 private:
49 _v::MonoPtr<_u::GameObject> m_GameObject;
51 _v::MonoPtr<_u::TextMeshProUGUI> m_AuthorNameText;
52 _v::MonoPtr<HMUI::ImageView> m_SongCoverImage;
57 _v::MonoPtr<_u::TextMeshProUGUI> m_SongOffsetText;
59 _v::MonoPtr<_u::TextMeshProUGUI> m_SongObstaclesText;
61 _v::MonoPtr<_u::BeatmapDifficultySegmentedControlController> m_DifficultiesSegmentedControllerClone;
62 _v::MonoPtr<_u::BeatmapCharacteristicSegmentedControlController> m_CharacteristicSegmentedControllerClone;
63 _v::MonoPtr<HMUI::TextSegmentedControl> m_SongDiffSegmentedControl;
64 _v::MonoPtr<HMUI::IconSegmentedControl> m_SongCharacteristicSegmentedControl;
65 _v::MonoPtr<_v::CSecondaryButton> m_SecondaryButton;
66 _v::MonoPtr<_v::CPrimaryButton> m_PrimaryButton;
67 _v::MonoPtr<_u::GameObject> m_FavoriteToggle;
69 Game::BeatMaps::MapDetail::Ptr m_BeatMap;
70
71 private:
72 double m_Time = 0;
73 float m_BPM = 0;
74 float m_NPS = 0;
75 int m_NJS = 0;
76 float m_Offset = 0;
77 int m_Notes = 0;
78 int m_Obstacles = 0;
79 int m_Bombs = 0;
80 std::u16string m_Difficulty;
81
83
84 public:
85 _v::MonoPtr<_u::BeatmapCharacteristicSO> SelectedBeatmapCharacteristicSO;
86 _u::BeatmapDifficulty SelectedBeatmapDifficulty;
87
88 _v::Event<_u::IDifficultyBeatmap*> OnActiveDifficultyChanged;
89
90 _v::Action<> OnSecondaryButton;
91 _v::Action<> OnPrimaryButton;
92
93 public:
94 std::u16string Name();
95 void Name(std::u16string_view p_Value);
96 std::u16string AuthorNameText();
97 void AuthorNameText(std::u16string_view p_Value);
98 _u::Sprite* Cover();
99 void Cover(_u::Sprite* p_Value);
100 double Time();
101 void Time(double p_Value);
102 float BPM();
103 void BPM(float p_Value);
104 float NPS();
105 void NPS(float p_Value);
106 int NJS();
107 void NJS(int p_Value);
108 float Offset();
109 void Offset(float p_Value);
110 int Notes();
111 void Notes(int p_Value);
112 int Obstacles();
113 void Obstacles(int p_Value);
114 int Bombs();
115 void Bombs(int p_Value);
116 HMUI::IconSegmentedControl::DataItem* Characteristic();
117 void Characteristic(HMUI::IconSegmentedControl::DataItem* p_Value);
118 std::u16string Difficulty();
119 void Difficulty(std::u16string_view p_Value);
120
121 public:
124 LevelDetail(_u::Transform* p_Parent);
127
128 public:
131 void SetActive(bool p_Active);
132
133 public:
139 bool FromSongCore(_u::IBeatmapLevel* p_BeatMap, _u::Sprite* p_Cover, _u::BeatmapCharacteristicSO* p_Characteristic, _u::BeatmapDifficulty p_Difficulty);
143 bool FromBeatSaver(Game::BeatMaps::MapDetail::Ptr& p_BeatMap, _u::Sprite* p_Cover);
144
145 public:
148 void SetFavoriteToggleEnabled(bool p_Value);
152 void SetFavoriteToggleImage(_u::Sprite* p_Default, _u::Sprite* p_Enabled);
155 void SetFavoriteToggleHoverHint(std::u16string_view p_Hint);
158 void SetFavoriteToggleValue(bool p_Value);
162
163 public:
166
167 public:
170 void SetSecondaryButtonEnabled(bool p_Value);
173 void SetPrimaryButtonEnabled(bool p_Value);
182 void SetSecondaryButtonText(std::u16string_view p_Value);
185 void SetPrimaryButtonText(std::u16string_view p_Value);
186
187 private:
191 void OnCharacteristicChanged(HMUI::SegmentedControl* p_SegmentControl, int p_Index);
195 void OnDifficultyChanged(HMUI::SegmentedControl* p_SegmentControl, int p_Index);
197 void OnSecondaryButtonClicked();
199 void OnPrimaryButtonClicked();
200
201 private:
203 _u::IDifficultyBeatmap* GetIDifficultyBeatMap();
204
205 };
206
207}
Event class helper.
Definition Event.hpp:100
Song detail widget.
void SetFavoriteToggleCallback(_v::CActionRef<> p_Action)
Set favorite toggle callback.
bool FromBeatSaver(Game::BeatMaps::MapDetail::Ptr &p_BeatMap, _u::Sprite *p_Cover)
Set from BeatSaver.
void SetFavoriteToggleEnabled(bool p_Value)
Set favorite toggle enabled.
void SetPrimaryButtonInteractable(bool p_Value)
Set button enabled interactable.
void SetFavoriteToggleImage(_u::Sprite *p_Default, _u::Sprite *p_Enabled)
Set favorite toggle images.
bool FromSongCore(_u::IBeatmapLevel *p_BeatMap, _u::Sprite *p_Cover, _u::BeatmapCharacteristicSO *p_Characteristic, _u::BeatmapDifficulty p_Difficulty)
Set from SongCore.
void SetFavoriteToggleValue(bool p_Value)
Set favorite toggle value.
static void Init()
Init.
void SetSecondaryButtonEnabled(bool p_Value)
Set button enabled state.
LevelDetail(_u::Transform *p_Parent)
Constructor.
void ReverseButtonsOrder()
Reverse button order.
void SetPrimaryButtonEnabled(bool p_Value)
Set button enabled state.
void SetFavoriteToggleHoverHint(std::u16string_view p_Hint)
Set favorite toggle hover hint.
void SetActive(bool p_Active)
Set if the game object is active.
void SetPracticeButtonInteractable(bool p_Value)
Set button enabled interactable.
void SetSecondaryButtonText(std::u16string_view p_Value)
Set button text.
void SetPrimaryButtonText(std::u16string_view p_Value)
Set button text.
Generic UI components.
User interface components, views, flow coordinator, builders and factories.
Various platform utils like Delegate/Action/Function/Event system.
Definition Delegate.hpp:8
BeatSaber specific UI compoenents and utilities.