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