Skip to content

Commit

Permalink
more consistent formspec size decision
Browse files Browse the repository at this point in the history
  • Loading branch information
VanessaE committed Mar 31, 2021
1 parent c044f5e commit 860371e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
4 changes: 4 additions & 0 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ local ui = unified_inventory
ui.style_full = {
formspec_x = 1,
formspec_y = 1,
formw = 17.75,
formh = 12.25,
pagecols = 8,
pagerows = 10,
page_x = 10.75,
Expand Down Expand Up @@ -80,6 +82,8 @@ ui.style_full = {
ui.style_lite = {
formspec_x = 0.6,
formspec_y = 0.6,
formw = 14,
formh = 9.75,
pagecols = 4,
pagerows = 6,
page_x = 10.5,
Expand Down
13 changes: 5 additions & 8 deletions internal.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,15 @@ function ui.get_formspec(player, page)
if not pagedef then
return "" -- Invalid page name
end

local formspec = {
"formspec_version[4]size[17.75,12.25]",
"formspec_version[4]",
"size["..ui_peruser.formw..","..ui_peruser.formh.."]",
pagedef.formspec_prepend and "" or "no_prepend[]",
ui.standard_background -- Background
ui.standard_background
}
local n = 4

if draw_lite_mode then
formspec[1] = "formspec_version[4]size[14,9.75]"
formspec[3] = ui.standard_background
end
local n = 5

local perplayer_formspec = ui.get_per_player_formspec(player_name)
local fsdata = pagedef.get_formspec(player, perplayer_formspec)
Expand Down

0 comments on commit 860371e

Please sign in to comment.