bastd.ui.settings.vrtesting

Provides UI for testing vr settings.

 1# Released under the MIT License. See LICENSE for details.
 2#
 3"""Provides UI for testing vr settings."""
 4
 5from __future__ import annotations
 6
 7from typing import TYPE_CHECKING
 8
 9import ba
10from bastd.ui.settings.testing import TestingWindow
11
12if TYPE_CHECKING:
13    from typing import Any
14
15
16class VRTestingWindow(TestingWindow):
17    """Window for testing vr settings."""
18
19    def __init__(self, transition: str = 'in_right'):
20
21        entries: list[dict[str, Any]] = []
22        app = ba.app
23        # these are gear-vr only
24        if app.platform == 'android' and app.subplatform == 'oculus':
25            entries += [
26                {
27                    'name': 'timeWarpDebug',
28                    'label': 'Time Warp Debug',
29                    'increment': 1.0
30                },
31                {
32                    'name': 'chromaticAberrationCorrection',
33                    'label': 'Chromatic Aberration Correction',
34                    'increment': 1.0
35                },
36                {
37                    'name': 'vrMinimumVSyncs',
38                    'label': 'Minimum Vsyncs',
39                    'increment': 1.0
40                },
41                # {'name':'eyeOffsX','label':'Eye IPD','increment':0.001}
42            ]
43        # cardboard/gearvr get eye offset controls..
44        # if app.platform == 'android':
45        #     entries += [
46        #         {'name':'eyeOffsY','label':'Eye Offset Y','increment':0.01},
47        #         {'name':'eyeOffsZ','label':'Eye Offset Z','increment':0.005}]
48        # everyone gets head-scale
49        entries += [{
50            'name': 'headScale',
51            'label': 'Head Scale',
52            'increment': 1.0
53        }]
54        # and everyone gets all these..
55        entries += [
56            {
57                'name': 'vrCamOffsetY',
58                'label': 'In-Game Cam Offset Y',
59                'increment': 0.1
60            },
61            {
62                'name': 'vrCamOffsetZ',
63                'label': 'In-Game Cam Offset Z',
64                'increment': 0.1
65            },
66            {
67                'name': 'vrOverlayScale',
68                'label': 'Overlay Scale',
69                'increment': 0.025
70            },
71            {
72                'name': 'allowCameraMovement',
73                'label': 'Allow Camera Movement',
74                'increment': 1.0
75            },
76            {
77                'name': 'cameraPanSpeedScale',
78                'label': 'Camera Movement Speed',
79                'increment': 0.1
80            },
81            {
82                'name': 'showOverlayBounds',
83                'label': 'Show Overlay Bounds',
84                'increment': 1
85            },
86        ]
87
88        super().__init__(
89            ba.Lstr(resource='settingsWindowAdvanced.vrTestingText'), entries,
90            transition)
class VRTestingWindow(bastd.ui.settings.testing.TestingWindow):
17class VRTestingWindow(TestingWindow):
18    """Window for testing vr settings."""
19
20    def __init__(self, transition: str = 'in_right'):
21
22        entries: list[dict[str, Any]] = []
23        app = ba.app
24        # these are gear-vr only
25        if app.platform == 'android' and app.subplatform == 'oculus':
26            entries += [
27                {
28                    'name': 'timeWarpDebug',
29                    'label': 'Time Warp Debug',
30                    'increment': 1.0
31                },
32                {
33                    'name': 'chromaticAberrationCorrection',
34                    'label': 'Chromatic Aberration Correction',
35                    'increment': 1.0
36                },
37                {
38                    'name': 'vrMinimumVSyncs',
39                    'label': 'Minimum Vsyncs',
40                    'increment': 1.0
41                },
42                # {'name':'eyeOffsX','label':'Eye IPD','increment':0.001}
43            ]
44        # cardboard/gearvr get eye offset controls..
45        # if app.platform == 'android':
46        #     entries += [
47        #         {'name':'eyeOffsY','label':'Eye Offset Y','increment':0.01},
48        #         {'name':'eyeOffsZ','label':'Eye Offset Z','increment':0.005}]
49        # everyone gets head-scale
50        entries += [{
51            'name': 'headScale',
52            'label': 'Head Scale',
53            'increment': 1.0
54        }]
55        # and everyone gets all these..
56        entries += [
57            {
58                'name': 'vrCamOffsetY',
59                'label': 'In-Game Cam Offset Y',
60                'increment': 0.1
61            },
62            {
63                'name': 'vrCamOffsetZ',
64                'label': 'In-Game Cam Offset Z',
65                'increment': 0.1
66            },
67            {
68                'name': 'vrOverlayScale',
69                'label': 'Overlay Scale',
70                'increment': 0.025
71            },
72            {
73                'name': 'allowCameraMovement',
74                'label': 'Allow Camera Movement',
75                'increment': 1.0
76            },
77            {
78                'name': 'cameraPanSpeedScale',
79                'label': 'Camera Movement Speed',
80                'increment': 0.1
81            },
82            {
83                'name': 'showOverlayBounds',
84                'label': 'Show Overlay Bounds',
85                'increment': 1
86            },
87        ]
88
89        super().__init__(
90            ba.Lstr(resource='settingsWindowAdvanced.vrTestingText'), entries,
91            transition)

Window for testing vr settings.

VRTestingWindow(transition: str = 'in_right')
20    def __init__(self, transition: str = 'in_right'):
21
22        entries: list[dict[str, Any]] = []
23        app = ba.app
24        # these are gear-vr only
25        if app.platform == 'android' and app.subplatform == 'oculus':
26            entries += [
27                {
28                    'name': 'timeWarpDebug',
29                    'label': 'Time Warp Debug',
30                    'increment': 1.0
31                },
32                {
33                    'name': 'chromaticAberrationCorrection',
34                    'label': 'Chromatic Aberration Correction',
35                    'increment': 1.0
36                },
37                {
38                    'name': 'vrMinimumVSyncs',
39                    'label': 'Minimum Vsyncs',
40                    'increment': 1.0
41                },
42                # {'name':'eyeOffsX','label':'Eye IPD','increment':0.001}
43            ]
44        # cardboard/gearvr get eye offset controls..
45        # if app.platform == 'android':
46        #     entries += [
47        #         {'name':'eyeOffsY','label':'Eye Offset Y','increment':0.01},
48        #         {'name':'eyeOffsZ','label':'Eye Offset Z','increment':0.005}]
49        # everyone gets head-scale
50        entries += [{
51            'name': 'headScale',
52            'label': 'Head Scale',
53            'increment': 1.0
54        }]
55        # and everyone gets all these..
56        entries += [
57            {
58                'name': 'vrCamOffsetY',
59                'label': 'In-Game Cam Offset Y',
60                'increment': 0.1
61            },
62            {
63                'name': 'vrCamOffsetZ',
64                'label': 'In-Game Cam Offset Z',
65                'increment': 0.1
66            },
67            {
68                'name': 'vrOverlayScale',
69                'label': 'Overlay Scale',
70                'increment': 0.025
71            },
72            {
73                'name': 'allowCameraMovement',
74                'label': 'Allow Camera Movement',
75                'increment': 1.0
76            },
77            {
78                'name': 'cameraPanSpeedScale',
79                'label': 'Camera Movement Speed',
80                'increment': 0.1
81            },
82            {
83                'name': 'showOverlayBounds',
84                'label': 'Show Overlay Bounds',
85                'increment': 1
86            },
87        ]
88
89        super().__init__(
90            ba.Lstr(resource='settingsWindowAdvanced.vrTestingText'), entries,
91            transition)
Inherited Members
ba.ui.Window
get_root_widget