share/hedgewars/Data/Scripts/Achievements.lua
changeset 13501 cbda0f842364
child 14236 74bf2d906097
equal deleted inserted replaced
13500:b5f8864a38d3 13501:cbda0f842364
       
     1 HedgewarsScriptLoad("/Scripts/Locale.lua")
       
     2 
       
     3 function awardAchievement(name, statMessage, capgrp)
       
     4 	local achievementString = string.format(loc("Achievement gotten: %s"), name)
       
     5 	if capgrp == nil then
       
     6 		captionType = capgrpMessage2
       
     7 	end
       
     8 	if capgrp ~= false then
       
     9 		AddCaption(achievementString, 0xFFBA00FF, capgrpMessage2)
       
    10 	end
       
    11 	if not statMessage then
       
    12 		statMessage = achievementString
       
    13 	end
       
    14 	SendStat(siCustomAchievement, statMessage)
       
    15 end