OpenTTD
Data Structures | Enumerations | Functions | Variables
network_content_gui.cpp File Reference

Implementation of the Network Content related GUIs. More...

#include "../stdafx.h"
#include "../strings_func.h"
#include "../gfx_func.h"
#include "../window_func.h"
#include "../error.h"
#include "../ai/ai.hpp"
#include "../game/game.hpp"
#include "../base_media_base.h"
#include "../sortlist_type.h"
#include "../stringfilter_type.h"
#include "../querystring_gui.h"
#include "../core/geometry_func.hpp"
#include "../textfile_gui.h"
#include "network_content_gui.h"
#include "table/strings.h"
#include "../table/sprites.h"
#include <bitset>
#include "../safeguards.h"

Go to the source code of this file.

Data Structures

struct  ContentTextfileWindow
 Window for displaying the textfile of an item in the content list. More...
 
struct  NetworkContentDownloadStatusWindow
 Window for showing the download status of content. More...
 
struct  ContentListFilterData
 Filter data for NetworkContentListWindow. More...
 
class  NetworkContentListWindow
 Window that lists the content that's at the content server. More...
 

Enumerations

enum  ContentListFilterCriteria { CONTENT_FILTER_TEXT = 0, CONTENT_FILTER_TYPE_OR_SELECTED }
 Filter criterias for NetworkContentListWindow. More...
 

Functions

void ShowContentTextfileWindow (TextfileType file_type, const ContentInfo *ci)
 
void BuildContentTypeStringList ()
 Build array of all strings corresponding to the content types.
 
void ShowNetworkContentListWindow (ContentVector *cv, ContentType type1, ContentType type2)
 Show the content list window with a given set of content. More...
 

Variables

static bool _accepted_external_search = false
 Whether the user accepted to enter external websites during this session. More...
 
static const NWidgetPart _nested_network_content_download_status_window_widgets []
 Nested widgets for the download window. More...
 
static WindowDesc _network_content_download_status_window_desc (WDP_CENTER, NULL, 0, 0, WC_NETWORK_STATUS_WINDOW, WC_NONE, WDF_MODAL, _nested_network_content_download_status_window_widgets, lengthof(_nested_network_content_download_status_window_widgets))
 Window description for the download window.
 
static const NWidgetPart _nested_network_content_list_widgets []
 The widgets for the content list. More...
 
static WindowDesc _network_content_list_desc (WDP_CENTER, "list_content", 630, 460, WC_NETWORK_WINDOW, WC_NONE, 0, _nested_network_content_list_widgets, lengthof(_nested_network_content_list_widgets))
 Window description of the content list.
 

Detailed Description

Implementation of the Network Content related GUIs.

Definition in file network_content_gui.cpp.

Enumeration Type Documentation

◆ ContentListFilterCriteria

Filter criterias for NetworkContentListWindow.

Enumerator
CONTENT_FILTER_TEXT 

Filter by query sting.

CONTENT_FILTER_TYPE_OR_SELECTED 

Filter by being of displayed type or selected for download.

Definition at line 294 of file network_content_gui.cpp.

Function Documentation

◆ ShowNetworkContentListWindow()

void ShowNetworkContentListWindow ( ContentVector cv,
ContentType  type1,
ContentType  type2 
)

Show the content list window with a given set of content.

Parameters
cvthe content to show, or NULL when it has to search for itself
type1the first type to (only) show or CONTENT_TYPE_END to show all.
type2the second type to (only) show in addition to type1. If type2 is != CONTENT_TYPE_END, then also type1 should be != CONTENT_TYPE_END. If type2 != CONTENT_TYPE_END, then type1 != type2 must be true.

Definition at line 1144 of file network_content_gui.cpp.

References _network_content_client, and ClientNetworkContentSocketHandler::Clear().

Referenced by ClientNetworkContentSocketHandler::RemoveCallback(), and ShowMissingContentWindow().

Variable Documentation

◆ _accepted_external_search

bool _accepted_external_search = false
static

Whether the user accepted to enter external websites during this session.

Definition at line 38 of file network_content_gui.cpp.

Referenced by NetworkContentListWindow::ExternalSearchDisclaimerCallback().

◆ _nested_network_content_download_status_window_widgets

const NWidgetPart _nested_network_content_download_status_window_widgets[]
static
Initial value:
= {
NWidget(WWT_CAPTION, COLOUR_GREY), SetDataTip(STR_CONTENT_DOWNLOAD_TITLE, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
NWidget(WWT_PUSHTXTBTN, COLOUR_WHITE, WID_NCDS_CANCELOK), SetMinimalSize(101, 12), SetDataTip(STR_BUTTON_CANCEL, STR_NULL),
}
Offset at top to draw the frame rectangular area.
Definition: window_gui.h:64
Horizontal container.
Definition: widget_type.h:75
static NWidgetPart SetMinimalTextLines(uint8 lines, uint8 spacing, FontSize size=FS_NORMAL)
Widget part function for setting the minimal text lines.
Definition: widget_type.h:965
Invisible widget that takes some space.
Definition: widget_type.h:79
static NWidgetPart SetDataTip(uint32 data, StringID tip)
Widget part function for setting the data and tooltip.
Definition: widget_type.h:1014
static NWidgetPart SetMinimalSize(int16 x, int16 y)
Widget part function for setting the minimal size.
Definition: widget_type.h:947
Normal push-button (no toggle button) with text caption.
Definition: widget_type.h:104
Simple depressed panel.
Definition: widget_type.h:50
Background of the window.
static NWidgetPart NWidget(WidgetType tp, Colours col, int16 idx=-1)
Widget part function for starting a new &#39;real&#39; widget.
Definition: widget_type.h:1114
Offset at bottom to draw the frame rectangular area.
Definition: window_gui.h:65
(Optional) Cancel/OK button.
Window caption (window title between closebox and stickybox)
Definition: widget_type.h:61
static NWidgetPart EndContainer()
Widget part function for denoting the end of a container (horizontal, vertical, WWT_FRAME, WWT_INSET, or WWT_PANEL).
Definition: widget_type.h:999
static NWidgetPart SetFill(uint fill_x, uint fill_y)
Widget part function for setting filling.
Definition: widget_type.h:983

Nested widgets for the download window.

Definition at line 84 of file network_content_gui.cpp.

◆ _nested_network_content_list_widgets

const NWidgetPart _nested_network_content_list_widgets[]
static

The widgets for the content list.

Definition at line 1053 of file network_content_gui.cpp.