LeviLamina
Loading...
Searching...
No Matches
ContainerScreenController.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/GameEventNotification.h"
8#include "mc/client/gui/ViewRequest.h"
9#include "mc/client/gui/screens/ContainerInteractionStateMachine.h"
10#include "mc/client/gui/screens/controllers/BundleHelper.h"
11#include "mc/client/gui/screens/controllers/ClientInstanceScreenController.h"
12#include "mc/client/gui/screens/controllers/FadeInIconBehavior.h"
13#include "mc/client/gui/screens/controllers/InteractionModel.h"
14#include "mc/client/gui/screens/controllers/ProgressiveTakeBarLocation.h"
15#include "mc/client/gui/screens/controllers/ProgressiveTakeButtonData.h"
16#include "mc/client/gui/screens/controllers/TypeInContainer.h"
17#include "mc/deps/shared_types/legacy/LevelSoundEvent.h"
18#include "mc/legacy/ActorUniqueID.h"
19#include "mc/world/containers/ContainerEnumName.h"
20#include "mc/world/containers/SlotData.h"
21#include "mc/world/item/ItemGroup.h"
22#include "mc/world/item/ItemLockAction.h"
23#include "mc/world/level/BlockPos.h"
24
25// auto generated forward declare list
26// clang-format off
28class ContainerManagerController;
29class ItemStack;
30class ItemStackBase;
31class UIPropertyBag;
32struct AutoPlaceItem;
33struct ItemStateData;
34struct ItemTransferAmount;
35struct SelectedSlotInfo;
36namespace Json { class Value; }
37// clang-format on
38
40public:
41 // ContainerScreenController inner types define
42 using FadeInIconSlotInfo = ::std::pair<::std::string, int>;
43
44 using FadeInIconTimeAndReadCount = ::std::pair<double, int>;
45
46public:
47 // member variables
48 // NOLINTBEGIN
49 ::ll::TypedStorage<4, 12, ::BlockPos> mBlockPos;
50 ::ll::TypedStorage<8, 8, ::ActorUniqueID> mEntityUniqueID;
51 ::ll::TypedStorage<4, 4, ::TypeInContainer> mTypeInContainer;
52 ::ll::TypedStorage<1, 1, bool> mShowItemCategory;
53 ::ll::TypedStorage<8, 336, ::ContainerInteractionStateMachine> mContainerStateMachine;
54 ::ll::TypedStorage<8, 40, ::SlotData> mLastStateSlot;
55 ::ll::TypedStorage<4, 4, int> mLastPlacedAmount;
56 ::ll::TypedStorage<1, 1, bool> mSingleSplit;
57 ::ll::TypedStorage<8, 40, ::SlotData> mTouchSplitData;
58 ::ll::TypedStorage<8, 136, ::ItemGroup> mSelectedSplitTarget;
59 ::ll::TypedStorage<1, 1, bool> mSplitDraggingToPlace;
60 ::ll::TypedStorage<1, 1, bool> mPreviousGestureControlEnabled;
61 ::ll::TypedStorage<1, 1, bool> mEnterKeyPressedForSplitting;
62 ::ll::TypedStorage<1, 1, bool> mArrowKeyPressed;
63 ::ll::TypedStorage<8, 96, ::ProgressiveTakeButtonData> mProgressiveTakeButton;
64 ::ll::TypedStorage<4, 4, uint> mTouchProgressiveSelectButton;
65 ::ll::TypedStorage<8, 24, ::std::vector<::ItemStateData>> mPreviousState;
66 ::ll::TypedStorage<8, 16, ::std::map<::std::pair<::std::string, int>, ::std::pair<double, int>>> mFadeInIconData;
67 ::ll::TypedStorage<8, 40, ::SlotData> mSelectedSlotData;
68 ::ll::TypedStorage<8, 40, ::SlotData> mLastSelectedSlotData;
69 ::ll::TypedStorage<8, 40, ::SlotData> mHoveredSlotData;
70 ::ll::TypedStorage<1, 1, bool> mShowHoverText;
71 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mLastHoverTime;
72 ::ll::TypedStorage<8, 40, ::SlotData> mStartDraggingSlotData;
73 ::ll::TypedStorage<1, 1, bool> mPointerHasMoved;
74 ::ll::TypedStorage<8, 64, ::std::unordered_map<::std::string, ::std::vector<::std::string>>> mCoalesceOrderMap;
75 ::ll::TypedStorage<8, 64, ::std::unordered_map<::std::string, ::std::vector<::AutoPlaceItem>>> mAutoPlaceOrderMap;
76 ::ll::TypedStorage<1, 1, bool> mIsHoldingScrolling;
77 ::ll::TypedStorage<1, 1, bool> mReadyToVibrate;
78 ::ll::TypedStorage<1, 1, bool> mNeedsUpdatedBinds;
79 ::ll::TypedStorage<4, 4, int> mStartHeldTime;
80 ::ll::TypedStorage<1, 1, bool> mStartDeciding;
81 ::ll::TypedStorage<2, 2, short> mLastPointerX;
82 ::ll::TypedStorage<2, 2, short> mLastPointerY;
83 ::ll::TypedStorage<2, 2, short> mStartDraggingPointerX;
84 ::ll::TypedStorage<2, 2, short> mStartDraggingPointerY;
85 ::ll::TypedStorage<8, 32, ::std::string> mDraggingCollectionName;
86 ::ll::TypedStorage<4, 4, int> mDraggingCollectionIndex;
87 ::ll::TypedStorage<8, 32, ::std::string> mInteractingCollectionName;
88 ::ll::TypedStorage<4, 4, int> mInteractingCollectionIndex;
89 ::ll::TypedStorage<4, 4, uint> mInteractingButtonId;
90 ::ll::TypedStorage<1, 1, bool> mIsDraggingTooFast;
91 ::ll::TypedStorage<1, 1, bool> mProgressBarShowing;
92 ::ll::TypedStorage<8, 152, ::BundleHelper> mBundleHelper;
93 ::ll::TypedStorage<4, 4, ::ui::DirtyFlag> mDirty;
94 ::ll::TypedStorage<1, 1, bool> mStartOutputSlotDeciding;
95 ::ll::TypedStorage<8, 32, ::std::string> mOutputCollectionName;
96 ::ll::TypedStorage<4, 4, int> mOutputCollectionIndex;
97 ::ll::TypedStorage<4, 4, int> mLastReleaseOutputSlotTime;
98 ::ll::TypedStorage<1, 1, bool> mScreenCanBeClosedByServer;
99 ::ll::TypedStorage<1, 1, ::ItemLockAction> mDefaultItemLockAction;
100 ::ll::TypedStorage<4, 4, ::InteractionModel> mInteractionModel;
101 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::ContainerManagerController>> mContainerManagerController;
102 // NOLINTEND
103
104public:
105 // prevent constructor by default
107
108public:
109 // virtual functions
110 // NOLINTBEGIN
111 virtual ~ContainerScreenController() /*override*/;
112
113 virtual ::ui::DirtyFlag tick() /*override*/;
114
115 virtual void onOpen() /*override*/;
116
117 virtual ::ui::DirtyFlag handleGameEventNotification(::ui::GameEventNotification notification) /*override*/;
118
119 virtual void onLeave() /*override*/;
120
121 virtual void setAssociatedBlockPos(::BlockPos const& pos) /*override*/;
122
123 virtual void setAssociatedEntityUniqueID(::ActorUniqueID const unqiueID) /*override*/;
124
125 virtual void addStaticScreenVars(::Json::Value& globalVars) /*override*/;
126
127 virtual bool _isStillValid() const /*override*/;
128
129 virtual void _handleTakeHalf(::std::string const& collectionName, int index);
130
131 virtual void _handlePlaceAll(::std::string const& collectionName, int index);
132
133 virtual void _handlePlaceOne(::std::string const& collectionName, int index);
134
135 virtual int _handleTakePlace(::std::string const& collectionName, int collectionIndex, bool allItems);
136
137 virtual void _handleSelectSlot(::std::string const& collectionName, int collectionIndex);
138
139 virtual ::SelectedSlotInfo const _getSelectedSlotInfo() const;
140
141 virtual ::SlotData _reevaluateSlotData(::SlotData&& slotData) const;
142
143 virtual ::std::string _getButtonADescription() /*override*/;
144
145 virtual ::std::string _getButtonXDescription() /*override*/;
146
147 virtual ::std::string _getButtonYDescription() /*override*/;
148
149 virtual ::ui::ViewRequest _onContainerSlotHovered(::std::string const& collectionName, int index);
150
151 virtual ::ui::ViewRequest _onContainerSlotUnhovered(::std::string const& collectionName, int index);
152
153 virtual ::ui::ViewRequest _onContainerSlotSelected(::std::string const& collectionName, int index);
154
155 virtual ::ui::ViewRequest _onContainerSlotPressed(::std::string const& collectionName, int index);
156
157 virtual ::ui::ViewRequest _onHotbarSlotHotkeyUsed(::SlotData const& dstSlot);
158
159 virtual bool _shouldSwap(
160 ::std::string const& collectionName,
161 int collectionIndex,
162 ::std::string const& otherCollectionName,
163 int otherCollectionIndex
164 ) const;
165
166 virtual bool _isTargetSwappable(::std::string const& otherCollectionName, int otherCollectionIndex) const;
167
168 virtual ::std::string _getCollectionName(::UIPropertyBag* bag) const;
169
170 virtual bool _canSplit(::std::string const& collectionName) const;
171
172 virtual void _sendFlyingItem(
173 ::ItemStackBase const& item,
174 ::std::string const& fromName,
175 int fromIndex,
176 ::std::string const& toName,
177 int toIndex,
178 ::FadeInIconBehavior fadeInIconBehavior
179 );
180
181 virtual bool _isContainerScreen() const /*override*/;
182
183 virtual ::ItemStackBase const&
184 _getVisualItemStackImpl(::std::string const& collectionName, int collectionIndex) const;
185
186 virtual void _registerCoalesceOrder() = 0;
187
188 virtual void _registerAutoPlaceOrder() = 0;
189
190 virtual void _createItemLockNotification(::ItemLockAction const action);
191
192 virtual ::ProgressiveTakeBarLocation
193 _getProgressiveBarDirection(::std::string const& collectionName, int collectionIndex) const;
194
195 virtual bool _isInCreativeContainer(::std::string const&) const;
196
197 virtual bool _getGestureControlEnabled() const /*override*/;
198 // NOLINTEND
199
200public:
201 // member functions
202 // NOLINTBEGIN
204 ::std::shared_ptr<::ClientInstanceScreenModel> model,
205 ::InteractionModel interactionModel
206 );
207
208 MCAPI bool _canProgressiveTakeFromCollection() const;
209
210 MCAPI void _compareStatesForFlyingItems();
211
212 MCAPI ::std::vector<::std::string> const& _getCoalesceOrder(::std::string const& collectionName) const;
213
214 MCAPI ::ItemGroup const& _getCursorSelectedItemGroup() const;
215
216 MCAPI ::std::string _getDisplayName() const;
217
218 MCAPI short _getDraggingDistanceSqrFromStartingPoint() const;
219
220 MCAPI ::ItemStack const& _getItemStack(::std::string const& collectionName, int collectionIndex) const;
221
222 MCAPI ::std::vector<::AutoPlaceItem>& _getReservedAutoPlaceOrder(::ContainerEnumName name, uint64 reserve);
223
224 MCAPI ::std::vector<::std::string>& _getReservedCoalesceOrder(::ContainerEnumName name, uint64 reserve);
225
226 MCAPI ::ItemStackBase const& _getSelectedItemStackBase() const;
227
228 MCAPI ::std::string _getStackItemCount() const;
229
230 MCAPI ::ItemStackBase const&
231 _getTakeableItemStackBase(::std::string const& collectionName, int collectionIndex) const;
232
233 MCAPI ::ItemStackBase const& _getVisualItemStack(::std::string const& collectionName, int collectionIndex) const;
234
235 MCAPI void _handleAddAllToCursor(::std::string const& collectionName, int collectionIndex);
236
237 MCAPI void _handleAutoPlace(int amount, ::std::string const& collectionName, int index);
238
239 MCAPI bool _handleCoalesceStack(::std::string const& collectionName);
240
241 MCAPI bool _handleCoalesceToIndex(::std::string const& collectionName, int collectionIndex);
242
243 MCAPI void
244 _handleDropItem(::std::string const& collectionName, int collectionIndex, ::ItemTransferAmount transferAmount);
245
246 MCAPI void _handleDropSelectedItem(::ItemTransferAmount transferAmount);
247
248 MCAPI void _handleSplit(::std::string const& collectionName, int collectionIndex);
249
250 MCAPI void
251 _handleSwap(::std::string const& firstName, int firstIndex, ::std::string const& secondName, int secondIndex);
252
253 MCAPI void _handleTakeAll(::std::string const& collectionName, int index);
254
255 MCAPI void _handleTakeAmount(int amount, ::std::string const& collectionName, int index);
256
257 MCAPI void _handleUnselectSlot();
258
259 MCAPI bool _hasItems(::std::string const& collectionName, int collectionIndex) const;
260
261 MCAPI bool _isCursorSelectedActive() const;
262
263 MCAPI bool _isInValidCraftingResultContainer(::std::string_view collectionName, int collectionIndex) const;
264
265 MCAPI bool _isProgressiveSelectBarVisible(::ProgressiveTakeBarLocation location) const;
266
267 MCAPI bool _isSelectedSlot(::std::string const& collectionName, int collectionIndex) const;
268
269 MCAPI void _loadLastSelectedSlot();
270
271 MCAPI bool _moveItemFromSlotIntoStorageItem(
272 ::std::string const& collectionName,
273 int collectionIndex,
274 ::ItemStack const& toStorageItem
275 );
276
277 MCAPI bool _moveSelectedItemFromStorageItem(
278 ::ItemStack const& fromStorageItem,
279 int selectedItemIdx,
280 ::std::string const& collectionName,
281 int collectionIndex
282 );
283
284 MCAPI bool _moveTopItemFromStorageItem(
285 ::ItemStack const& fromStorageItem,
286 ::std::string const& collectionName,
287 int collectionIndex
288 );
289
290 MCAPI void _playSound(::SharedTypes::Legacy::LevelSoundEvent type);
291
292 MCAPI void _postSetSelectedSlot(
293 ::SelectedSlotInfo const& selected,
294 bool allowEmpty,
295 bool unselect,
296 ::ItemLockAction actionOverride
297 );
298
299 MCAPI void _registerBindings();
300
301 MCAPI void _registerEventHandlers();
302
303 MCAPI void _registerEventHandlersForStateMachine(uint buttonId);
304
305 MCAPI void _registerSingleTouchOutputSlot(::ContainerEnumName outputContainer);
306
307 MCAPI void _registerStateMachine();
308
309 MCAPI void _registerTouchHoldEventHandlersForStateMachine(uint buttonId);
310
311 MCAPI void _saveLastSelectedSlot();
312
313 MCAPI void _stopSplitting();
314
315 MCAPI ::std::vector<::AutoPlaceItem> const* tryGetAutoPlaceOrder(::std::string const& collectionName) const;
316 // NOLINTEND
317
318public:
319 // static functions
320 // NOLINTBEGIN
321 MCAPI static bool _isInRecipeContainer(::std::string const& collectionName);
322 // NOLINTEND
323
324public:
325 // static variables
326 // NOLINTBEGIN
327 MCAPI static ::SlotData const& mCursorSlotData();
328 // NOLINTEND
329
330public:
331 // constructor thunks
332 // NOLINTBEGIN
333 MCAPI void* $ctor(::std::shared_ptr<::ClientInstanceScreenModel> model, ::InteractionModel interactionModel);
334 // NOLINTEND
335
336public:
337 // destructor thunk
338 // NOLINTBEGIN
339 MCAPI void $dtor();
340 // NOLINTEND
341
342public:
343 // virtual function thunks
344 // NOLINTBEGIN
345 MCAPI ::ui::DirtyFlag $tick();
346
347 MCAPI void $onOpen();
348
349 MCAPI void $onLeave();
350
351 MCAPI void $setAssociatedBlockPos(::BlockPos const& pos);
352
353 MCAPI void $setAssociatedEntityUniqueID(::ActorUniqueID const unqiueID);
354
355 MCAPI void $addStaticScreenVars(::Json::Value& globalVars);
356
357 MCAPI bool $_isStillValid() const;
358
359 MCAPI void $_handleTakeHalf(::std::string const& collectionName, int index);
360
361 MCAPI void $_handlePlaceAll(::std::string const& collectionName, int index);
362
363 MCAPI void $_handlePlaceOne(::std::string const& collectionName, int index);
364
365 MCAPI int $_handleTakePlace(::std::string const& collectionName, int collectionIndex, bool allItems);
366
367 MCAPI void $_handleSelectSlot(::std::string const& collectionName, int collectionIndex);
368
369 MCAPI ::SelectedSlotInfo const $_getSelectedSlotInfo() const;
370
371 MCAPI ::SlotData $_reevaluateSlotData(::SlotData&& slotData) const;
372
373 MCAPI ::std::string $_getButtonADescription();
374
375 MCAPI ::std::string $_getButtonXDescription();
376
377 MCAPI ::std::string $_getButtonYDescription();
378
379 MCAPI ::ui::ViewRequest $_onContainerSlotHovered(::std::string const& collectionName, int index);
380
381 MCAPI ::ui::ViewRequest $_onContainerSlotUnhovered(::std::string const& collectionName, int index);
382
383 MCAPI ::ui::ViewRequest $_onContainerSlotSelected(::std::string const& collectionName, int index);
384
385 MCAPI ::ui::ViewRequest $_onContainerSlotPressed(::std::string const& collectionName, int index);
386
387 MCAPI ::ui::ViewRequest $_onHotbarSlotHotkeyUsed(::SlotData const& dstSlot);
388
389 MCAPI bool $_shouldSwap(
390 ::std::string const& collectionName,
391 int collectionIndex,
392 ::std::string const& otherCollectionName,
393 int otherCollectionIndex
394 ) const;
395
396 MCAPI bool $_isTargetSwappable(::std::string const& otherCollectionName, int otherCollectionIndex) const;
397
398 MCAPI ::std::string $_getCollectionName(::UIPropertyBag* bag) const;
399
400 MCAPI bool $_canSplit(::std::string const& collectionName) const;
401
402 MCAPI void $_sendFlyingItem(
403 ::ItemStackBase const& item,
404 ::std::string const& fromName,
405 int fromIndex,
406 ::std::string const& toName,
407 int toIndex,
408 ::FadeInIconBehavior fadeInIconBehavior
409 );
410
411 MCFOLD bool $_isContainerScreen() const;
412
413 MCAPI ::ItemStackBase const&
414 $_getVisualItemStackImpl(::std::string const& collectionName, int collectionIndex) const;
415
416 MCAPI void $_createItemLockNotification(::ItemLockAction const action);
417
418 MCAPI ::ProgressiveTakeBarLocation
419 $_getProgressiveBarDirection(::std::string const& collectionName, int collectionIndex) const;
420
421 MCFOLD bool $_isInCreativeContainer(::std::string const&) const;
422
423 MCFOLD bool $_getGestureControlEnabled() const;
424 // NOLINTEND
425
426public:
427 // vftables
428 // NOLINTBEGIN
430
431 MCNAPI static void** $vftableForScreenController();
432 // NOLINTEND
433};
Definition ClientInstanceScreenController.h:5
Definition ClientInstanceScreenModel.h:5
Definition ContainerScreenController.h:5
static MCAPI void ** $vftableForEnableNonOwnerReferences()
static MCAPI void ** $vftableForScreenController()
STL namespace.