mirror of
https://github.com/minetest-mods/craftguide.git
synced 2024-11-29 22:03:42 +01:00
Shorten function name
This commit is contained in:
parent
c4272d8d24
commit
3cf4bef83a
17
init.lua
17
init.lua
@ -13,6 +13,7 @@ local searches = {}
|
|||||||
local progressive_mode = mt.settings:get_bool("craftguide_progressive_mode")
|
local progressive_mode = mt.settings:get_bool("craftguide_progressive_mode")
|
||||||
local sfinv_only = mt.settings:get_bool("craftguide_sfinv_only") and rawget(_G, "sfinv")
|
local sfinv_only = mt.settings:get_bool("craftguide_sfinv_only") and rawget(_G, "sfinv")
|
||||||
|
|
||||||
|
local colorize = mt.colorize
|
||||||
local fs_esc = mt.formspec_escape
|
local fs_esc = mt.formspec_escape
|
||||||
local reg_items = mt.registered_items
|
local reg_items = mt.registered_items
|
||||||
local get_result = mt.get_craft_result
|
local get_result = mt.get_craft_result
|
||||||
@ -290,7 +291,7 @@ local function get_tooltip(item, groups, cooktime, burntime)
|
|||||||
if groups then
|
if groups then
|
||||||
local groupstr = {}
|
local groupstr = {}
|
||||||
for i = 1, #groups do
|
for i = 1, #groups do
|
||||||
groupstr[#groupstr + 1] = mt.colorize("yellow", groups[i])
|
groupstr[#groupstr + 1] = colorize("yellow", groups[i])
|
||||||
end
|
end
|
||||||
|
|
||||||
groupstr = concat(groupstr, ", ")
|
groupstr = concat(groupstr, ", ")
|
||||||
@ -300,13 +301,13 @@ local function get_tooltip(item, groups, cooktime, burntime)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if cooktime then
|
if cooktime then
|
||||||
tooltip = tooltip .. "\n" .. S("Cooking time: @1",
|
tooltip = tooltip .. "\n" ..
|
||||||
mt.colorize("yellow", cooktime))
|
S("Cooking time: @1", colorize("yellow", cooktime))
|
||||||
end
|
end
|
||||||
|
|
||||||
if burntime then
|
if burntime then
|
||||||
tooltip = tooltip .. "\n" .. S("Burning time: @1",
|
tooltip = tooltip .. "\n" ..
|
||||||
mt.colorize("yellow", burntime))
|
S("Burning time: @1", colorize("yellow", burntime))
|
||||||
end
|
end
|
||||||
|
|
||||||
return "tooltip[" .. item .. ";" .. fs_esc(tooltip) .. "]"
|
return "tooltip[" .. item .. ";" .. fs_esc(tooltip) .. "]"
|
||||||
@ -510,7 +511,7 @@ local function make_formspec(name)
|
|||||||
fs[#fs + 1] = fmt(fmt_label,
|
fs[#fs + 1] = fmt(fmt_label,
|
||||||
data.iX - (sfinv_only and 1.7 or 2.2),
|
data.iX - (sfinv_only and 1.7 or 2.2),
|
||||||
0.22,
|
0.22,
|
||||||
mt.colorize("yellow", data.pagenum) .. " / " .. data.pagemax)
|
colorize("yellow", data.pagenum) .. " / " .. data.pagemax)
|
||||||
|
|
||||||
fs[#fs + 1] = "image_button[" .. (data.iX -
|
fs[#fs + 1] = "image_button[" .. (data.iX -
|
||||||
(sfinv_only and 0.7 or 1.2) - (data.iX >= 11 and 0.08 or 0)) ..
|
(sfinv_only and 0.7 or 1.2) - (data.iX >= 11 and 0.08 or 0)) ..
|
||||||
@ -954,7 +955,7 @@ mt.register_chatcommand("craft", {
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local red = mt.colorize("red", "[craftguide] ")
|
local red = colorize("red", "[craftguide] ")
|
||||||
|
|
||||||
if not node_name then
|
if not node_name then
|
||||||
return false, red .. S("No node pointed")
|
return false, red .. S("No node pointed")
|
||||||
@ -971,7 +972,7 @@ mt.register_chatcommand("craft", {
|
|||||||
end
|
end
|
||||||
|
|
||||||
if not recipes or #recipes == 0 then
|
if not recipes or #recipes == 0 then
|
||||||
local ylw = mt.colorize("yellow", node_name)
|
local ylw = colorize("yellow", node_name)
|
||||||
local msg = red .. "%s: " .. ylw
|
local msg = red .. "%s: " .. ylw
|
||||||
|
|
||||||
if is_fuel then
|
if is_fuel then
|
||||||
|
Loading…
Reference in New Issue
Block a user