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 "UI.h"
3#include "UIScene_DebugOptions.h"
4
5LPCWSTR UIScene_DebugOptionsMenu::m_DebugCheckboxTextA[eDebugSetting_Max+1]=
6{
7 L"Load Saves From Local Folder Mode",
8 L"Write Saves To Local Folder Mode",
9 L"Freeze Players", //L"Not Used",
10 L"Display Safe Area",
11 L"Mobs don't attack",
12 L"Freeze Time",
13 L"Disable Weather",
14 L"Craft Anything",
15 L"Use DPad for debug",
16 L"Mobs don't tick",
17 L"Art tools", //L"Instant Mine",
18 L"Show UI Console",
19 L"Distributable Save",
20 L"Debug Leaderboards",
21 L"Height-Water Maps",
22 L"Superflat Nether",
23 //L"Light/Dark background",
24 L"More lightning when thundering",
25 L"Biome override",
26 //L"Go To End",
27 L"Go To Overworld",
28 L"Unlock All DLC", //L"Toggle Font",
29 L"Show Marketing Guide",
30};
31
32UIScene_DebugOptionsMenu::UIScene_DebugOptionsMenu(int iPad, void *initData, UILayer *parentLayer) : UIScene(iPad, parentLayer)
33{
34 // Setup all the Iggy references we need for this scene
35 initialiseMovie();
36
37 unsigned int uiDebugBitmask=app.GetGameSettingsDebugMask(iPad);
38
39 IggyValuePath *root = IggyPlayerRootPath ( getMovie() );
40 for(m_iTotalCheckboxElements = 0; m_iTotalCheckboxElements < eDebugSetting_Max && m_iTotalCheckboxElements < 21; ++m_iTotalCheckboxElements)
41 {
42 wstring label(m_DebugCheckboxTextA[m_iTotalCheckboxElements]);
43 m_checkboxes[m_iTotalCheckboxElements].init(label,m_iTotalCheckboxElements,(uiDebugBitmask&(1<<m_iTotalCheckboxElements)) ? true : false);
44 }
45}
46
47wstring UIScene_DebugOptionsMenu::getMoviePath()
48{
49 return L"DebugOptionsMenu";
50}
51
52void UIScene_DebugOptionsMenu::handleInput(int iPad, int key, bool repeat, bool pressed, bool released, bool &handled)
53{
54 //app.DebugPrintf("UIScene_DebugOptionsMenu handling input for pad %d, key %d, repeat- %s, pressed- %s, released- %s\n", iPad, key, repeat?"TRUE":"FALSE", pressed?"TRUE":"FALSE", released?"TRUE":"FALSE");
55
56 switch(key)
57 {
58 case ACTION_MENU_CANCEL:
59 if(pressed)
60 {
61 int iCurrentBitmaskIndex=0;
62 unsigned int uiDebugBitmask=0L;
63 for(int i=0;i<m_iTotalCheckboxElements;i++)
64 {
65 uiDebugBitmask|=m_checkboxes[i].IsChecked()?(1<<iCurrentBitmaskIndex):0;
66 iCurrentBitmaskIndex++;
67 }
68
69 if(uiDebugBitmask!=app.GetGameSettingsDebugMask(iPad))
70 {
71 app.SetGameSettingsDebugMask(iPad,uiDebugBitmask);
72 if(app.DebugSettingsOn())
73 {
74 app.ActionDebugMask(iPad);
75 }
76 else
77 {
78 // force debug mask off
79 app.ActionDebugMask(iPad,true);
80 }
81
82 app.CheckGameSettingsChanged(true,iPad);
83 }
84
85 navigateBack();
86 }
87 break;
88 case ACTION_MENU_OK:
89 case ACTION_MENU_UP:
90 case ACTION_MENU_DOWN:
91 case ACTION_MENU_PAGEUP:
92 case ACTION_MENU_PAGEDOWN:
93 sendInputToMovie(key, repeat, pressed, released);
94 break;
95 }
96}