ChatPlexSDK-BS 1.0.1-v6.2.0
C++ ChatPlex BeatSaber SDK
Loading...
Searching...
No Matches
FontManager.hpp
1#pragma once
2
3#include "../Utils/Delegate.hpp"
4#include "../Utils/Il2cpp.hpp"
5#include "../Utils/MonoPtr.hpp"
6
7#include <TMPro/TMP_FontAsset.hpp>
8#include <UnityEngine/AssetBundle.hpp>
9
10namespace CP_SDK::Unity {
11
12 namespace _u
13 {
14 using namespace TMPro;
15 using namespace UnityEngine;
16 }
17 namespace _v
18 {
19 using namespace CP_SDK::Utils;
20 }
21
24 {
25 CP_SDK_NO_DEF_CTORS(FontManager);
26
27 using t_AssetBundle_LoadFromMemory = function_ptr_t<_u::AssetBundle*, ::Array<uint8_t>*, unsigned int>;
28
29 private:
30 static bool m_IsInitialized;
31 static _v::MonoPtr<_u::AssetBundle> m_AssetBundle;
32 static _v::MonoPtr<_u::TMP_FontAsset> m_BundleFont;
33 static _v::MonoPtr<_u::TMP_FontAsset> m_MainFont;
34 static _v::MonoPtr<_u::TMP_FontAsset> m_ChatFont;
35 static _v::Func<_u::TMP_FontAsset*, _u::TMP_FontAsset*> m_TMPFontAssetSetup;
36
37 public:
38 static bool IsInitialized() { return m_IsInitialized; }
39 static std::u16string_view MainFontName() { return u"Segoe UI"; }
40 static std::u16string_view ChatFontName() { return u"Segoe UI"; }
41
42 public:
47 static void Init();
48
49 public:
51 static _u::TMP_FontAsset* GetMainFont();
53 static _u::TMP_FontAsset* GetChatFont();
54
55 };
56
57}
Open type to TextMeshPro font manager.
static void Setup(_v::CFuncRef< _u::TMP_FontAsset *, _u::TMP_FontAsset * > p_TMPFontAssetSetup)
Setup for specific app.
static _u::TMP_FontAsset * GetChatFont()
Get chat font.
static _u::TMP_FontAsset * GetMainFont()
Get main font.
static void Init()
Init the font manager.
Delegate helper class.
Definition Delegate.hpp:123
Tools and extensions to interact with Unity on different layer & threads, load fonts/sprites/textures...
Various platform utils like Delegate/Action/Function/Event system.
Definition Delegate.hpp:8