|
OpenTTD Source 20260421-master-gc2fbc6fdeb
|
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 "../base_media_graphics.h"#include "../base_media_music.h"#include "../base_media_sounds.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 "../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 : uint8_t { CONTENT_FILTER_TEXT = 0 , CONTENT_FILTER_TYPE_OR_SELECTED } |
| Filter criteria for NetworkContentListWindow. More... | |
Functions | |
| static StringID | GetContentTypeString (ContentType type) |
| Get the string associated with a ContentType. | |
| static void | ShowContentTextfileWindow (Window *parent, TextfileType file_type, const ContentInfo *ci) |
| Open the window with one of the text files associated with content. | |
| 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 std::initializer_list< NWidgetPart > | _nested_network_content_download_status_window_widgets |
| Nested widgets for the download window. | |
| static WindowDesc | _network_content_download_status_window_desc (WDP_CENTER, {}, 0, 0, WC_NETWORK_STATUS_WINDOW, WC_NONE, WindowDefaultFlag::Modal, _nested_network_content_download_status_window_widgets) |
| Window description for the download window. | |
| static constexpr std::initializer_list< 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, {}, _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.
| enum ContentListFilterCriteria : uint8_t |
Filter criteria for NetworkContentListWindow.
| Enumerator | |
|---|---|
| CONTENT_FILTER_TEXT | Filter by query string. |
| CONTENT_FILTER_TYPE_OR_SELECTED | Filter by being of displayed type or selected for download. |
Definition at line 334 of file network_content_gui.cpp.
| void BuildContentTypeStringList | ( | ) |
Build array of all strings corresponding to the content types.
Definition at line 1038 of file network_content_gui.cpp.
Referenced by ReadLanguagePack().
|
static |
Get the string associated with a ContentType.
| type | The content type. |
Definition at line 45 of file network_content_gui.cpp.
References Ai, AiLibrary, BaseGraphics, BaseMusic, BaseSounds, Gs, GsLibrary, Heightmap, NewGRF, and Scenario.
Referenced by NetworkContentListWindow::BuildContentTypeStringList, NetworkContentListWindow::DrawDetails(), NetworkContentListWindow::DrawMatrix(), ContentTextfileWindow::GetWidgetString(), and NetworkContentListWindow::UpdateWidgetSize().
|
static |
Open the window with one of the text files associated with content.
| parent | Our parent window, i.e. if that window closes we close. |
| file_type | The type of file to load. |
| ci | The content info to load the file for. |
Definition at line 96 of file network_content_gui.cpp.
References Window::CloseChildWindowById(), and WC_TEXTFILE.
Referenced by NetworkContentListWindow::OnClick().
| 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 ContentType::End to show all. |
| type2 | the second type to (only) show in addition to type1. If type2 is != ContentType::End, then also type1 should be != ContentType::End. If type2 != ContentType::End, then type1 != type2 must be true. |
Definition at line 1135 of file network_content_gui.cpp.
References _network_content_client, _network_content_list_desc, CloseWindowById(), End, GetEncodedString(), BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Set(), ShowErrorMessage(), WC_NETWORK_WINDOW, WL_ERROR, and WN_NETWORK_WINDOW_CONTENT_LIST.
Referenced by AIConfigWindow::OnClick(), GameOptionsWindow::OnClick(), GSConfigWindow::OnClick(), SaveLoadWindow::OnClick(), SelectGameWindow::OnClick(), and ShowMissingContentWindow().
|
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(), and NetworkContentListWindow::OnClick().
|
staticconstexpr |
Nested widgets for the download window.
Definition at line 103 of file network_content_gui.cpp.
|
staticconstexpr |
The widgets for the content list.
Definition at line 1046 of file network_content_gui.cpp.