Show / Hide Table of Contents

Class AchievementDefinition

The definition for an achievement, which can be in the base list or externally created via mods. See ModAchievements.cs

Inheritance
System.Object
UnserializedEntry
AchievementDefinition
Implements
System.ComponentModel.INotifyPropertyChanged
ILinkable
IHasIcon
IController
IViewController
IHasUniversalID
Inherited Members
UnserializedEntry.Id
UnserializedEntry.idToEntry
UnserializedEntry.All<T>()
UnserializedEntry.GetById(Int32)
UnserializedEntry.OnLinkClicked(TooltipOrigin, TooltipClickContext, User)
UnserializedEntry.ControllerID
UnserializedEntry.PropertyChanged
Namespace: Eco.Gameplay.Achievements
Assembly: Eco.Gameplay.dll
Syntax
public class AchievementDefinition : UnserializedEntry, INotifyPropertyChanged, ILinkable, IHasIcon, IController, IViewController, IHasUniversalID

Fields

AchievementProgressEvent

Declaration
public static ThreadSafeAction<AchievementProgressChange> AchievementProgressEvent
Field Value
Type Description
ThreadSafeAction<AchievementProgressChange>

Properties

Description

Declaration
public LocString Description { get; set; }
Property Value
Type Description
LocString

DisplayName

Declaration
public LocString DisplayName { get; set; }
Property Value
Type Description
LocString

IconComment

Declaration
public string IconComment { get; }
Property Value
Type Description
System.String

IconName

Declaration
public string IconName { get; }
Property Value
Type Description
System.String

IsServerAchievement

Declaration
public bool IsServerAchievement { get; set; }
Property Value
Type Description
System.Boolean

Name

Declaration
public string Name { get; }
Property Value
Type Description
System.String

NotifyEvery

Declaration
public float NotifyEvery { get; set; }
Property Value
Type Description
System.Single

RequiredProgress

Declaration
public float RequiredProgress { get; set; }
Property Value
Type Description
System.Single

Methods

CreateAchievementDefinition(LocString, LocString, Action<AchievementDefinition>, Boolean, Single, Nullable<Int32>)

Declaration
public static AchievementDefinition CreateAchievementDefinition(LocString displayName, LocString desc, Action<AchievementDefinition> setup, bool isServerAchievement, float requiredAmountOfProgress = 0F, Nullable<int> notifyEvery = null)
Parameters
Type Name Description
LocString displayName

The name of the achievement that will be shown to the player.

LocString desc
System.Action<AchievementDefinition> setup
System.Boolean isServerAchievement
System.Single requiredAmountOfProgress
System.Nullable<System.Int32> notifyEvery
Returns
Type Description
AchievementDefinition

TriggerAchievementProgress(User, Func<LocString>, Nullable<Single>, Nullable<Single>)

Trigger the achievement or add progress to cumulative one

Declaration
public void TriggerAchievementProgress(User user, Func<LocString> description, Nullable<float> progressDelta = null, Nullable<float> progressAbsolute = null)
Parameters
Type Name Description
User user
System.Func<LocString> description
System.Nullable<System.Single> progressDelta
System.Nullable<System.Single> progressAbsolute

UILinkContent()

Declaration
public override LocString UILinkContent()
Returns
Type Description
LocString
Overrides
UnserializedEntry.UILinkContent()

Implements

System.ComponentModel.INotifyPropertyChanged
ILinkable
IHasIcon
IController
IViewController
IHasUniversalID

Extension Methods

TagUtils.TagNames(Object, Boolean)
TagUtils.TagDisplayNames(Object, Boolean)
ClientSetViewExtensions.SetClassOfProperty(Object, Player, String, String, Int32)
TypeTooltipExtensions.UILinkGeneric(Object)
AchievementDefinitionTooltipLibrary.AchievementDescTooltip(AchievementDefinition)
☀
☾
In This Article
Back to top
Copyright (c) Strange Loop Games 2021
☀
☾