the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at main 77 lines 1.7 kB view raw
1#include "stdafx.h" 2#include "IUIScene_HopperMenu.h" 3#include "../Minecraft.World/net.minecraft.world.inventory.h" 4 5IUIScene_AbstractContainerMenu::ESceneSection IUIScene_HopperMenu::GetSectionAndSlotInDirection( ESceneSection eSection, ETapState eTapDirection, int *piTargetX, int *piTargetY ) 6{ 7 ESceneSection newSection = eSection; 8 9 int xOffset = 0; 10 11 // Find the new section if there is one 12 switch( eSection ) 13 { 14 case eSectionHopperContents: 15 if(eTapDirection == eTapStateDown) 16 { 17 newSection = eSectionHopperInventory; 18 xOffset = -2; 19 } 20 else if(eTapDirection == eTapStateUp) 21 { 22 xOffset = -2; 23 newSection = eSectionHopperUsing; 24 } 25 break; 26 case eSectionHopperInventory: 27 if(eTapDirection == eTapStateDown) 28 { 29 newSection = eSectionHopperUsing; 30 } 31 else if(eTapDirection == eTapStateUp) 32 { 33 xOffset = 2; 34 newSection = eSectionHopperContents; 35 } 36 break; 37 case eSectionHopperUsing: 38 if(eTapDirection == eTapStateDown) 39 { 40 xOffset = 2; 41 newSection = eSectionHopperContents; 42 } 43 else if(eTapDirection == eTapStateUp) 44 { 45 newSection = eSectionHopperInventory; 46 } 47 break; 48 default: 49 assert(false); 50 break; 51 } 52 53 updateSlotPosition(eSection, newSection, eTapDirection, piTargetX, piTargetY, xOffset); 54 55 return newSection; 56} 57 58int IUIScene_HopperMenu::getSectionStartOffset(ESceneSection eSection) 59{ 60 int offset = 0; 61 switch( eSection ) 62 { 63 case eSectionHopperContents: 64 offset = HopperMenu::CONTENTS_SLOT_START; 65 break; 66 case eSectionHopperInventory: 67 offset = HopperMenu::INV_SLOT_START; 68 break; 69 case eSectionHopperUsing: 70 offset = HopperMenu::USE_ROW_SLOT_START; 71 break; 72 default: 73 assert( false ); 74 break; 75 } 76 return offset; 77}