More tweaks
This commit is contained in:
parent
b0002eb7cf
commit
6fe9f96cad
22
init.lua
22
init.lua
|
@ -1793,9 +1793,9 @@ local function get_rcp_extra(player, fs, data, panel, is_recipe, is_usage)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function get_items_fs(fs, data, creative)
|
local function get_items_fs(fs, data, extend)
|
||||||
local rows = 8
|
local rows = 8
|
||||||
local lines = creative and 12 or 9
|
local lines = extend and 12 or 9
|
||||||
local ipp = rows * lines
|
local ipp = rows * lines
|
||||||
local size = 0.85
|
local size = 0.85
|
||||||
|
|
||||||
|
@ -1834,7 +1834,7 @@ local function get_items_fs(fs, data, creative)
|
||||||
X = X - (X * 0.045) + data.xoffset + 0.28
|
X = X - (X * 0.045) + data.xoffset + 0.28
|
||||||
|
|
||||||
local Y = round((i % ipp - X) / rows + 1, 0)
|
local Y = round((i % ipp - X) / rows + 1, 0)
|
||||||
Y = Y - (Y * (creative and 0.11 or 0.06)) + 0.9
|
Y = Y - (Y * (extend and 0.11 or 0.06)) + 0.9
|
||||||
|
|
||||||
if data.query_item == item then
|
if data.query_item == item then
|
||||||
fs("image", X, Y, size, size, PNG.slot)
|
fs("image", X, Y, size, size, PNG.slot)
|
||||||
|
@ -1870,17 +1870,27 @@ local function get_panels(player, data, fs, full_height)
|
||||||
|
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
local creative = core.is_creative_enabled(name)
|
local creative = core.is_creative_enabled(name)
|
||||||
|
local extend
|
||||||
|
|
||||||
if data.query_item then
|
if data.query_item then
|
||||||
panels = {_title, _recipes, _usages, _favs}
|
panels = {_title, _recipes, _usages, _favs}
|
||||||
else
|
else
|
||||||
panels = {_items, _favs}
|
panels = {_items}
|
||||||
|
|
||||||
|
if #data.favs == 0 then
|
||||||
|
extend = true
|
||||||
|
else
|
||||||
|
insert(panels, _favs)
|
||||||
|
end
|
||||||
|
|
||||||
|
if creative or extend then
|
||||||
|
_items.height = full_height
|
||||||
|
|
||||||
if creative then
|
if creative then
|
||||||
_items.height = full_height
|
|
||||||
panels = {_items}
|
panels = {_items}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
for idx = 1, #panels do
|
for idx = 1, #panels do
|
||||||
local panel = panels[idx]
|
local panel = panels[idx]
|
||||||
|
@ -1899,7 +1909,7 @@ local function get_panels(player, data, fs, full_height)
|
||||||
if is_recipe or is_usage then
|
if is_recipe or is_usage then
|
||||||
get_rcp_extra(player, fs, data, panel, is_recipe, is_usage)
|
get_rcp_extra(player, fs, data, panel, is_recipe, is_usage)
|
||||||
elseif panel.name == "items" then
|
elseif panel.name == "items" then
|
||||||
get_items_fs(fs, data, creative)
|
get_items_fs(fs, data, extend)
|
||||||
elseif panel.name == "title" then
|
elseif panel.name == "title" then
|
||||||
get_header(fs, data)
|
get_header(fs, data)
|
||||||
elseif panel.name == "favs" then
|
elseif panel.name == "favs" then
|
||||||
|
|
Ŝarĝante…
Reference in New Issue