the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at main 165 lines 6.1 kB view raw
1#pragma once 2 3#include "UIScene.h" 4 5class UIScene_LaunchMoreOptionsMenu : public UIScene 6{ 7private: 8 static const int TAB_WORLD_OPTIONS = 0; 9 static const int TAB_GAME_OPTIONS = 1; 10 11 enum EControls 12 { 13 // Add all checkboxes at the start as they also index into a checkboxes array 14 eLaunchCheckbox_Online, 15 eLaunchCheckbox_InviteOnly, 16 eLaunchCheckbox_AllowFoF, 17 eLaunchCheckbox_PVP, 18 eLaunchCheckbox_TrustSystem, 19 eLaunchCheckbox_FireSpreads, 20 eLaunchCheckbox_TNT, 21 eLaunchCheckbox_HostPrivileges, 22 eLaunchCheckbox_ResetNether, 23 eLaunchCheckbox_Structures, 24 eLaunchCheckbox_FlatWorld, 25 eLaunchCheckbox_BonusChest, 26 eLaunchCheckbox_DisableSaving, 27 eLaunchCheckbox_WorldResizeType, 28 eLaunchCheckbox_KeepInventory, 29 eLaunchCheckbox_MobSpawning, 30 eLaunchCheckbox_MobLoot, 31 eLaunchCheckbox_MobGriefing, 32 eLaunchCheckbox_TileDrops, 33 eLaunchCheckbox_NaturalRegeneration, 34 eLaunchCheckbox_DayLightCycle, 35 36 eLaunchCheckboxes_Count, 37 38 eControl_EditSeed, 39 eControl_WorldSize, 40 eControl_WorldResize, 41 42 eControl_Count 43 }; 44 45#ifdef __PSVITA__ 46 enum ETouchInput 47 { 48 ETouchInput_TabWorld = eControl_Count, 49 ETouchInput_TabGame, 50 51 ETouchInput_Count 52 }; 53 UIControl_Touch m_TouchTabWorld, m_TouchTabGame; 54 UIControl m_controlWorldPanel, m_controlGamePanel; 55#endif 56 UIControl m_gameOptions, m_worldOptions; 57 UIControl_CheckBox m_checkboxes[eLaunchCheckboxes_Count]; 58 UIControl_Label m_labelWorldOptions, m_labelGameOptions, m_labelDescription; 59 UIControl_HTMLLabel m_labelDescription_GameOptions, m_labelDescription_WorldOptions; 60 UIControl_Label m_labelSeed, m_labelRandomSeed, m_labelWorldSize, m_labelWorldResize; 61 UIControl_TextInput m_editSeed; 62 UIControl_Slider m_sliderWorldSize; 63 UIControl_Slider m_sliderWorldResize; 64 IggyName m_funcSetMenuType, m_funcChangeTab, m_funcSetDescription; 65 UI_BEGIN_MAP_ELEMENTS_AND_NAMES(UIScene) 66 UI_MAP_ELEMENT( m_labelGameOptions, "LabelGame") 67 UI_MAP_ELEMENT( m_labelWorldOptions, "LabelWorld") 68 69 UI_MAP_ELEMENT( m_gameOptions, "GameOptions") 70 UI_BEGIN_MAP_CHILD_ELEMENTS(m_gameOptions) 71#ifdef __PSVITA__ 72 UI_MAP_ELEMENT( m_TouchTabGame, "TouchTabGame" ) 73#endif 74 UI_MAP_ELEMENT( m_labelDescription_GameOptions, "Description_GameOptions") 75 76 UI_MAP_ELEMENT( m_checkboxes[eLaunchCheckbox_Online], "CheckboxOnline") 77 UI_MAP_ELEMENT( m_checkboxes[eLaunchCheckbox_InviteOnly], "CheckboxInviteOnly") 78 UI_MAP_ELEMENT( m_checkboxes[eLaunchCheckbox_AllowFoF], "CheckboxAllowFoF") 79 UI_MAP_ELEMENT( m_checkboxes[eLaunchCheckbox_PVP], "CheckboxPVP") 80 UI_MAP_ELEMENT( m_checkboxes[eLaunchCheckbox_HostPrivileges], "CheckboxHostPrivileges") 81 UI_MAP_ELEMENT( m_checkboxes[eLaunchCheckbox_DayLightCycle], "CheckboxDayLightCycle") 82 UI_MAP_ELEMENT( m_checkboxes[eLaunchCheckbox_KeepInventory], "CheckboxKeepInventory") 83 UI_MAP_ELEMENT( m_checkboxes[eLaunchCheckbox_MobSpawning], "CheckboxMobSpawning") 84 UI_MAP_ELEMENT( m_checkboxes[eLaunchCheckbox_MobGriefing], "CheckboxMobGriefing") 85 UI_MAP_ELEMENT( m_checkboxes[eLaunchCheckbox_MobLoot], "CheckboxMobLoot") 86 UI_MAP_ELEMENT( m_checkboxes[eLaunchCheckbox_TileDrops], "CheckboxTileDrops") 87 UI_MAP_ELEMENT( m_checkboxes[eLaunchCheckbox_NaturalRegeneration], "CheckboxNaturalRegeneration") 88 UI_END_MAP_CHILD_ELEMENTS() 89 90 UI_MAP_ELEMENT(m_worldOptions, "WorldOptions") 91 UI_BEGIN_MAP_CHILD_ELEMENTS(m_worldOptions) 92#ifdef __PSVITA__ 93 UI_MAP_ELEMENT( m_TouchTabWorld, "TouchTabWorld" ) 94#endif 95 UI_MAP_ELEMENT( m_labelDescription_WorldOptions, "Description_WorldOptions") 96 97 UI_MAP_ELEMENT( m_labelSeed, "Seed") 98 UI_MAP_ELEMENT( m_editSeed, "EditSeed") 99 UI_MAP_ELEMENT( m_labelRandomSeed, "RandomSeed") 100 UI_MAP_ELEMENT( m_labelWorldSize, "WorldSize") 101 UI_MAP_ELEMENT( m_sliderWorldSize, "WorldSizeSlider") 102 103 UI_MAP_ELEMENT( m_checkboxes[eLaunchCheckbox_Structures], "CheckboxStructures") 104 UI_MAP_ELEMENT( m_checkboxes[eLaunchCheckbox_BonusChest], "CheckboxBonusChest") 105 UI_MAP_ELEMENT( m_checkboxes[eLaunchCheckbox_FlatWorld], "CheckboxFlatWorld") 106 107 UI_MAP_ELEMENT( m_checkboxes[eLaunchCheckbox_ResetNether], "CheckboxResetNether") 108 109 UI_MAP_ELEMENT( m_checkboxes[eLaunchCheckbox_DisableSaving], "CheckboxDisableSaving") 110 UI_MAP_ELEMENT( m_checkboxes[eLaunchCheckbox_TrustSystem], "CheckboxTrustSystem") 111 UI_MAP_ELEMENT( m_checkboxes[eLaunchCheckbox_FireSpreads], "CheckboxFireSpreads") 112 UI_MAP_ELEMENT( m_checkboxes[eLaunchCheckbox_TNT], "CheckboxTNT") 113 114 UI_MAP_ELEMENT( m_labelWorldResize, "ResizeLabel") 115 UI_MAP_ELEMENT( m_sliderWorldResize, "ChangeWorldSizeSlider") 116 UI_MAP_ELEMENT( m_checkboxes[eLaunchCheckbox_WorldResizeType], "CheckboxResizeType") 117 UI_END_MAP_CHILD_ELEMENTS() 118 119 UI_MAP_NAME( m_funcChangeTab, L"ChangeTab") 120 UI_MAP_NAME( m_funcSetMenuType, L"SetMenuType") 121 UI_END_MAP_ELEMENTS_AND_NAMES() 122 123 LaunchMoreOptionsMenuInitData *m_params; 124 bool m_bMultiplayerAllowed; 125 bool m_bIgnoreInput; 126 int m_tabIndex; 127 128public: 129 UIScene_LaunchMoreOptionsMenu(int iPad, void *initData, UILayer *parentLayer); 130 131 virtual void updateTooltips(); 132 virtual void updateComponents(); 133 134 virtual EUIScene getSceneType() { return eUIScene_LaunchMoreOptionsMenu;} 135 136protected: 137 // TODO: This should be pure virtual in this class 138 virtual wstring getMoviePath(); 139 140public: 141 virtual void tick(); 142 virtual void handleDestroy(); 143 // INPUT 144 virtual void handleInput(int iPad, int key, bool repeat, bool pressed, bool released, bool &handled); 145 virtual void handleFocusChange(F64 controlId, F64 childId); 146 virtual void handleTimerComplete(int id); 147 static int KeyboardCompleteSeedCallback(LPVOID lpParam,const bool bRes); 148 virtual void handlePress(F64 controlId, F64 childId); 149 virtual void handleSliderMove(F64 sliderId, F64 currentValue); 150 151protected: 152 void handleCheckboxToggled(F64 controlId, bool selected); 153 154private: 155 bool m_bUpdateCheats; // If true, update cheats on next tick 156 void UpdateCheats(); 157 158 bool m_bUpdateOnline; // If true, update online settings on next tick 159 void UpdateOnline(); 160 161#ifdef __PSVITA__ 162 virtual void handleTouchInput(unsigned int iPad, S32 x, S32 y, int iId, bool bPressed, bool bRepeat, bool bReleased); 163 virtual UIControl* GetMainPanel(); 164#endif //__PSVITA__ 165};