LeviLamina
Loading...
Searching...
No Matches
CraftingScreenController.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/client/gui/CraftingType.h"
7#include "mc/client/gui/DirtyFlag.h"
8#include "mc/client/gui/ViewRequest.h"
9#include "mc/client/gui/screens/controllers/CategoryTabState.h"
10#include "mc/client/gui/screens/controllers/ContainerScreenController.h"
11#include "mc/client/gui/screens/controllers/FadeInIconBehavior.h"
12#include "mc/client/gui/screens/controllers/RepeatCraftButtonData.h"
13#include "mc/client/social/IToastListener.h"
14#include "mc/world/containers/ContainerEnumName.h"
15#include "mc/world/containers/SlotData.h"
16#include "mc/world/containers/controllers/ItemCraftType.h"
17#include "mc/world/containers/controllers/ItemTakeType.h"
18#include "mc/world/inventory/InventoryLeftTabIndex.h"
19#include "mc/world/item/CreativeItemCategory.h"
20#include "mc/world/item/ItemInstance.h"
21
22// auto generated forward declare list
23// clang-format off
24class BlockPos;
27class ItemStackBase;
28class Player;
29class ToastMessage;
30class UIPropertyBag;
31struct ActorUniqueID;
32struct AutoPlaceResult;
33namespace Json { class Value; }
34// clang-format on
35
37public:
38 // CraftingScreenController inner types declare
39 // clang-format off
40 struct CategoryTabInfo;
41 struct ScrollItemData;
42 // clang-format on
43
44 // CraftingScreenController inner types define
45 struct CategoryTabInfo {
46 public:
47 // member variables
48 // NOLINTBEGIN
49 ::ll::TypedStorage<4, 4, ::InventoryLeftTabIndex> tabIndex;
50 ::ll::TypedStorage<4, 4, ::CreativeItemCategory> category;
51 ::ll::TypedStorage<1, 1, ::ContainerEnumName> container;
52 ::ll::TypedStorage<8, 32, ::std::string> tabName;
53 ::ll::TypedStorage<8, 32, ::std::string> factoryName;
54 // NOLINTEND
55
56 public:
57 // member functions
58 // NOLINTBEGIN
59 MCAPI ~CategoryTabInfo();
60 // NOLINTEND
61
62 public:
63 // destructor thunk
64 // NOLINTBEGIN
65 MCFOLD void $dtor();
66 // NOLINTEND
67 };
68
69 struct ScrollItemData {
70 public:
71 // member variables
72 // NOLINTBEGIN
73 ::ll::TypedStorage<8, 40, ::SlotData> mSlot;
74 ::ll::TypedStorage<4, 4, int> mNumExpandedItems;
75 // NOLINTEND
76
77 public:
78 // member functions
79 // NOLINTBEGIN
80 MCAPI ~ScrollItemData();
81 // NOLINTEND
82
83 public:
84 // destructor thunk
85 // NOLINTBEGIN
86 MCFOLD void $dtor();
87 // NOLINTEND
88 };
89
90public:
91 // member variables
92 // NOLINTBEGIN
93 ::ll::TypedStorage<4, 4, ::ui::DirtyFlag> mDirty;
94 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::CraftingContainerManagerController>>
95 mCraftingContainerManagerController;
96 ::ll::TypedStorage<8, 40, ::std::optional<::std::string>> mDelayedSearchString;
97 ::ll::TypedStorage<1, 1, bool> mWorkbench;
98 ::ll::TypedStorage<1, 1, bool> mPocket;
99 ::ll::TypedStorage<1, 1, bool> mCraftableFilterOn;
100 ::ll::TypedStorage<4, 4, ::CraftingType> mCraftingType;
101 ::ll::TypedStorage<1, 1, bool> mEntered;
102 ::ll::TypedStorage<4, 4, int> mLayout;
103 ::ll::TypedStorage<4, 4, int> mSavedLayout;
104 ::ll::TypedStorage<4, 4, int> mCurrentlySelectedIndex;
105 ::ll::TypedStorage<8, 128, ::ItemInstance> mCurrentlySelectedItem;
106 ::ll::TypedStorage<1, 1, bool> mNeedReselectRecipeIndex;
107 ::ll::TypedStorage<1, 1, bool> mCanReselectRecipeIndex;
108 ::ll::TypedStorage<1, 1, bool> mIngredientSetChanged;
109 ::ll::TypedStorage<1, 1, bool> mNeedFirstTabSelection;
110 ::ll::TypedStorage<1, 1, bool> mNeedDefaultFocusSet;
111 ::ll::TypedStorage<1, 1, bool> mSearchBarSelected;
112 ::ll::TypedStorage<1, 1, bool> mCanCreativeHotbarSwap;
113 ::ll::TypedStorage<1, 1, bool> mRecipeLocked;
114 ::ll::TypedStorage<1, 1, bool> mUseRecipeUnlocking;
115 ::ll::TypedStorage<4, 4, int> mFocusRestorationContextSelectedTab;
116 ::ll::TypedStorage<8, 40, ::SlotData> mFocusRestorationContext;
117 ::ll::TypedStorage<8, 32, ::std::string> mRepeatCollectionName;
118 ::ll::TypedStorage<4, 4, int> mRepeatCollectionIndex;
119 ::ll::TypedStorage<4, 4, int> mRepeatCraftStartTime;
120 ::ll::TypedStorage<4, 4, int> mRepeatCraftLoopStartTime;
121 ::ll::TypedStorage<8, 48, ::CraftingScreenController::ScrollItemData> mNeedToScrollToItem;
122 ::ll::TypedStorage<8, 136, ::RepeatCraftButtonData> mRepeatCraftButton;
123 ::ll::TypedStorage<1, 1, bool> mHasInitalCategoryTabsState;
124 ::ll::TypedStorage<4, 4, int> mTicksLeftUntilCategoryTabUpdate;
125 ::ll::TypedStorage<4, 4, int> mTabFiltersDirty;
126 ::ll::TypedStorage<4, 4, int> mSelectedLeftTab;
127 ::ll::TypedStorage<4, 4, int> mSelectedRightTab;
128 ::ll::TypedStorage<8, 64, ::std::unordered_map<::InventoryLeftTabIndex, ::CategoryTabState>> mCategoryTabsState;
129 // NOLINTEND
130
131public:
132 // prevent constructor by default
133 CraftingScreenController();
134
135public:
136 // virtual functions
137 // NOLINTBEGIN
138 virtual ~CraftingScreenController() /*override*/;
139
140 virtual void onOpen() /*override*/;
141
142 virtual void onEntered() /*override*/;
143
144 virtual void onTerminate() /*override*/;
145
146 virtual ::ui::DirtyFlag tick() /*override*/;
147
148 virtual void addStaticScreenVars(::Json::Value& globalVars) /*override*/;
149
150 virtual void showToast(::ToastMessage message, bool animateIn) /*override*/;
151
152 virtual void removeToast() /*override*/;
153
154 virtual void refreshToast() /*override*/;
155
156 virtual bool _isStillValid() const /*override*/;
157
158 virtual void _handlePlaceAll(::std::string const& collectionName, int index) /*override*/;
159
160 virtual void _handlePlaceOne(::std::string const& collectionName, int index) /*override*/;
161
162 virtual void _handleSelectSlot(::std::string const& collectionName, int collectionIndex) /*override*/;
163
164 virtual ::ItemStackBase const&
165 _getVisualItemStackImpl(::std::string const& collectionName, int collectionIndex) const /*override*/;
166
167 virtual ::std::string _getButtonADescription() /*override*/;
168
169 virtual ::std::string _getButtonBDescription() /*override*/;
170
171 virtual ::std::string _getButtonXDescription() /*override*/;
172
173 virtual ::std::string _getButtonYDescription() /*override*/;
174
175 virtual ::ui::ViewRequest _onContainerSlotHovered(::std::string const& collectionName, int index) /*override*/;
176
177 virtual ::ui::ViewRequest _onContainerSlotPressed(::std::string const& collectionName, int index) /*override*/;
178
179 virtual ::std::string _getCollectionName(::UIPropertyBag* bag) const /*override*/;
180
181 virtual ::SlotData _reevaluateSlotData(::SlotData&& slotData) const /*override*/;
182
183 virtual bool _shouldSwap(
184 ::std::string const& collectionName,
185 int collectionIndex,
186 ::std::string const& otherCollectionName,
187 int otherCollectionIndex
188 ) const /*override*/;
189
190 virtual bool _isTargetSwappable(::std::string const& otherCollectionName, int otherCollectionIndex) const
191 /*override*/;
192
193 virtual void _sendFlyingItem(
194 ::ItemStackBase const& item,
195 ::std::string const& fromName,
196 int fromIndex,
197 ::std::string const& toName,
198 int toIndex,
199 ::FadeInIconBehavior fadeInIconBehavior
200 ) /*override*/;
201
202 virtual void _registerCoalesceOrder() /*override*/;
203
204 virtual void _registerAutoPlaceOrder() /*override*/;
205
206 virtual bool _isInCreativeContainer(::std::string const& containerName) const /*override*/;
207 // NOLINTEND
208
209public:
210 // member functions
211 // NOLINTBEGIN
212 MCAPI CraftingScreenController(
213 ::std::shared_ptr<::ClientInstanceScreenModel> model,
214 ::Player& player,
215 ::BlockPos const& pos,
216 ::ActorUniqueID uniqueId,
217 ::CraftingType craftingType
218 );
219
220 MCAPI bool _currentItemIsSelected(::std::string const& collectionName, int collectionIndex) const;
221
222 MCAPI void _cycleLayout(int dir);
223
224 MCAPI void _cycleRightSideInventoryTab(int dir);
225
226 MCAPI void _destroyCategoryTabs();
227
228 MCAPI void _evacuateCraftingGrid();
229
230 MCAPI int _findNextLeftSideInventoryTab(int dir) const;
231
232 MCAPI void _focusCollectionItem(::std::string const& collectionName, int collectionIndex, bool forceFocus);
233
234 MCAPI ::std::string _getButtonLeftStickDescription() const;
235
236 MCAPI ::std::string _getCraftStackText() const;
237
238 MCAPI ::std::string _getExpandoItemGroupName(::std::string const& collectionName, int collectionIndex);
239
240 MCAPI ::std::string _getRecipeHoverText(::std::string const& collectionName, int collectionIndex);
241
242 MCAPI void _handleCraftItem(::ItemCraftType);
243
244 MCAPI void _handleCreativeHotbarPlaceAll(::std::string const& collectionName, int collectionIndex);
245
246 MCAPI void _handleCreativeHotbarPlaceOne(::std::string const& collectionName, int collectionIndex);
247
248 MCAPI void _handleRecipeSelect(::std::string const& collectionName, int collectionIndex, bool displayOnly);
249
250 MCAPI bool _isRecipeBookOnlyLayoutAvailable() const;
251
252 MCAPI void _loadPlayerInventoryOptions();
253
254 MCAPI ::ui::ViewRequest
255 _recipeAutoCraft(::std::string const& collectionName, int collectionIndex, ::ItemCraftType craftType);
256
257 MCAPI void _refreshFilters(::InventoryLeftTabIndex tab, bool forceRefresh);
258
259 MCAPI void _registerBindings();
260
261 MCAPI void _registerEventHandlers();
262
263 MCAPI void _registerStateMachine();
264
265 MCAPI void _savePlayerInventoryOptions();
266
267 MCAPI void _sendActiveLayoutInfo();
268
269 MCAPI void _setInitialTabsSelected(int defaultLeftTab, int defaultRightTab);
270
271 MCAPI void _setIsFiltering(bool craftableFilterOn);
272
273 MCAPI void _setLayout(int layoutIndex, bool saveOptions);
274
275 MCAPI void _setLeftSideInventoryTab(int tabIndex, bool saveOptions);
276
277 MCAPI bool _shouldAlwaysShowAllTabs() const;
278
279 MCAPI void _showAllTabs();
280
281 MCAPI void
282 _showCategoryTab(::CraftingScreenController::CategoryTabInfo const& categoryTab, bool animated, int tabsToSlide);
283
284 MCAPI ::std::string _tabIndexToCollectionName(::InventoryLeftTabIndex index) const;
285
286 MCAPI int _tryAutoPlaceItemIntoContainer(
287 ::SlotData const& srcSlot,
288 ::ItemTakeType type,
289 ::ContainerEnumName containerName,
290 ::std::vector<::AutoPlaceResult>& autoPlaceResults
291 );
292
293 MCAPI void _tryHoverOnIngredientSetChanged();
294
295 MCAPI ::ui::DirtyFlag _updateCategoryTabs();
296 // NOLINTEND
297
298public:
299 // static functions
300 // NOLINTBEGIN
301 MCAPI static void addStaticScreenVars(::Json::Value& globalVars, bool pocket);
302 // NOLINTEND
303
304public:
305 // static variables
306 // NOLINTBEGIN
307 MCAPI static ::std::string_view const& RECIPE_BOOK_COLLECTION_NAME();
308
309 MCAPI static ::std::vector<::CraftingScreenController::CategoryTabInfo> const& mCategoryTabs();
310
311 MCAPI static int& mTabsWaitingToBeAnimatedIn();
312 // NOLINTEND
313
314public:
315 // constructor thunks
316 // NOLINTBEGIN
317 MCAPI void* $ctor(
318 ::std::shared_ptr<::ClientInstanceScreenModel> model,
319 ::Player& player,
320 ::BlockPos const& pos,
321 ::ActorUniqueID uniqueId,
322 ::CraftingType craftingType
323 );
324 // NOLINTEND
325
326public:
327 // destructor thunk
328 // NOLINTBEGIN
329 MCAPI void $dtor();
330 // NOLINTEND
331
332public:
333 // virtual function thunks
334 // NOLINTBEGIN
335 MCAPI void $onOpen();
336
337 MCAPI void $onEntered();
338
339 MCAPI void $onTerminate();
340
341 MCAPI ::ui::DirtyFlag $tick();
342
343 MCAPI void $addStaticScreenVars(::Json::Value& globalVars);
344
345 MCAPI void $showToast(::ToastMessage message, bool animateIn);
346
347 MCAPI void $removeToast();
348
349 MCAPI void $refreshToast();
350
351 MCAPI bool $_isStillValid() const;
352
353 MCAPI void $_handlePlaceAll(::std::string const& collectionName, int index);
354
355 MCAPI void $_handlePlaceOne(::std::string const& collectionName, int index);
356
357 MCAPI void $_handleSelectSlot(::std::string const& collectionName, int collectionIndex);
358
359 MCAPI ::ItemStackBase const&
360 $_getVisualItemStackImpl(::std::string const& collectionName, int collectionIndex) const;
361
362 MCAPI ::std::string $_getButtonADescription();
363
364 MCAPI ::std::string $_getButtonBDescription();
365
366 MCAPI ::std::string $_getButtonXDescription();
367
368 MCAPI ::std::string $_getButtonYDescription();
369
370 MCAPI ::ui::ViewRequest $_onContainerSlotHovered(::std::string const& collectionName, int index);
371
372 MCAPI ::ui::ViewRequest $_onContainerSlotPressed(::std::string const& collectionName, int index);
373
374 MCAPI ::std::string $_getCollectionName(::UIPropertyBag* bag) const;
375
376 MCAPI ::SlotData $_reevaluateSlotData(::SlotData&& slotData) const;
377
378 MCAPI bool $_shouldSwap(
379 ::std::string const& collectionName,
380 int collectionIndex,
381 ::std::string const& otherCollectionName,
382 int otherCollectionIndex
383 ) const;
384
385 MCAPI bool $_isTargetSwappable(::std::string const& otherCollectionName, int otherCollectionIndex) const;
386
387 MCAPI void $_sendFlyingItem(
388 ::ItemStackBase const& item,
389 ::std::string const& fromName,
390 int fromIndex,
391 ::std::string const& toName,
392 int toIndex,
393 ::FadeInIconBehavior fadeInIconBehavior
394 );
395
396 MCAPI void $_registerCoalesceOrder();
397
398 MCAPI void $_registerAutoPlaceOrder();
399
400 MCAPI bool $_isInCreativeContainer(::std::string const& containerName) const;
401 // NOLINTEND
402
403public:
404 // vftables
405 // NOLINTBEGIN
406 MCNAPI static void** $vftableForScreenController();
407
408 MCNAPI static void** $vftable();
409
411 // NOLINTEND
412};
Definition BlockPos.h:19
Definition ClientInstanceScreenModel.h:5
Definition ContainerScreenController.h:5
Definition CraftingContainerManagerController.h:40
Definition CraftingScreenController.h:5
static MCAPI void ** $vftableForScreenController()
static MCAPI void ** $vftableForEnableNonOwnerReferences()
static MCAPI void ** $vftable()
Definition IToastListener.h:5
Definition ItemStackBase.h:44
Definition Value.h:16
Definition Player.h:129
Definition ToastMessage.h:5
Definition UIPropertyBag.h:5
Definition ActorUniqueID.h:5
Definition AutoPlaceResult.h:5
Definition CraftingScreenController.h:14
Definition CraftingScreenController.h:16