From cfadc397f5e6a99de5dbc89f95c7d1d3feb32f7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Tue, 30 Jan 2024 14:50:55 +0100 Subject: [PATCH] Store: remove the broken download speed indicator. --- UI/Store.cpp | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/UI/Store.cpp b/UI/Store.cpp index 113228ae4d..592ae739dc 100644 --- a/UI/Store.cpp +++ b/UI/Store.cpp @@ -280,7 +280,6 @@ private: UI::Button *installButton_ = nullptr; UI::Button *launchButton_ = nullptr; UI::Button *cancelButton_ = nullptr; - UI::TextView *speedView_ = nullptr; bool wasInstalled_ = false; }; @@ -305,12 +304,9 @@ void ProductView::CreateViews() { installButton_->OnClick.Handle(this, &ProductView::OnInstall); uninstallButton_ = nullptr; - speedView_ = progressDisplay->Add(new TextView("")); - speedView_->SetVisibility(isDownloading ? V_VISIBLE : V_GONE); Add(progressDisplay); } else { installButton_ = nullptr; - speedView_ = nullptr; launchButton_ = new Button(st->T("Launch Game")); launchButton_->OnClick.Handle(this, &ProductView::OnLaunchClick); Add(launchButton_); @@ -349,16 +345,9 @@ void ProductView::Update() { if (uninstallButton_) { uninstallButton_->SetEnabled(g_GameManager.GetState() == GameManagerState::IDLE); } - if (g_GameManager.GetState() == GameManagerState::DOWNLOADING) { - if (speedView_) { - float speed = g_GameManager.DownloadSpeedKBps(); - speedView_->SetText(StringFromFormat("%0.1f KB/s", speed)); - } - } else { + if (g_GameManager.GetState() != GameManagerState::DOWNLOADING) { if (cancelButton_) cancelButton_->SetVisibility(UI::V_GONE); - if (speedView_) - speedView_->SetVisibility(UI::V_GONE); } if (launchButton_) launchButton_->SetEnabled(g_GameManager.GetState() == GameManagerState::IDLE); @@ -383,10 +372,6 @@ UI::EventReturn ProductView::OnInstall(UI::EventParams &e) { if (cancelButton_) { cancelButton_->SetVisibility(UI::V_VISIBLE); } - if (speedView_) { - speedView_->SetVisibility(UI::V_VISIBLE); - speedView_->SetText(""); - } INFO_LOG(SYSTEM, "Triggering install of '%s'", fileUrl.c_str()); g_GameManager.DownloadAndInstall(fileUrl); return UI::EVENT_DONE;