Style cleaning

This commit is contained in:
Jean-Patrick Guerrero 2019-11-27 13:36:06 +01:00
parent 89059f20b6
commit 303aa3ef91

@ -671,13 +671,12 @@ local function get_tooltip(name, info)
if info.replace then if info.replace then
local desc = clr("yellow", get_desc(info.replace)) local desc = clr("yellow", get_desc(info.replace))
tooltip = add(S("Replaced by @1 on crafting", desc))
if info.cooktime then if info.cooktime then
tooltip = add(S("Replaced by @1 on smelting", desc)) tooltip = add(S("Replaced by @1 on smelting", desc))
elseif info.burntime then elseif info.burntime then
tooltip = add(S("Replaced by @1 on burning", desc)) tooltip = add(S("Replaced by @1 on burning", desc))
else
tooltip = add(S("Replaced by @1 on crafting", desc))
end end
end end
@ -710,7 +709,7 @@ local function get_output_fs(fs, L)
fs[#fs + 1] = fmt(FMT.image, pos_x, pos_y + L.spacing, 0.5, 0.5, icon) fs[#fs + 1] = fmt(FMT.image, pos_x, pos_y + L.spacing, 0.5, 0.5, icon)
local tooltip = custom_recipe and custom_recipe.description or local tooltip = custom_recipe and custom_recipe.description or
L.shapeless and S("Shapeless") or S("Cooking") L.shapeless and S"Shapeless" or S"Cooking"
if CORE_VERSION >= 500 then if CORE_VERSION >= 500 then
fs[#fs + 1] = fmt(FMT.tooltip, pos_x, pos_y + L.spacing, 0.5, 0.5, ESC(tooltip)) fs[#fs + 1] = fmt(FMT.tooltip, pos_x, pos_y + L.spacing, 0.5, 0.5, ESC(tooltip))
@ -916,7 +915,7 @@ local function get_panels(data, fs)
if not sfinv_only and rn == 0 then if not sfinv_only and rn == 0 then
btn_lab = clr("red", is_recipe and btn_lab = clr("red", is_recipe and
ESC(S("No recipes")) or ESC(S("No usages"))) ESC(S"No recipes") or ESC(S"No usages"))
elseif (not sfinv_only and is_recipe) or elseif (not sfinv_only and is_recipe) or
(sfinv_only and not data.show_usages) then (sfinv_only and not data.show_usages) then
@ -1027,7 +1026,7 @@ local function make_formspec(name)
fs[#fs + 1] = fmt(mul_elem(FMT.arrow, 2), fs[#fs + 1] = fmt(mul_elem(FMT.arrow, 2),
sfinv_only and 5.45 or (ROWS * 6.83) / 11, sfinv_only and 5.45 or (ROWS * 6.83) / 11,
-0.05, PNG.prev, "prev_page", PNG.prev, -0.05, PNG.prev, "prev_page", PNG.prev,
sfinv_only and 7.2 or (ROWS * 8.75) / 11, sfinv_only and 7.2 or (ROWS * 8.75) / 11,
-0.05, PNG.next, "next_page", PNG.next) -0.05, PNG.next, "next_page", PNG.next)
end end
@ -1036,11 +1035,11 @@ local function make_formspec(name)
0.06, clr("yellow", data.pagenum), data.pagemax) 0.06, clr("yellow", data.pagenum), data.pagemax)
if #data.items == 0 then if #data.items == 0 then
local no_item = S("No item to show") local no_item = S"No item to show"
local pos = ROWS / 3 local pos = ROWS / 3
if next(recipe_filters) and #init_items > 0 and data.filter == "" then if next(recipe_filters) and #init_items > 0 and data.filter == "" then
no_item = S("Collect items to reveal more recipes") no_item = S"Collect items to reveal more recipes"
pos = pos - 1 pos = pos - 1
end end
@ -1085,12 +1084,12 @@ local show_fs = function(player, name)
end end
craftguide.register_craft_type("digging", { craftguide.register_craft_type("digging", {
description = ESC(S("Digging")), description = ESC(S"Digging"),
icon = "default_tool_steelpick.png", icon = "default_tool_steelpick.png",
}) })
craftguide.register_craft_type("digging_chance", { craftguide.register_craft_type("digging_chance", {
description = ESC(S("Digging Chance")), description = ESC(S"Digging Chance"),
icon = "default_tool_mesepick.png", icon = "default_tool_mesepick.png",
}) })
@ -1564,7 +1563,7 @@ end
if sfinv_only then if sfinv_only then
sfinv.register_page("craftguide:craftguide", { sfinv.register_page("craftguide:craftguide", {
title = S("Craft Guide"), title = S"Craft Guide",
get = function(self, player, context) get = function(self, player, context)
local name = player:get_player_name() local name = player:get_player_name()
@ -1607,7 +1606,7 @@ else
end end
core.register_craftitem("craftguide:book", { core.register_craftitem("craftguide:book", {
description = S("Crafting Guide"), description = S"Crafting Guide",
inventory_image = PNG.book, inventory_image = PNG.book,
wield_image = PNG.book, wield_image = PNG.book,
stack_max = 1, stack_max = 1,
@ -1618,7 +1617,7 @@ else
}) })
core.register_node("craftguide:sign", { core.register_node("craftguide:sign", {
description = S("Crafting Guide Sign"), description = S"Crafting Guide Sign",
drawtype = "nodebox", drawtype = "nodebox",
tiles = {PNG.sign}, tiles = {PNG.sign},
inventory_image = PNG.sign, inventory_image = PNG.sign,
@ -1670,8 +1669,8 @@ else
if rawget(_G, "sfinv_buttons") then if rawget(_G, "sfinv_buttons") then
sfinv_buttons.register_button("craftguide", { sfinv_buttons.register_button("craftguide", {
title = S("Crafting Guide"), title = S"Crafting Guide",
tooltip = S("Shows a list of available crafting recipes, cooking recipes and fuels"), tooltip = S"Shows a list of available crafting recipes, cooking recipes and fuels",
image = PNG.book, image = PNG.book,
action = function(player) action = function(player)
on_use(player) on_use(player)
@ -1968,12 +1967,12 @@ function craftguide.show(name, item, show_usages)
if not recipes and not usages then if not recipes and not usages then
if not recipes_cache[item] and not usages_cache[item] then if not recipes_cache[item] and not usages_cache[item] then
return false, msg(name, fmt("%s: %s", return false, msg(name, fmt("%s: %s",
S("No recipe or usage for this item"), S"No recipe or usage for this item",
get_desc(item))) get_desc(item)))
end end
return false, msg(name, fmt("%s: %s", return false, msg(name, fmt("%s: %s",
S("You don't know a recipe or usage for this item"), S"You don't know a recipe or usage for this item",
get_desc(item))) get_desc(item)))
end end
@ -1989,7 +1988,7 @@ function craftguide.show(name, item, show_usages)
end end
register_command("craft", { register_command("craft", {
description = S("Show recipe(s) of the pointed node"), description = S"Show recipe(s) of the pointed node",
func = function(name) func = function(name)
local player = get_player_by_name(name) local player = get_player_by_name(name)
local dir = player:get_look_dir() local dir = player:get_look_dir()
@ -2009,7 +2008,7 @@ register_command("craft", {
end end
if not node_name then if not node_name then
return false, msg(name, S("No node pointed")) return false, msg(name, S"No node pointed")
end end
return true, craftguide.show(name, node_name) return true, craftguide.show(name, node_name)