share/hedgewars/Data/Scripts/Achievements.lua
changeset 13501 cbda0f842364
child 14236 74bf2d906097
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/share/hedgewars/Data/Scripts/Achievements.lua	Tue Jul 17 16:45:34 2018 +0200
@@ -0,0 +1,15 @@
+HedgewarsScriptLoad("/Scripts/Locale.lua")
+
+function awardAchievement(name, statMessage, capgrp)
+	local achievementString = string.format(loc("Achievement gotten: %s"), name)
+	if capgrp == nil then
+		captionType = capgrpMessage2
+	end
+	if capgrp ~= false then
+		AddCaption(achievementString, 0xFFBA00FF, capgrpMessage2)
+	end
+	if not statMessage then
+		statMessage = achievementString
+	end
+	SendStat(siCustomAchievement, statMessage)
+end