Window for showing the download status of content. More...
Public Member Functions | |
NetworkContentDownloadStatusWindow () | |
Create a new download window based on a list of content information with flags whether to download them or not. | |
~NetworkContentDownloadStatusWindow () | |
Free whatever we've allocated. | |
virtual void | DrawWidget (const Rect &r, int widget) const |
Draw the contents of a nested widget. | |
virtual void | OnClick (Point pt, int widget, int click_count) |
A click with the left mouse button has been made on the window. | |
virtual void | OnDownloadProgress (const ContentInfo *ci, int bytes) |
We have progress in the download of a file. | |
Private Attributes | |
ClientNetworkContentSocketHandler * | connection |
Our connection with the content server. | |
SmallVector< ContentType, 4 > | receivedTypes |
Types we received so we can update their cache. | |
uint | total_files |
Number of files to download. | |
uint | downloaded_files |
Number of files downloaded. | |
uint | total_bytes |
Number of bytes to download. | |
uint | downloaded_bytes |
Number of bytes downloaded. | |
uint32 | cur_id |
The current ID of the downloaded file. | |
char | name [48] |
The current name of the downloaded file. |
Window for showing the download status of content.
Definition at line 57 of file network_content_gui.cpp.
virtual void NetworkContentDownloadStatusWindow::DrawWidget | ( | const Rect & | r, | |
int | widget | |||
) | const [inline, virtual] |
Draw the contents of a nested widget.
r | Rectangle occupied by the widget. | |
widget | Number of the widget to draw. |
Reimplemented from Window.
Definition at line 140 of file network_content_gui.cpp.
References downloaded_bytes, downloaded_files, DrawFrameRect(), DrawString(), DrawStringMultiLine(), FONT_HEIGHT_NORMAL, name, NCDSWW_BACKGROUND, SA_CENTER, SA_HOR_CENTER, SetDParam(), SetDParamStr(), StrEmpty(), total_bytes, and total_files.
virtual void NetworkContentDownloadStatusWindow::OnClick | ( | Point | pt, | |
int | widget, | |||
int | click_count | |||
) | [inline, virtual] |
A click with the left mouse button has been made on the window.
pt | the point inside the window that has been clicked. | |
widget | the clicked widget. | |
click_count | Number of fast consecutive clicks at same position |
Reimplemented from Window.
Definition at line 169 of file network_content_gui.cpp.
References _network_content_client, ClientNetworkContentSocketHandler::Close(), downloaded_bytes, NCDSWW_CANCELOK, and total_bytes.
virtual void NetworkContentDownloadStatusWindow::OnDownloadProgress | ( | const ContentInfo * | ci, | |
int | bytes | |||
) | [inline, virtual] |
We have progress in the download of a file.
ci | the content info of the file | |
bytes | the number of bytes downloaded since the previous call |
Reimplemented from ContentCallback.
Definition at line 177 of file network_content_gui.cpp.
References cur_id, downloaded_bytes, downloaded_files, ContentInfo::filename, ContentInfo::id, SmallVector< T, S >::Include(), lastof, name, NCDSWW_CANCELOK, receivedTypes, Window::SetDirty(), strecpy(), total_bytes, and ContentInfo::type.