ChatPlexSDK-BS 1.0.1-v6.2.0
C++ ChatPlex BeatSaber SDK
All Classes Namespaces Functions Variables Typedefs Enumerations Concepts
CFloatingPanel.hpp
1#pragma once
2
3#include "CIconButton.hpp"
4#include "../IScreen.hpp"
5#include "../../ChatPlexSDK.hpp"
6
7#include <map>
8
9#include <UnityEngine/Vector2.hpp>
10#include <UnityEngine/Vector3.hpp>
11
12namespace CP_SDK::UI::Components {
13
14 namespace _u
15 {
16 using namespace UnityEngine;
17 using namespace UnityEngine::UI;
18 }
19 namespace _v
20 {
21 using namespace CP_SDK::Utils;
22 }
23
25 class CFloatingPanel : public IScreen
26 {
27 CP_SDK_IL2CPP_INHERIT("CP_SDK.UI.Components", CFloatingPanel, IScreen);
28 CP_SDK_IL2CPP_DECLARE_CTOR_CHILD(CFloatingPanel);
29 CP_SDK_IL2CPP_DECLARE_DTOR_MONOBEHAVIOUR_CHILD(CFloatingPanel);
30
31 private:
32 _v::MonoPtr<IViewController> m_CurrentViewController;
33 bool m_AllowMovement;
34 bool m_AutoLockOnSceneSwitch;
35 bool m_AlignWithFloor;
36 std::map<EGenericScene, std::tuple<_u::Vector3, _u::Vector3>> m_SceneTransforms;
37 std::map<EGenericScene, _v::Action<_u::Vector3, _u::Vector3>> m_OnSceneRelease;
38 _v::MonoPtr<_u::Image> m_Background;
39 _v::MonoPtr<CIconButton> m_LockIcon;
40 _v::MonoPtr<CIconButton> m_GearIcon;
41
43 _v::Event<_v::CMonoPtrRef<CFloatingPanel>, _u::Vector2> m_OnSizeChanged;
45
46 protected:
49
50 _v::Action<bool> m_SetAllowMovement;
51 _v::Action<float> m_SetRadius;
53
54 public:
55 enum class ECorner
56 {
57 None,
58 TopLeft,
59 TopRight,
60 BottomLeft,
61 BottomRight,
62 };
63
64 public:
65 UIFieldRefDel<IViewController> CurrentViewController;
67
68 public:
72
73 public:
89 CFloatingPanel* OnSizeChanged(_v::CActionRef<_v::CMonoPtrRef<CFloatingPanel>, _u::Vector2> p_Functor, bool p_Add = true);
94
95 public:
98
99 public:
109 CFloatingPanel* SetBackground(bool p_Enabled, std::optional<_u::Color> p_Color = std::nullopt);
116 CFloatingPanel* SetBackgroundSprite(_u::Sprite* p_Sprite, _u::Image::Type p_Type = _u::Image::Type::Simple);
119 CFloatingPanel* SetLockIcon(ECorner p_Corner);
122 CFloatingPanel* SetGearIcon(ECorner p_Corner);
125 CFloatingPanel* SetRadius(float p_Radius);
134 CFloatingPanel* SetSceneTransform(EGenericScene p_Scene, _u::Vector3 p_LocalPosition, _u::Vector3 p_LocalEulerAngles);
137 CFloatingPanel* SetSize(_u::Vector2 p_Size);
141 CFloatingPanel* SetTransformDirect(_u::Vector3 p_LocalPosition, _u::Vector3 p_LocalEulerAngles);
142
143 protected:
146
147 private:
150 void ChatPlexSDK_OnGenericSceneChange(EGenericScene p_ActiveScene);
151
152 };
153
154}
155
156CP_SDK_IL2CPP_INHERIT_HELPERS(CP_SDK::UI::Components::CFloatingPanel);
CFloatingPanel * SetSceneTransform(EGenericScene p_Scene, _u::Vector3 p_LocalPosition, _u::Vector3 p_LocalEulerAngles)
Set scene transform.
CFloatingPanel * OnSizeChanged(_v::CActionRef< _v::CMonoPtrRef< CFloatingPanel >, _u::Vector2 > p_Functor, bool p_Add=true)
On scene relocated icon event.
DECLARE_INSTANCE_METHOD(void, Awake)
On component creation.
CFloatingPanel * SetLockIcon(ECorner p_Corner)
Set lock icon mode.
CFloatingPanel * SetGearIcon(ECorner p_Corner)
Set gear icon mode.
CFloatingPanel * SetSize(_u::Vector2 p_Size)
Set size.
CFloatingPanel * OnSceneRelease(EGenericScene p_Scene, _v::CActionRef< _u::Vector3, _u::Vector3 > p_Callback)
Set on scene release.
bool GetAllowMovement()
Get allow movement.
CFloatingPanel * OnRelease(_v::CActionRef< _v::CMonoPtrRef< CFloatingPanel > > p_Functor, bool p_Add=true)
On release event.
CFloatingPanel * SetAlignWithFloor(bool p_Align)
Set align with floor.
CFloatingPanel * OnGrab(_v::CActionRef< _v::CMonoPtrRef< CFloatingPanel > > p_Functor, bool p_Add=true)
On grab event.
CFloatingPanel * SetBackgroundColor(_u::Color p_Color)
Set background color.
CFloatingPanel * OnSceneRelocated(_v::CActionRef< _v::CMonoPtrRef< CFloatingPanel > > p_Functor, bool p_Add=true)
On scene relocated icon event.
CFloatingPanel * OnGearIcon(_v::CActionRef< _v::CMonoPtrRef< CFloatingPanel > > p_Functor, bool p_Add=true)
On gear icon event.
void SetViewController_Impl(_v::CMonoPtrRef< IViewController > p_ViewController)
Replace active view controller.
CFloatingPanel * SetRadius(float p_Radius)
Set radius on supported games.
CFloatingPanel * SetTransformDirect(_u::Vector3 p_LocalPosition, _u::Vector3 p_LocalEulerAngles)
Set transform direct.
CFloatingPanel * SetBackgroundSprite(_u::Sprite *p_Sprite, _u::Image::Type p_Type=_u::Image::Type::Simple)
Set background sprite.
CFloatingPanel * SetAllowMovement(bool p_Allow)
Set allow movements.
CFloatingPanel * SetBackground(bool p_Enabled, std::optional< _u::Color > p_Color=std::nullopt)
Set background state.
Abstract screen.
Definition IScreen.hpp:30
Event class helper.
Definition Event.hpp:100
Generic UI components.
Various platform utils like Delegate/Action/Function/Event system.
Definition Delegate.hpp:8