extract a function
This commit is contained in:
parent
f1ddd6b8da
commit
d71e7fcfc8
|
@ -1,7 +1,5 @@
|
|||
settings_button = function(x)
|
||||
local w = App.width('settings')
|
||||
local x = x-5-w-5
|
||||
styled_button('settings', x, Menu_top+5,
|
||||
return right_justified_button('settings', x, Menu_top+5,
|
||||
function()
|
||||
Show_settings = not Show_settings
|
||||
if Show_settings then Show_overflow = false end
|
||||
|
@ -10,5 +8,4 @@ settings_button = function(x)
|
|||
love.filesystem.write('config', json.encode(settings()))
|
||||
end
|
||||
end)
|
||||
return x
|
||||
end
|
|
@ -0,0 +1,6 @@
|
|||
right_justified_button = function(name, x, y, callback)
|
||||
local w = App.width('settings')
|
||||
local x = x-5-w-5
|
||||
styled_button('settings', x, y, callback)
|
||||
return x
|
||||
end
|
Loading…
Reference in New Issue