author | Wuzzy <Wuzzy2@mail.ru> |
Mon, 13 May 2019 21:23:25 +0200 | |
changeset 14933 | 4c5fb1ee75b7 |
parent 14236 | 74bf2d906097 |
permissions | -rw-r--r-- |
13501
cbda0f842364
Standardize hidden mission achievement in new Lua library "Achievements"
Wuzzy <Wuzzy2@mail.ru>
parents:
diff
changeset
|
1 |
HedgewarsScriptLoad("/Scripts/Locale.lua") |
cbda0f842364
Standardize hidden mission achievement in new Lua library "Achievements"
Wuzzy <Wuzzy2@mail.ru>
parents:
diff
changeset
|
2 |
|
cbda0f842364
Standardize hidden mission achievement in new Lua library "Achievements"
Wuzzy <Wuzzy2@mail.ru>
parents:
diff
changeset
|
3 |
function awardAchievement(name, statMessage, capgrp) |
cbda0f842364
Standardize hidden mission achievement in new Lua library "Achievements"
Wuzzy <Wuzzy2@mail.ru>
parents:
diff
changeset
|
4 |
local achievementString = string.format(loc("Achievement gotten: %s"), name) |
cbda0f842364
Standardize hidden mission achievement in new Lua library "Achievements"
Wuzzy <Wuzzy2@mail.ru>
parents:
diff
changeset
|
5 |
if capgrp == nil then |
14236
74bf2d906097
Turn accidental globals to locals in Lua libraries
Wuzzy <Wuzzy2@mail.ru>
parents:
13501
diff
changeset
|
6 |
capgrp = capgrpMessage2 |
13501
cbda0f842364
Standardize hidden mission achievement in new Lua library "Achievements"
Wuzzy <Wuzzy2@mail.ru>
parents:
diff
changeset
|
7 |
end |
cbda0f842364
Standardize hidden mission achievement in new Lua library "Achievements"
Wuzzy <Wuzzy2@mail.ru>
parents:
diff
changeset
|
8 |
if capgrp ~= false then |
14236
74bf2d906097
Turn accidental globals to locals in Lua libraries
Wuzzy <Wuzzy2@mail.ru>
parents:
13501
diff
changeset
|
9 |
AddCaption(achievementString, 0xFFBA00FF, capgrp) |
13501
cbda0f842364
Standardize hidden mission achievement in new Lua library "Achievements"
Wuzzy <Wuzzy2@mail.ru>
parents:
diff
changeset
|
10 |
end |
cbda0f842364
Standardize hidden mission achievement in new Lua library "Achievements"
Wuzzy <Wuzzy2@mail.ru>
parents:
diff
changeset
|
11 |
if not statMessage then |
cbda0f842364
Standardize hidden mission achievement in new Lua library "Achievements"
Wuzzy <Wuzzy2@mail.ru>
parents:
diff
changeset
|
12 |
statMessage = achievementString |
cbda0f842364
Standardize hidden mission achievement in new Lua library "Achievements"
Wuzzy <Wuzzy2@mail.ru>
parents:
diff
changeset
|
13 |
end |
cbda0f842364
Standardize hidden mission achievement in new Lua library "Achievements"
Wuzzy <Wuzzy2@mail.ru>
parents:
diff
changeset
|
14 |
SendStat(siCustomAchievement, statMessage) |
cbda0f842364
Standardize hidden mission achievement in new Lua library "Achievements"
Wuzzy <Wuzzy2@mail.ru>
parents:
diff
changeset
|
15 |
end |