|
@@ -128,13 +128,13 @@ void BaseNetworkContentDownloadStatusWin
|
|
|
SetDParam(2, this->downloaded_bytes * 100LL / this->total_bytes);
|
|
|
DrawString(r.left + 2, r.right - 2, y, STR_CONTENT_DOWNLOAD_PROGRESS_SIZE, TC_FROMSTRING, SA_HOR_CENTER);
|
|
|
|
|
|
StringID str;
|
|
|
if (this->downloaded_bytes == this->total_bytes) {
|
|
|
str = STR_CONTENT_DOWNLOAD_COMPLETE;
|
|
|
} else if (!StrEmpty(this->name)) {
|
|
|
} else if (!this->name.empty()) {
|
|
|
SetDParamStr(0, this->name);
|
|
|
SetDParam(1, this->downloaded_files);
|
|
|
SetDParam(2, this->total_files);
|
|
|
str = STR_CONTENT_DOWNLOAD_FILE;
|
|
|
} else {
|
|
|
str = STR_CONTENT_DOWNLOAD_INITIALISE;
|
|
@@ -144,13 +144,13 @@ void BaseNetworkContentDownloadStatusWin
|
|
|
DrawStringMultiLine(r.left + 2, r.right - 2, y, y + FONT_HEIGHT_NORMAL * 2, str, TC_FROMSTRING, SA_CENTER);
|
|
|
}
|
|
|
|
|
|
void BaseNetworkContentDownloadStatusWindow::OnDownloadProgress(const ContentInfo *ci, int bytes)
|
|
|
{
|
|
|
if (ci->id != this->cur_id) {
|
|
|
strecpy(this->name, ci->filename.c_str(), lastof(this->name));
|
|
|
this->name = ci->filename;
|
|
|
this->cur_id = ci->id;
|
|
|
this->downloaded_files++;
|
|
|
}
|
|
|
|
|
|
this->downloaded_bytes += bytes;
|
|
|
this->SetDirty();
|