3#include "mc/_HeaderOutputPredefine.h"
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/options/UIProfile.h"
20#include "mc/world/containers/ContainerEnumName.h"
21#include "mc/world/containers/SlotData.h"
22#include "mc/world/item/ItemGroup.h"
23#include "mc/world/item/ItemLockAction.h"
24#include "mc/world/level/BlockPos.h"
37namespace Json {
class Value; }
43 using FadeInIconSlotInfo = ::std::pair<::std::string, int>;
45 using FadeInIconTimeAndReadCount = ::std::pair<double, int>;
50 ::ll::TypedStorage<4, 12, ::BlockPos> mBlockPos;
51 ::ll::TypedStorage<8, 8, ::ActorUniqueID> mEntityUniqueID;
52 ::ll::TypedStorage<4, 4, ::TypeInContainer> mTypeInContainer;
53 ::ll::TypedStorage<1, 1, bool> mShowItemCategory;
54 ::ll::TypedStorage<8, 336, ::ContainerInteractionStateMachine> mContainerStateMachine;
55 ::ll::TypedStorage<8, 40, ::SlotData> mLastStateSlot;
56 ::ll::TypedStorage<4, 4, int> mLastPlacedAmount;
57 ::ll::TypedStorage<1, 1, bool> mSingleSplit;
58 ::ll::TypedStorage<8, 40, ::SlotData> mTouchSplitData;
59 ::ll::TypedStorage<8, 136, ::ItemGroup> mSelectedSplitTarget;
60 ::ll::TypedStorage<1, 1, bool> mSplitDraggingToPlace;
61 ::ll::TypedStorage<1, 1, bool> mPreviousGestureControlEnabled;
62 ::ll::TypedStorage<1, 1, bool> mEnterKeyPressedForSplitting;
63 ::ll::TypedStorage<1, 1, bool> mArrowKeyPressed;
64 ::ll::TypedStorage<8, 96, ::ProgressiveTakeButtonData> mProgressiveTakeButton;
65 ::ll::TypedStorage<4, 4, uint> mTouchProgressiveSelectButton;
66 ::ll::TypedStorage<8, 24, ::std::vector<::ItemStateData>> mPreviousState;
67 ::ll::TypedStorage<8, 16, ::std::map<::std::pair<::std::string, int>, ::std::pair<double, int>>> mFadeInIconData;
68 ::ll::TypedStorage<8, 40, ::SlotData> mSelectedSlotData;
69 ::ll::TypedStorage<8, 40, ::SlotData> mLastSelectedSlotData;
70 ::ll::TypedStorage<8, 40, ::SlotData> mHoveredSlotData;
71 ::ll::TypedStorage<1, 1, bool> mShowHoverText;
72 ::ll::TypedStorage<1, 1, bool> mHoverTextSuppressedUntilPointerMoves;
73 ::ll::TypedStorage<4, 4, int> mHoverTextInitialPointerX;
74 ::ll::TypedStorage<4, 4, int> mHoverTextInitialPointerY;
75 ::ll::TypedStorage<1, 1, bool> mHoverTextSkipNextGamepadHover;
76 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mLastHoverTime;
77 ::ll::TypedStorage<8, 40, ::SlotData> mStartDraggingSlotData;
78 ::ll::TypedStorage<1, 1, bool> mPointerHasMoved;
79 ::ll::TypedStorage<8, 64, ::std::unordered_map<::std::string, ::std::vector<::std::string>>> mCoalesceOrderMap;
80 ::ll::TypedStorage<8, 64, ::std::unordered_map<::std::string, ::std::vector<::AutoPlaceItem>>> mAutoPlaceOrderMap;
81 ::ll::TypedStorage<1, 1, bool> mIsHoldingScrolling;
82 ::ll::TypedStorage<1, 1, bool> mReadyToVibrate;
83 ::ll::TypedStorage<1, 1, bool> mNeedsUpdatedBinds;
84 ::ll::TypedStorage<4, 4, int> mStartHeldTime;
85 ::ll::TypedStorage<1, 1, bool> mStartDeciding;
86 ::ll::TypedStorage<2, 2, short> mLastPointerX;
87 ::ll::TypedStorage<2, 2, short> mLastPointerY;
88 ::ll::TypedStorage<2, 2, short> mStartDraggingPointerX;
89 ::ll::TypedStorage<2, 2, short> mStartDraggingPointerY;
90 ::ll::TypedStorage<8, 32, ::std::string> mDraggingCollectionName;
91 ::ll::TypedStorage<4, 4, int> mDraggingCollectionIndex;
92 ::ll::TypedStorage<8, 32, ::std::string> mInteractingCollectionName;
93 ::ll::TypedStorage<4, 4, int> mInteractingCollectionIndex;
94 ::ll::TypedStorage<4, 4, uint> mInteractingButtonId;
95 ::ll::TypedStorage<1, 1, bool> mIsDraggingTooFast;
96 ::ll::TypedStorage<1, 1, bool> mProgressBarShowing;
97 ::ll::TypedStorage<8, 144, ::BundleHelper> mBundleHelper;
98 ::ll::TypedStorage<4, 4, ::ui::DirtyFlag> mDirty;
99 ::ll::TypedStorage<1, 1, bool> mStartOutputSlotDeciding;
100 ::ll::TypedStorage<8, 32, ::std::string> mOutputCollectionName;
101 ::ll::TypedStorage<4, 4, int> mOutputCollectionIndex;
102 ::ll::TypedStorage<4, 4, int> mLastReleaseOutputSlotTime;
103 ::ll::TypedStorage<1, 1, bool> mScreenCanBeClosedByServer;
104 ::ll::TypedStorage<1, 1, ::ItemLockAction> mDefaultItemLockAction;
105 ::ll::TypedStorage<4, 4, ::InteractionModel> mInteractionModel;
106 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::ContainerManagerController>> mContainerManagerController;
111 ContainerScreenController();
116 virtual ~ContainerScreenController() ;
118 virtual ::ui::DirtyFlag tick() ;
120 virtual void onOpen() ;
122 virtual ::ui::DirtyFlag handleGameEventNotification(::ui::GameEventNotification notification) ;
124 virtual void onLeave() ;
126 virtual void setAssociatedBlockPos(::BlockPos
const& pos) ;
128 virtual void setAssociatedEntityUniqueID(::ActorUniqueID
const uniqueID) ;
130 virtual void addStaticScreenVars(::Json::Value& globalVars) ;
132 virtual bool _isStillValid() const ;
134 virtual
void _handleTakeHalf(::std::
string const& collectionName,
int index);
136 virtual
void _handlePlaceAll(::std::
string const& collectionName,
int index);
138 virtual
void _handlePlaceOne(::std::
string const& collectionName,
int index);
140 virtual
int _handleTakePlace(::std::
string const& collectionName,
int collectionIndex,
bool allItems);
142 virtual
void _handleSelectSlot(::std::
string const& collectionName,
int collectionIndex);
144 virtual ::SelectedSlotInfo const _getSelectedSlotInfo() const;
146 virtual ::SlotData _reevaluateSlotData(::SlotData&& slotData) const;
148 virtual ::std::
string _getButtonADescription() ;
150 virtual ::std::
string _getButtonXDescription() ;
152 virtual ::std::
string _getButtonYDescription() ;
154 virtual ::ui::ViewRequest _onContainerSlotHovered(::std::
string const& collectionName,
int index);
156 virtual ::ui::ViewRequest _onContainerSlotUnhovered(::std::
string const& collectionName,
int index);
158 virtual ::ui::ViewRequest _onContainerSlotSelected(::std::
string const& collectionName,
int index);
160 virtual ::ui::ViewRequest _onContainerSlotPressed(::std::
string const& collectionName,
int index);
162 virtual ::ui::ViewRequest _onHotbarSlotHotkeyUsed(::SlotData const& dstSlot);
164 virtual
bool _shouldSwap(
165 ::std::
string const& collectionName,
167 ::std::
string const& otherCollectionName,
168 int otherCollectionIndex
171 virtual
bool _isTargetSwappable(::std::
string const& otherCollectionName,
int otherCollectionIndex) const;
173 virtual ::std::
string _getCollectionName(::UIPropertyBag* bag) const;
175 virtual
bool _canSplit(::std::
string const& collectionName) const;
177 virtual
void _sendFlyingItem(
178 ::ItemStackBase const& item,
179 ::std::
string const& fromName,
181 ::std::
string const& toName,
183 ::FadeInIconBehavior fadeInIconBehavior
186 virtual
bool _isContainerScreen() const ;
188 virtual ::ItemStackBase const&
189 _getVisualItemStackImpl(::std::
string const& collectionName,
int collectionIndex) const;
191 virtual
void _registerCoalesceOrder() = 0;
193 virtual
void _registerAutoPlaceOrder() = 0;
195 virtual
void _createItemLockNotification(::ItemLockAction const action);
197 virtual ::ProgressiveTakeBarLocation
198 _getProgressiveBarDirection(::std::
string const& collectionName,
int collectionIndex) const;
200 virtual
bool _isInCreativeContainer(::std::
string const& containerName) const;
202 virtual
bool _getGestureControlEnabled() const ;
208 MCAPI ContainerScreenController(
209 ::std::shared_ptr<::ClientInstanceScreenModel> model,
210 ::InteractionModel interactionModel
213 MCAPI
bool _canProgressiveTakeFromCollection() const;
215 MCAPI
void _compareStatesForFlyingItems();
217 MCFOLD
int _getCollectionIndex(::UIPropertyBag* bag) const;
219 MCAPI ::ItemGroup const& _getCursorSelectedItemGroup() const;
221 MCAPI ::std::
string _getDisplayName() const;
223 MCFOLD ::std::
string _getFormattedHoverText(::ItemStackBase const& item) const;
225 MCFOLD ::std::
string _getFormattedHoverTextForItem(::ItemStackBase const& item) const;
227 MCAPI ::InteractionModel _getInteractionModel() const;
229 MCAPI ::ItemStack const& _getItemStack(::std::
string const& collectionName,
int collectionIndex) const;
231 MCAPI ::std::vector<::AutoPlaceItem>& _getReservedAutoPlaceOrder(::ContainerEnumName name, uint64 reserve);
233 MCAPI ::std::vector<::std::
string>& _getReservedCoalesceOrder(::ContainerEnumName name, uint64 reserve);
235 MCAPI ::ItemStackBase const& _getSelectedItemStackBase() const;
237 MCAPI ::std::
string _getStackItemCount() const;
239 MCAPI
int _getStorageItemRemainingWeight(::ItemStackBase const& storageItem) const;
241 MCAPI ::ItemStackBase const&
242 _getTakeableItemStackBase(::std::
string const& collectionName,
int collectionIndex) const;
244 MCAPI ::ItemStackBase const& _getVisualItemStack(::std::
string const& collectionName,
int collectionIndex) const;
246 MCAPI
void _handleAddAllToCursor(::std::
string const& collectionName,
int collectionIndex);
248 MCAPI
void _handleAddHalfToCursor(::std::
string const& collectionName,
int collectionIndex);
250 MCAPI
void _handleAutoPlace(
int amount, ::std::
string const& collectionName,
int index);
252 MCAPI
bool _handleCoalesceStack(::std::
string const& collectionName);
254 MCAPI
bool _handleCoalesceToIndex(::std::
string const& collectionName,
int collectionIndex);
257 _handleDropItem(::std::
string const& collectionName,
int collectionIndex, ::ItemTransferAmount transferAmount);
259 MCAPI
void _handleDropSelectedItem(::ItemTransferAmount transferAmount);
261 MCAPI
void _handleSplit(::std::
string const& collectionName,
int collectionIndex);
264 _handleSwap(::std::
string const& firstName,
int firstIndex, ::std::
string const& secondName,
int secondIndex);
266 MCAPI
void _handleTakeAll(::std::
string const& collectionName,
int index);
268 MCAPI
void _handleTakeAmount(
int amount, ::std::
string const& collectionName,
int index);
270 MCAPI
void _handleUnselectSlot();
272 MCAPI
bool _hasItems(::std::
string const& collectionName,
int collectionIndex) const;
274 MCAPI
bool _hasSelectedSlot() const;
276 MCAPI
bool _isCursorSelectedActive() const;
278 MCAPI
bool _isExpandoItem(::std::
string const& collectionName,
int collectionIndex) const;
280 MCAPI
bool _isIdle() const;
282 MCAPI
bool _isInValidCraftingResultContainer(::std::string_view collectionName,
int collectionIndex) const;
284 MCAPI
bool _isOutputSlot(::std::
string const& collectionName) const;
286 MCAPI
bool _isProgressiveSelectBarVisible() const;
288 MCAPI
bool _isSelectedSlot(::std::
string const& collectionName,
int collectionIndex) const;
290 MCAPI
bool _isStorageItemEmpty(::ItemStackBase const& storageItem) const;
292 MCAPI
void _loadLastSelectedSlot();
294 MCAPI
bool _moveItemFromSlotIntoStorageItem(
295 ::std::
string const& collectionName,
297 ::ItemStack const& toStorageItem
300 MCAPI
bool _moveSelectedItemFromStorageItem(
301 ::ItemStack const& fromStorageItem,
303 ::std::
string const& collectionName,
307 MCAPI
bool _moveSelectedItemFromStorageItemToStorageItem(
308 ::ItemStack const& fromStorageItem,
310 ::ItemStack const& toStorageItem
313 MCAPI
bool _moveTopItemFromStorageItem(
314 ::ItemStack const& fromStorageItem,
315 ::std::
string const& collectionName,
319 MCAPI
void _playSound(::SharedTypes::Legacy::LevelSoundEvent type);
321 MCAPI
void _postSetSelectedSlot(
322 ::SelectedSlotInfo const& selected,
325 ::ItemLockAction actionOverride
328 MCAPI
void _registerBindings();
330 MCAPI
void _registerEventHandlers();
332 MCAPI
void _registerEventHandlersForStateMachine(uint buttonId);
334 MCAPI
void _registerSingleTouchOutputSlot(::ContainerEnumName outputContainer);
336 MCAPI
void _registerStateMachine();
338 MCAPI
void _registerTouchHoldEventHandlersForStateMachine(uint buttonId);
340 MCAPI
void _saveCurrentContainerState();
342 MCAPI
void _saveLastSelectedSlot();
344 MCAPI
void _stopSplitting();
346 MCAPI
bool _usingGamepadScheme() const;
348 MCAPI
bool _usingTouchScheme() const;
350 MCAPI ::std::vector<::AutoPlaceItem> const* tryGetAutoPlaceOrder(::std::
string const& collectionName) const;
356 MCAPI static
bool _isInRecipeContainer(::std::
string const& collectionName);
358 MCAPI static ::InteractionModel interactionModelFromUIProfile(::UIProfile uiProfile);
364 MCAPI static ::SlotData const& mCursorSlotData();
370 MCAPI
void* $ctor(::std::shared_ptr<::ClientInstanceScreenModel> model, ::InteractionModel interactionModel);
382 MCAPI ::ui::DirtyFlag $tick();
384 MCAPI
void $onOpen();
386 MCAPI ::ui::DirtyFlag $handleGameEventNotification(::ui::GameEventNotification notification);
388 MCAPI
void $onLeave();
390 MCAPI
void $setAssociatedBlockPos(::BlockPos const& pos);
392 MCAPI
void $setAssociatedEntityUniqueID(::ActorUniqueID const uniqueID);
394 MCAPI
void $addStaticScreenVars(::Json::Value& globalVars);
396 MCAPI
bool $_isStillValid() const;
398 MCAPI
void $_handleTakeHalf(::std::
string const& collectionName,
int index);
400 MCAPI
void $_handlePlaceAll(::std::
string const& collectionName,
int index);
402 MCAPI
void $_handlePlaceOne(::std::
string const& collectionName,
int index);
404 MCAPI
int $_handleTakePlace(::std::
string const& collectionName,
int collectionIndex,
bool allItems);
406 MCAPI
void $_handleSelectSlot(::std::
string const& collectionName,
int collectionIndex);
408 MCAPI ::SelectedSlotInfo const $_getSelectedSlotInfo() const;
410 MCAPI ::SlotData $_reevaluateSlotData(::SlotData&& slotData) const;
412 MCAPI ::std::
string $_getButtonADescription();
414 MCAPI ::std::
string $_getButtonXDescription();
416 MCAPI ::std::
string $_getButtonYDescription();
418 MCAPI ::ui::ViewRequest $_onContainerSlotHovered(::std::
string const& collectionName,
int index);
420 MCAPI ::ui::ViewRequest $_onContainerSlotUnhovered(::std::
string const& collectionName,
int index);
422 MCAPI ::ui::ViewRequest $_onContainerSlotSelected(::std::
string const& collectionName,
int index);
424 MCAPI ::ui::ViewRequest $_onContainerSlotPressed(::std::
string const& collectionName,
int index);
426 MCAPI ::ui::ViewRequest $_onHotbarSlotHotkeyUsed(::SlotData const& dstSlot);
428 MCAPI
bool $_shouldSwap(
429 ::std::
string const& collectionName,
431 ::std::
string const& otherCollectionName,
432 int otherCollectionIndex
435 MCAPI
bool $_isTargetSwappable(::std::
string const& otherCollectionName,
int otherCollectionIndex) const;
437 MCAPI ::std::
string $_getCollectionName(::UIPropertyBag* bag) const;
439 MCAPI
bool $_canSplit(::std::
string const& collectionName) const;
441 MCAPI
void $_sendFlyingItem(
442 ::ItemStackBase const& item,
443 ::std::
string const& fromName,
445 ::std::
string const& toName,
447 ::FadeInIconBehavior fadeInIconBehavior
450 MCFOLD
bool $_isContainerScreen() const;
452 MCAPI ::ItemStackBase const&
453 $_getVisualItemStackImpl(::std::
string const& collectionName,
int collectionIndex) const;
455 MCAPI
void $_createItemLockNotification(::ItemLockAction const action);
457 MCAPI ::ProgressiveTakeBarLocation
458 $_getProgressiveBarDirection(::std::
string const& collectionName,
int collectionIndex) const;
460 MCFOLD
bool $_isInCreativeContainer(::std::
string const& containerName) const;
462 MCAPI
bool $_getGestureControlEnabled() const;
Definition ClientInstanceScreenController.h:5
Definition ClientInstanceScreenModel.h:5
Definition ContainerManagerController.h:48
Definition ContainerScreenController.h:5
static MCAPI void ** $vftableForEnableNonOwnerReferences()
static MCAPI void ** $vftableForScreenController()
Definition ItemStackBase.h:52
Definition ItemStack.h:35
Definition UIPropertyBag.h:5
Definition AutoPlaceItem.h:5
Definition ItemStateData.h:10
Definition ItemTransferAmount.h:9
Definition SelectedSlotInfo.h:10