mirror of
https://github.com/MinetestForFun/quests.git
synced 2025-07-06 10:20:24 +02:00
Updated the translation bits of the code so they use the
now builtin minetest functions. Not able to add any more translations myself though.
This commit is contained in:
14
core.lua
14
core.lua
@ -2,13 +2,7 @@
|
|||||||
-- @module core
|
-- @module core
|
||||||
|
|
||||||
-- Boilerplate to support localized strings if intllib mod is installed.
|
-- Boilerplate to support localized strings if intllib mod is installed.
|
||||||
local S
|
local S = minetest.get_translator("quests")
|
||||||
if minetest.get_modpath("intllib") then
|
|
||||||
S = intllib.Getter()
|
|
||||||
else
|
|
||||||
-- If you don't use insertions (@1, @2, etc) you can use this:
|
|
||||||
S = function(s) return s end
|
|
||||||
end
|
|
||||||
local empty_callback = function(...) end
|
local empty_callback = function(...) end
|
||||||
|
|
||||||
local function compute_tasks(playername, questname, nocallback)
|
local function compute_tasks(playername, questname, nocallback)
|
||||||
@ -230,7 +224,7 @@ function quests.start_quest(playername, questname, metadata)
|
|||||||
end
|
end
|
||||||
|
|
||||||
quests.update_hud(playername)
|
quests.update_hud(playername)
|
||||||
quests.show_message("new", playername, S("New quest:") .. " " .. quest.title)
|
quests.show_message("new", playername, S("New quest") .. ": " .. quest.title)
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -522,7 +516,7 @@ function quests.accept_quest(playername, questname)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
handle_quest_end(playername, questname)
|
handle_quest_end(playername, questname)
|
||||||
quests.show_message("success", playername, S("Quest completed:") .. " " .. quests.registered_quests[questname].title)
|
quests.show_message("success", playername, S("Quest completed") .. ": " .. quests.registered_quests[questname].title)
|
||||||
minetest.after(3, function(playername, questname)
|
minetest.after(3, function(playername, questname)
|
||||||
quests.active_quests[playername][questname] = nil
|
quests.active_quests[playername][questname] = nil
|
||||||
quests.update_hud(playername)
|
quests.update_hud(playername)
|
||||||
@ -565,7 +559,7 @@ function quests.abort_quest(playername, questname)
|
|||||||
local quest = quests.registered_quests[questname]
|
local quest = quests.registered_quests[questname]
|
||||||
quest.abortcallback(playername, questname, quests.active_quests[playername][questname].metadata)
|
quest.abortcallback(playername, questname, quests.active_quests[playername][questname].metadata)
|
||||||
handle_quest_end(playername, questname)
|
handle_quest_end(playername, questname)
|
||||||
quests.show_message("failed", playername, S("Quest failed:") .. " " .. quest.title)
|
quests.show_message("failed", playername, S("Quest failed") .. ": " .. quest.title)
|
||||||
minetest.after(3, function(playername, questname)
|
minetest.after(3, function(playername, questname)
|
||||||
quests.active_quests[playername][questname] = nil
|
quests.active_quests[playername][questname] = nil
|
||||||
quests.update_hud(playername)
|
quests.update_hud(playername)
|
||||||
|
@ -1,11 +1,5 @@
|
|||||||
-- Boilerplate to support localized strings if intllib mod is installed.
|
-- Boilerplate to support localized strings if intllib mod is installed.
|
||||||
local S
|
local S = minetest.get_translator("quests")
|
||||||
if minetest.get_modpath("intllib") then
|
|
||||||
S = intllib.Getter()
|
|
||||||
else
|
|
||||||
-- If you don't use insertions (@1, @2, etc) you can use this:
|
|
||||||
S = function(s) return s end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- construct the questlog
|
-- construct the questlog
|
||||||
function quests.create_formspec(playername, tab, integrated)
|
function quests.create_formspec(playername, tab, integrated)
|
||||||
|
12
hud.lua
12
hud.lua
@ -2,13 +2,7 @@
|
|||||||
-- @module hud
|
-- @module hud
|
||||||
|
|
||||||
-- Boilerplate to support localized strings if intllib mod is installed.
|
-- Boilerplate to support localized strings if intllib mod is installed.
|
||||||
local S
|
local S = minetest.get_translator("quests")
|
||||||
if minetest.get_modpath("intllib") then
|
|
||||||
S = intllib.Getter()
|
|
||||||
else
|
|
||||||
-- If you don't use insertions (@1, @2, etc) you can use this:
|
|
||||||
S = function(s) return s end
|
|
||||||
end
|
|
||||||
|
|
||||||
local show_max = 10 -- the maximum visible quests.
|
local show_max = 10 -- the maximum visible quests.
|
||||||
|
|
||||||
@ -55,7 +49,7 @@ function quests.show_hud(playername, autohide)
|
|||||||
position = {x = hud_config.position.x, y = hud_config.position.y},
|
position = {x = hud_config.position.x, y = hud_config.position.y},
|
||||||
offset = {x = hud_config.offset.x, y = hud_config.offset.y - 20},
|
offset = {x = hud_config.offset.x, y = hud_config.offset.y - 20},
|
||||||
number = hud_config.number,
|
number = hud_config.number,
|
||||||
text = S("Quests:")
|
text = S("Quests") .. ":"
|
||||||
})
|
})
|
||||||
|
|
||||||
quests.hud[playername].list = {}
|
quests.hud[playername].list = {}
|
||||||
@ -190,7 +184,7 @@ function quests.update_hud(playername)
|
|||||||
player:hud_change(quests.hud[playername].header, "text", S("No more Quests"))
|
player:hud_change(quests.hud[playername].header, "text", S("No more Quests"))
|
||||||
minetest.after(3, function(playername)
|
minetest.after(3, function(playername)
|
||||||
if next(quests.active_quests[playername]) ~= nil then
|
if next(quests.active_quests[playername]) ~= nil then
|
||||||
player:hud_change(quests.hud[playername].header, "text", S("Quests:"))
|
player:hud_change(quests.hud[playername].header, "text", S("Quests")..":")
|
||||||
quests.update_hud(playername)
|
quests.update_hud(playername)
|
||||||
else
|
else
|
||||||
quests.hide_hud(playername)
|
quests.hide_hud(playername)
|
||||||
|
@ -1,20 +0,0 @@
|
|||||||
missing description = fehlende Beschreibung
|
|
||||||
missing title = fehlender Titel
|
|
||||||
Quests: = Quests:
|
|
||||||
No more Quests = Keine weiteren Quests
|
|
||||||
Abort quest = Quest abbrechen
|
|
||||||
Configure = Konfigurieren
|
|
||||||
Enable HUD = HUD einschalten
|
|
||||||
Autohide HUD = HUD automatisch verstecken
|
|
||||||
Exit = Verlassen
|
|
||||||
Failed quests = Gescheiterte Quests
|
|
||||||
Finished quests = Beendete Quests
|
|
||||||
Info = Info
|
|
||||||
No quest specified. = Keine Quest ausgewählt.
|
|
||||||
Open quests = Offene Quests
|
|
||||||
Return = Zurück
|
|
||||||
Show all open quests = Zeige alle offenen Quests
|
|
||||||
There are no quests in this category. = Es gibt keine Quests in dieser Kategorie.
|
|
||||||
New quest: = Neue Quest:
|
|
||||||
Quest completed: = Quest beendet:
|
|
||||||
Quest failed: = Quest gescheitert:
|
|
23
locale/quests.de.tr
Normal file
23
locale/quests.de.tr
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
# textdomain: quests
|
||||||
|
missing description=fehlende Beschreibung
|
||||||
|
missing title=fehlender Titel
|
||||||
|
Quests=Quests
|
||||||
|
No more Quests=Keine weiteren Quests
|
||||||
|
Abort quest=Quest abbrechen
|
||||||
|
Configure=Konfigurieren
|
||||||
|
Enable HUD=HUD einschalten
|
||||||
|
Autohide HUD=HUD automatisch verstecken
|
||||||
|
Exit=Verlassen
|
||||||
|
Failed quests=Gescheiterte Quests
|
||||||
|
Finished quests=Beendete Quests
|
||||||
|
Info=Info
|
||||||
|
No quest specified.=Keine Quest ausgewählt.
|
||||||
|
Open quests=Offene Quests
|
||||||
|
Return=Zurück
|
||||||
|
Show all open quests=Zeige alle offenen Quests
|
||||||
|
There are no quests in this category.=Es gibt keine Quests in dieser Kategorie.
|
||||||
|
New quest=Neue Quest
|
||||||
|
Quest completed=Quest beendet
|
||||||
|
Quest failed=Quest gescheitert
|
||||||
|
Central messages=Zentrale nachrichten
|
||||||
|
|
22
locale/quests.template.tr
Normal file
22
locale/quests.template.tr
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
# textdomain: quests
|
||||||
|
missing description=
|
||||||
|
missing title=
|
||||||
|
Quests=
|
||||||
|
No more Quests=
|
||||||
|
Abort quest=
|
||||||
|
Configure=
|
||||||
|
Enable HUD=
|
||||||
|
Autohide HUD=
|
||||||
|
Exit=
|
||||||
|
Failed quests=
|
||||||
|
Finished quests=
|
||||||
|
Info=
|
||||||
|
No quest specified.=
|
||||||
|
Open quests=
|
||||||
|
Return=
|
||||||
|
Show all open quests=
|
||||||
|
There are no quests in this category.=
|
||||||
|
New quest=
|
||||||
|
Quest completed=
|
||||||
|
Quest failed=
|
||||||
|
Central messages=
|
@ -1,20 +0,0 @@
|
|||||||
missing description =
|
|
||||||
missing title =
|
|
||||||
Quests: =
|
|
||||||
No more Quests =
|
|
||||||
Abort quest =
|
|
||||||
Configure =
|
|
||||||
Enable HUD =
|
|
||||||
Autohide HUD =
|
|
||||||
Exit =
|
|
||||||
Failed quests =
|
|
||||||
Finished quests =
|
|
||||||
Info =
|
|
||||||
No quest specified. =
|
|
||||||
Open quests =
|
|
||||||
Return =
|
|
||||||
Show all open quests =
|
|
||||||
There are no quests in this category. =
|
|
||||||
New quest: =
|
|
||||||
Quest completed: =
|
|
||||||
Quest failed: =
|
|
Reference in New Issue
Block a user