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