Fix bgcolor fullscreen value
This commit is contained in:
parent
98906e1dde
commit
e9302239fb
7
core.lua
7
core.lua
|
@ -142,6 +142,13 @@ function types.boolean(bool)
|
|||
end
|
||||
end
|
||||
|
||||
function types.fullscreen(param)
|
||||
if param == 'both' or param == 'neither' then
|
||||
return param
|
||||
end
|
||||
return types.boolean(param)
|
||||
end
|
||||
|
||||
function types.table(obj)
|
||||
local s, e = obj:find('=', nil, true)
|
||||
assert(s, 'Invalid syntax: "' .. obj .. '".')
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -65,10 +65,10 @@ background9:
|
|||
- - [middle_x, number]
|
||||
bgcolor:
|
||||
- - [bgcolor, string]
|
||||
- [fullscreen, boolean]
|
||||
- [fullscreen, fullscreen]
|
||||
- [fbgcolor, string]
|
||||
- - [bgcolor, string]
|
||||
- [fullscreen, boolean]
|
||||
- [fullscreen, fullscreen]
|
||||
- - [bgcolor, string]
|
||||
box:
|
||||
- - - [x, number]
|
||||
|
|
|
@ -18,8 +18,9 @@ _known = _make_known(
|
|||
'starting_item_index', 'scroll_factor', 'frame_count',
|
||||
'frame_duration', 'frame_start'),
|
||||
boolean=('auto_clip', 'fixed_size', 'transparent', 'draw_border', 'bool',
|
||||
'fullscreen', 'noclip', 'drawborder', 'selected', 'force',
|
||||
'close_on_enter', 'continuous', 'mouse_control'),
|
||||
'noclip', 'drawborder', 'selected', 'force', 'close_on_enter',
|
||||
'continuous', 'mouse_control'),
|
||||
fullscreen=('fullscreen',),
|
||||
table=('param', 'opt', 'prop'),
|
||||
null=('',),
|
||||
)
|
||||
|
|
13
tests.lua
13
tests.lua
|
@ -82,6 +82,8 @@ local fs = [[
|
|||
dropdown[0,0;1;test;abc,def,ghi,jkl;2]
|
||||
field_close_on_enter[my-field;false]
|
||||
bgcolor[blue]
|
||||
bgcolor[blue;true]
|
||||
bgcolor[blue;both;green]
|
||||
]]
|
||||
fs = ('\n' .. fs):gsub('\n[ \n]*', '')
|
||||
|
||||
|
@ -173,6 +175,17 @@ test_parse_unparse(fs, {
|
|||
type = "bgcolor",
|
||||
bgcolor = "blue",
|
||||
},
|
||||
{
|
||||
type = "bgcolor",
|
||||
bgcolor = "blue",
|
||||
fullscreen = true,
|
||||
},
|
||||
{
|
||||
type = "bgcolor",
|
||||
bgcolor = "blue",
|
||||
fullscreen = "both",
|
||||
fbgcolor = "green",
|
||||
},
|
||||
})
|
||||
|
||||
local function permutations(elem_s, elem, ...)
|
||||
|
|
Loading…
Reference in New Issue