OpenTTD Source 20241224-master-gee860a5c8e
|
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 "../openttd.h"
#include "../sortlist_type.h"
#include "../stringfilter_type.h"
#include "../querystring_gui.h"
#include "../core/geometry_func.hpp"
#include "../textfile_gui.h"
#include "../fios.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 criteria 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. | |
Variables | |
static bool | _accepted_external_search = false |
Whether the user accepted to enter external websites during this session. | |
static constexpr NWidgetPart | _nested_network_content_download_status_window_widgets [] |
Nested widgets for the download window. | |
static WindowDesc | _network_content_download_status_window_desc (WDP_CENTER, nullptr, 0, 0, WC_NETWORK_STATUS_WINDOW, WC_NONE, WDF_MODAL, _nested_network_content_download_status_window_widgets) |
Window description for the download window. | |
static constexpr NWidgetPart | _nested_network_content_list_widgets [] |
The widgets for the content list. | |
static WindowDesc | _network_content_list_desc (WDP_CENTER, "list_content", 630, 460, WC_NETWORK_WINDOW, WC_NONE, 0, _nested_network_content_list_widgets) |
Window description of the content list. | |
Implementation of the Network Content related GUIs.
Definition in file network_content_gui.cpp.
Filter criteria 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 323 of file network_content_gui.cpp.
void BuildContentTypeStringList | ( | ) |
Build array of all strings corresponding to the content types.
Definition at line 1029 of file network_content_gui.cpp.
Referenced by ReadLanguagePack().
void ShowContentTextfileWindow | ( | TextfileType | file_type, |
const ContentInfo * | ci | ||
) |
Definition at line 78 of file network_content_gui.cpp.
void ShowNetworkContentListWindow | ( | ContentVector * | cv, |
ContentType | type1, | ||
ContentType | type2 | ||
) |
Show the content list window with a given set of content.
cv | the content to show, or nullptr when it has to search for itself |
type1 | the first type to (only) show or CONTENT_TYPE_END to show all. |
type2 | the 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 1130 of file network_content_gui.cpp.
References _network_content_client, _network_content_list_desc, ClientNetworkContentSocketHandler::Clear(), CloseWindowById(), CONTENT_TYPE_END, ClientNetworkContentSocketHandler::RequestContentList(), ShowErrorMessage(), WC_NETWORK_WINDOW, WL_ERROR, and WN_NETWORK_WINDOW_CONTENT_LIST.
Referenced by AIConfigWindow::OnClick(), SaveLoadWindow::OnClick(), GSConfigWindow::OnClick(), SelectGameWindow::OnClick(), GameOptionsWindow::OnClick(), and ShowMissingContentWindow().
|
static |
Whether the user accepted to enter external websites during this session.
Definition at line 37 of file network_content_gui.cpp.
Referenced by NetworkContentListWindow::ExternalSearchDisclaimerCallback(), and NetworkContentListWindow::OnClick().
|
staticconstexpr |
Nested widgets for the download window.
Definition at line 85 of file network_content_gui.cpp.
|
staticconstexpr |
The widgets for the content list.
Definition at line 1037 of file network_content_gui.cpp.