Skip to content

Commit

Permalink
Store: remove the broken download speed indicator.
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed Jan 30, 2024
1 parent 954d40d commit cfadc39
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions UI/Store.cpp
Expand Up @@ -280,7 +280,6 @@ class ProductView : public UI::LinearLayout {
UI::Button *installButton_ = nullptr;
UI::Button *launchButton_ = nullptr;
UI::Button *cancelButton_ = nullptr;
UI::TextView *speedView_ = nullptr;
bool wasInstalled_ = false;
};

Expand All @@ -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_);
Expand Down Expand Up @@ -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);
Expand All @@ -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;
Expand Down

0 comments on commit cfadc39

Please sign in to comment.