Improve layout

This commit is contained in:
Pyrex 2024-02-10 21:02:31 -08:00
parent 6998d614a9
commit b4f4b8cbb5

View File

@ -164,29 +164,30 @@ function ruleset:generate_layouts()
local ruleset=self
local width=ruleset.n_slots*10
local x=(128-width)\2
local y=9 -- 1 is also fine
function layouts:well(i)
if i<=ruleset.n_suits then
local wx=width-ruleset.n_suits*10+(i-1)*10
return layout:new(x+wx,1,layout_mode.obscured)
return layout:new(x+wx,y,layout_mode.obscured)
end
i-=ruleset.n_suits
if (i==1) return layout:new(x,1,layout_mode.obscured)
if (i==2) return layout:new(x+10,1,layout_mode.obscured)
if (i==1) return layout:new(x,y,layout_mode.obscured)
if (i==2) return layout:new(x+10,y,layout_mode.obscured)
assert(false,"unknown well")
end
function layouts:checkpoint()
local wx=(ruleset.n_slots\2)*10
return layout:new(x+wx,1,layout_mode.obscured)
return layout:new(x+wx,y,layout_mode.obscured)
end
function layouts:slot(i)
if i<=ruleset.n_slots then
local sx=(i-1)*10
return layout:new(x+sx,18,layout_mode.vertical)
return layout:new(x+sx,y+17,layout_mode.vertical)
end
if (i==ruleset.n_slots+1) return layout:new(x+width-ruleset.n_suits*5-5,1,layout_mode.rotated)
if (i==ruleset.n_slots+1) return layout:new(x+width-ruleset.n_suits*5-5,y,layout_mode.rotated)
assert(false, "unknown slot")
end
end