Add specific sysprop for accelerometer
This commit is contained in:
parent
949dc97e3a
commit
c5469c409a
6 changed files with 15 additions and 2 deletions
|
@ -130,6 +130,7 @@ enum SystemProperty {
|
|||
SYSPROP_HAS_IMAGE_BROWSER,
|
||||
SYSPROP_HAS_BACK_BUTTON,
|
||||
SYSPROP_HAS_KEYBOARD,
|
||||
SYSPROP_HAS_ACCELEROMETER, // Used to enable/disable tilt input settings
|
||||
SYSPROP_HAS_OPEN_DIRECTORY,
|
||||
SYSPROP_HAS_LOGIN_DIALOG,
|
||||
SYSPROP_HAS_TEXT_INPUT_DIALOG, // Indicates that System_InputBoxGetString is available.
|
||||
|
|
|
@ -584,6 +584,12 @@ bool System_GetPropertyBool(SystemProperty prop) {
|
|||
case SYSPROP_HAS_FOLDER_BROWSER:
|
||||
case SYSPROP_HAS_FILE_BROWSER:
|
||||
return true;
|
||||
#endif
|
||||
case SYSPROP_HAS_ACCELEROMETER:
|
||||
#if defined(MOBILE_DEVICE)
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
default:
|
||||
return false;
|
||||
|
|
|
@ -643,10 +643,10 @@ void GameSettingsScreen::CreateControlsSettings(UI::ViewGroup *controlsSettings)
|
|||
controlsSettings->Add(new CheckBox(&g_Config.bGamepadOnlyFocused, co->T("Ignore gamepads when not focused")));
|
||||
#endif
|
||||
|
||||
if (System_GetPropertyInt(SYSPROP_DEVICE_TYPE) == DEVICE_TYPE_MOBILE) {
|
||||
if (System_GetPropertyBool(SYSPROP_HAS_ACCELEROMETER)) {
|
||||
Choice *customizeTilt = controlsSettings->Add(new Choice(co->T("Tilt control setup")));
|
||||
customizeTilt->OnClick.Handle(this, &GameSettingsScreen::OnTiltCustomize);
|
||||
} else if (System_GetPropertyInt(SYSPROP_DEVICE_TYPE) == DEVICE_TYPE_VR) {
|
||||
} else if (System_GetPropertyInt(SYSPROP_DEVICE_TYPE) == DEVICE_TYPE_VR) { // TODO: This seems like a regression
|
||||
controlsSettings->Add(new CheckBox(&g_Config.bHapticFeedback, co->T("HapticFeedback", "Haptic Feedback (vibration)")));
|
||||
}
|
||||
|
||||
|
|
|
@ -416,6 +416,8 @@ bool System_GetPropertyBool(SystemProperty prop) {
|
|||
return true; // we just use the file browser
|
||||
case SYSPROP_HAS_BACK_BUTTON:
|
||||
return true;
|
||||
case SYSPROP_HAS_ACCELEROMETER:
|
||||
return IsMobile();
|
||||
case SYSPROP_APP_GOLD:
|
||||
#ifdef GOLD
|
||||
return true;
|
||||
|
|
|
@ -530,6 +530,8 @@ bool System_GetPropertyBool(SystemProperty prop) {
|
|||
}
|
||||
case SYSPROP_HAS_KEYBOARD:
|
||||
return deviceType != DEVICE_TYPE_VR;
|
||||
case SYSPROP_HAS_ACCELEROMETER:
|
||||
return deviceType == DEVICE_TYPE_MOBILE;
|
||||
#ifndef HTTPS_NOT_AVAILABLE
|
||||
case SYSPROP_SUPPORTS_HTTPS:
|
||||
return !g_Config.bDisableHTTPS;
|
||||
|
|
|
@ -160,6 +160,8 @@ bool System_GetPropertyBool(SystemProperty prop) {
|
|||
return false;
|
||||
case SYSPROP_HAS_BACK_BUTTON:
|
||||
return false;
|
||||
case SYSPROP_HAS_ACCELEROMETER:
|
||||
return true;
|
||||
case SYSPROP_APP_GOLD:
|
||||
#ifdef GOLD
|
||||
return true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue