Represents a single achievement and its data. More...
#include <achievements.hpp>
Public Member Functions | |
achievement (const config &cfg, const std::string &content_for, bool achieved, int progress) | |
Public Attributes | |
std::string | id_ |
The ID of the achievement. More... | |
t_string | name_ |
The name of the achievement to show on the UI. More... | |
t_string | name_completed_ |
The name of the achievement to show on the UI if the achievement is completed. More... | |
t_string | description_ |
The description of the achievement to show on the UI. More... | |
t_string | description_completed_ |
The name of the achievement to show on the UI if the achievement is completed. More... | |
std::string | icon_ |
The icon of the achievement to show on the UI. More... | |
std::string | icon_completed_ |
The icon of the achievement to show on the UI if the achievement is completed. More... | |
bool | hidden_ |
Whether to show the achievement's actual name and description on the UI before it's been completed. More... | |
bool | achieved_ |
Whether the achievement has been completed. More... | |
int | max_progress_ |
When the achievement's current progress matches or equals this value, then it should be marked as completed. More... | |
int | current_progress_ |
The current progress value of the achievement. More... | |
std::string | sound_path_ |
The path to a sound to play when an achievement is completed. More... | |
std::vector< sub_achievement > | sub_achievements_ |
The list of distinct sub-achievements for this achievement. More... | |
Represents a single achievement and its data.
Definition at line 48 of file achievements.hpp.
achievement::achievement | ( | const config & | cfg, |
const std::string & | content_for, | ||
bool | achieved, | ||
int | progress | ||
) |
Definition at line 36 of file achievements.cpp.
References achieved_, config::child_range(), description_, description_completed_, t_string::empty(), ERR_CONFIG, icon_completed_, id_, max_progress_, name_, name_completed_, preferences::sub_achievement(), and sub_achievements_.
bool achievement::achieved_ |
Whether the achievement has been completed.
Definition at line 67 of file achievements.hpp.
Referenced by achievement(), game_lua_kernel::intf_progress_achievement(), game_lua_kernel::intf_set_achievement(), and game_lua_kernel::intf_set_sub_achievement().
int achievement::current_progress_ |
The current progress value of the achievement.
Definition at line 71 of file achievements.hpp.
Referenced by game_lua_kernel::intf_progress_achievement(), game_lua_kernel::intf_set_achievement(), and game_lua_kernel::intf_set_sub_achievement().
t_string achievement::description_ |
The description of the achievement to show on the UI.
Definition at line 57 of file achievements.hpp.
Referenced by achievement().
t_string achievement::description_completed_ |
The name of the achievement to show on the UI if the achievement is completed.
Definition at line 59 of file achievements.hpp.
Referenced by achievement(), and game_lua_kernel::intf_set_achievement().
bool achievement::hidden_ |
Whether to show the achievement's actual name and description on the UI before it's been completed.
Definition at line 65 of file achievements.hpp.
std::string achievement::icon_ |
The icon of the achievement to show on the UI.
Definition at line 61 of file achievements.hpp.
std::string achievement::icon_completed_ |
The icon of the achievement to show on the UI if the achievement is completed.
Definition at line 63 of file achievements.hpp.
Referenced by achievement(), and game_lua_kernel::intf_set_achievement().
std::string achievement::id_ |
The ID of the achievement.
Must be unique per achievement_group
Definition at line 51 of file achievements.hpp.
Referenced by achievement(), game_lua_kernel::intf_progress_achievement(), game_lua_kernel::intf_set_achievement(), and game_lua_kernel::intf_set_sub_achievement().
int achievement::max_progress_ |
When the achievement's current progress matches or equals this value, then it should be marked as completed.
Definition at line 69 of file achievements.hpp.
Referenced by achievement(), game_lua_kernel::intf_progress_achievement(), game_lua_kernel::intf_set_achievement(), and game_lua_kernel::intf_set_sub_achievement().
t_string achievement::name_ |
The name of the achievement to show on the UI.
Definition at line 53 of file achievements.hpp.
Referenced by achievement().
t_string achievement::name_completed_ |
The name of the achievement to show on the UI if the achievement is completed.
Definition at line 55 of file achievements.hpp.
Referenced by achievement(), and game_lua_kernel::intf_set_achievement().
std::string achievement::sound_path_ |
The path to a sound to play when an achievement is completed.
Definition at line 73 of file achievements.hpp.
Referenced by game_lua_kernel::intf_set_achievement().
std::vector<sub_achievement> achievement::sub_achievements_ |
The list of distinct sub-achievements for this achievement.
Definition at line 75 of file achievements.hpp.
Referenced by achievement(), game_lua_kernel::intf_progress_achievement(), game_lua_kernel::intf_set_sub_achievement(), and gui2::dialogs::achievements_dialog::set_sub_achievements().