LeviLamina
Loading...
Searching...
No Matches
BookScreenController.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/client/gui/DirtyFlag.h"
7#include "mc/client/gui/screens/controllers/ClientInstanceScreenController.h"
8#include "mc/deps/core/utility/pub_sub/Subscription.h"
9
10// auto generated forward declare list
11// clang-format off
12class BlockActor;
15class UIPropertyBag;
16struct PageContent;
17namespace Json { class Value; }
18// clang-format on
19
21public:
22 // BookScreenController inner types define
23 enum class BookView : uchar {
24 Viewing = 0,
25 Signing = 1,
26 Picking = 2,
27 Exporting = 3,
28 };
29
30public:
31 // member variables
32 // NOLINTBEGIN
33 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::BookScreenManager>> mBookScreenManager;
34 ::ll::TypedStorage<1, 1, bool const> mEditable;
35 ::ll::TypedStorage<1, 1, bool> mEditingLeft;
36 ::ll::TypedStorage<1, 1, bool> mEditingRight;
37 ::ll::TypedStorage<1, 2, ::std::array<bool, 2>> mPageHasCursor;
38 ::ll::TypedStorage<8, 24, ::std::vector<::PageContent>> mPages;
39 ::ll::TypedStorage<4, 4, int> mCurrentPage;
40 ::ll::TypedStorage<4, 4, int> mCurrentPageIndex;
41 ::ll::TypedStorage<8, 32, ::std::string> mTitle;
42 ::ll::TypedStorage<8, 40, ::std::optional<::std::string>> mFilteredTitle;
43 ::ll::TypedStorage<8, 32, ::std::string> mAuthor;
44 ::ll::TypedStorage<8, 40, ::std::optional<::std::string>> mFilteredAuthor;
45 ::ll::TypedStorage<8, 32, ::std::string> mAuthorXUID;
46 ::ll::TypedStorage<1, 1, ::BookScreenController::BookView> mCurrentView;
47 ::ll::TypedStorage<1, 1, bool> mForceUIRefresh;
48 ::ll::TypedStorage<4, 4, int> mPickPageIndex;
49 ::ll::TypedStorage<8, 32, ::std::string> mPageBlockedText;
50 ::ll::TypedStorage<1, 1, bool> mShouldRefreshText;
51 ::ll::TypedStorage<1, 1, bool> mShouldUseFilteredText;
52 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mProfanityToggleSubscription;
53 // NOLINTEND
54
55public:
56 // prevent constructor by default
57 BookScreenController();
58
59public:
60 // virtual functions
61 // NOLINTBEGIN
62 virtual ~BookScreenController() /*override*/;
63
64 virtual void addStaticScreenVars(::Json::Value& globalVars) /*override*/;
65
66 virtual void preFrameTick() /*override*/;
67
68 virtual ::ui::DirtyFlag tick() /*override*/;
69
70 virtual bool _isStillValid() const /*override*/;
71
72 virtual ::std::string _getButtonBDescription() /*override*/;
73 // NOLINTEND
74
75public:
76 // member functions
77 // NOLINTBEGIN
78 MCAPI BookScreenController(
79 ::std::shared_ptr<::ClientInstanceScreenModel> model,
80 int bookSlot,
81 bool editable,
82 int page,
83 ::BlockActor* lectern
84 );
85
86 MCAPI void _addPageAt(int index, ::PageContent const& page);
87
88 MCAPI void _addPhotoPageAt(int index, ::std::string const& photoName);
89
90 MCAPI void _addTextPageAt(int index, ::std::string text);
91
92 MCAPI void _deletePage(int index);
93
94 MCAPI void _editPageText(int index);
95
96 MCAPI ::std::string const& _getPageText(int index, bool isBeingEdited);
97
98 MCAPI int _getPickIndex(char const* collectionPrefix, ::UIPropertyBag& bag);
99
100 MCAPI void _loadAuthorFromBook();
101
102 MCAPI void _loadTextFromBook();
103
104 MCAPI void _loadTitleFromBook();
105
106 MCAPI void _parsePageText(int index);
107
108 MCAPI void _registerBindings();
109
110 MCAPI void _registerEventHandlers();
111
112 MCAPI void _setPageText(int index, ::std::string const& text);
113
114 MCAPI bool _signBook();
115
116 MCAPI void _swapPages(int page1Index, int page2Index);
117
118 MCAPI void _tickExport();
119
120 MCAPI void _tryFirePageTurnSound(::UIPropertyBag const& bag) const;
121 // NOLINTEND
122
123public:
124 // constructor thunks
125 // NOLINTBEGIN
126 MCAPI void* $ctor(
127 ::std::shared_ptr<::ClientInstanceScreenModel> model,
128 int bookSlot,
129 bool editable,
130 int page,
131 ::BlockActor* lectern
132 );
133 // NOLINTEND
134
135public:
136 // destructor thunk
137 // NOLINTBEGIN
138 MCAPI void $dtor();
139 // NOLINTEND
140
141public:
142 // virtual function thunks
143 // NOLINTBEGIN
144 MCAPI void $addStaticScreenVars(::Json::Value& globalVars);
145
146 MCAPI void $preFrameTick();
147
148 MCAPI ::ui::DirtyFlag $tick();
149
150 MCAPI bool $_isStillValid() const;
151
152 MCAPI ::std::string $_getButtonBDescription();
153 // NOLINTEND
154
155public:
156 // vftables
157 // NOLINTBEGIN
159
160 MCNAPI static void** $vftableForScreenController();
161 // NOLINTEND
162};
Definition BlockActor.h:30
Definition BookScreenController.h:5
static MCAPI void ** $vftableForEnableNonOwnerReferences()
static MCAPI void ** $vftableForScreenController()
Definition BookScreenManager.h:5
Definition ClientInstanceScreenController.h:5
Definition ClientInstanceScreenModel.h:5
Definition Value.h:16
Definition UIPropertyBag.h:5
Definition PageContent.h:10