Implement flexible calendar formspec size
parent
a4a5e5a333
commit
e1f7f23925
5
gui.lua
5
gui.lua
|
@ -43,7 +43,7 @@ function calendar.show_calendar(player_name, settings, wanted_months, wanted_yea
|
|||
wanted_dmonths = wanted_dmonths + 1
|
||||
wanted_dyears = wanted_dyears + 1
|
||||
end
|
||||
local formspec = "formspec_version[3]size["..(calendar.WEEK_DAYS+2)..",10]"
|
||||
local formspec = ""
|
||||
if ordinal then
|
||||
formspec = formspec .. "label[0.5,0.5;"..F(S("Month @1, year @2", wanted_dmonths, wanted_dyears)).."]"
|
||||
else
|
||||
|
@ -119,6 +119,9 @@ function calendar.show_calendar(player_name, settings, wanted_months, wanted_yea
|
|||
.. "tooltip[next_month;"..F(S("Next month")).."]"
|
||||
.. "tooltip[next_year;"..F(S("Next year")).."]"
|
||||
end
|
||||
local size_x = math.max(calendar.WEEK_DAYS+2, 7)
|
||||
local size_y = y+1.5
|
||||
formspec = "formspec_version[3]size["..size_x..","..size_y.."]" .. formspec
|
||||
minetest.show_formspec(player_name, "calendar:calendar", formspec)
|
||||
|
||||
player_current_calendars[player_name] = { years = wanted_years, months = wanted_months }
|
||||
|
|
Loading…
Reference in New Issue