mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-28 02:11:43 +00:00
[glass] NetworkTablesSetting: Allow disable of server option (#3227)
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user