The Battle for Wesnoth 1.21.0-dev
 
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
achievement Struct Reference

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.
 
t_string name_
 The name of the achievement to show on the UI.
 
t_string name_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.
 
t_string description_completed_
 The name of the achievement to show on the UI if the achievement is completed.
 
std::string icon_
 The icon of the achievement to show on the UI.
 
std::string icon_completed_
 The icon of the achievement to show on the UI if the achievement is completed.
 
bool hidden_
 Whether to show the achievement's actual name and description on the UI before it's been completed.
 
bool achieved_
 Whether the achievement has been completed.
 
int max_progress_
 When the achievement's current progress matches or equals this value, then it should be marked as completed.
 
int current_progress_
 The current progress value of the achievement.
 
std::string sound_path_
 The path to a sound to play when an achievement is completed.
 
std::vector< sub_achievement > sub_achievements_
 The list of distinct sub-achievements for this achievement.
 

Detailed Description

Represents a single achievement and its data.

Definition at line 47 of file achievements.hpp.

Constructor & Destructor Documentation

◆ achievement()

achievement::achievement ( const config &  cfg,
const std::string &  content_for,
bool  achieved,
int  progress 
)

Member Data Documentation

◆ achieved_

bool achievement::achieved_

Whether the achievement has been completed.

Definition at line 66 of file achievements.hpp.

Referenced by achievement().

◆ current_progress_

int achievement::current_progress_

The current progress value of the achievement.

Definition at line 70 of file achievements.hpp.

◆ description_

t_string achievement::description_

The description of the achievement to show on the UI.

Definition at line 56 of file achievements.hpp.

Referenced by achievement().

◆ description_completed_

t_string achievement::description_completed_

The name of the achievement to show on the UI if the achievement is completed.

Definition at line 58 of file achievements.hpp.

Referenced by achievement().

◆ hidden_

bool achievement::hidden_

Whether to show the achievement's actual name and description on the UI before it's been completed.

Definition at line 64 of file achievements.hpp.

◆ icon_

std::string achievement::icon_

The icon of the achievement to show on the UI.

Definition at line 60 of file achievements.hpp.

◆ icon_completed_

std::string achievement::icon_completed_

The icon of the achievement to show on the UI if the achievement is completed.

Definition at line 62 of file achievements.hpp.

Referenced by achievement().

◆ id_

std::string achievement::id_

The ID of the achievement.

Must be unique per achievement_group

Definition at line 50 of file achievements.hpp.

Referenced by achievement().

◆ max_progress_

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 68 of file achievements.hpp.

Referenced by achievement().

◆ name_

t_string achievement::name_

The name of the achievement to show on the UI.

Definition at line 52 of file achievements.hpp.

Referenced by achievement().

◆ name_completed_

t_string achievement::name_completed_

The name of the achievement to show on the UI if the achievement is completed.

Definition at line 54 of file achievements.hpp.

Referenced by achievement().

◆ sound_path_

std::string achievement::sound_path_

The path to a sound to play when an achievement is completed.

Definition at line 72 of file achievements.hpp.

◆ sub_achievements_

std::vector<sub_achievement> achievement::sub_achievements_

The list of distinct sub-achievements for this achievement.

Definition at line 74 of file achievements.hpp.

Referenced by achievement(), and gui2::dialogs::achievements_dialog::set_sub_achievements().


The documentation for this struct was generated from the following files: