mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-22 01:09:41 +00:00
Merge branch 'settings_input' into 'master'
More responsive renderers for input events (#6827) Closes #6827 See merge request OpenMW/openmw!2093
This commit is contained in:
commit
e70d2be1ee
2 changed files with 14 additions and 13 deletions
|
@ -150,6 +150,13 @@ local function renderGroup(group, global)
|
||||||
|
|
||||||
local resetButtonLayout = {
|
local resetButtonLayout = {
|
||||||
template = I.MWUI.templates.box,
|
template = I.MWUI.templates.box,
|
||||||
|
events = {
|
||||||
|
mouseClick = async:callback(function()
|
||||||
|
for _, setting in pairs(group.settings) do
|
||||||
|
setSettingValue(global, group.key, setting.key, setting.default)
|
||||||
|
end
|
||||||
|
end),
|
||||||
|
},
|
||||||
content = ui.content {
|
content = ui.content {
|
||||||
{
|
{
|
||||||
template = I.MWUI.templates.padding,
|
template = I.MWUI.templates.padding,
|
||||||
|
@ -159,13 +166,6 @@ local function renderGroup(group, global)
|
||||||
props = {
|
props = {
|
||||||
text = interfaceL10n('Reset')
|
text = interfaceL10n('Reset')
|
||||||
},
|
},
|
||||||
events = {
|
|
||||||
mouseClick = async:callback(function()
|
|
||||||
for _, setting in pairs(group.settings) do
|
|
||||||
setSettingValue(global, group.key, setting.key, setting.default)
|
|
||||||
end
|
|
||||||
end),
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -73,7 +73,7 @@ return function(registerRenderer)
|
||||||
registerRenderer('checkbox', function(value, set, argument)
|
registerRenderer('checkbox', function(value, set, argument)
|
||||||
argument = applyDefaults(argument, defaultArgument)
|
argument = applyDefaults(argument, defaultArgument)
|
||||||
local l10n = core.l10n(argument.l10n)
|
local l10n = core.l10n(argument.l10n)
|
||||||
return disable(argument.disabled, paddedBox {
|
local box = paddedBox {
|
||||||
template = I.MWUI.templates.padding,
|
template = I.MWUI.templates.padding,
|
||||||
content = ui.content {
|
content = ui.content {
|
||||||
{
|
{
|
||||||
|
@ -81,12 +81,13 @@ return function(registerRenderer)
|
||||||
props = {
|
props = {
|
||||||
text = l10n(value and argument.trueLabel or argument.falseLabel)
|
text = l10n(value and argument.trueLabel or argument.falseLabel)
|
||||||
},
|
},
|
||||||
events = {
|
|
||||||
mouseClick = async:callback(function() set(not value) end),
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
})
|
}
|
||||||
|
box.events = {
|
||||||
|
mouseClick = async:callback(function() set(not value) end)
|
||||||
|
}
|
||||||
|
return disable(argument.disabled, box)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue