1
0
mirror of synced 2024-11-28 17:40:51 +01:00

fix: Disable IP and Port fields when TCP Client/Server are connected

This commit is contained in:
WerWolv 2023-11-05 00:10:59 +01:00
parent c9a728c318
commit d6ba41c2d9

View File

@ -1906,6 +1906,9 @@ namespace hex::plugin::builtin {
static std::mutex receiverMutex; static std::mutex receiverMutex;
ImGui::Header("hex.builtin.tools.tcp_client_server.settings"_lang, true); ImGui::Header("hex.builtin.tools.tcp_client_server.settings"_lang, true);
ImGui::BeginDisabled(client.isConnected());
{
ImGui::PushItemWidth(ImGui::GetContentRegionAvail().x * 0.3F); ImGui::PushItemWidth(ImGui::GetContentRegionAvail().x * 0.3F);
ImGui::InputText("##ipAddress", ipAddress); ImGui::InputText("##ipAddress", ipAddress);
ImGui::PopItemWidth(); ImGui::PopItemWidth();
@ -1915,6 +1918,9 @@ namespace hex::plugin::builtin {
ImGui::PushItemWidth(ImGui::GetContentRegionAvail().x * 0.2F); ImGui::PushItemWidth(ImGui::GetContentRegionAvail().x * 0.2F);
ImGui::InputInt("##port", &port, 0, 0); ImGui::InputInt("##port", &port, 0, 0);
ImGui::PopItemWidth(); ImGui::PopItemWidth();
}
ImGui::EndDisabled();
ImGui::SameLine(); ImGui::SameLine();
ImGui::PushItemWidth(ImGui::GetContentRegionAvail().x * 0.2F); ImGui::PushItemWidth(ImGui::GetContentRegionAvail().x * 0.2F);
@ -1991,9 +1997,13 @@ namespace hex::plugin::builtin {
ImGui::Header("hex.builtin.tools.tcp_client_server.settings"_lang, true); ImGui::Header("hex.builtin.tools.tcp_client_server.settings"_lang, true);
ImGui::BeginDisabled(server.isActive());
{
ImGui::PushItemWidth(ImGui::GetContentRegionAvail().x * 0.2F); ImGui::PushItemWidth(ImGui::GetContentRegionAvail().x * 0.2F);
ImGui::InputInt("##port", &port, 0, 0); ImGui::InputInt("##port", &port, 0, 0);
ImGui::PopItemWidth(); ImGui::PopItemWidth();
}
ImGui::EndDisabled();
ImGui::SameLine(); ImGui::SameLine();