milo save status tab + update record for new pastebin link

This commit is contained in:
kepler155c@gmail.com
2019-03-21 20:28:51 -04:00
parent 3d815c6332
commit 8ca0071786
3 changed files with 19 additions and 2 deletions

View File

@@ -92,7 +92,7 @@ local function loadAPI(url, env)
return apiEnv return apiEnv
end end
bbpack = loadAPI('http://pastebin.com/raw/PdrJjb5S', getfenv(1)) bbpack = loadAPI('http://pastebin.com/raw/cUYTGbpb', getfenv(1))
GIF = loadAPI('http://pastebin.com/raw/5uk9uRjC', getfenv(1)) GIF = loadAPI('http://pastebin.com/raw/5uk9uRjC', getfenv(1))
local s, m = Util.runUrl(getfenv(1), 'http://pastebin.com/raw/cUYTGbpb', 'get', 'CnLzL5fg') local s, m = Util.runUrl(getfenv(1), 'http://pastebin.com/raw/cUYTGbpb', 'get', 'CnLzL5fg')

View File

@@ -436,6 +436,15 @@ Unlocked Slots : %d of %d (%d%%)
UI.Tab.disable(self) UI.Tab.disable(self)
end end
function page:eventHandler(event)
if event.type == 'tab_activate' then
local state = Milo:getState('statusState') or { }
state[node.name] = event.activated.tabTitle
Milo:setState('statusState', state)
end
return UI.Page.eventHandler(self, event)
end
table.insert(context.loggers, function(...) table.insert(context.loggers, function(...)
local oterm = term.redirect(activityTab.term.win) local oterm = term.redirect(activityTab.term.win)
activityTab.term.win.scrollBottom() activityTab.term.win.scrollBottom()
@@ -449,6 +458,13 @@ Unlocked Slots : %d of %d (%d%%)
Event.onTimeout(0, function() Event.onTimeout(0, function()
UI:setPage(page) UI:setPage(page)
end) end)
-- restore active tab
local tabState = Milo:getState('statusState') or { }
if tabState[node.name] then
page.tabs:selectTab(Util.find(page.tabs, 'tabTitle', tabState[node.name]))
end
return page return page
end end

View File

@@ -15,6 +15,7 @@ local function showRequirements(missing)
print([[A neural interface is required containing: print([[A neural interface is required containing:
* Overlay glasses * Overlay glasses
* Scanner * Scanner
* Modem
]]) ]])
error('Missing: ' .. missing) error('Missing: ' .. missing)
end end
@@ -53,7 +54,7 @@ local targets = {
["minecraft:glowstone"] = 0xFFDFA166 ["minecraft:glowstone"] = 0xFFDFA166
} }
local projecting = { } local projecting = { }
local offset = getPoint() or error('GPS not found') local offset = getPoint() or showRequirements('GPS')
local canvas = modules.canvas3d().create() local canvas = modules.canvas3d().create()
local function update() local function update()