Skip to content

Commit

Permalink
Switch to centimeters for height and arm span
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoco007 committed Oct 1, 2024
1 parent 9ade974 commit 0872296
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 20 deletions.
25 changes: 6 additions & 19 deletions Source/CustomAvatar/UI/GeneralSettingsHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -240,11 +240,6 @@ private string ResizeModeFormatter(object value)
};
}

private string MillimeterFormatter(object value)
{
return $"{(float)value * 100:0.#} cm";
}

private string FloorHeightAdjustFormatter(object value)
{
if (value is not FloorHeightAdjustMode floorHeightAdjustMode)
Expand All @@ -261,28 +256,20 @@ private string FloorHeightAdjustFormatter(object value)
};
}

private string HeightFormatter(float value)
private string CentimeterFormatter(float value)
{
return $"{value + BeatSaberUtilities.kHeadPosToPlayerHeightOffset:0.00} m";
return $"{value * 100:0.#} cm";
}

private string HeightFormatter(float value) => CentimeterFormatter(value + BeatSaberUtilities.kHeadPosToPlayerHeightOffset);

private string ArmSpanFormatter(float value) => _armSpanMeasurer.isMeasuring ? $"Measuring... {CentimeterFormatter(value)}" : CentimeterFormatter(value);

private void OnMeasureHeightButtonClicked()
{
this.height = _trackingRig.eyeHeight;
}

private string ArmSpanFormatter(float value)
{
if (_armSpanMeasurer.isMeasuring)
{
return $"Measuring... {value:0.00} m";
}
else
{
return $"{value:0.00} m";
}
}

private void OnMeasureArmSpanButtonClicked()
{
if (_armSpanMeasurer.isMeasuring)
Expand Down
2 changes: 1 addition & 1 deletion Source/CustomAvatar/UI/Views/Settings.bsml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

<toggle-setting value="moveFloorWithRoomAdjust" bind-value="true" apply-on-change="true" text="Move Floor with Room Adjust" hover-hint="Move the floor/environment along with the game's built-in vertical room adjust." />
<toggle-setting value="enableLocomotion" bind-value="true" apply-on-change="true" text="Enable locomotion" hover-hint="Allow feet and waist to be moved automatically to follow your head/body when not using dedicated trackers. Only affects full body avatars." />
<list-setting value="cameraNearClipPlane" bind-value="true" apply-on-change="true" text="Camera Near Clip Plane" hover-hint="Distance from your eyes at which objets start being visible." options="nearClipPlaneValues" formatter="MillimeterFormatter" />
<list-setting value="cameraNearClipPlane" bind-value="true" apply-on-change="true" text="Camera Near Clip Plane" hover-hint="Distance from your eyes at which objets start being visible." options="nearClipPlaneValues" formatter="CentimeterFormatter" />
</macro.as-host>

<horizontal pref-width="90" pad-top="2">
Expand Down

0 comments on commit 0872296

Please sign in to comment.