Skip to content
This repository has been archived by the owner on Dec 26, 2021. It is now read-only.

Commit

Permalink
Fix Inventory Cleaner, Update ContainerScreenController vtable (#4473)
Browse files Browse the repository at this point in the history
  • Loading branch information
FloppyDolphin57 authored Aug 28, 2021
1 parent 0718e27 commit 49b14c7
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 28 deletions.
4 changes: 2 additions & 2 deletions SDK/CInventory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<drop_t>(FindSignature("85 D2 0F 88 ?? ?? ?? ?? 55 56 57 41 54 41 55 41 56 41 57 48"));
static drop_t func = reinterpret_cast<drop_t>(FindSignature("85 D2 0F 88 ?? ?? ?? ?? 48 89 5C 24 ?? 55"));
if (func != 0)
func(this, slot, 0);
}
Expand All @@ -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<ContainerScreenController__autoPlace>(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<ContainerScreenController__autoPlace>(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);

Expand Down
53 changes: 27 additions & 26 deletions SDK/CInventory.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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 {
Expand Down

0 comments on commit 49b14c7

Please sign in to comment.