diff --git a/glass/src/libnt/native/cpp/NetworkTablesSettings.cpp b/glass/src/libnt/native/cpp/NetworkTablesSettings.cpp index 23c22e90ab..2a603b6eae 100644 --- a/glass/src/libnt/native/cpp/NetworkTablesSettings.cpp +++ b/glass/src/libnt/native/cpp/NetworkTablesSettings.cpp @@ -110,7 +110,7 @@ void NetworkTablesSettings::Update() { bool NetworkTablesSettings::Display() { static const char* modeOptions[] = {"Disabled", "Client", "Server"}; - ImGui::Combo("Mode", m_pMode, modeOptions, 3); + ImGui::Combo("Mode", m_pMode, modeOptions, m_serverOption ? 3 : 2); switch (*m_pMode) { case 1: ImGui::InputText("Team/IP", m_pServerTeam); diff --git a/glass/src/libnt/native/include/glass/networktables/NetworkTablesSettings.h b/glass/src/libnt/native/include/glass/networktables/NetworkTablesSettings.h index 4736e6f4d0..7738541d79 100644 --- a/glass/src/libnt/native/include/glass/networktables/NetworkTablesSettings.h +++ b/glass/src/libnt/native/include/glass/networktables/NetworkTablesSettings.h @@ -22,11 +22,17 @@ class NetworkTablesSettings { NT_Inst inst = nt::GetDefaultInstance(), const char* storageName = "NetworkTables Settings"); + /** + * Enables or disables the server option. Default is enabled. + */ + void EnableServerOption(bool enable) { m_serverOption = enable; } + void Update(); bool Display(); private: bool m_restart = true; + bool m_serverOption = true; int* m_pMode; std::string* m_pIniName; std::string* m_pServerTeam;