ChatPlexSDK-BS 1.0.1-v6.2.0
C++ ChatPlex BeatSaber SDK
Loading...
Searching...
No Matches
DefaultCSlider.hpp
1#pragma once
2
3#include "../Components/CSlider.hpp"
4#include "../Components/CText.hpp"
5#include "../Components/Generics/CPOrSButton.hpp"
6#include "../../Utils/Event.hpp"
7
8#include <UnityEngine/EventSystems/IBeginDragHandler.hpp>
9#include <UnityEngine/EventSystems/IDragHandler.hpp>
10#include <UnityEngine/EventSystems/IEventSystemHandler.hpp>
11#include <UnityEngine/EventSystems/IInitializePotentialDragHandler.hpp>
12#include <UnityEngine/EventSystems/PointerEventData.hpp>
13#include <UnityEngine/UI/CanvasUpdate.hpp>
14#include <UnityEngine/UI/ICanvasElement.hpp>
15#include <UnityEngine/UI/Selectable_SelectionState.hpp>
16
18
19 namespace _u
20 {
21 using namespace UnityEngine;
22 using namespace UnityEngine::UI;
23 using namespace UnityEngine::EventSystems;
24 }
25 namespace _v
26 {
27 using namespace CP_SDK::Utils;
28 }
29
32 {
33 CP_SDK_IL2CPP_INHERIT("CP_SDK.UI.DefaultComponents", DefaultCSlider, Components::CSlider, CP_SDK_IL2CPP_INTERFACES(
34 _u::IEventSystemHandler,
35 _u::IBeginDragHandler,
36 _u::IDragHandler,
37 _u::IInitializePotentialDragHandler,
38 _u::ICanvasElement
39 ));
40 CP_SDK_IL2CPP_DECLARE_CTOR_CHILD(DefaultCSlider);
41 CP_SDK_IL2CPP_DECLARE_DTOR_MONOBEHAVIOUR_CHILD(DefaultCSlider);
42
43 private:
44 enum class EColorMode
45 {
46 None,
47 H,
48 S,
49 V,
50 O
51 };
52
53 private:
64 _u::Color m_OnColor;
65 _u::Color m_OffColor;
66 EColorMode m_ColorMode;
67 bool m_EnableDragging;
68 bool m_IsInteger;
69 float m_HandleSize;
70 float m_ValueSize;
71 float m_SeparatorSize;
72 int m_NumberOfSteps;
73 float m_NormalizedValue;
74 float m_MinValue;
75 float m_MaxValue;
76 float m_Increments;
77 float m_DragSmoothing;
78 bool m_LeftMouseButtonPressed;
79 float m_DragStartTime;
80 float m_DragTargetValue;
81 float m_DragCurrentValue;
82 _v::MonoPtr<_u::PointerEventData> m_LastPointerEvent;
83
84 _v::Func<std::u16string, float> m_CustomFormatter;
85 _v::Event<float> m_OnChange;
86
87 public:
90
93
94 public:
98 void OnValueChanged_Impl(_v::CActionRef<float> p_Functor, bool p_Add = true);
99
100 public:
109
110 public:
113 void SetColor_Impl(_u::Color p_Color);
119 void SetInteger_Impl(bool p_IsInteger);
122 void SetInteractable_Impl(bool p_Interactable);
125 void SetMinValue_Impl(float p_MinValue);
128 void SetMaxValue_Impl(float p_MaxValue);
131 void SetIncrements_Impl(float p_Increments);
135 void SetValue_Impl(float p_Value, bool p_Notify = true);
136
137 public:
143 void SwitchToColorMode_Impl(bool p_H, bool p_S, bool p_V, bool p_O);
146 void ColorModeSetHue_Impl(float p_H);
147
148 protected:
150 DECLARE_INSTANCE_METHOD(void, OnEnable);
151
152 private:
154 DECLARE_INSTANCE_METHOD(void, LateUpdate);
155
156 private:
159 bool MayDrag(_u::PointerEventData* p_EventData);
162 CP_SDK_IL2CPP_OVERRIDE_METHOD_EX(_u, IInitializePotentialDragHandler, void, OnInitializePotentialDrag, _u::PointerEventData*);
165 CP_SDK_IL2CPP_OVERRIDE_METHOD_EX(_u, IBeginDragHandler, void, OnBeginDrag, _u::PointerEventData*);
168 CP_SDK_IL2CPP_OVERRIDE_METHOD_EX(_u, IDragHandler, void, OnDrag, _u::PointerEventData*);
171 void UpdateDrag(_u::PointerEventData* p_EventData);
172
173 public:
176 CP_SDK_IL2CPP_OVERRIDE_METHOD_EX(_u, IPointerEnterHandler, void, OnPointerEnter, _u::PointerEventData*);
179 CP_SDK_IL2CPP_OVERRIDE_METHOD_EX(_u, IPointerExitHandler, void, OnPointerExit, _u::PointerEventData*);
182 CP_SDK_IL2CPP_OVERRIDE_METHOD_EX(_u, IPointerDownHandler, void, OnPointerDown, _u::PointerEventData*);
185 CP_SDK_IL2CPP_OVERRIDE_METHOD_EX(_u, IPointerUpHandler, void, OnPointerUp, _u::PointerEventData*);
186
187 public:
191 void SetNormalizedValue(float p_Value, bool p_Notify = true);
192
193 protected:
195 CP_SDK_IL2CPP_OVERRIDE_METHOD_EX(_u, UIBehaviour, void, OnRectTransformDimensionsChange);
203 CP_SDK_IL2CPP_OVERRIDE_METHOD_EX(_u, Selectable, void, DoStateTransition, _u::Selectable::SelectionState, bool);
204
205 public:
207 CP_SDK_IL2CPP_OVERRIDE_METHOD_EX(_u, ICanvasElement, _u::Transform*, get_transform);
210 CP_SDK_IL2CPP_OVERRIDE_METHOD_EX(_u, ICanvasElement, void, Rebuild, _u::CanvasUpdate);
212 CP_SDK_IL2CPP_OVERRIDE_METHOD_EX(_u, ICanvasElement, void, LayoutComplete);
214 CP_SDK_IL2CPP_OVERRIDE_METHOD_EX(_u, ICanvasElement, void, GraphicUpdateComplete);
216 CP_SDK_IL2CPP_OVERRIDE_METHOD_EX(_u, ICanvasElement, bool, IsDestroyed);
217
218 private:
220 float GetSteppedNormalizedValue();
223 float ConvertFromSteppedNormalizedValue(float p_NormalizedValue);
224
225 private:
228 std::u16string GetTextValue(float p_ConvertedValue);
229
230 };
231
232}
233
234CP_SDK_IL2CPP_INHERIT_HELPERS(CP_SDK::UI::DefaultComponents::DefaultCSlider);
CP_SDK_IL2CPP_OVERRIDE_METHOD_EX(_u, IPointerEnterHandler, void, OnPointerEnter, _u::PointerEventData *)
On pointer enter.
CP_SDK_IL2CPP_OVERRIDE_METHOD_EX(_u, ICanvasElement, _u::Transform *, get_transform)
Get transform.
void SetMaxValue_Impl(float p_MaxValue)
Set max value.
void OnValueChanged_Impl(_v::CActionRef< float > p_Functor, bool p_Add=true)
On value changed event.
CP_SDK_IL2CPP_OVERRIDE_METHOD_EX(_u, IPointerUpHandler, void, OnPointerUp, _u::PointerEventData *)
On pointer button up.
void Init_DefaultCSlider()
On component creation.
void SwitchToColorMode_Impl(bool p_H, bool p_S, bool p_V, bool p_O)
Switch to color mode.
void SetIncrements_Impl(float p_Increments)
Set increments.
void SetColor_Impl(_u::Color p_Color)
Set theme color.
CP_SDK_IL2CPP_OVERRIDE_METHOD_EX(_u, Selectable, void, DoStateTransition, _u::Selectable::SelectionState, bool)
On state transition.
CP_SDK_IL2CPP_OVERRIDE_METHOD_EX(_u, ICanvasElement, void, GraphicUpdateComplete)
On graphic update complete.
void SetMinValue_Impl(float p_MinValue)
Set min value.
void SetFormatter_Impl(_v::CFuncRef< std::u16string, float > p_CustomFormatter)
Set value formatter.
CP_SDK_IL2CPP_OVERRIDE_METHOD_EX(_u, ICanvasElement, void, Rebuild, _u::CanvasUpdate)
On canvas rebuild.
CP_SDK_IL2CPP_OVERRIDE_METHOD_EX(_u, ICanvasElement, bool, IsDestroyed)
Is destroyed.
void ColorModeSetHue_Impl(float p_H)
Color mode set H.
void SetValue_Impl(float p_Value, bool p_Notify=true)
Set value.
void SetNormalizedValue(float p_Value, bool p_Notify=true)
Set normalized value.
void SetInteractable_Impl(bool p_Interactable)
Set button interactable state.
CP_SDK_IL2CPP_OVERRIDE_METHOD_EX(_u, UIBehaviour, void, OnRectTransformDimensionsChange)
On rect transform dimensions changed.
void SetInteger_Impl(bool p_IsInteger)
Set integer mode.
CP_SDK_IL2CPP_OVERRIDE_METHOD_EX(_u, IPointerDownHandler, void, OnPointerDown, _u::PointerEventData *)
On pointer button down.
DECLARE_INSTANCE_METHOD(void, OnEnable)
On component enable.
CP_SDK_IL2CPP_OVERRIDE_METHOD_EX(_u, ICanvasElement, void, LayoutComplete)
On layout rebuild.
CP_SDK_IL2CPP_OVERRIDE_METHOD_EX(_u, IPointerExitHandler, void, OnPointerExit, _u::PointerEventData *)
On pointer exit.
Delegate helper class.
Definition Delegate.hpp:123
Event class helper.
Definition Event.hpp:100
Default generic components implementation.
Various platform utils like Delegate/Action/Function/Event system.
Definition Delegate.hpp:8