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_SettingsAudioMenu.h"
4
5UIScene_SettingsAudioMenu::UIScene_SettingsAudioMenu(int iPad, void *initData, UILayer *parentLayer) : UIScene(iPad, parentLayer)
6{
7 // Setup all the Iggy references we need for this scene
8 initialiseMovie();
9
10 WCHAR TempString[256];
11 swprintf( (WCHAR *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_MUSIC ),app.GetGameSettings(m_iPad,eGameSetting_MusicVolume));
12 m_sliderMusic.init(TempString,eControl_Music,0,100,app.GetGameSettings(m_iPad,eGameSetting_MusicVolume));
13
14 swprintf( (WCHAR *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_SOUND ),app.GetGameSettings(m_iPad,eGameSetting_SoundFXVolume));
15 m_sliderSound.init(TempString,eControl_Sound,0,100,app.GetGameSettings(m_iPad,eGameSetting_SoundFXVolume));
16
17 doHorizontalResizeCheck();
18
19 if(app.GetLocalPlayerCount()>1)
20 {
21#if TO_BE_IMPLEMENTED
22 app.AdjustSplitscreenScene(m_hObj,&m_OriginalPosition,m_iPad);
23#endif
24 }
25}
26
27UIScene_SettingsAudioMenu::~UIScene_SettingsAudioMenu()
28{
29}
30
31wstring UIScene_SettingsAudioMenu::getMoviePath()
32{
33 if(app.GetLocalPlayerCount() > 1)
34 {
35 return L"SettingsAudioMenuSplit";
36 }
37 else
38 {
39 return L"SettingsAudioMenu";
40 }
41}
42
43void UIScene_SettingsAudioMenu::updateTooltips()
44{
45 ui.SetTooltips( m_iPad, IDS_TOOLTIPS_SELECT,IDS_TOOLTIPS_BACK);
46}
47
48void UIScene_SettingsAudioMenu::updateComponents()
49{
50 bool bNotInGame=(Minecraft::GetInstance()->level==NULL);
51 if(bNotInGame)
52 {
53 m_parentLayer->showComponent(m_iPad,eUIComponent_Panorama,true);
54 m_parentLayer->showComponent(m_iPad,eUIComponent_Logo,true);
55 }
56 else
57 {
58 m_parentLayer->showComponent(m_iPad,eUIComponent_Panorama,false);
59
60 if( app.GetLocalPlayerCount() == 1 ) m_parentLayer->showComponent(m_iPad,eUIComponent_Logo,true);
61 else m_parentLayer->showComponent(m_iPad,eUIComponent_Logo,false);
62 }
63}
64
65void UIScene_SettingsAudioMenu::handleInput(int iPad, int key, bool repeat, bool pressed, bool released, bool &handled)
66{
67 //app.DebugPrintf("UIScene_DebugOverlay handling input for pad %d, key %d, down- %s, pressed- %s, released- %s\n", iPad, key, down?"TRUE":"FALSE", pressed?"TRUE":"FALSE", released?"TRUE":"FALSE");
68 ui.AnimateKeyPress(m_iPad, key, repeat, pressed, released);
69
70 switch(key)
71 {
72 case ACTION_MENU_CANCEL:
73 if(pressed)
74 {
75 navigateBack();
76 }
77 break;
78 case ACTION_MENU_OK:
79#ifdef __ORBIS__
80 case ACTION_MENU_TOUCHPAD_PRESS:
81#endif
82 sendInputToMovie(key, repeat, pressed, released);
83 break;
84 case ACTION_MENU_UP:
85 case ACTION_MENU_DOWN:
86 case ACTION_MENU_LEFT:
87 case ACTION_MENU_RIGHT:
88 sendInputToMovie(key, repeat, pressed, released);
89 break;
90 }
91}
92
93void UIScene_SettingsAudioMenu::handleSliderMove(F64 sliderId, F64 currentValue)
94{
95 WCHAR TempString[256];
96 int value = (int)currentValue;
97 switch((int)sliderId)
98 {
99 case eControl_Music:
100 m_sliderMusic.handleSliderMove(value);
101
102 app.SetGameSettings(m_iPad,eGameSetting_MusicVolume,value);
103 swprintf( (WCHAR *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_MUSIC ),value);
104 m_sliderMusic.setLabel(TempString);
105
106 break;
107 case eControl_Sound:
108 m_sliderSound.handleSliderMove(value);
109
110 app.SetGameSettings(m_iPad,eGameSetting_SoundFXVolume,value);
111 swprintf( (WCHAR *)TempString, 256, L"%ls: %d%%", app.GetString( IDS_SLIDER_SOUND ),value);
112 m_sliderSound.setLabel(TempString);
113
114 break;
115 }
116}