Skip to content

Commit a22f947

Browse files
committed
Cleanup SimHUD, remove some unused methods
1 parent ebfbb3f commit a22f947

2 files changed

Lines changed: 10 additions & 47 deletions

File tree

Unreal/Plugins/AirSim/Source/SimHUD/SimHUD.cpp

Lines changed: 9 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -91,40 +91,6 @@ void ASimHUD::inputEventToggleTrace()
9191
simmode_->toggleTraceAll();
9292
}
9393

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();
126-
}
127-
12894
void ASimHUD::updateWidgetSubwindowVisibility()
12995
{
13096
for (int window_index = 0; window_index < AirSimSettings::kSubwindowCount; ++window_index) {
@@ -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+
159130
void ASimHUD::inputEventToggleSubwindow1()
160131
{
161-
getSubWindowSettings().at(1).visible = !getSubWindowSettings().at(1).visible;
162-
updateWidgetSubwindowVisibility();
132+
toggleSubwindowVisibility(1);
163133
}
164134

165135
void ASimHUD::inputEventToggleSubwindow2()
166136
{
167-
getSubWindowSettings().at(2).visible = !getSubWindowSettings().at(2).visible;
168-
updateWidgetSubwindowVisibility();
137+
toggleSubwindowVisibility(2);
169138
}
170139

171140
void ASimHUD::inputEventToggleAll()

Unreal/Plugins/AirSim/Source/SimHUD/SimHUD.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,6 @@ class AIRSIM_API ASimHUD : public AHUD
3434
void inputEventToggleSubwindow2();
3535
void inputEventToggleAll();
3636

37-
ImageType getSubwindowCameraType(int window_index);
38-
void setSubwindowCameraType(int window_index, ImageType type);
39-
APIPCamera* getSubwindowCamera(int window_index);
40-
void setSubwindowCamera(int window_index, APIPCamera* camera);
41-
bool getSubwindowVisible(int window_index);
42-
void setSubwindowVisible(int window_index, bool is_visible);
43-
4437
ASimHUD();
4538
virtual void BeginPlay() override;
4639
virtual void EndPlay(const EEndPlayReason::Type EndPlayReason) override;
@@ -51,6 +44,7 @@ class AIRSIM_API ASimHUD : public AHUD
5144
void toggleRecordHandler();
5245
void updateWidgetSubwindowVisibility();
5346
bool isWidgetSubwindowVisible(int window_index);
47+
void toggleSubwindowVisibility(int window_index);
5448

5549
private:
5650
void initializeSubWindows();

0 commit comments

Comments
 (0)