mirror of
https://git.neolegacy.dev/neoStudiosLCE/neoLegacy.git
synced 2026-11-23 03:06:29 +01:00
577 lines
18 KiB
C++
577 lines
18 KiB
C++
#include "stdafx.h"
|
|
#include "UI.h"
|
|
#include "UIScene_ControlsMenu.h"
|
|
#include "../../Minecraft.h"
|
|
#include "../../MultiPlayerLocalPlayer.h"
|
|
|
|
//new control binding menu made by drperky, abusing iggy with c++ is what i live for
|
|
|
|
static void loadDefaultControls();
|
|
|
|
UIScene_ControlsMenu::UIScene_ControlsMenu(int iPad, void* initData, UILayer* parentLayer) : UIScene(iPad, parentLayer) {
|
|
boundControls.clear(); //idk if this is needed but we dont want to persist data, compile it every time we open
|
|
|
|
|
|
// Setup all the Iggy references we need for this scene
|
|
initialiseMovie();
|
|
doHorizontalResizeCheck();
|
|
|
|
m_multiList.init(eControl_MultiList);
|
|
m_multiList.clearList();
|
|
|
|
m_multiList.AddNewButton(L"Reset To Defaults", eControl_ApplyDefaults);
|
|
|
|
m_multiList.AddNewLabel(L"");
|
|
m_multiList.AddNewLabel(L"Movement");
|
|
m_multiList.AddNewCheckbox(app.GetString(IDS_INVERT_LOOK), eControl_InvertLook, false);
|
|
m_multiList.AddNewCheckbox(app.GetString(IDS_SOUTHPAW), eControl_SouthPaw, false);
|
|
|
|
{
|
|
IggyValuePath LookButton = m_multiList.AddNewButton(app.GetString(IDS_CONTROLS_LOOK), -1);
|
|
|
|
|
|
}
|
|
|
|
m_multiList.AddNewLabel(L"");
|
|
m_multiList.AddNewLabel(L"Standard");
|
|
|
|
for (int i = 0; i < 20; i++) {
|
|
this->registerControlBindingButton(IDS_TOOLTIPS_USE , -1, 0x10 + i);
|
|
this->registerControlBindingButton(IDS_TOOLTIPS_HARVEST, -1, 0x10 + i + 20);
|
|
}
|
|
|
|
this->compileControlBindingButtons();
|
|
|
|
|
|
if (app.GetLocalPlayerCount() > 1) {
|
|
#if TO_BE_IMPLEMENTED
|
|
app.AdjustSplitscreenScene(m_hObj, &m_OriginalPosition, m_iPad);
|
|
#endif
|
|
}
|
|
}
|
|
|
|
wstring UIScene_ControlsMenu::getMoviePath() {
|
|
if (app.GetLocalPlayerCount() > 1) {
|
|
return L"MultilistMenuSplit";
|
|
} else {
|
|
return L"MultilistMenu";
|
|
}
|
|
}
|
|
|
|
void UIScene_ControlsMenu::updateTooltips() {
|
|
ui.SetTooltips(m_iPad, IDS_TOOLTIPS_SELECT, IDS_TOOLTIPS_BACK);
|
|
}
|
|
|
|
void UIScene_ControlsMenu::updateComponents() {
|
|
bool bNotInGame = (Minecraft::GetInstance()->level == nullptr);
|
|
if (bNotInGame) {
|
|
m_parentLayer->showComponent(m_iPad, eUIComponent_Panorama, true);
|
|
m_parentLayer->showComponent(m_iPad, eUIComponent_Logo, true);
|
|
} else {
|
|
m_parentLayer->showComponent(m_iPad, eUIComponent_Panorama, false);
|
|
|
|
if (app.GetLocalPlayerCount() == 1) m_parentLayer->showComponent(m_iPad, eUIComponent_Logo, true);
|
|
else m_parentLayer->showComponent(m_iPad, eUIComponent_Logo, false);
|
|
}
|
|
}
|
|
|
|
void UIScene_ControlsMenu::tick() {
|
|
UIScene::tick();
|
|
repositionControlElements();
|
|
|
|
|
|
}
|
|
|
|
/*
|
|
private function HandleScrollListArrows(param1:Boolean) : void
|
|
{
|
|
if(param1 && m_aItems.length >= m_iMaxItemsVisible && !m_ScrollArrowUp.parent)
|
|
{
|
|
parent.addChild(m_ScrollArrowUp);
|
|
parent.addChild(m_ScrollArrowDown);
|
|
m_ScrollArrowUp.x = Math.round(this.x + this.width - m_ScrollArrowUp.width * 1.5);
|
|
m_ScrollArrowUp.y = Math.round(this.y + this.height - m_ScrollArrowUp.height / 2);
|
|
m_ScrollArrowDown.x = Math.round(this.x + this.width - m_ScrollArrowUp.width / 2);
|
|
m_ScrollArrowDown.y = m_ScrollArrowUp.y;
|
|
FJ_ScrollArrow(m_ScrollArrowUp).ChangeState(FJ_ScrollArrow.ARROW_A_VISIBLE);
|
|
FJ_ScrollArrow(m_ScrollArrowDown).ChangeState(FJ_ScrollArrow.ARROW_B_VISIBLE);
|
|
}
|
|
if(m_iTopItem > 0)
|
|
{
|
|
FJ_ScrollArrow(m_ScrollArrowUp).visible = true;
|
|
}
|
|
else
|
|
{
|
|
FJ_ScrollArrow(m_ScrollArrowUp).visible = false;
|
|
}
|
|
if(m_iTopItem < m_aItems.length - m_iMaxItemsVisible)
|
|
{
|
|
FJ_ScrollArrow(m_ScrollArrowDown).visible = true;
|
|
}
|
|
else
|
|
{
|
|
FJ_ScrollArrow(m_ScrollArrowDown).visible = false;
|
|
}
|
|
}
|
|
*/
|
|
|
|
void UIScene_ControlsMenu::registerControlBindingButton(int controlName_IDS, int key, int eControlIndex) {
|
|
boundControls.push_back(ControlBinding(controlName_IDS, eControlIndex, key));
|
|
}
|
|
|
|
void UIScene_ControlsMenu::compileControlBindingButtons() {
|
|
IggyName m_funcSetLabel = this->registerFastName(L"SetLabel");
|
|
IggyName m_funcSetSecondaryText = this->registerFastName(L"SetSecondaryText");
|
|
|
|
//IggyName m_bUseHtmlText = this->registerFastName(L"m_bUseHtmlText");
|
|
IggyName m_iTextFieldAlign = this->registerFastName(L"m_iTextFieldAlign");
|
|
|
|
for (ControlBinding& binding : boundControls) {
|
|
binding.buttonPath = m_multiList.AddNewButton(L"", eControl_ControlButton + binding.id);
|
|
IggyValueSetU32RS(&binding.buttonPath, m_iTextFieldAlign, 0, 1); //1 is ALIGN_LEFT
|
|
|
|
{
|
|
wstring string = L" ";
|
|
string += app.GetString(binding.nameid);
|
|
|
|
IggyDataValue args[1];
|
|
args[0].type = IGGY_DATATYPE_string_UTF16;
|
|
args[0].string16.string = const_cast<wchar_t*>(string.c_str());
|
|
args[0].string16.length = (S32)wcslen(args[0].string16.string);
|
|
|
|
IggyPlayerCallMethodRS(binding.buttonPath.f, 0, &binding.buttonPath, m_funcSetLabel, 1, args);
|
|
}
|
|
|
|
{
|
|
wstring string = app.GetString(binding.nameid);
|
|
|
|
IggyDataValue args[1];
|
|
args[0].type = IGGY_DATATYPE_string_UTF16;
|
|
args[0].string16.string = L"<img src='XboxOne_ButtonY' width='48' height='48'/> ";
|
|
args[0].string16.length = (S32)wcslen(args[0].string16.string);
|
|
|
|
IggyPlayerCallMethodRS(binding.buttonPath.f, 0, &binding.buttonPath, m_funcSetSecondaryText, 1, args);
|
|
}
|
|
}
|
|
|
|
repositionControlElements();
|
|
}
|
|
|
|
void UIScene_ControlsMenu::repositionControlElements() {
|
|
return;
|
|
|
|
double lastButtonY = -1, lastButtonHeight = -1;
|
|
for (ControlBinding& binding : boundControls) {
|
|
double buttonX = 0, buttonY = 0, buttonWidth = 0, buttonHeight = 0;
|
|
|
|
IggyValueGetF64RS(&binding.buttonPath, 0, "x", &buttonX);
|
|
IggyValueGetF64RS(&binding.buttonPath, 0, "y", &buttonY);
|
|
|
|
IggyValueGetF64RS(&binding.buttonPath, 0, "width", &buttonWidth);
|
|
IggyValueGetF64RS(&binding.buttonPath, 0, "height", &buttonHeight);
|
|
|
|
if (lastButtonY != -1) {
|
|
buttonY = lastButtonY + lastButtonHeight + 2; //2 for padding
|
|
|
|
IggyValueSetF64RS(&binding.buttonPath, 0, "y", buttonY);
|
|
}
|
|
lastButtonY = buttonY;
|
|
lastButtonHeight = buttonHeight;
|
|
}
|
|
}
|
|
|
|
|
|
/*
|
|
UIScene_ControlsMenu::UIScene_ControlsMenu(int iPad, void *initData, UILayer *parentLayer) : UIScene(iPad, parentLayer)
|
|
{
|
|
// Setup all the Iggy references we need for this scene
|
|
initialiseMovie();
|
|
|
|
IggyDataValue result;
|
|
IggyDataValue value[1];
|
|
value[0].type = IGGY_DATATYPE_number;
|
|
#if defined(_XBOX) || defined(_WIN64)
|
|
int controlType = app.GetGameSettings(m_iPad, eGameSetting_ControlType);
|
|
static const int platformMap[] = {0, 1, 0, 2, 3, 5};
|
|
value[0].number = static_cast<F64>(platformMap[controlType]);
|
|
#elif defined(_DURANGO)
|
|
value[0].number = (F64)1;
|
|
#elif defined(__PS3__)
|
|
value[0].number = (F64)2;
|
|
#elif defined(__ORBIS__)
|
|
value[0].number = (F64)3;
|
|
#elif defined(__PSVITA__)
|
|
value[0].number = (F64)4;
|
|
#endif
|
|
IggyResult out = IggyPlayerCallMethodRS ( getMovie() , &result, IggyPlayerRootPath( getMovie() ), m_funcSetPlatform , 1 , value );
|
|
|
|
bool bNotInGame=(Minecraft::GetInstance()->level==nullptr);
|
|
|
|
if(bNotInGame)
|
|
{
|
|
LPWSTR layoutString = new wchar_t[ 128 ];
|
|
swprintf( layoutString, 128, L"%ls", VER_PRODUCTVERSION_STR_W);
|
|
m_labelVersion.init(layoutString);
|
|
delete [] layoutString;
|
|
}
|
|
// 4J-PB - stop the label showing in the in-game controls menu
|
|
else
|
|
{
|
|
m_labelVersion.init(L" ");
|
|
}
|
|
m_bCreativeMode = !bNotInGame && Minecraft::GetInstance()->localplayers[m_iPad] && Minecraft::GetInstance()->localplayers[m_iPad]->abilities.mayfly;
|
|
|
|
#ifndef __PSVITA__
|
|
#ifdef __ORBIS__
|
|
// no buttons to initialise if we're running this on PS4 remote play
|
|
if(!InputManager.UsingRemoteVita())
|
|
#endif
|
|
{
|
|
m_buttonLayouts[0].init(L"1", eControl_Button0);
|
|
m_buttonLayouts[1].init(L"2", eControl_Button1);
|
|
m_buttonLayouts[2].init(L"3", eControl_Button2);
|
|
|
|
if (controlType == 0)
|
|
{
|
|
m_buttonLayouts[1].setEnable(false);
|
|
m_buttonLayouts[2].setEnable(false);
|
|
}
|
|
}
|
|
#endif
|
|
|
|
m_checkboxInvert.init(app.GetString(IDS_INVERT_LOOK), eControl_InvertLook, app.GetGameSettings(m_iPad,eGameSetting_ControlInvertLook));
|
|
m_checkboxSouthpaw.init(app.GetString(IDS_SOUTHPAW), eControl_Southpaw, app.GetGameSettings(m_iPad,eGameSetting_ControlSouthPaw));
|
|
m_checkboxSafeCam.init(app.GetString(IDS_SAFE_SPRINT), eControl_SafeCam, app.GetGameSettings(m_iPad,eGameSetting_SafeCam));
|
|
|
|
if (app.GetGameSettings(m_iPad, eGameSetting_ControlType) == 0)
|
|
{
|
|
m_checkboxAbswap.init(app.GetString(IDS_SWAP_KBM), eControl_ABSwap, app.GetGameSettings(m_iPad,eGameSetting_Swap));
|
|
}
|
|
else
|
|
{
|
|
m_checkboxAbswap.init(app.GetString(IDS_SWAP), eControl_ABSwap, app.GetGameSettings(m_iPad,eGameSetting_Swap));
|
|
IggyDataValue result;
|
|
IggyDataValue value[1];
|
|
value[0].type = IGGY_DATATYPE_boolean;
|
|
value[0].boolval = 0;
|
|
IggyPlayerCallMethodRS(getMovie(), &result, IggyPlayerRootPath(getMovie()), m_funcSetABSwapCheckBox, 1, value);
|
|
}
|
|
|
|
m_iSchemeTextA[0]=IDS_CONTROLS_SCHEME0;
|
|
m_iSchemeTextA[1]=IDS_CONTROLS_SCHEME1;
|
|
m_iSchemeTextA[2]=IDS_CONTROLS_SCHEME2;
|
|
|
|
int iSelected=app.GetGameSettings(m_iPad,eGameSetting_ControlScheme);
|
|
if (controlType == 0)
|
|
{
|
|
app.SetGameSettings(m_iPad,eGameSetting_ControlScheme,0);
|
|
iSelected = 0;
|
|
}
|
|
|
|
#ifndef __PSVITA__
|
|
LPWSTR layoutString = new wchar_t[ 128 ];
|
|
swprintf( layoutString, 128, L"%ls : %ls", app.GetString( IDS_CURRENT_LAYOUT ),app.GetString(m_iSchemeTextA[iSelected]));
|
|
#ifdef __ORBIS__
|
|
if (!InputManager.UsingRemoteVita())
|
|
#endif
|
|
{
|
|
m_labelCurrentLayout.init(layoutString);
|
|
}
|
|
#endif
|
|
|
|
m_iCurrentNavigatedControlsLayout = iSelected;
|
|
|
|
|
|
#ifdef __ORBIS__
|
|
// don't set controller layout if we're entering the PS4 remote play scene
|
|
if(!InputManager.UsingRemoteVita())
|
|
#endif
|
|
{
|
|
IggyDataValue result;
|
|
IggyDataValue value[1];
|
|
value[0].type = IGGY_DATATYPE_number;
|
|
value[0].number = static_cast<F64>(m_iCurrentNavigatedControlsLayout);
|
|
IggyResult out = IggyPlayerCallMethodRS ( getMovie() , &result, IggyPlayerRootPath( getMovie() ), m_funcSetControllerLayout , 1 , value );
|
|
}
|
|
|
|
#ifdef __ORBIS__
|
|
// Set mapping to Vita mapping
|
|
if (InputManager.UsingRemoteVita()) m_iCurrentNavigatedControlsLayout = 3;
|
|
#elif defined __PSVITA__
|
|
// Set mapping to Vita mapping
|
|
if (InputManager.IsVitaTV()) m_iCurrentNavigatedControlsLayout = 1;
|
|
#endif
|
|
|
|
m_parentLayer->showComponent(m_iPad, eUIComponent_Logo, false);
|
|
m_bLayoutChanged = false;
|
|
|
|
|
|
PositionAllText(m_iPad);
|
|
}
|
|
|
|
wstring UIScene_ControlsMenu::getMoviePath()
|
|
{
|
|
#ifdef __ORBIS__
|
|
if(InputManager.UsingRemoteVita())
|
|
{
|
|
return L"ControlsRemotePlay";
|
|
}
|
|
else
|
|
#endif
|
|
#ifdef __PSVITA__
|
|
if(InputManager.IsVitaTV())
|
|
{
|
|
return L"ControlsTV";
|
|
}
|
|
else
|
|
#endif
|
|
if(app.GetLocalPlayerCount() > 1)
|
|
{
|
|
return L"ControlsSplit";
|
|
}
|
|
else
|
|
{
|
|
return L"Controls";
|
|
}
|
|
}
|
|
|
|
void UIScene_ControlsMenu::updateTooltips()
|
|
{
|
|
ui.SetTooltips( m_iPad, IDS_TOOLTIPS_SELECT,IDS_TOOLTIPS_BACK);
|
|
}
|
|
|
|
void UIScene_ControlsMenu::tick()
|
|
{
|
|
if(m_bLayoutChanged) PositionAllText(m_iPad);
|
|
UIScene::tick();
|
|
}
|
|
|
|
void UIScene_ControlsMenu::handleInput(int iPad, int key, bool repeat, bool pressed, bool released, bool &handled)
|
|
{
|
|
//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");
|
|
ui.AnimateKeyPress(m_iPad, key, repeat, pressed, released);
|
|
|
|
switch(key)
|
|
{
|
|
case ACTION_MENU_CANCEL:
|
|
if(pressed)
|
|
{
|
|
app.CheckGameSettingsChanged(true,iPad);
|
|
navigateBack();
|
|
}
|
|
break;
|
|
case ACTION_MENU_OK:
|
|
#ifdef __ORBIS__
|
|
case ACTION_MENU_TOUCHPAD_PRESS:
|
|
#endif
|
|
if( pressed )
|
|
{
|
|
//CD - Added for audio
|
|
ui.PlayUISFX(eSFX_Press);
|
|
}
|
|
sendInputToMovie(key, repeat, pressed, released);
|
|
break;
|
|
case ACTION_MENU_UP:
|
|
case ACTION_MENU_DOWN:
|
|
case ACTION_MENU_LEFT:
|
|
case ACTION_MENU_RIGHT:
|
|
sendInputToMovie(key, repeat, pressed, released);
|
|
break;
|
|
}
|
|
}
|
|
|
|
void UIScene_ControlsMenu::handleCheckboxToggled(F64 controlId, bool selected)
|
|
{
|
|
switch(static_cast<int>(controlId))
|
|
{
|
|
case eControl_InvertLook:
|
|
app.SetGameSettings(m_iPad,eGameSetting_ControlInvertLook,(unsigned char)( selected ) );
|
|
break;
|
|
case eControl_Southpaw:
|
|
app.SetGameSettings(m_iPad,eGameSetting_ControlSouthPaw,(unsigned char)( selected ) );
|
|
PositionAllText(m_iPad);
|
|
break;
|
|
case eControl_SafeCam:
|
|
app.SetGameSettings(m_iPad,eGameSetting_SafeCam,(unsigned char)( selected ) );
|
|
m_bLayoutChanged = true;
|
|
break;
|
|
case eControl_ABSwap:
|
|
app.SetGameSettings(m_iPad,eGameSetting_Swap,(unsigned char)( selected ) );
|
|
m_bLayoutChanged = true;
|
|
break;
|
|
};
|
|
}
|
|
|
|
void UIScene_ControlsMenu::handlePress(F64 controlId, F64 childId)
|
|
{
|
|
int control = static_cast<int>(controlId);
|
|
if (app.GetGameSettings(m_iPad, eGameSetting_ControlType) == 0 && control != eControl_Button0)
|
|
{
|
|
app.SetGameSettings(m_iPad,eGameSetting_ControlScheme,0);
|
|
m_iCurrentNavigatedControlsLayout = 0;
|
|
m_bLayoutChanged = true;
|
|
return;
|
|
}
|
|
|
|
switch(control)
|
|
{
|
|
case eControl_Button0:
|
|
case eControl_Button1:
|
|
case eControl_Button2:
|
|
app.SetGameSettings(m_iPad,eGameSetting_ControlScheme,static_cast<unsigned char>(control));
|
|
LPWSTR layoutString = new wchar_t[ 128 ];
|
|
swprintf( layoutString, 128, L"%ls : %ls", app.GetString( IDS_CURRENT_LAYOUT ),app.GetString(m_iSchemeTextA[control]));
|
|
#ifdef __ORBIS__
|
|
if (!InputManager.UsingRemoteVita())
|
|
#endif
|
|
{
|
|
m_labelCurrentLayout.setLabel(layoutString);
|
|
}
|
|
|
|
break;
|
|
};
|
|
}
|
|
|
|
void UIScene_ControlsMenu::handleFocusChange(F64 controlId, F64 childId)
|
|
{
|
|
int control = static_cast<int>(controlId);
|
|
if (app.GetGameSettings(m_iPad, eGameSetting_ControlType) == 0 && control != eControl_Button0)
|
|
{
|
|
m_iCurrentNavigatedControlsLayout = 0;
|
|
m_bLayoutChanged = true;
|
|
return;
|
|
}
|
|
|
|
switch(control)
|
|
{
|
|
case eControl_Button0:
|
|
case eControl_Button1:
|
|
case eControl_Button2:
|
|
m_iCurrentNavigatedControlsLayout=control;
|
|
m_bLayoutChanged = true;
|
|
break;
|
|
};
|
|
}
|
|
|
|
void UIScene_ControlsMenu::PositionAllText(int iPad)
|
|
{
|
|
// disable for keyboard
|
|
int controlType = app.GetGameSettings(m_iPad,eGameSetting_ControlType);
|
|
if (controlType == 0) return;
|
|
|
|
IggyDataValue result;
|
|
IggyPlayerCallMethodRS(getMovie(), &result, IggyPlayerRootPath(getMovie()), m_funcClearAllKeyLines, 0, 0);
|
|
|
|
if(m_bCreativeMode)
|
|
{
|
|
PositionText(iPad,IDS_CONTROLS_JUMPFLY,MINECRAFT_ACTION_JUMP);
|
|
}
|
|
else
|
|
{
|
|
PositionText(iPad,IDS_CONTROLS_JUMP,MINECRAFT_ACTION_JUMP);
|
|
}
|
|
PositionText(iPad,IDS_CONTROLS_INVENTORY,MINECRAFT_ACTION_INVENTORY);
|
|
PositionText(iPad,IDS_CONTROLS_PAUSE,MINECRAFT_ACTION_PAUSEMENU);
|
|
if(m_bCreativeMode)
|
|
{
|
|
PositionText(iPad,IDS_CONTROLS_SNEAKFLY,MINECRAFT_ACTION_SNEAK_TOGGLE);
|
|
}
|
|
else
|
|
{
|
|
PositionText(iPad,IDS_CONTROLS_SNEAK,MINECRAFT_ACTION_SNEAK_TOGGLE);
|
|
}
|
|
PositionText(iPad,IDS_CONTROLS_USE,MINECRAFT_ACTION_USE);
|
|
PositionText(iPad,IDS_CONTROLS_ACTION,MINECRAFT_ACTION_ACTION);
|
|
PositionText(iPad,IDS_CONTROLS_HELDITEM,MINECRAFT_ACTION_RIGHT_SCROLL);
|
|
PositionText(iPad,IDS_CONTROLS_HELDITEM,MINECRAFT_ACTION_LEFT_SCROLL);
|
|
PositionText(iPad,IDS_CONTROLS_DROP,MINECRAFT_ACTION_DROP);
|
|
PositionText(iPad,IDS_CONTROLS_CRAFTING,MINECRAFT_ACTION_CRAFTING);
|
|
PositionText(iPad,IDS_CONTROLS_THIRDPERSON,MINECRAFT_ACTION_RENDER_THIRD_PERSON);
|
|
PositionText(iPad,IDS_CONTROLS_PLAYERS,MINECRAFT_ACTION_GAME_INFO);
|
|
|
|
// Swap for southpaw.
|
|
if ( app.GetGameSettings(m_iPad,eGameSetting_ControlSouthPaw) )
|
|
{
|
|
// Move
|
|
PositionText(iPad,IDS_CONTROLS_LOOK,MINECRAFT_ACTION_RIGHT);
|
|
// Look
|
|
PositionText(iPad,IDS_CONTROLS_MOVE,MINECRAFT_ACTION_LOOK_RIGHT);
|
|
}
|
|
else // Normal right handed.
|
|
{
|
|
// Move
|
|
PositionText(iPad,IDS_CONTROLS_MOVE,MINECRAFT_ACTION_RIGHT);
|
|
// Look
|
|
PositionText(iPad,IDS_CONTROLS_LOOK,MINECRAFT_ACTION_LOOK_RIGHT);
|
|
}
|
|
|
|
bool layoutHasDpadFly;
|
|
#ifdef __PSVITA__
|
|
layoutHasDpadFly = m_iCurrentNavigatedControlsLayout == 1;
|
|
#else
|
|
layoutHasDpadFly = m_iCurrentNavigatedControlsLayout == 0;
|
|
#endif
|
|
|
|
// If we're in controls mode 1, and creative mode show the dpad for Creative Mode
|
|
if(m_bCreativeMode && layoutHasDpadFly)
|
|
{
|
|
PositionText(iPad,IDS_CONTROLS_DPAD,MINECRAFT_ACTION_DPAD_LEFT);
|
|
}
|
|
m_bLayoutChanged = false;
|
|
}
|
|
|
|
void UIScene_ControlsMenu::PositionText(int iPad,int iTextID, unsigned char ucAction)
|
|
{
|
|
unsigned int uiVal = InputManager.GetGameJoypadMaps(m_iCurrentNavigatedControlsLayout, ucAction);
|
|
|
|
if (uiVal & _360_JOY_BUTTON_A) PositionTextDirect(iPad, iTextID, e_PadA, true);
|
|
if (uiVal & _360_JOY_BUTTON_B) PositionTextDirect(iPad, iTextID, e_PadB, true);
|
|
if (uiVal & _360_JOY_BUTTON_X) PositionTextDirect(iPad, iTextID, e_PadX, true);
|
|
if (uiVal & _360_JOY_BUTTON_Y) PositionTextDirect(iPad, iTextID, e_PadY, true);
|
|
if (uiVal & _360_JOY_BUTTON_BACK)
|
|
{
|
|
#ifdef __ORBIS__
|
|
PositionTextDirect(iPad, iTextID, (InputManager.UsingRemoteVita() ? e_PadTouch : e_PadBack), true);
|
|
#else
|
|
PositionTextDirect(iPad, iTextID, e_PadBack, true);
|
|
#endif
|
|
}
|
|
if (uiVal & _360_JOY_BUTTON_START) PositionTextDirect(iPad, iTextID, e_PadStart, true);
|
|
if (uiVal & _360_JOY_BUTTON_RB) PositionTextDirect(iPad, iTextID, e_PadRB, true);
|
|
if (uiVal & _360_JOY_BUTTON_LB) PositionTextDirect(iPad, iTextID, e_PadLB, true);
|
|
if (uiVal & _360_JOY_BUTTON_RTHUMB) PositionTextDirect(iPad, iTextID, e_PadRS_1, true);
|
|
if (uiVal & _360_JOY_BUTTON_LTHUMB) PositionTextDirect(iPad, iTextID, e_PadLS_1, true);
|
|
// Look
|
|
if (uiVal & _360_JOY_BUTTON_RSTICK_RIGHT) PositionTextDirect(iPad, iTextID, e_PadRS_2, true);
|
|
// Move
|
|
if (uiVal & _360_JOY_BUTTON_LSTICK_RIGHT) PositionTextDirect(iPad, iTextID, e_PadLS_2, true);
|
|
if (uiVal & _360_JOY_BUTTON_RT) PositionTextDirect(iPad, iTextID, e_PadRT, true);
|
|
if (uiVal & _360_JOY_BUTTON_LT) PositionTextDirect(iPad, iTextID, e_PadLT, true);
|
|
if (uiVal & _360_JOY_BUTTON_DPAD_RIGHT) PositionTextDirect(iPad, iTextID, e_PadDPadRight, true);
|
|
if (uiVal & _360_JOY_BUTTON_DPAD_LEFT) PositionTextDirect(iPad, iTextID, e_PadDPadLeft, true);
|
|
if (uiVal & _360_JOY_BUTTON_DPAD_UP) PositionTextDirect(iPad, iTextID, e_PadDPadUp, true);
|
|
if (uiVal & _360_JOY_BUTTON_DPAD_DOWN) PositionTextDirect(iPad, iTextID, e_PadDPadDown, true);
|
|
}
|
|
|
|
void UIScene_ControlsMenu::PositionTextDirect(int iPad,int iTextID, int iControlDetailsIndex, bool bShow)
|
|
{
|
|
LPCWSTR text = app.GetString(iTextID);
|
|
|
|
IggyDataValue result;
|
|
IggyDataValue value[3];
|
|
|
|
value[0].type = IGGY_DATATYPE_number;
|
|
value[0].number = static_cast<F64>(iControlDetailsIndex);
|
|
|
|
IggyStringUTF16 stringVal;
|
|
stringVal.string = (IggyUTF16*)text;
|
|
stringVal.length = (int)wcslen(text);
|
|
value[1].type = IGGY_DATATYPE_string_UTF16;
|
|
value[1].string16 = stringVal;
|
|
|
|
value[2].type = IGGY_DATATYPE_boolean;
|
|
value[2].boolval = bShow ? 1 : 0;
|
|
|
|
IggyPlayerCallMethodRS(getMovie(), &result, IggyPlayerRootPath(getMovie()), m_funcSetLineAndText, 3, value);
|
|
}
|
|
*/ |