This static class encapsulates all functions related to Ufopaedia for the game.
More...
#include <Ufopaedia.h>
|
static size_t | _current_index = 0 |
| current selected article index (for prev/next navigation).
|
|
This static class encapsulates all functions related to Ufopaedia for the game.
Main purpose is to open Ufopaedia from Geoscape, navigate between articles and release new articles after successful research.
◆ createArticleState()
create a new state object from article definition.
Creates a new article state dependent on the given article definition.
- Parameters
-
game | Pointer to actual game. |
article | Article definition to create from. |
- Returns
- Article state object if created, 0 otherwise.
◆ getArticleIndex()
size_t OpenXcom::Ufopaedia::getArticleIndex |
( |
SavedGame * |
save, |
|
|
Mod * |
mod, |
|
|
std::string & |
article_id |
|
) |
| |
|
staticprotected |
get index of the given article id in the visible list.
Gets the index of the selected article_id in the visible list.
If the id is not found, returns -1.
- Parameters
-
save | Pointer to saved game. |
mod | Pointer to mod. |
article_id | Article id to find. |
- Returns
- Index of the given article id in the internal list, -1 if not found.
◆ getAvailableArticles()
ArticleDefinitionList OpenXcom::Ufopaedia::getAvailableArticles |
( |
SavedGame * |
save, |
|
|
Mod * |
mod |
|
) |
| |
|
staticprotected |
get list of researched articles
Return an ArticleList with all the currently visible ArticleIds.
- Parameters
-
save | Pointer to saved game. |
mod | Pointer to mod. |
- Returns
- List of visible ArticleDefinitions.
◆ isArticleAvailable()
check, if a specific article is currently available.
Checks, if an article has already been released.
- Parameters
-
save | Pointer to saved game. |
article | Article definition to release. |
- Returns
- true, if the article is available.
◆ list()
void OpenXcom::Ufopaedia::list |
( |
SavedGame * |
save, |
|
|
Mod * |
mod, |
|
|
const std::string & |
section, |
|
|
ArticleDefinitionList & |
data |
|
) |
| |
|
static |
load a vector with article ids that are currently visible of a given section.
Fill an ArticleList with the currently visible ArticleIds of the given section.
- Parameters
-
save | Pointer to saved game. |
mod | Pointer to mod. |
section | Article section to find, e.g. "XCOM Crafts & Armaments", "Alien Lifeforms", etc. |
data | Article definition list object to fill data in. |
◆ next()
void OpenXcom::Ufopaedia::next |
( |
Game * |
game | ) |
|
|
static |
article navigation to next article.
Open the next article in the list.
Loops to the first.
- Parameters
-
game | Pointer to actual game. |
◆ open()
void OpenXcom::Ufopaedia::open |
( |
Game * |
game | ) |
|
|
static |
open Ufopaedia with selection dialog.
Open Ufopaedia start state, presenting the section selection buttons.
- Parameters
-
game | Pointer to actual game. |
◆ openArticle() [1/2]
void OpenXcom::Ufopaedia::openArticle |
( |
Game * |
game, |
|
|
const std::string & |
article_id |
|
) |
| |
|
static |
open Ufopaedia on a certain entry.
Checks if selected article_id is available -> if yes, open it.
- Parameters
-
game | Pointer to actual game. |
article_id | Article id to find. |
◆ openArticle() [2/2]
open Ufopaedia article from a given article definition.
Set UPSaved index and open the new state.
- Parameters
-
game | Pointer to actual game. |
article | Article definition of the article to open. |
◆ prev()
void OpenXcom::Ufopaedia::prev |
( |
Game * |
game | ) |
|
|
static |
article navigation to previous article.
Open the previous article in the list.
Loops to the last.
- Parameters
-
game | Pointer to actual game. |
The documentation for this class was generated from the following files: