From 49b14c7c33a2d372e7ee8962a888434bb956be1b Mon Sep 17 00:00:00 2001 From: FloppyDolphin57 <50063641+FloppyDolphin57@users.noreply.github.com> Date: Fri, 27 Aug 2021 20:46:45 -0400 Subject: [PATCH] Fix Inventory Cleaner, Update ContainerScreenController vtable (#4473) --- SDK/CInventory.cpp | 4 ++-- SDK/CInventory.h | 53 +++++++++++++++++++++++----------------------- 2 files changed, 29 insertions(+), 28 deletions(-) diff --git a/SDK/CInventory.cpp b/SDK/CInventory.cpp index c3c6cb552..fe37cce2f 100644 --- a/SDK/CInventory.cpp +++ b/SDK/CInventory.cpp @@ -4,7 +4,7 @@ void C_Inventory::dropSlot(int slot) { // FillingContainer::dropSlot using drop_t = void(__fastcall*)(C_Inventory*, int, char); - static drop_t func = reinterpret_cast(FindSignature("85 D2 0F 88 ?? ?? ?? ?? 55 56 57 41 54 41 55 41 56 41 57 48")); + static drop_t func = reinterpret_cast(FindSignature("85 D2 0F 88 ?? ?? ?? ?? 48 89 5C 24 ?? 55")); if (func != 0) func(this, slot, 0); } @@ -27,7 +27,7 @@ bool C_Inventory::isFull() { void C_ContainerScreenController::handleAutoPlace(uintptr_t a1, std::string name, int slot) { using ContainerScreenController__autoPlace = __int64(__fastcall*)(C_ContainerScreenController*, uintptr_t, TextHolder, int); - static ContainerScreenController__autoPlace autoPlaceFunc = reinterpret_cast(FindSignature("40 55 53 56 57 41 54 41 55 41 56 41 57 48 8D 6C 24 ? 48 81 EC ? ? ? ? 48 C7 44 24 ? ? ? ? ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 45 ? 45 8B E1 49 8B F8")); + static ContainerScreenController__autoPlace autoPlaceFunc = reinterpret_cast(FindSignature("40 55 53 56 57 41 54 41 55 41 56 41 57 48 8D 6C 24 ?? 48 81 EC ?? ?? ?? ?? 48 C7 44 24 ?? ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 45 07 4D 8B F9 4D 8B E8")); TextHolder txt = TextHolder(name); diff --git a/SDK/CInventory.h b/SDK/CInventory.h index 9d1e0c3f8..1727bc70c 100644 --- a/SDK/CInventory.h +++ b/SDK/CInventory.h @@ -75,17 +75,16 @@ class C_PlayerInventoryProxy { }; class C_ContainerScreenController { -public: - void handleAutoPlace(uintptr_t a1, std::string name, int slot); - private: virtual __int64 destructor(); virtual __int64 tick(void); virtual __int64 handleEvent(__int64&); - virtual __int64 sub_140321330(void) const; + virtual __int64 getRoute(void); + virtual __int64 setScreenState(__int64, std::string const&); virtual __int64 onOpen(void); virtual __int64 onTerminate(void); virtual __int64 onInit(void); + virtual __int64 onDelete(void); public: virtual bool canExit(void); @@ -95,6 +94,8 @@ class C_ContainerScreenController { virtual __int64 areControllerTabsEnabled(void); virtual __int64 onCreation(void); virtual __int64 logCreationTime(std::string const&, double, double, unsigned char); + virtual __int64 unknown1(); + virtual __int64 unknown2(); public: virtual __int64 onLeave(void); @@ -108,32 +109,28 @@ class C_ContainerScreenController { virtual __int64 onDictationEvent(std::string const&); public: - virtual void setAssociatedvec3_ti(vec3_ti const&); + virtual void setAssociatedBlockPos(vec3_ti const&); virtual void setAssociatedEntityUniqueID(__int64); virtual void setSuspendInput(bool); private: - virtual __int64 getCallbackInterval(void) const; - -public: - virtual void setViewCommand(__int64); - -private: + virtual __int64 getCallbackInterval(void); virtual __int64 onRender(void); virtual __int64 addStaticScreenVars(__int64&); - virtual __int64 getAdditionalScreenInfo(void) const; - virtual __int64 getTelemetryOverride(void) const; + virtual __int64 getAdditionalScreenInfo(void); + virtual __int64 getTelemetryOverride(void); virtual __int64 addEventProperties(__int64) const; - virtual __int64 getSceneType(void) const; - virtual __int64 getScreenVersion(void) const; - virtual __int64 screenHandlesGamepadMenuButton(void) const; + virtual __int64 getSceneType(void); + virtual __int64 getScreenVersion(void); + virtual __int64 screenHandlesGamepadMenuButton(void); virtual __int64 getProxy(void); virtual __int64 onEntered(void); - virtual __int64 getNameId(std::string const&) const; - virtual __int64 _isStillValid(void) const; - virtual __int64 _getGamepadHelperVisible(void) const; - virtual __int64 _getMixedHelperVisible(void) const; - virtual __int64 _getKeyboardHelperVisible(void) const; + virtual __int64 getNameId(std::string const&); + virtual __int64 _doesScreenHaveExitBehavior(void); + virtual __int64 _isStillValid(void); + virtual __int64 _getGamepadHelperVisible(void); + virtual __int64 _getMixedHelperVisible(void); + virtual __int64 _getKeyboardHelperVisible(void); virtual __int64 _getButtonADescription(void); virtual __int64 _getButtonBDescription(void); virtual __int64 _getButtonXDescription(void); @@ -144,18 +141,22 @@ class C_ContainerScreenController { virtual __int64 _handlePlaceAll(std::string const&, int); virtual __int64 _handlePlaceOne(std::string const&, int); virtual __int64 _handleSelectSlot(std::string const&, int); - virtual __int64 _getSelectedItem(void) const; + virtual __int64 _getSelectedSlotInfo(void); virtual C_ItemStack* _getItemStack(TextHolder, int) const; private: - virtual __int64 _getVisualItemStack(std::string const&, int) const; + virtual __int64 _getVisualItemStack(std::string const&, int); + virtual __int64 _getTakeableItemStackBase(std::string const&, int); virtual __int64 _onContainerSlotHovered(std::string const&, int); virtual __int64 _onContainerSlotSelected(std::string const&, int); virtual __int64 _onContainerSlotPressed(std::string const&, int); - virtual __int64 _shouldSwap(std::string const&, int, std::string const&, int) const; - virtual __int64 _getCollectionName(__int64*) const; - virtual __int64 _canSplit(std::string const&, int) const; + virtual __int64 _shouldSwap(std::string const&, int, std::string const&, int); + virtual __int64 _getCollectionName(__int64*); + virtual __int64 _canSplit(std::string const&, int); virtual __int64 _sendFlyingItem(__int64 const&, std::string const&, int, std::string const&, int); + +public: + void handleAutoPlace(uintptr_t a1, std::string name, int slot); }; class C_CraftingScreenController : public C_ContainerScreenController {