58 : id_(cfg[
"id"].str())
59 , name_(cfg[
"name"].t_str())
60 , name_completed_(cfg[
"name_completed"].t_str())
61 , description_(cfg[
"description"].t_str())
62 , description_completed_(cfg[
"description_completed"].t_str())
63 , icon_(cfg[
"icon"].str()+
"~GS()")
64 , icon_completed_(cfg[
"icon_completed"].str())
65 , hidden_(cfg[
"hidden"].to_bool())
66 , hidden_name_(cfg[
"hidden_name"].t_str())
67 , hidden_hint_(cfg[
"hidden_hint"].t_str())
69 , max_progress_(cfg[
"max_progress"].to_int(0))
70 , current_progress_(progress)
72 if(name_completed_.
empty()) {
73 name_completed_ =
name_;
75 if(description_completed_.
empty()) {
78 if(icon_completed_.empty()) {
80 icon_completed_ = cfg[
"icon"].str();
110 return achievement_list_;
114 config read_achievements_file(
const std::string&
path);
115 void process_achievements_file(
const config& cfg,
const std::string& content_source);
This class is responsible for reading all available achievements from mainline's and any add-ons' ach...
t_string name_
The name of the achievement to show on the UI.
std::vector< achievement > achievements_
The achievements associated to this content.
bool achieved_
Whether the achievement has been completed.
std::string icon_
The icon of the achievement to show on the UI.
std::string content_for_
The internal ID used for this content.
Definitions for the interface to Wesnoth Markup Language (WML).
std::string icon_completed_
The icon of the achievement to show on the UI if the achievement is completed.
int max_progress_
When the achievement's current progress matches or equals this value, then it should be marked as com...
achievement(const config &cfg, bool achieved, int progress)
t_string description_completed_
The name of the achievement to show on the UI if the achievement is completed.
t_string description_
The description of the achievement to show on the UI.
int current_progress_
The current progress value of the achievement.
t_string hidden_hint_
The hint to display in place of the description if the achievement is hidden and uncompleted.
bool hidden_
Whether to show the achievement's actual name and description on the UI before it's been completed...
std::string id_
The ID of the achievement.
t_string display_name_
The name of the content to display on the UI.
std::vector< achievement_group > achievement_list_
t_string hidden_name_
The hint to display in place of the description if the achievement is hidden and uncompleted.
Represents a single achievement and its data.
A set of achievements tied to a particular content.
A config object defines a single node in a WML file, with access to child nodes.
t_string name_completed_
The name of the achievement to show on the UI if the achievement is completed.
std::vector< achievement_group > & get_list()