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