The Battle for Wesnoth  1.17.12+dev
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, 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...
 
t_string hidden_name_
 The hint to display in place of the description if the achievement is hidden and uncompleted. More...
 
t_string hidden_hint_
 The hint to display in place of the description if the achievement is hidden and uncompleted. 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...
 

Detailed Description

Represents a single achievement and its data.

Definition at line 28 of file achievements.hpp.

Constructor & Destructor Documentation

◆ achievement()

achievement::achievement ( const config cfg,
bool  achieved,
int  progress 
)
inline

Definition at line 57 of file achievements.hpp.

References description_, t_string::empty(), and name_.

Member Data Documentation

◆ achieved_

bool achievement::achieved_

Whether the achievement has been completed.

Definition at line 51 of file achievements.hpp.

Referenced by game_lua_kernel::intf_progress_achievement(), and game_lua_kernel::intf_set_achievement().

◆ current_progress_

int achievement::current_progress_

The current progress value of the achievement.

Definition at line 55 of file achievements.hpp.

Referenced by game_lua_kernel::intf_progress_achievement().

◆ description_

t_string achievement::description_

The description of the achievement to show on the UI.

Definition at line 37 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 39 of file achievements.hpp.

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

◆ hidden_hint_

t_string achievement::hidden_hint_

The hint to display in place of the description if the achievement is hidden and uncompleted.

Definition at line 49 of file achievements.hpp.

◆ hidden_name_

t_string achievement::hidden_name_

The hint to display in place of the description if the achievement is hidden and uncompleted.

Definition at line 47 of file achievements.hpp.

◆ icon_

std::string achievement::icon_

The icon of the achievement to show on the UI.

Definition at line 41 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 43 of file achievements.hpp.

◆ id_

std::string achievement::id_

The ID of the achievement.

Must be unique per achievement_group

Definition at line 31 of file achievements.hpp.

Referenced by game_lua_kernel::intf_progress_achievement(), and game_lua_kernel::intf_set_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 53 of file achievements.hpp.

Referenced by game_lua_kernel::intf_progress_achievement().

◆ name_

t_string achievement::name_

The name of the achievement to show on the UI.

Definition at line 33 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 35 of file achievements.hpp.


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