|
OpenTTD Source 20251117-master-g7398d2e290
|
Container for all important information about a piece of content. More...
#include <tcp_content_type.h>
Public Types | |
| enum class | State : uint8_t { Unselected , Selected , Autoselected , AlreadyHere , DoesNotExist , Invalid } |
| The state the content can be in. More... | |
Public Member Functions | |
| bool | IsSelected () const |
| Is the state either selected or autoselected? | |
| bool | IsValid () const |
| Is the information from this content info valid? | |
| std::optional< std::string > | GetTextfile (TextfileType type) const |
| Search a textfile file next to this file in the content list. | |
Data Fields | |
| ContentType | type = INVALID_CONTENT_TYPE |
| Type of content. | |
| ContentID | id = INVALID_CONTENT_ID |
| Unique (server side) ID for the content. | |
| uint32_t | filesize = 0 |
| Size of the file. | |
| std::string | filename |
| Filename (for the .tar.gz; only valid on download) | |
| std::string | name |
| Name of the content. | |
| std::string | version |
| Version of the content. | |
| std::string | url |
| URL related to the content. | |
| std::string | description |
| Description of the content. | |
| uint32_t | unique_id = 0 |
| Unique ID; either GRF ID or shortname. | |
| MD5Hash | md5sum |
| The MD5 checksum. | |
| std::vector< ContentID > | dependencies |
| The dependencies (unique server side ids) | |
| StringList | tags |
| Tags associated with the content. | |
| State | state = State::Unselected |
| Whether the content info is selected (for download) | |
| bool | upgrade = false |
| This item is an upgrade. | |
Container for all important information about a piece of content.
Definition at line 56 of file tcp_content_type.h.
|
strong |
The state the content can be in.
Definition at line 58 of file tcp_content_type.h.
| std::optional< std::string > ContentInfo::GetTextfile | ( | TextfileType | type | ) | const |
Search a textfile file next to this file in the content list.
| type | The type of the textfile to search for. |
Definition at line 59 of file tcp_content.cpp.
References CONTENT_TYPE_AI, CONTENT_TYPE_AI_LIBRARY, CONTENT_TYPE_BASE_GRAPHICS, CONTENT_TYPE_BASE_MUSIC, CONTENT_TYPE_BASE_SOUNDS, CONTENT_TYPE_GAME, CONTENT_TYPE_GAME_LIBRARY, CONTENT_TYPE_HEIGHTMAP, CONTENT_TYPE_NEWGRF, CONTENT_TYPE_SCENARIO, FGCM_EXACT, GRFConfig::filename, FindGRFConfig(), ScriptScanner::FindMainScript(), FindScenario(), BaseMedia< GraphicsSet >::GetAvailableSets(), BaseMedia< SoundsSet >::GetAvailableSets(), BaseMedia< MusicSet >::GetAvailableSets(), GetContentInfoSubDir(), AI::GetScannerInfo(), Game::GetScannerInfo(), AI::GetScannerLibrary(), Game::GetScannerLibrary(), Invalid, md5sum, state, TryGetBaseSetFile(), type, and unique_id.
| bool ContentInfo::IsSelected | ( | ) | const |
Is the state either selected or autoselected?
Definition at line 32 of file tcp_content.cpp.
References AlreadyHere, Autoselected, Selected, and state.
Referenced by ClientNetworkContentSocketHandler::CheckDependencyState(), NetworkContentListWindow::DrawDetails(), NetworkContentListWindow::OnReceiveContentInfo(), and ClientNetworkContentSocketHandler::Unselect().
| bool ContentInfo::IsValid | ( | ) | const |
Is the information from this content info valid?
Definition at line 49 of file tcp_content.cpp.
References CONTENT_TYPE_BEGIN, CONTENT_TYPE_END, Invalid, state, and type.
| std::vector<ContentID> ContentInfo::dependencies |
The dependencies (unique server side ids)
Definition at line 77 of file tcp_content_type.h.
Referenced by ClientNetworkContentSocketHandler::CheckDependencyState(), and NetworkContentListWindow::DrawDetails().
| std::string ContentInfo::description |
Description of the content.
Definition at line 74 of file tcp_content_type.h.
Referenced by NetworkContentListWindow::DrawDetails().
| std::string ContentInfo::filename |
Filename (for the .tar.gz; only valid on download)
Definition at line 70 of file tcp_content_type.h.
Referenced by GetFullFilename(), and BaseNetworkContentDownloadStatusWindow::OnDownloadProgress().
| uint32_t ContentInfo::filesize = 0 |
Size of the file.
Definition at line 69 of file tcp_content_type.h.
Referenced by NetworkContentListWindow::DrawDetails(), and NetworkContentListWindow::OnInvalidateData().
| ContentID ContentInfo::id = INVALID_CONTENT_ID |
Unique (server side) ID for the content.
Definition at line 68 of file tcp_content_type.h.
Referenced by ClientNetworkContentSocketHandler::CheckDependencyState(), NetworkContentListWindow::DrawDetails(), BaseNetworkContentDownloadStatusWindow::OnDownloadProgress(), BootstrapAskForDownloadWindow::OnReceiveContentInfo(), OutputContentState(), ClientNetworkContentSocketHandler::RequestQueuedContentInfo(), ClientNetworkContentSocketHandler::ReverseLookupDependency(), and ClientNetworkContentSocketHandler::ToggleSelectedState().
| MD5Hash ContentInfo::md5sum |
The MD5 checksum.
Definition at line 76 of file tcp_content_type.h.
Referenced by FindScenario(), GetTextfile(), HasGRFConfig(), IsSameScript(), NetworkContentListWindow::OpenExternalSearch(), OutputContentState(), and TryGetBaseSetFile().
| std::string ContentInfo::name |
Name of the content.
Definition at line 71 of file tcp_content_type.h.
Referenced by NetworkContentListWindow::DrawDetails(), NetworkContentListWindow::DrawMatrix(), ContentTextfileWindow::GetWidgetString(), NetworkContentListWindow::NameSorter(), and OutputContentState().
| State ContentInfo::state = State::Unselected |
Whether the content info is selected (for download)
Definition at line 79 of file tcp_content_type.h.
Referenced by NetworkContentListWindow::BuildContentList(), ClientNetworkContentSocketHandler::CheckDependencyState(), NetworkContentListWindow::DrawDetails(), NetworkContentListWindow::DrawMatrix(), GetTextfile(), IsSelected(), IsValid(), NetworkContentListWindow::OnClick(), ClientNetworkContentSocketHandler::OnDownloadComplete(), NetworkContentListWindow::OnInvalidateData(), NetworkContentListWindow::OpenExternalSearch(), OutputContentState(), ClientNetworkContentSocketHandler::Select(), NetworkContentListWindow::StateSorter(), ClientNetworkContentSocketHandler::ToggleSelectedState(), and ClientNetworkContentSocketHandler::Unselect().
| StringList ContentInfo::tags |
Tags associated with the content.
Definition at line 78 of file tcp_content_type.h.
Referenced by NetworkContentListWindow::DrawDetails().
| ContentType ContentInfo::type = INVALID_CONTENT_TYPE |
Type of content.
Definition at line 67 of file tcp_content_type.h.
Referenced by NetworkContentListWindow::DrawDetails(), NetworkContentListWindow::DrawMatrix(), GetFullFilename(), GetTextfile(), IsValid(), NetworkContentDownloadStatusWindow::OnDownloadProgress(), OutputContentState(), and NetworkContentListWindow::TypeSorter().
| uint32_t ContentInfo::unique_id = 0 |
Unique ID; either GRF ID or shortname.
Definition at line 75 of file tcp_content_type.h.
Referenced by FindScenario(), GetTextfile(), HasGRFConfig(), IsSameScript(), NetworkContentListWindow::OpenExternalSearch(), OutputContentState(), and TryGetBaseSetFile().
| bool ContentInfo::upgrade = false |
This item is an upgrade.
Definition at line 80 of file tcp_content_type.h.
Referenced by NetworkContentListWindow::DrawDetails(), and NetworkContentListWindow::OnInvalidateData().
| std::string ContentInfo::url |
URL related to the content.
Definition at line 73 of file tcp_content_type.h.
Referenced by NetworkContentListWindow::DrawDetails(), NetworkContentListWindow::OnClick(), and NetworkContentListWindow::OnInvalidateData().
| std::string ContentInfo::version |
Version of the content.
Definition at line 72 of file tcp_content_type.h.
Referenced by NetworkContentListWindow::DrawDetails(), NetworkContentListWindow::DrawMatrix(), and NetworkContentListWindow::NameSorter().