refactor: format project

This commit is contained in:
2021-11-21 17:02:42 +01:00
parent 0f328e6f81
commit f48af51dc7
36 changed files with 162 additions and 162 deletions

View File

@@ -20,18 +20,18 @@ void UpdateMenu::render() {
bool updateAvailable = m_UpdateAvailable.get();
if (updateAvailable) {
if(m_Updater.isFileWrited()){
if (m_Updater.isFileWrited()) {
ImGui::Text("The update is now installed");
ImGui::Text("The game needs to be restarted");
}else if (m_Updater.isDownloadComplete()) {
} else if (m_Updater.isDownloadComplete()) {
ImGui::Text("Download done!");
if(ImGui::Button("Install")){
if(!m_Updater.writeFile()){
if (ImGui::Button("Install")) {
if (!m_Updater.writeFile()) {
m_Error = "Failed to write file !\n";
ImGui::OpenPopup("UpdateError");
}
}
if(ImGui::Button("Cancel")){
if (ImGui::Button("Cancel")) {
m_Updater.cancelDownload();
m_Updater.clearCache();
}
@@ -50,13 +50,13 @@ void UpdateMenu::render() {
bool canDownloadFile = m_Updater.canUpdate();
if(!canDownloadFile) ImGui::BeginDisabled();
if (!canDownloadFile) ImGui::BeginDisabled();
if (ImGui::Button("Download")) {
m_Updater.downloadUpdate();
}
if(!canDownloadFile) ImGui::EndDisabled();
if (!canDownloadFile) ImGui::EndDisabled();
ImGui::SameLine();
if (ImGui::Button("Cancel")) {
@@ -77,8 +77,8 @@ void UpdateMenu::render() {
}
}
void UpdateMenu::renderErrorPopup(){
if(ImGui::BeginPopup("UpdateError")){
void UpdateMenu::renderErrorPopup() {
if (ImGui::BeginPopup("UpdateError")) {
ImGui::Text("Error : %s", m_Error.c_str());
ImGui::EndPopup();
}