Skip to content

Commit

Permalink
Ability to show password in connnect window
Browse files Browse the repository at this point in the history
  • Loading branch information
kaczy93 committed Oct 22, 2023
1 parent 166a75d commit fea9505
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions CentrED/UI/UIFunctions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ private void DrawMainMenu() {
private int _connectPort = 2597;
private string _connectUsername = "admin";
private string _connectPassword = "admin";
private bool _connectButtonDisabled = false;
private bool _connectShowPassword;
private bool _connectButtonDisabled;
private Vector4 _connectInfoColor = Blue;
private string _connectInfo = "";

Expand All @@ -82,7 +83,11 @@ private void DrawConnectWindow() {
ImGui.InputText("Host", ref _connectHostname, ConnectWindowTextInputLength);
ImGui.InputInt("Port", ref _connectPort);
ImGui.InputText("Username", ref _connectUsername, ConnectWindowTextInputLength);
ImGui.InputText("Password", ref _connectPassword, ConnectWindowTextInputLength, ImGuiInputTextFlags.Password);
ImGui.InputText("Password", ref _connectPassword, ConnectWindowTextInputLength, _connectShowPassword ? ImGuiInputTextFlags.None : ImGuiInputTextFlags.Password);
ImGui.SameLine();
if (ImGui.Button(_connectShowPassword? "Hide" : "Show")) {
_connectShowPassword = !_connectShowPassword;
}
ImGui.TextColored(_connectInfoColor, _connectInfo);
ImGui.BeginDisabled(
_connectHostname.Length == 0 || _connectPassword.Length == 0 || _connectUsername.Length == 0 || _connectButtonDisabled);
Expand Down

0 comments on commit fea9505

Please sign in to comment.