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"
28class ContainerManagerController;
34struct ItemTransferAmount;
35struct SelectedSlotInfo;
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, 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;
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 unqiueID) ;
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&) const;
197 virtual
bool _getGestureControlEnabled() const ;
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 ::
std::
string _getDisplayName() const;
218 MCAPI
short _getDraggingDistanceSqrFromStartingPoint() const;
220 MCAPI ::ItemStack const& _getItemStack(::
std::
string const& collectionName,
int collectionIndex) const;
222 MCAPI ::
std::vector<::AutoPlaceItem>& _getReservedAutoPlaceOrder(::ContainerEnumName name, uint64 reserve);
224 MCAPI ::
std::vector<::
std::
string>& _getReservedCoalesceOrder(::ContainerEnumName name, uint64 reserve);
226 MCAPI ::ItemStackBase const& _getSelectedItemStackBase() const;
228 MCAPI ::
std::
string _getStackItemCount() const;
230 MCAPI ::ItemStackBase const&
231 _getTakeableItemStackBase(::
std::
string const& collectionName,
int collectionIndex) const;
233 MCAPI ::ItemStackBase const& _getVisualItemStack(::
std::
string const& collectionName,
int collectionIndex) const;
235 MCAPI
void _handleAddAllToCursor(::
std::
string const& collectionName,
int collectionIndex);
237 MCAPI
void _handleAutoPlace(
int amount, ::
std::
string const& collectionName,
int index);
239 MCAPI
bool _handleCoalesceStack(::
std::
string const& collectionName);
241 MCAPI
bool _handleCoalesceToIndex(::
std::
string const& collectionName,
int collectionIndex);
244 _handleDropItem(::
std::
string const& collectionName,
int collectionIndex, ::ItemTransferAmount transferAmount);
246 MCAPI
void _handleDropSelectedItem(::ItemTransferAmount transferAmount);
248 MCAPI
void _handleSplit(::
std::
string const& collectionName,
int collectionIndex);
251 _handleSwap(::
std::
string const& firstName,
int firstIndex, ::
std::
string const& secondName,
int secondIndex);
253 MCAPI
void _handleTakeAll(::
std::
string const& collectionName,
int index);
255 MCAPI
void _handleTakeAmount(
int amount, ::
std::
string const& collectionName,
int index);
257 MCAPI
void _handleUnselectSlot();
259 MCAPI
bool _hasItems(::
std::
string const& collectionName,
int collectionIndex) const;
261 MCAPI
bool _isCursorSelectedActive() const;
263 MCAPI
bool _isInValidCraftingResultContainer(::
std::string_view collectionName,
int collectionIndex) const;
265 MCAPI
bool _isProgressiveSelectBarVisible(::ProgressiveTakeBarLocation location) const;
267 MCAPI
bool _isSelectedSlot(::
std::
string const& collectionName,
int collectionIndex) const;
269 MCAPI
void _loadLastSelectedSlot();
271 MCAPI
bool _moveItemFromSlotIntoStorageItem(
272 ::
std::
string const& collectionName,
274 ::ItemStack const& toStorageItem
277 MCAPI
bool _moveSelectedItemFromStorageItem(
278 ::ItemStack const& fromStorageItem,
280 ::
std::
string const& collectionName,
284 MCAPI
bool _moveTopItemFromStorageItem(
285 ::ItemStack const& fromStorageItem,
286 ::
std::
string const& collectionName,
290 MCAPI
void _playSound(::SharedTypes::Legacy::LevelSoundEvent type);
292 MCAPI
void _postSetSelectedSlot(
293 ::SelectedSlotInfo const& selected,
296 ::ItemLockAction actionOverride
299 MCAPI
void _registerBindings();
301 MCAPI
void _registerEventHandlers();
303 MCAPI
void _registerEventHandlersForStateMachine(uint buttonId);
305 MCAPI
void _registerSingleTouchOutputSlot(::ContainerEnumName outputContainer);
307 MCAPI
void _registerStateMachine();
309 MCAPI
void _registerTouchHoldEventHandlersForStateMachine(uint buttonId);
311 MCAPI
void _saveLastSelectedSlot();
313 MCAPI
void _stopSplitting();
315 MCAPI ::
std::vector<::AutoPlaceItem> const* tryGetAutoPlaceOrder(::
std::
string const& collectionName) const;
321 MCAPI static
bool _isInRecipeContainer(::
std::
string const& collectionName);
327 MCAPI static ::SlotData const& mCursorSlotData();
345 MCAPI ::ui::DirtyFlag $tick();
347 MCAPI
void $onOpen();
349 MCAPI
void $onLeave();
351 MCAPI
void $setAssociatedBlockPos(::BlockPos const& pos);
353 MCAPI
void $setAssociatedEntityUniqueID(::ActorUniqueID const unqiueID);
355 MCAPI
void $addStaticScreenVars(::Json::Value& globalVars);
357 MCAPI
bool $_isStillValid() const;
359 MCAPI
void $_handleTakeHalf(::
std::
string const& collectionName,
int index);
361 MCAPI
void $_handlePlaceAll(::
std::
string const& collectionName,
int index);
363 MCAPI
void $_handlePlaceOne(::
std::
string const& collectionName,
int index);
365 MCAPI
int $_handleTakePlace(::
std::
string const& collectionName,
int collectionIndex,
bool allItems);
367 MCAPI
void $_handleSelectSlot(::
std::
string const& collectionName,
int collectionIndex);
369 MCAPI ::SelectedSlotInfo const $_getSelectedSlotInfo() const;
371 MCAPI ::SlotData $_reevaluateSlotData(::SlotData&& slotData) const;
373 MCAPI ::
std::
string $_getButtonADescription();
375 MCAPI ::
std::
string $_getButtonXDescription();
377 MCAPI ::
std::
string $_getButtonYDescription();
379 MCAPI ::ui::ViewRequest $_onContainerSlotHovered(::
std::
string const& collectionName,
int index);
381 MCAPI ::ui::ViewRequest $_onContainerSlotUnhovered(::
std::
string const& collectionName,
int index);
383 MCAPI ::ui::ViewRequest $_onContainerSlotSelected(::
std::
string const& collectionName,
int index);
385 MCAPI ::ui::ViewRequest $_onContainerSlotPressed(::
std::
string const& collectionName,
int index);
387 MCAPI ::ui::ViewRequest $_onHotbarSlotHotkeyUsed(::SlotData const& dstSlot);
389 MCAPI
bool $_shouldSwap(
390 ::
std::
string const& collectionName,
392 ::
std::
string const& otherCollectionName,
393 int otherCollectionIndex
396 MCAPI
bool $_isTargetSwappable(::
std::
string const& otherCollectionName,
int otherCollectionIndex) const;
398 MCAPI ::
std::
string $_getCollectionName(::UIPropertyBag* bag) const;
400 MCAPI
bool $_canSplit(::
std::
string const& collectionName) const;
402 MCAPI
void $_sendFlyingItem(
403 ::ItemStackBase const& item,
404 ::
std::
string const& fromName,
406 ::
std::
string const& toName,
408 ::FadeInIconBehavior fadeInIconBehavior
411 MCFOLD
bool $_isContainerScreen() const;
413 MCAPI ::ItemStackBase const&
414 $_getVisualItemStackImpl(::
std::
string const& collectionName,
int collectionIndex) const;
416 MCAPI
void $_createItemLockNotification(::ItemLockAction const action);
418 MCAPI ::ProgressiveTakeBarLocation
419 $_getProgressiveBarDirection(::
std::
string const& collectionName,
int collectionIndex) const;
421 MCFOLD
bool $_isInCreativeContainer(::
std::
string const&) const;
423 MCFOLD
bool $_getGestureControlEnabled() const;
Definition ClientInstanceScreenController.h:5
Definition ClientInstanceScreenModel.h:5
Definition ContainerScreenController.h:5
static MCAPI void ** $vftableForEnableNonOwnerReferences()
static MCAPI void ** $vftableForScreenController()