Use awards for technical things, and achievements for user facing things

Fixes #18
This commit is contained in:
rubenwardy
2018-04-05 17:09:42 +01:00
parent e110bbbc7a
commit 4e6ade249e
6 changed files with 105 additions and 104 deletions

20
gui.lua
View File

@ -67,7 +67,7 @@ function awards.get_formspec(name, to, sid)
local data = awards.player(name)
if #awards_list == 0 then
formspec = formspec .. "label[3.9,1.5;"..minetest.formspec_escape(S("Error: No awards available.")).."]"
formspec = formspec .. "label[3.9,1.5;"..minetest.formspec_escape(S("Error: No achivements available.")).."]"
formspec = formspec .. "button_exit[4.2,2.3;3,1;close;"..minetest.formspec_escape(S("OK")).."]"
return formspec
end
@ -79,12 +79,12 @@ function awards.get_formspec(name, to, sid)
if def and def.secret and not item.unlocked then
formspec = formspec .. "label[1,2.75;"..
minetest.formspec_escape(S("(Secret Award)")).."]"..
minetest.formspec_escape(S("(Secret Achievement)")).."]"..
"image[1,0;3,3;awards_unknown.png]"
if def and def.description then
formspec = formspec .. "textarea[0.25,3.25;4.8,1.7;;"..
minetest.formspec_escape(
S("Unlock this award to find out what it is."))..";]"
S("Unlock this achievement to find out what it is."))..";]"
end
else
local title = item.name
@ -139,7 +139,7 @@ function awards.get_formspec(name, to, sid)
first = false
if def.secret and not award.unlocked then
formspec = formspec .. "#707070"..minetest.formspec_escape(S("(Secret Award)"))
formspec = formspec .. "#707070"..minetest.formspec_escape(S("(Secret Achievement)"))
else
local title = award.name
if def and def.title then
@ -166,19 +166,19 @@ function awards.show_to(name, to, sid, text)
end
local data = awards.player(to)
if name == to and data.disabled then
minetest.chat_send_player(S("You've disabled awards. Type /awards enable to reenable."))
minetest.chat_send_player(S("You've disabled achievement. Type /awards enable to reenable."))
return
end
if text then
local awards_list = order_awards(name)
if #awards_list == 0 then
minetest.chat_send_player(to, S("Error: No awards available."))
minetest.chat_send_player(to, S("Error: No achievement available."))
return
elseif not data or not data.unlocked then
minetest.chat_send_player(to, S("You have not unlocked any awards."))
minetest.chat_send_player(to, S("You have not unlocked any achievements."))
return
end
minetest.chat_send_player(to, string.format(S("%ss awards:"), name))
minetest.chat_send_player(to, string.format(S("%ss achievements:"), name))
for str, _ in pairs(data.unlocked) do
local def = awards.registered_awards[str]
@ -211,7 +211,7 @@ end
if minetest.get_modpath("sfinv") then
sfinv.register_page("awards:awards", {
title = S("Awards"),
title = S("Achievements"),
on_enter = function(self, player, context)
context.awards_idx = 1
end,
@ -237,7 +237,7 @@ if minetest.get_modpath("unified_inventory") ~= nil then
unified_inventory.register_button("awards", {
type = "image",
image = "awards_ui_icon.png",
tooltip = S("Awards"),
tooltip = S("Achievements"),
action = function(player)
local name = player:get_player_name()
awards.show_to(name, name, nil, false)