fixing button crash
This commit is contained in:
@@ -66,6 +66,7 @@ void MainMenu::Render() {
|
|||||||
if (m_FileDialog.showFileDialog("WorldFileDialog", imgui_addons::ImGuiFileBrowser::DialogMode::OPEN, ImVec2(600, 300), ".tdmap")) {
|
if (m_FileDialog.showFileDialog("WorldFileDialog", imgui_addons::ImGuiFileBrowser::DialogMode::OPEN, ImVec2(600, 300), ".tdmap")) {
|
||||||
m_WorldFilePath = m_FileDialog.selected_path;
|
m_WorldFilePath = m_FileDialog.selected_path;
|
||||||
}
|
}
|
||||||
|
if (m_Server != nullptr) ImGui::BeginDisabled();
|
||||||
if (ImGui::Button("Créer")) {
|
if (ImGui::Button("Créer")) {
|
||||||
if (!StartServer()) {
|
if (!StartServer()) {
|
||||||
m_TriedToCreate = true;
|
m_TriedToCreate = true;
|
||||||
@@ -73,6 +74,7 @@ void MainMenu::Render() {
|
|||||||
GetClient()->Connect(td::network::Dns::Resolve("localhost"), m_ServerPort);
|
GetClient()->Connect(td::network::Dns::Resolve("localhost"), m_ServerPort);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (m_Server != nullptr) ImGui::EndDisabled();
|
||||||
if (m_TriedToCreate)
|
if (m_TriedToCreate)
|
||||||
ImGui::Text("Failed to launch server");
|
ImGui::Text("Failed to launch server");
|
||||||
ImGui::EndPopup();
|
ImGui::EndPopup();
|
||||||
|
|||||||
Reference in New Issue
Block a user