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/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"
36namespace Json {
class Value; }
42 using FadeInIconSlotInfo = ::std::pair<::std::string, int>;
44 using FadeInIconTimeAndReadCount = ::std::pair<double, int>;
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, 144, ::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;
106 ContainerScreenController();
111 virtual ~ContainerScreenController() ;
113 virtual ::ui::DirtyFlag tick() ;
115 virtual void onOpen() ;
117 virtual ::ui::DirtyFlag handleGameEventNotification(::ui::GameEventNotification notification) ;
119 virtual void onLeave() ;
121 virtual void setAssociatedBlockPos(::BlockPos
const& pos) ;
123 virtual void setAssociatedEntityUniqueID(::ActorUniqueID
const uniqueID) ;
125 virtual void addStaticScreenVars(::Json::Value& globalVars) ;
127 virtual bool _isStillValid() const ;
129 virtual
void _handleTakeHalf(::std::
string const& collectionName,
int index);
131 virtual
void _handlePlaceAll(::std::
string const& collectionName,
int index);
133 virtual
void _handlePlaceOne(::std::
string const& collectionName,
int index);
135 virtual
int _handleTakePlace(::std::
string const& collectionName,
int collectionIndex,
bool allItems);
137 virtual
void _handleSelectSlot(::std::
string const& collectionName,
int collectionIndex);
139 virtual ::SelectedSlotInfo const _getSelectedSlotInfo() const;
141 virtual ::SlotData _reevaluateSlotData(::SlotData&& slotData) const;
143 virtual ::std::
string _getButtonADescription() ;
145 virtual ::std::
string _getButtonXDescription() ;
147 virtual ::std::
string _getButtonYDescription() ;
149 virtual ::ui::ViewRequest _onContainerSlotHovered(::std::
string const& collectionName,
int index);
151 virtual ::ui::ViewRequest _onContainerSlotUnhovered(::std::
string const& collectionName,
int index);
153 virtual ::ui::ViewRequest _onContainerSlotSelected(::std::
string const& collectionName,
int index);
155 virtual ::ui::ViewRequest _onContainerSlotPressed(::std::
string const& collectionName,
int index);
157 virtual ::ui::ViewRequest _onHotbarSlotHotkeyUsed(::SlotData const& dstSlot);
159 virtual
bool _shouldSwap(
160 ::std::
string const& collectionName,
162 ::std::
string const& otherCollectionName,
163 int otherCollectionIndex
166 virtual
bool _isTargetSwappable(::std::
string const& otherCollectionName,
int otherCollectionIndex) const;
168 virtual ::std::
string _getCollectionName(::UIPropertyBag* bag) const;
170 virtual
bool _canSplit(::std::
string const& collectionName) const;
172 virtual
void _sendFlyingItem(
173 ::ItemStackBase const& item,
174 ::std::
string const& fromName,
176 ::std::
string const& toName,
178 ::FadeInIconBehavior fadeInIconBehavior
181 virtual
bool _isContainerScreen() const ;
183 virtual ::ItemStackBase const&
184 _getVisualItemStackImpl(::std::
string const& collectionName,
int collectionIndex) const;
186 virtual
void _registerCoalesceOrder() = 0;
188 virtual
void _registerAutoPlaceOrder() = 0;
190 virtual
void _createItemLockNotification(::ItemLockAction const action);
192 virtual ::ProgressiveTakeBarLocation
193 _getProgressiveBarDirection(::std::
string const& collectionName,
int collectionIndex) const;
195 virtual
bool _isInCreativeContainer(::std::
string const& containerName) const;
197 virtual
bool _getGestureControlEnabled() const ;
203 MCAPI ContainerScreenController(
204 ::std::shared_ptr<::ClientInstanceScreenModel> model,
205 ::InteractionModel interactionModel
208 MCAPI
bool _canProgressiveTakeFromCollection() const;
210 MCAPI
void _compareStatesForFlyingItems();
212 MCAPI ::std::vector<::std::
string> const& _getCoalesceOrder(::std::
string const& collectionName) const;
214 MCAPI ::ItemGroup const& _getCursorSelectedItemGroup() const;
216 MCAPI
short _getDraggingDistanceSqrFromStartingPoint() const;
218 MCAPI ::ItemStack const& _getItemStack(::std::
string const& collectionName,
int collectionIndex) const;
220 MCAPI ::std::vector<::AutoPlaceItem>& _getReservedAutoPlaceOrder(::ContainerEnumName name, uint64 reserve);
222 MCAPI ::ItemStackBase const& _getSelectedItemStackBase() const;
224 MCAPI ::ItemStackBase const&
225 _getTakeableItemStackBase(::std::
string const& collectionName,
int collectionIndex) const;
227 MCAPI ::ItemStackBase const& _getVisualItemStack(::std::
string const& collectionName,
int collectionIndex) const;
229 MCAPI
void _handleAddAllToCursor(::std::
string const& collectionName,
int collectionIndex);
231 MCAPI
void _handleAutoPlace(
int amount, ::std::
string const& collectionName,
int index);
233 MCAPI
bool _handleCoalesceStack(::std::
string const& collectionName);
235 MCAPI
bool _handleCoalesceToIndex(::std::
string const& collectionName,
int collectionIndex);
238 _handleDropItem(::std::
string const& collectionName,
int collectionIndex, ::ItemTransferAmount transferAmount);
240 MCAPI
void _handleDropSelectedItem(::ItemTransferAmount transferAmount);
242 MCAPI
void _handleSplit(::std::
string const& collectionName,
int collectionIndex);
245 _handleSwap(::std::
string const& firstName,
int firstIndex, ::std::
string const& secondName,
int secondIndex);
247 MCAPI
void _handleTakeAll(::std::
string const& collectionName,
int index);
249 MCAPI
void _handleTakeAmount(
int amount, ::std::
string const& collectionName,
int index);
251 MCAPI
void _handleUnselectSlot();
253 MCAPI
bool _hasCustomDisplayName() const;
255 MCAPI
bool _hasItems(::std::
string const& collectionName,
int collectionIndex) const;
257 MCAPI
bool _isCursorSelectedActive() const;
259 MCAPI
bool _isInValidCraftingResultContainer(::std::string_view collectionName,
int collectionIndex) const;
261 MCAPI
bool _isProgressiveSelectBarVisible(::ProgressiveTakeBarLocation location) const;
263 MCAPI
bool _isSelectedSlot(::std::
string const& collectionName,
int collectionIndex) const;
265 MCAPI
void _loadLastSelectedSlot();
267 MCAPI
bool _moveItemFromSlotIntoStorageItem(
268 ::std::
string const& collectionName,
270 ::ItemStack const& toStorageItem
273 MCAPI
bool _moveSelectedItemFromStorageItem(
274 ::ItemStack const& fromStorageItem,
276 ::std::
string const& collectionName,
280 MCAPI
bool _moveTopItemFromStorageItem(
281 ::ItemStack const& fromStorageItem,
282 ::std::
string const& collectionName,
286 MCAPI
void _playSound(::SharedTypes::Legacy::LevelSoundEvent type);
288 MCAPI
void _postSetSelectedSlot(
289 ::SelectedSlotInfo const& selected,
292 ::ItemLockAction actionOverride
295 MCAPI
void _registerBindings();
297 MCAPI
void _registerEventHandlers();
299 MCAPI
void _registerEventHandlersForStateMachine(uint buttonId);
301 MCAPI
void _registerSingleTouchOutputSlot(::ContainerEnumName outputContainer);
303 MCAPI
void _registerStateMachine();
305 MCAPI
void _registerTouchHoldEventHandlersForStateMachine(uint buttonId);
307 MCAPI
void _saveLastSelectedSlot();
309 MCAPI
void _stopSplitting();
311 MCAPI ::std::vector<::AutoPlaceItem> const* tryGetAutoPlaceOrder(::std::
string const& collectionName) const;
317 MCAPI static
bool _isInRecipeContainer(::std::
string const& collectionName);
323 MCAPI static ::SlotData const& mCursorSlotData();
329 MCAPI
void* $ctor(::std::shared_ptr<::ClientInstanceScreenModel> model, ::InteractionModel interactionModel);
341 MCAPI ::ui::DirtyFlag $tick();
343 MCAPI
void $onOpen();
345 MCAPI ::ui::DirtyFlag $handleGameEventNotification(::ui::GameEventNotification notification);
347 MCAPI
void $onLeave();
349 MCAPI
void $setAssociatedBlockPos(::BlockPos const& pos);
351 MCAPI
void $setAssociatedEntityUniqueID(::ActorUniqueID const uniqueID);
353 MCAPI
void $addStaticScreenVars(::Json::Value& globalVars);
355 MCAPI
bool $_isStillValid() const;
357 MCAPI
void $_handleTakeHalf(::std::
string const& collectionName,
int index);
359 MCAPI
void $_handlePlaceAll(::std::
string const& collectionName,
int index);
361 MCAPI
void $_handlePlaceOne(::std::
string const& collectionName,
int index);
363 MCAPI
int $_handleTakePlace(::std::
string const& collectionName,
int collectionIndex,
bool allItems);
365 MCAPI
void $_handleSelectSlot(::std::
string const& collectionName,
int collectionIndex);
367 MCAPI ::SelectedSlotInfo const $_getSelectedSlotInfo() const;
369 MCAPI ::SlotData $_reevaluateSlotData(::SlotData&& slotData) const;
371 MCAPI ::std::
string $_getButtonADescription();
373 MCAPI ::std::
string $_getButtonXDescription();
375 MCAPI ::std::
string $_getButtonYDescription();
377 MCAPI ::ui::ViewRequest $_onContainerSlotHovered(::std::
string const& collectionName,
int index);
379 MCAPI ::ui::ViewRequest $_onContainerSlotUnhovered(::std::
string const& collectionName,
int index);
381 MCAPI ::ui::ViewRequest $_onContainerSlotSelected(::std::
string const& collectionName,
int index);
383 MCAPI ::ui::ViewRequest $_onContainerSlotPressed(::std::
string const& collectionName,
int index);
385 MCAPI ::ui::ViewRequest $_onHotbarSlotHotkeyUsed(::SlotData const& dstSlot);
387 MCAPI
bool $_shouldSwap(
388 ::std::
string const& collectionName,
390 ::std::
string const& otherCollectionName,
391 int otherCollectionIndex
394 MCAPI
bool $_isTargetSwappable(::std::
string const& otherCollectionName,
int otherCollectionIndex) const;
396 MCAPI ::std::
string $_getCollectionName(::UIPropertyBag* bag) const;
398 MCAPI
bool $_canSplit(::std::
string const& collectionName) const;
400 MCAPI
void $_sendFlyingItem(
401 ::ItemStackBase const& item,
402 ::std::
string const& fromName,
404 ::std::
string const& toName,
406 ::FadeInIconBehavior fadeInIconBehavior
409 MCFOLD
bool $_isContainerScreen() const;
411 MCAPI ::ItemStackBase const&
412 $_getVisualItemStackImpl(::std::
string const& collectionName,
int collectionIndex) const;
414 MCAPI
void $_createItemLockNotification(::ItemLockAction const action);
416 MCAPI ::ProgressiveTakeBarLocation
417 $_getProgressiveBarDirection(::std::
string const& collectionName,
int collectionIndex) const;
419 MCFOLD
bool $_isInCreativeContainer(::std::
string const& containerName) const;
421 MCFOLD
bool $_getGestureControlEnabled() const;
Definition ClientInstanceScreenController.h:5
Definition ClientInstanceScreenModel.h:5
Definition ContainerManagerController.h:47
Definition ContainerScreenController.h:5
static MCAPI void ** $vftableForEnableNonOwnerReferences()
static MCAPI void ** $vftableForScreenController()
Definition ItemStackBase.h:44
Definition ItemStack.h:26
Definition UIPropertyBag.h:5
Definition AutoPlaceItem.h:5
Definition ItemStateData.h:5
Definition ItemTransferAmount.h:5
Definition SelectedSlotInfo.h:10