Extract translation strings.

This commit is contained in:
Matthias Mailänder
2022-10-21 21:26:30 +02:00
committed by abcdefg30
parent 640e9d68b7
commit 5032b2b872
65 changed files with 575 additions and 268 deletions

View File

@@ -7,6 +7,26 @@
information, see COPYING.
]]
---Adds a new mandatory objective, translates it and announces it via in-game chat message.
---@param player player recipient of the objective
---@param description string key of the translation string
---@return number id used to query for the objective later
AddPrimaryObjective = function(player, description)
local translation = UserInterface.Translate(description)
Media.DisplayMessageToPlayer(player, translation, UserInterface.Translate("new-primary-objective"))
return player.AddObjective(translation, UserInterface.Translate("primary"), true)
end
---Adds a new optional objective, translates it and announces it via in-game chat message.
---@param player player recipient of the objective
---@param description string key of the translation string
---@return number id used to query for the objective later
AddSecondaryObjective = function(player, description)
local translation = UserInterface.Translate(description)
Media.DisplayMessageToPlayer(player, translation, UserInterface.Translate("new-secondary-objective"))
return player.AddObjective(translation, UserInterface.Translate("secondary"), false)
end
IdleHunt = function(actor)
if actor.HasProperty("Hunt") and not actor.IsDead then
Trigger.OnIdle(actor, actor.Hunt)