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 3#include "IUIScene_DispenserMenu.h" 4#include "..\..\..\Minecraft.World\net.minecraft.world.inventory.h" 5 6IUIScene_AbstractContainerMenu::ESceneSection IUIScene_DispenserMenu::GetSectionAndSlotInDirection( ESceneSection eSection, ETapState eTapDirection, int *piTargetX, int *piTargetY ) 7{ 8 ESceneSection newSection = eSection; 9 int xOffset = 0; 10 11 // Find the new section if there is one 12 switch( eSection ) 13 { 14 case eSectionTrapTrap: 15 if(eTapDirection == eTapStateDown) 16 { 17 newSection = eSectionTrapInventory; 18 xOffset = -TRAP_SCENE_TRAP_SLOT_OFFSET; 19 } 20 else if(eTapDirection == eTapStateUp) 21 { 22 newSection = eSectionTrapUsing; 23 xOffset = -TRAP_SCENE_TRAP_SLOT_OFFSET; 24 } 25 break; 26 case eSectionTrapInventory: 27 if(eTapDirection == eTapStateDown) 28 { 29 newSection = eSectionTrapUsing; 30 } 31 else if(eTapDirection == eTapStateUp) 32 { 33 newSection = eSectionTrapTrap; 34 xOffset = TRAP_SCENE_TRAP_SLOT_OFFSET; 35 } 36 break; 37 case eSectionTrapUsing: 38 if(eTapDirection == eTapStateDown) 39 { 40 newSection = eSectionTrapTrap; 41 xOffset = TRAP_SCENE_TRAP_SLOT_OFFSET; 42 } 43 else if(eTapDirection == eTapStateUp) 44 { 45 newSection = eSectionTrapInventory; 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_DispenserMenu::getSectionStartOffset(ESceneSection eSection) 59{ 60 int offset = 0; 61 switch( eSection ) 62 { 63 case eSectionTrapTrap: 64 offset = 0; 65 break; 66 case eSectionTrapInventory: 67 offset = 9; 68 break; 69 case eSectionTrapUsing: 70 offset = 9 + 27; 71 break; 72 default: 73 assert( false ); 74 break; 75 } 76 return offset; 77}