Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add restart, work text for reset #1332

Merged
merged 1 commit into from
Mar 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lua/core/menu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ m["PARAMS"] = require 'core/menu/params'
m["SYSTEM"] = require 'core/menu/system'
m["DEVICES"] = require 'core/menu/devices'
m["WIFI"] = require 'core/menu/wifi'
m["RESTART"] = require 'core/menu/restart'
m["RESET"] = require 'core/menu/reset'
m["UPDATE"] = require 'core/menu/update'
m["SLEEP"] = require 'core/menu/sleep'
Expand Down
2 changes: 1 addition & 1 deletion lua/core/menu/reset.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ m.redraw = function()
screen.clear()
screen.level(m.confirmed==false and 10 or 2)
screen.move(64,40)
screen.text_center(m.confirmed==false and "reset?" or "reset")
screen.text_center(m.confirmed==false and "clear settings and restart?" or "restarting.")
screen.update()
end

Expand Down
29 changes: 29 additions & 0 deletions lua/core/menu/restart.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
local m = {
confirmed = false
}

m.key = function(n,z)
if n==2 and z==1 then
_menu.set_page("SYSTEM")
elseif n==3 and z==1 then
m.confirmed = true
_menu.redraw()
_norns.reset()
end
end


m.enc = function(n,delta) end

m.redraw = function()
screen.clear()
screen.level(m.confirmed==false and 10 or 2)
screen.move(64,40)
screen.text_center(m.confirmed==false and "restart?" or "restarting.")
screen.update()
end

m.init = function() end
m.deinit = function() end

return m
4 changes: 2 additions & 2 deletions lua/core/menu/system.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
local m = {
pos = 1,
list = {"DEVICES > ", "WIFI >", "RESET", "UPDATE"},
pages = {"DEVICES", "WIFI", "RESET", "UPDATE"}
list = {"DEVICES > ", "WIFI >", "RESTART", "RESET", "UPDATE"},
pages = {"DEVICES", "WIFI", "RESTART", "RESET", "UPDATE"}
}

m.key = function(n,z)
Expand Down