Skip to content

Commit e9a9f67

Browse files
AIRO-1841 Show "Disconnect" button on the hud if there's a connection error (#268)
1 parent 7d57917 commit e9a9f67

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

com.unity.robotics.ros-tcp-connector/Runtime/TcpConnector/ROSConnection.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,12 +1052,11 @@ void DrawHeaderGUI()
10521052
alignment = TextAnchor.MiddleLeft,
10531053
padding = new RectOffset(10, 0, 0, 5),
10541054
normal = { textColor = Color.white },
1055-
fixedWidth = 300
10561055
};
10571056

10581057

10591058
// ROS IP Setup
1060-
GUILayout.BeginHorizontal();
1059+
GUILayout.BeginHorizontal(GUILayout.Width(300));
10611060
DrawConnectionArrows(
10621061
true,
10631062
0,
@@ -1100,6 +1099,13 @@ void DrawHeaderGUI()
11001099
else
11011100
{
11021101
GUILayout.Label($"{RosIPAddress}:{RosPort}", contentStyle);
1102+
1103+
if (HasConnectionError)
1104+
{
1105+
if (GUI.Button(new Rect(250, 2, 50, 22), "Set IP"))
1106+
Disconnect();
1107+
}
1108+
11031109
GUILayout.EndHorizontal();
11041110
}
11051111
}

0 commit comments

Comments
 (0)