Make button position constant

master
Wuzzy 2020-08-27 10:09:32 +02:00
parent 53e45a1c3c
commit 50d7f558d6
1 changed files with 6 additions and 1 deletions

View File

@ -41,6 +41,7 @@ local function show_calendar(player_name, ordinal, wanted_months, wanted_years)
local tdays = 0
tdays = tdays + wanted_years * (calendar.MONTHS * calendar.MONTH_DAYS)
tdays = tdays + wanted_months * calendar.MONTH_DAYS
local tdays_start = tdays
local weekday = calendar.get_weekday(tdays)
local x, y = 0.75, 1.2
@ -81,7 +82,11 @@ local function show_calendar(player_name, ordinal, wanted_months, wanted_years)
"label["..(x+0.15)..","..(y+0.3)..";"..day_str.."]"
tdays = tdays + 1
end
y = y + 1.2
y = y + 1.1
if calendar.get_weekday(tdays_start) <= calendar.get_weekday(tdays - 1) then
y = y + 1.1
end
y = y + 0.1
if wanted_months > 0 or wanted_years > 0 then
formspec = formspec .. "button[0.5,"..y..";1,1;prev_year;<<]"
.. "button[1.5,"..y..";1,1;prev_month;<]"