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