SaveTool: improve readability.

This commit is contained in:
Guillaume Jacquemin 2021-07-10 16:46:45 +02:00
parent ed25f7f5fa
commit 476eb2b1e6

View file

@ -161,8 +161,10 @@ auto SaveTool::drawRenamePopup(Containers::ArrayView<char> name_view) -> bool {
ImGuiInputTextFlags_CallbackCharFilter, ImGuiInputTextFlags_CallbackCharFilter,
callback, nullptr); callback, nullptr);
ImGui::SameLine(); ImGui::SameLine();
if((!_unsafeMode && _mbManager->gameState() != GameState::NotRunning) || GameState game_state = _mbManager->gameState();
!(len >= 6 && len <= 32) || !(name_view[0] != ' ' && name_view[len - 1] != ' ')) if((!_unsafeMode && game_state != GameState::NotRunning) ||
!(len >= 6 && len <= 32) ||
!(name_view[0] != ' ' && name_view[len - 1] != ' '))
{ {
ImGui::PushItemFlag(ImGuiItemFlags_Disabled, true); ImGui::PushItemFlag(ImGuiItemFlags_Disabled, true);
ImGui::PushStyleVar(ImGuiStyleVar_Alpha, 0.5f); ImGui::PushStyleVar(ImGuiStyleVar_Alpha, 0.5f);
@ -173,8 +175,9 @@ auto SaveTool::drawRenamePopup(Containers::ArrayView<char> name_view) -> bool {
ImGui::CloseCurrentPopup(); ImGui::CloseCurrentPopup();
} }
if((!_unsafeMode && _mbManager->gameState() != GameState::NotRunning) || if((!_unsafeMode && game_state != GameState::NotRunning) ||
!(len >= 6 && len <= 32) || !(name_view[0] != ' ' && name_view[len - 1] != ' ')) !(len >= 6 && len <= 32) ||
!(name_view[0] != ' ' && name_view[len - 1] != ' '))
{ {
ImGui::PopItemFlag(); ImGui::PopItemFlag();
ImGui::PopStyleVar(); ImGui::PopStyleVar();