@@ -88,41 +88,7 @@ void ASimHUD::inputEventToggleHelp()
8888
8989void ASimHUD::inputEventToggleTrace ()
9090{
91- simmode_->getVehicleSimApi ()->toggleTrace ();
92- }
93-
94- ASimHUD::ImageType ASimHUD::getSubwindowCameraType (int window_index)
95- {
96- // TODO: index check
97- return getSubWindowSettings ().at (window_index).image_type ;
98- }
99-
100- void ASimHUD::setSubwindowCameraType (int window_index, ImageType type)
101- {
102- getSubWindowSettings ().at (window_index).image_type = type;
103- updateWidgetSubwindowVisibility ();
104- }
105-
106- APIPCamera* ASimHUD::getSubwindowCamera (int window_index)
107- {
108- return subwindow_cameras_[window_index]; // TODO: index check
109- }
110-
111- void ASimHUD::setSubwindowCamera (int window_index, APIPCamera* camera)
112- {
113- subwindow_cameras_[window_index] = camera; // TODO: index check
114- updateWidgetSubwindowVisibility ();
115- }
116-
117- bool ASimHUD::getSubwindowVisible (int window_index)
118- {
119- return getSubWindowSettings ().at (window_index).visible ;
120- }
121-
122- void ASimHUD::setSubwindowVisible (int window_index, bool is_visible)
123- {
124- getSubWindowSettings ().at (window_index).visible = is_visible;
125- updateWidgetSubwindowVisibility ();
91+ simmode_->toggleTraceAll ();
12692}
12793
12894void ASimHUD::updateWidgetSubwindowVisibility ()
@@ -135,7 +101,7 @@ void ASimHUD::updateWidgetSubwindowVisibility()
135101
136102 if (camera != nullptr ) {
137103 camera->setCameraTypeEnabled (camera_type, is_visible);
138- // sub-window captures don’ t count as a request, set bCaptureEveryFrame and bCaptureOnMovement to display so we can show correctly the subwindow
104+ // sub-window captures don' t count as a request, set bCaptureEveryFrame and bCaptureOnMovement to display so we can show correctly the subwindow
139105 camera->setCameraTypeUpdate (camera_type, false );
140106 }
141107
@@ -150,22 +116,25 @@ bool ASimHUD::isWidgetSubwindowVisible(int window_index)
150116 return widget_->getSubwindowVisibility (window_index) != 0 ;
151117}
152118
153- void ASimHUD::inputEventToggleSubwindow0 ( )
119+ void ASimHUD::toggleSubwindowVisibility ( int window_index )
154120{
155- getSubWindowSettings ().at (0 ).visible = !getSubWindowSettings ().at (0 ).visible ;
121+ getSubWindowSettings ().at (window_index ).visible = !getSubWindowSettings ().at (window_index ).visible ;
156122 updateWidgetSubwindowVisibility ();
157123}
158124
125+ void ASimHUD::inputEventToggleSubwindow0 ()
126+ {
127+ toggleSubwindowVisibility (0 );
128+ }
129+
159130void ASimHUD::inputEventToggleSubwindow1 ()
160131{
161- getSubWindowSettings ().at (1 ).visible = !getSubWindowSettings ().at (1 ).visible ;
162- updateWidgetSubwindowVisibility ();
132+ toggleSubwindowVisibility (1 );
163133}
164134
165135void ASimHUD::inputEventToggleSubwindow2 ()
166136{
167- getSubWindowSettings ().at (2 ).visible = !getSubWindowSettings ().at (2 ).visible ;
168- updateWidgetSubwindowVisibility ();
137+ toggleSubwindowVisibility (2 );
169138}
170139
171140void ASimHUD::inputEventToggleAll ()
0 commit comments