@@ -37,8 +37,11 @@ protected override void CreateAttributes()
37
37
}
38
38
39
39
CreateVariable ( OpenVrVariable . FPS , "FPS" , "fps" ) ;
40
+ CreateVariable ( OpenVrVariable . HMDCharging , "HMD Charging" , "hmdcharging" ) ;
40
41
CreateVariable ( OpenVrVariable . HMDBattery , "HMD Battery (%)" , "hmdbattery" ) ;
42
+ CreateVariable ( OpenVrVariable . LeftControllerCharging , "Left Controller Charging" , "leftcontrollercharging" ) ;
41
43
CreateVariable ( OpenVrVariable . LeftControllerBattery , "Left Controller Battery (%)" , "leftcontrollerbattery" ) ;
44
+ CreateVariable ( OpenVrVariable . RightControllerCharging , "Right Controller Charging" , "rightcontrollercharging" ) ;
42
45
CreateVariable ( OpenVrVariable . RightControllerBattery , "Right Controller Battery (%)" , "rightcontrollerbattery" ) ;
43
46
CreateVariable ( OpenVrVariable . AverageTrackerBattery , "Average Tracker Battery (%)" , "averagetrackerbattery" ) ;
44
47
@@ -71,16 +74,22 @@ private void updateVariablesAndParameters()
71
74
}
72
75
73
76
SetVariableValue ( OpenVrVariable . FPS , OVRClient . System . FPS . ToString ( "##0" ) ) ;
77
+ SetVariableValue ( OpenVrVariable . HMDCharging , OVRClient . HMD . IsCharging ? "Charging" : "Uncharging" ) ;
74
78
SetVariableValue ( OpenVrVariable . HMDBattery , ( ( int ) ( OVRClient . HMD . BatteryPercentage * 100 ) ) . ToString ( "##0" ) ) ;
79
+ SetVariableValue ( OpenVrVariable . LeftControllerCharging , OVRClient . LeftController . IsCharging ? "Charging" : "Uncharging" ) ;
75
80
SetVariableValue ( OpenVrVariable . LeftControllerBattery , ( ( int ) ( OVRClient . LeftController . BatteryPercentage * 100 ) ) . ToString ( "##0" ) ) ;
81
+ SetVariableValue ( OpenVrVariable . RightControllerCharging , OVRClient . RightController . IsCharging ? "Charging" : "Uncharging" ) ;
76
82
SetVariableValue ( OpenVrVariable . RightControllerBattery , ( ( int ) ( OVRClient . RightController . BatteryPercentage * 100 ) ) . ToString ( "##0" ) ) ;
77
83
SetVariableValue ( OpenVrVariable . AverageTrackerBattery , ( ( int ) ( trackerBatteryAverage * 100 ) ) . ToString ( "##0" ) ) ;
78
84
}
79
85
else
80
86
{
81
87
SetVariableValue ( OpenVrVariable . FPS , "0" ) ;
88
+ SetVariableValue ( OpenVrVariable . HMDCharging , "Unknown" ) ;
82
89
SetVariableValue ( OpenVrVariable . HMDBattery , "0" ) ;
90
+ SetVariableValue ( OpenVrVariable . LeftControllerCharging , "Unknown" ) ;
83
91
SetVariableValue ( OpenVrVariable . LeftControllerBattery , "0" ) ;
92
+ SetVariableValue ( OpenVrVariable . RightControllerCharging , "Unknown" ) ;
84
93
SetVariableValue ( OpenVrVariable . RightControllerBattery , "0" ) ;
85
94
SetVariableValue ( OpenVrVariable . AverageTrackerBattery , "0" ) ;
86
95
@@ -220,6 +229,9 @@ private enum OpenVrVariable
220
229
HMDBattery ,
221
230
LeftControllerBattery ,
222
231
RightControllerBattery ,
223
- AverageTrackerBattery
232
+ AverageTrackerBattery ,
233
+ HMDCharging ,
234
+ LeftControllerCharging ,
235
+ RightControllerCharging
224
236
}
225
237
}
0 commit comments