Reset button and calibrate height button for revive tab & bugfixes.
This commit is contained in:
@@ -599,7 +599,7 @@ MyStackViewPage {
|
||||
property double playerHeight: 0.0
|
||||
property double eyeHeight: 0.0
|
||||
dialogWidth: 600
|
||||
dialogHeight: 440
|
||||
dialogHeight: 480
|
||||
dialogTitle: "Personal Information"
|
||||
dialogContentItem: GridLayout {
|
||||
rowSpacing: 6
|
||||
@@ -742,6 +742,32 @@ MyStackViewPage {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
Item {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
MyPushButton {
|
||||
id: reviveCalibrateHeightButton
|
||||
Layout.preferredWidth: 230
|
||||
text: "Calibrate Height"
|
||||
onClicked: {
|
||||
var hmdHeight = ReviveTabController.getCurrentHMDHeight()
|
||||
revivePersonalInfoDialog.eyeHeight = hmdHeight.toFixed(2)
|
||||
pridEyeHeighInputField.text = revivePersonalInfoDialog.eyeHeight
|
||||
revivePersonalInfoDialog.playerHeight = (hmdHeight + 0.103).toFixed(2)
|
||||
pridPlayerHeighInputField.text = revivePersonalInfoDialog.playerHeight
|
||||
}
|
||||
}
|
||||
Item {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
function openPopup() {
|
||||
rpidUsername.text = ReviveTabController.piUsername
|
||||
@@ -764,12 +790,28 @@ MyStackViewPage {
|
||||
}
|
||||
}
|
||||
|
||||
MyPushButton {
|
||||
id: revivePersonalInfoButton
|
||||
Layout.preferredWidth: 300
|
||||
text: "Personal Information"
|
||||
onClicked: {
|
||||
revivePersonalInfoDialog.openPopup()
|
||||
|
||||
RowLayout {
|
||||
MyPushButton {
|
||||
id: revivePersonalInfoButton
|
||||
Layout.preferredWidth: 300
|
||||
text: "Personal Information"
|
||||
onClicked: {
|
||||
revivePersonalInfoDialog.openPopup()
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
MyPushButton {
|
||||
id: reviveResetButton
|
||||
Layout.preferredWidth: 200
|
||||
text: "Reset"
|
||||
onClicked: {
|
||||
ReviveTabController.reset()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace advsettings {
|
||||
if (vrSettingsError != vr::VRSettingsError_None) {
|
||||
LOG(WARNING) << "Could not read \"revive::" << key_pixelsPerDisplayPixel << "\" setting: " << vr::VRSettings()->GetSettingsErrorNameFromEnum(vrSettingsError);
|
||||
} else {
|
||||
if (m_pixelsPerDisplayPixelOverride == 0.0) {
|
||||
if (valuef == 0.0) {
|
||||
m_pixelsPerDisplayPixelOverrideEnabled = false;
|
||||
m_pixelsPerDisplayPixelOverride = 1.0;
|
||||
} else {
|
||||
@@ -165,6 +165,7 @@ namespace advsettings {
|
||||
if (valuef == 0.0) {
|
||||
setPixelsPerDisplayPixelOverrideEnabled(false);
|
||||
} else {
|
||||
setPixelsPerDisplayPixelOverrideEnabled(true);
|
||||
setPixelsPerDisplayPixelOverride(valuef);
|
||||
}
|
||||
}
|
||||
@@ -582,4 +583,75 @@ namespace advsettings {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ReviveTabController::reset() {
|
||||
vr::EVRSettingsError vrSettingsError;
|
||||
|
||||
vr::VRSettings()->RemoveKeyInSection(section_revive, key_pixelsPerDisplayPixel, &vrSettingsError);
|
||||
if (vrSettingsError != vr::VRSettingsError_None) {
|
||||
LOG(WARNING) << "Could not remove \"revive::" << key_pixelsPerDisplayPixel << "\" setting: " << vr::VRSettings()->GetSettingsErrorNameFromEnum(vrSettingsError);
|
||||
}
|
||||
|
||||
vr::VRSettings()->RemoveKeyInSection(section_revive, key_toggleGrip, &vrSettingsError);
|
||||
if (vrSettingsError != vr::VRSettingsError_None) {
|
||||
LOG(WARNING) << "Could not remove \"revive::" << key_toggleGrip << "\" setting: " << vr::VRSettings()->GetSettingsErrorNameFromEnum(vrSettingsError);
|
||||
}
|
||||
|
||||
vr::VRSettings()->RemoveKeyInSection(section_revive, key_thumbDeadzone, &vrSettingsError);
|
||||
if (vrSettingsError != vr::VRSettingsError_None) {
|
||||
LOG(WARNING) << "Could not remove \"revive::" << key_thumbDeadzone << "\" setting: " << vr::VRSettings()->GetSettingsErrorNameFromEnum(vrSettingsError);
|
||||
}
|
||||
|
||||
vr::VRSettings()->RemoveKeyInSection(section_revive, key_thumbSensitivity, &vrSettingsError);
|
||||
if (vrSettingsError != vr::VRSettingsError_None) {
|
||||
LOG(WARNING) << "Could not remove \"revive::" << key_thumbSensitivity << "\" setting: " << vr::VRSettings()->GetSettingsErrorNameFromEnum(vrSettingsError);
|
||||
}
|
||||
|
||||
vr::VRSettings()->RemoveKeyInSection(section_revive, key_touchPitch, &vrSettingsError);
|
||||
if (vrSettingsError != vr::VRSettingsError_None) {
|
||||
LOG(WARNING) << "Could not remove \"revive::" << key_touchPitch << "\" setting: " << vr::VRSettings()->GetSettingsErrorNameFromEnum(vrSettingsError);
|
||||
}
|
||||
|
||||
vr::VRSettings()->RemoveKeyInSection(section_revive, key_touchYaw, &vrSettingsError);
|
||||
if (vrSettingsError != vr::VRSettingsError_None) {
|
||||
LOG(WARNING) << "Could not remove \"revive::" << key_touchYaw << "\" setting: " << vr::VRSettings()->GetSettingsErrorNameFromEnum(vrSettingsError);
|
||||
}
|
||||
|
||||
vr::VRSettings()->RemoveKeyInSection(section_revive, key_touchRoll, &vrSettingsError);
|
||||
if (vrSettingsError != vr::VRSettingsError_None) {
|
||||
LOG(WARNING) << "Could not remove \"revive::" << key_touchRoll << "\" setting: " << vr::VRSettings()->GetSettingsErrorNameFromEnum(vrSettingsError);
|
||||
}
|
||||
|
||||
vr::VRSettings()->RemoveKeyInSection(section_revive, key_touchX, &vrSettingsError);
|
||||
if (vrSettingsError != vr::VRSettingsError_None) {
|
||||
LOG(WARNING) << "Could not remove \"revive::" << key_touchX << "\" setting: " << vr::VRSettings()->GetSettingsErrorNameFromEnum(vrSettingsError);
|
||||
}
|
||||
|
||||
vr::VRSettings()->RemoveKeyInSection(section_revive, key_touchY, &vrSettingsError);
|
||||
if (vrSettingsError != vr::VRSettingsError_None) {
|
||||
LOG(WARNING) << "Could not remove \"revive::" << key_touchY << "\" setting: " << vr::VRSettings()->GetSettingsErrorNameFromEnum(vrSettingsError);
|
||||
}
|
||||
|
||||
vr::VRSettings()->RemoveKeyInSection(section_revive, key_touchZ, &vrSettingsError);
|
||||
if (vrSettingsError != vr::VRSettingsError_None) {
|
||||
LOG(WARNING) << "Could not remove \"revive::" << key_touchZ << "\" setting: " << vr::VRSettings()->GetSettingsErrorNameFromEnum(vrSettingsError);
|
||||
}
|
||||
|
||||
vr::VRSettings()->Sync();
|
||||
settingsUpdateCounter = 999; // Easiest way to get default values
|
||||
}
|
||||
|
||||
float ReviveTabController::getCurrentHMDHeight() {
|
||||
float hmdHeight = 0.0f;
|
||||
vr::TrackedDevicePose_t devicePoses[vr::k_unMaxTrackedDeviceCount];
|
||||
vr::VRSystem()->GetDeviceToAbsoluteTrackingPose(vr::TrackingUniverseStanding, 0.0f, devicePoses, vr::k_unMaxTrackedDeviceCount);
|
||||
vr::TrackedDevicePose_t& hmdPose = devicePoses[vr::k_unTrackedDeviceIndex_Hmd];
|
||||
if (hmdPose.eTrackingResult == vr::TrackingResult_Running_OK) {
|
||||
hmdHeight = hmdPose.mDeviceToAbsoluteTracking.m[1][3];
|
||||
} else {
|
||||
LOG(WARNING) << "Error while getting HMD pose: Tracking result (" << hmdPose.eTrackingResult << ") is not TrackingResult_Running_OK";
|
||||
}
|
||||
return hmdHeight;
|
||||
}
|
||||
|
||||
} // namespace advconfig
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace advsettings {
|
||||
bool m_isOverlayInstalled = false;
|
||||
int m_gripButtonMode = 0;
|
||||
bool m_pixelsPerDisplayPixelOverrideEnabled = false;
|
||||
float m_pixelsPerDisplayPixelOverride = 1.0;
|
||||
float m_pixelsPerDisplayPixelOverride = 1.0f;
|
||||
float m_thumbDeadzone = 0.3f;
|
||||
float m_thumbRange = 2.0f;
|
||||
float m_touchPitch = -28.0f;
|
||||
@@ -85,6 +85,8 @@ namespace advsettings {
|
||||
const QString& piName() const;
|
||||
int piGender() const; // 0 .. Unknown, 1 .. Male, 2 .. Female
|
||||
|
||||
Q_INVOKABLE float getCurrentHMDHeight();
|
||||
|
||||
public slots:
|
||||
void setGripButtonMode(int value, bool notify = true);
|
||||
|
||||
@@ -107,6 +109,8 @@ namespace advsettings {
|
||||
void setPiName(const QString& value, bool notify = true);
|
||||
void setPiGender(int value, bool notify = true); // 0 .. Unknown, 1 .. Male, 2 .. Female
|
||||
|
||||
void reset();
|
||||
|
||||
signals:
|
||||
void isOverlayInstalledChanged(bool value);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user