LeviLamina
Loading...
Searching...
No Matches
TextComponent.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/client/gui/FontHandle.h"
7#include "mc/client/gui/FontSize.h"
8#include "mc/client/gui/TextAlignment.h"
9#include "mc/client/gui/controls/RenderableComponent.h"
10#include "mc/deps/core/math/Color.h"
11
12// auto generated forward declare list
13// clang-format off
14class RectangleArea;
15class UIComponent;
16class UIControl;
18class UIRenderContext;
19// clang-format on
20
22public:
23 // member variables
24 // NOLINTBEGIN
25 ::ll::TypedStorage<8, 80, ::FontHandle> mFontHandle;
26 ::ll::TypedStorage<8, 80, ::FontHandle> mPrimaryFontHandle;
27 ::ll::TypedStorage<8, 80, ::FontHandle> mBackupFontHandle;
28 ::ll::TypedStorage<4, 4, float> mTextOffset;
29 ::ll::TypedStorage<4, 16, ::mce::Color> mColor;
30 ::ll::TypedStorage<4, 4, float> mLockedAlpha;
31 ::ll::TypedStorage<4, 16, ::mce::Color> mLockedColor;
32 ::ll::TypedStorage<4, 4, ::ui::FontSize> mFontSize;
33 ::ll::TypedStorage<4, 4, float> mFontScaleFactor;
34 ::ll::TypedStorage<4, 4, float> mLinePadding;
35 ::ll::TypedStorage<4, 4, ::ui::TextAlignment> mAlignment;
36 ::ll::TypedStorage<8, 32, ::std::string> mLabel;
37 ::ll::TypedStorage<8, 32, ::std::string> mLabelTTS;
38 ::ll::TypedStorage<4, 4, float> mCurrentTime;
39 ::ll::TypedStorage<4, 4, int> mLastNumChanges;
40 ::ll::TypedStorage<8, 8, uint64> mLastTextHash;
41 ::ll::TypedStorage<8, 8, uint64> mLastFilteredTextHash;
42 ::ll::TypedStorage<8, 32, ::std::string> mFilteredText;
43 ::ll::TypedStorage<8, 32, ::std::string> mMeasuredText;
44 ::ll::TypedStorage<8, 32, ::std::string> mCachedText;
45 ::ll::TypedStorage<8, 32, ::std::string> mLOCCachedText;
46 ::ll::TypedStorage<8, 32, ::std::string> mCachedLangCode;
47 ::ll::TypedStorage<8, 32, ::std::string> mCachedFontSources;
48 ::ll::TypedStorage<8, 32, ::std::string> mCachedTextTTS;
49 ::ll::TypedStorage<8, 24, ::std::vector<int>> mCaretOffsets;
50 ::ll::TypedStorage<4, 4, float> mCaretHeightOffset;
51 ::ll::TypedStorage<4, 4, float> mLineHeight;
52 ::ll::TypedStorage<8, 24, ::std::vector<::std::string>> mNotifyControlsOnEllipses;
53 ::ll::TypedStorage<8, 64, ::std::function<::std::pair<::FontHandle, ::FontHandle>(::std::string const&)>>
54 mGetFontsFromFontTypeCallback;
55 ::ll::TypedStorage<4, 12, ::std::optional<::glm::vec2>> mLastClickRelativePosition;
56 bool mShadow : 1;
57 bool mShouldRenderCaret : 1;
58 bool mLocalize : 1;
59 bool mCaretBlinkVisible : 1;
60 bool mHideHyphen : 1;
61 bool mEnableProfanityFilter : 1;
62 bool mProfanityFilterToggleState : 1;
63 bool mBackupFontHandleOverridden : 1;
64 bool mNotifyEllipsesOnSiblings : 1;
65 bool mCachedTextDirty : 1;
66 // NOLINTEND
67
68public:
69 // prevent constructor by default
70 TextComponent();
71
72public:
73 // virtual functions
74 // NOLINTBEGIN
75 virtual ~TextComponent() /*override*/;
76
77 virtual ::std::unique_ptr<::UIComponent> clone(::UIControl& cloneOwner) const /*override*/;
78
79 virtual void reset() /*override*/;
80
81 virtual void render(::UIRenderContext& context);
82
83 virtual void updateUI(::UIMeasureStrategy const& context) /*override*/;
84
85 virtual ::std::string const& getTextToSpeechComponentValue() const /*override*/;
86 // NOLINTEND
87
88public:
89 // member functions
90 // NOLINTBEGIN
91 MCAPI explicit TextComponent(::UIControl& owner);
92
93 MCAPI bool _fontSourcesChanged();
94
95 MCAPI ::std::string _getMeasuredText(::UIRenderContext& context);
96
97 MCAPI ::RectangleArea _getParentArea(::UIRenderContext& context);
98
99 MCAPI void _notifyOnEllipses(bool usingEllipses);
100
101 MCAPI bool _updateCachedText();
102
103 MCAPI ::std::string calculateUpdatedText();
104
105 MCAPI void setFontType(::std::string const& fontType);
106
107 MCAPI void setText(::std::string const& label);
108
109 MCAPI void setTextTTS(::std::string const& label);
110 // NOLINTEND
111
112public:
113 // constructor thunks
114 // NOLINTBEGIN
115 MCAPI void* $ctor(::UIControl& owner);
116 // NOLINTEND
117
118public:
119 // destructor thunk
120 // NOLINTBEGIN
121 MCAPI void $dtor();
122 // NOLINTEND
123
124public:
125 // virtual function thunks
126 // NOLINTBEGIN
127 MCAPI ::std::unique_ptr<::UIComponent> $clone(::UIControl& cloneOwner) const;
128
129 MCAPI void $reset();
130
131 MCAPI void $render(::UIRenderContext& context);
132
133 MCAPI void $updateUI(::UIMeasureStrategy const& context);
134
135 MCFOLD ::std::string const& $getTextToSpeechComponentValue() const;
136 // NOLINTEND
137
138public:
139 // vftables
140 // NOLINTBEGIN
141 MCNAPI static void** $vftable();
142 // NOLINTEND
143};
Definition RectangleArea.h:5
Definition RenderableComponent.h:5
Definition TextComponent.h:5
static MCAPI void ** $vftable()
Definition UIComponent.h:5
Definition UIControl.h:5
Definition UIMeasureStrategy.h:5
Definition UIRenderContext.h:5