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