ChatPlexSDK-BS 1.0.1-v6.2.0
C++ ChatPlex BeatSaber SDK
Loading...
Searching...
No Matches
IViewController.hpp
1#pragma once
2
3#include "UIIl2cpp.hpp"
4
5#include <UnityEngine/CanvasGroup.hpp>
6#include <UnityEngine/Color.hpp>
7#include <UnityEngine/MonoBehaviour.hpp>
8#include <UnityEngine/RectTransform.hpp>
9#include <UnityEngine/Vector3.hpp>
10
11#include <tuple>
12#include <vector>
13
14namespace CP_SDK::UI {
15
16 namespace _u
17 {
18 using namespace UnityEngine;
19 }
20 namespace _v
21 {
22 using namespace CP_SDK::Utils;
23 }
24
25 class IModal;
26 class IScreen;
27
28 using KeyboardCustomKey = std::tuple<std::u16string, _v::Delegate<void()>, std::u16string>;
29 using KeyboardCustomKeys = std::vector<KeyboardCustomKey>;
30
32 class IViewController : public _u::MonoBehaviour
33 {
34 CP_SDK_IL2CPP_INHERIT("CP_SDK.UI", IViewController, _u::MonoBehaviour);
35 CP_SDK_IL2CPP_DECLARE_CTOR(IViewController);
36 CP_SDK_IL2CPP_DECLARE_DTOR_MONOBEHAVIOUR(IViewController);
37
38 public:
40 UIFieldRefDel<_u::RectTransform> ModalContainerRTransform;
42 UIFieldRefDel<IScreen> CurrentScreen;
43
44 public:
47 void __Activate(IScreen* p_Screen);
50
51 public:
54 void ShowModal(IModal* p_Modal);
57 void CloseModal(IModal* p_Modal);
60
61 public:
67 void ShowColorPickerModal(_u::Color p_Value, bool p_Opacity, _v::CActionRef<_u::Color> p_Callback, _v::CActionRef<> p_CancelCallback = nullptr);
71 void ShowConfirmationModal(std::u16string_view p_Message, _v::CActionRef<bool> p_Callback);
76 void ShowDropdownModal(const std::vector<std::u16string>& p_Options, std::u16string_view p_Selected, _v::CActionRef<std::u16string_view> p_Callback);
82 void ShowKeyboardModal(std::u16string_view p_Value, _v::CActionRef<std::u16string_view> p_Callback, _v::CActionRef<> p_CancelCallback = nullptr, KeyboardCustomKeys* p_CustomKeys = nullptr);
87 void ShowLoadingModal(std::u16string_view p_Message = {}, bool p_CancelButton = false, _v::CActionRef<> p_CancelCallback = nullptr);
91 void ShowMessageModal(std::u16string_view p_Message, _v::CActionRef<> p_Callback = nullptr);
92
93 public:
95 std::u16string_view KeyboardModal_GetValue();
98 void KeyboardModal_SetValue(std::u16string_view p_Value);
101 void KeyboardModal_Append(std::u16string_view p_ToAppend);
104 void LoadingModal_SetMessage(std::u16string_view p_Message);
105
106 public:
119
120 public:
124 void ShowTooltip(_u::Vector3 p_Position, std::u16string_view p_Text);
127
128 protected:
129 _v::Action<IScreen*> m___Activate;
130 _v::Action<> m___Deactivate;
131
132 _v::Action<IModal*> m_ShowModal;
133 _v::Action<IModal*> m_CloseModal;
134 _v::Action<> m_CloseAllModals;
135
142
143 _v::Func<std::u16string_view> m_KeyboardModal_GetValue;
144 _v::Action<std::u16string_view> m_KeyboardModal_SetValue;
145 _v::Action<std::u16string_view> m_KeyboardModal_Append;
146 _v::Action<std::u16string_view> m_LoadingModal_SetMessage;
147
148 _v::Action<> m_CloseColorPickerModal;
149 _v::Action<> m_CloseConfirmationModal;
150 _v::Action<> m_CloseDropdownModal;
151 _v::Action<> m_CloseKeyboardModal;
152 _v::Action<> m_CloseLoadingModal;
153 _v::Action<> m_CloseMessageModal;
154
156 _v::Action<> m_HideTooltip;
157
158 };
159
160}
161
162CP_SDK_IL2CPP_INHERIT_HELPERS(CP_SDK::UI::IViewController);
Abstract base modal component.
Definition IModal.hpp:22
Abstract screen.
Definition IScreen.hpp:30
IViewController interface.
void KeyboardModal_SetValue(std::u16string_view p_Value)
Set value.
void CloseMessageModal()
Close the message modal.
void ShowKeyboardModal(std::u16string_view p_Value, _v::CActionRef< std::u16string_view > p_Callback, _v::CActionRef<> p_CancelCallback=nullptr, KeyboardCustomKeys *p_CustomKeys=nullptr)
Show the keyboard modal.
void CloseDropdownModal()
Close the dropdown modal.
void ShowTooltip(_u::Vector3 p_Position, std::u16string_view p_Text)
Show the tooltip.
void ShowColorPickerModal(_u::Color p_Value, bool p_Opacity, _v::CActionRef< _u::Color > p_Callback, _v::CActionRef<> p_CancelCallback=nullptr)
Show color picker modal.
void ShowDropdownModal(const std::vector< std::u16string > &p_Options, std::u16string_view p_Selected, _v::CActionRef< std::u16string_view > p_Callback)
Show the dropdown modal.
void CloseConfirmationModal()
Close the confirmation modal.
void CloseModal(IModal *p_Modal)
Close a modal.
void CloseColorPickerModal()
Close color picker modal.
void CloseLoadingModal()
Close the loading modal.
void ShowConfirmationModal(std::u16string_view p_Message, _v::CActionRef< bool > p_Callback)
Show the confirmation modal.
void HideTooltip()
Hide the tooltip.
void __Activate(IScreen *p_Screen)
Activate.
void ShowModal(IModal *p_Modal)
Show a modal.
void ShowLoadingModal(std::u16string_view p_Message={}, bool p_CancelButton=false, _v::CActionRef<> p_CancelCallback=nullptr)
Show the loading modal.
void LoadingModal_SetMessage(std::u16string_view p_Message)
Set message.
void KeyboardModal_Append(std::u16string_view p_ToAppend)
Append.
void CloseAllModals()
Close all modals.
void CloseKeyboardModal()
Close the keyboard modal.
void __Deactivate()
Deactivate.
void ShowMessageModal(std::u16string_view p_Message, _v::CActionRef<> p_Callback=nullptr)
Show the message modal.
std::u16string_view KeyboardModal_GetValue()
Get current value.
Delegate helper class.
Definition Delegate.hpp:123
User interface components, views, flow coordinator, builders and factories.
Various platform utils like Delegate/Action/Function/Event system.
Definition Delegate.hpp:8