GameServer.Achievements.Achievement
(game_server_core v1.0.950)
Copy Markdown
Ecto schema for the achievements table.
An achievement is a goal or milestone that players can unlock.
Fields
slug— unique identifier (e.g., "first_lobby_join")title— display namedescription— human-readable descriptionicon_url— optional icon path/URLsort_order— display ordering (lower = first)hidden— if true, not shown until unlockedprogress_target— number of steps to complete (1 = one-shot, >1 = incremental)metadata— arbitrary JSON data
Summary
Functions
Returns the localized description for the given locale.
Returns the localized title for the given locale.
Types
Functions
Returns the localized description for the given locale.
Looks up metadata["descriptions"][locale], falling back to description.
Returns the localized title for the given locale.
Looks up metadata["titles"][locale], falling back to title.
Examples
iex> a = %Achievement{title: "First Kill", metadata: %{"titles" => %{"es" => "Primera Baja"}}}
iex> Achievement.localized_title(a, "es")
"Primera Baja"
iex> Achievement.localized_title(a, "en")
"First Kill"