Added secret achievement (i.e. progress not shown in list).
This commit is contained in:
parent
08c8de1986
commit
50c21cc11e
@ -48,4 +48,8 @@
|
||||
title="Banana Lover" description="Collect at least 5 bananas in one race.">
|
||||
<banana goal="5"/>
|
||||
</achievement>
|
||||
<achievement id="10" secret="yes" check-type="all-at-least" reset-type="race"
|
||||
title="It's secret" description="Really ... a secret.">
|
||||
</achievement>
|
||||
|
||||
</achievements>
|
||||
|
@ -35,6 +35,7 @@ AchievementInfo::AchievementInfo(const XMLNode * input)
|
||||
m_id = 0;
|
||||
m_title = "";
|
||||
m_description = "";
|
||||
m_is_secret = false;
|
||||
bool all;
|
||||
all = input->get("id", &m_id ) &&
|
||||
input->get("title", &m_title ) &&
|
||||
@ -69,6 +70,7 @@ AchievementInfo::AchievementInfo(const XMLNode * input)
|
||||
else
|
||||
Log::warn("AchievementInfo", "Achievement check type '%s' unknown.",
|
||||
s.c_str());
|
||||
input->get("secret", &m_is_secret);
|
||||
|
||||
// Now load the goal nodes
|
||||
for (unsigned int n = 0; n < input->getNumNodes(); n++)
|
||||
|
@ -94,6 +94,9 @@ private:
|
||||
/** Determines when the achievement needs to be reset */
|
||||
ResetType m_reset_type;
|
||||
|
||||
/** A secret achievement has its progress not shown. */
|
||||
bool m_is_secret;
|
||||
|
||||
public:
|
||||
AchievementInfo(const XMLNode * input);
|
||||
virtual ~AchievementInfo() {};
|
||||
@ -119,6 +122,9 @@ public:
|
||||
/** Returns the check type for this achievement. */
|
||||
AchievementCheckType getCheckType() const { return m_check_type; }
|
||||
// ------------------------------------------------------------------------
|
||||
/** Returns if this achievement is a secret achievement. */
|
||||
bool isSecret() const { return m_is_secret; }
|
||||
// ------------------------------------------------------------------------
|
||||
}; // class AchievementInfo
|
||||
|
||||
|
||||
|
@ -103,6 +103,8 @@ void OnlineProfileAchievements::init()
|
||||
{
|
||||
std::vector<ListWidget::ListCell> row;
|
||||
const Achievement *a = it->second;
|
||||
if(a->getInfo()->isSecret())
|
||||
continue;
|
||||
ListWidget::ListCell title(a->getInfo()->getTitle(), -1, 2);
|
||||
ListWidget::ListCell progress(a->getProgressAsString(), -1, 1);
|
||||
row.push_back(title);
|
||||
|
Loading…
x
Reference in New Issue
Block a user