diff --git a/core/Turtles.lua b/core/Turtles.lua index 11cee46..1b77dee 100644 --- a/core/Turtles.lua +++ b/core/Turtles.lua @@ -14,7 +14,7 @@ local os = _G.os local shell = _ENV.shell local term = _G.term -UI.Button.defaults.focusIndicator = ' ' +--UI.Button.defaults.focusIndicator = ' ' UI:configure('Turtles', ...) local config = { } @@ -43,7 +43,7 @@ local page = UI.Page { x = 1, y = 5, ey = -2, scripts = UI.ScrollingGrid { tabTitle = 'Run', - backgroundColor = UI.TabBar.defaults.selectedBackgroundColor, + backgroundColor = colors.cyan, columns = { { heading = '', key = 'label' }, }, @@ -53,7 +53,7 @@ local page = UI.Page { }, turtles = UI.ScrollingGrid { tabTitle = 'Select', - backgroundColor = UI.TabBar.defaults.selectedBackgroundColor, + backgroundColor = colors.cyan, columns = { { heading = 'label', key = 'label' }, { heading = 'Dist', key = 'distance' }, @@ -65,7 +65,7 @@ local page = UI.Page { autospace = true, }, inventory = UI.ScrollingGrid { - backgroundColor = UI.TabBar.defaults.selectedBackgroundColor, + backgroundColor = colors.cyan, tabTitle = 'Inv', columns = { { heading = '', key = 'index', width = 2 }, @@ -90,7 +90,7 @@ local page = UI.Page { ]] action = UI.Window { tabTitle = 'Action', - backgroundColor = UI.TabBar.defaults.selectedBackgroundColor, + backgroundColor = colors.cyan, moveUp = UI.Button { x = 5, y = 2, text = 'up', diff --git a/milo/core/learnWizard.lua b/milo/core/learnWizard.lua index 34e6633..1643201 100644 --- a/milo/core/learnWizard.lua +++ b/milo/core/learnWizard.lua @@ -8,7 +8,7 @@ local learnPage = UI.Page { wizard = UI.Wizard { y = 2, ey = -2, pages = { - general = UI.Window { + general = UI.WizardPage { index = 1, grid = UI.ScrollingGrid { x = 2, ex = -2, y = 2, ey = -2, diff --git a/milo/core/machines.lua b/milo/core/machines.lua index c93642f..6bdc396 100644 --- a/milo/core/machines.lua +++ b/milo/core/machines.lua @@ -192,7 +192,7 @@ nodeWizard = UI.Page { wizard = UI.Wizard { y = 2, ey = -2, pages = { - general = UI.Window { + general = UI.WizardPage { index = 1, backgroundColor = colors.cyan, form = UI.Form { @@ -221,7 +221,7 @@ nodeWizard = UI.Page { help = 'Contents of inventory', }, }, - confirmation = UI.Window { + confirmation = UI.WizardPage { title = 'Confirm changes', index = 2, notice = UI.TextArea { @@ -375,7 +375,7 @@ end --[[ General Page ]] -- function nodeWizard.wizard.pages.general:enable() - UI.Window.enable(self) + UI.WizardPage.enable(self) self:focusFirst() end diff --git a/milo/plugins/activityView.lua b/milo/plugins/activityView.lua index c95e48b..2260111 100644 --- a/milo/plugins/activityView.lua +++ b/milo/plugins/activityView.lua @@ -14,7 +14,7 @@ local template = [[%sDisplays the amount of items entering or leaving storage.%s Right-clicking on the activity monitor will reset the totals.]] -local wizardPage = UI.Window { +local wizardPage = UI.WizardPage { title = 'Activity Monitor', index = 2, backgroundColor = colors.cyan, diff --git a/milo/plugins/brewingStandView.lua b/milo/plugins/brewingStandView.lua index 1d11816..c0cebda 100644 --- a/milo/plugins/brewingStandView.lua +++ b/milo/plugins/brewingStandView.lua @@ -15,7 +15,7 @@ When finished brewing, the recipe will be available upon refreshing. Note that you do not need to import items from the brewing stand or export blaze powder, this will be done automatically.]] -local brewingStandView = UI.Window { +local wizardPage = UI.WizardPage { title = 'Brewing Stand', index = 2, backgroundColor = colors.cyan, @@ -25,7 +25,7 @@ local brewingStandView = UI.Window { }, } -function brewingStandView:isValidType(node) +function wizardPage:isValidType(node) local m = device[node.name] return m and m.type == 'minecraft:brewing_stand'and { name = 'Brewing Stand', @@ -35,8 +35,8 @@ function brewingStandView:isValidType(node) } end -function brewingStandView:isValidFor(node) +function wizardPage:isValidFor(node) return node.mtype == 'brewingStand' end -UI:getPage('nodeWizard').wizard:add({ brewingStand = brewingStandView }) +UI:getPage('nodeWizard').wizard:add({ brewingStand = wizardPage }) diff --git a/milo/plugins/demandCraft.lua b/milo/plugins/demandCraft.lua index 5d33521..6464861 100644 --- a/milo/plugins/demandCraft.lua +++ b/milo/plugins/demandCraft.lua @@ -11,7 +11,7 @@ local craftPage = UI.Page { wizard = UI.Wizard { y = 2, ey = -2, pages = { - quantity = UI.Window { + quantity = UI.WizardPage { index = 1, text = UI.Text { x = 6, y = 3, @@ -36,7 +36,7 @@ local craftPage = UI.Page { }, }, }, - resources = UI.Window { + resources = UI.WizardPage { index = 2, grid = UI.ScrollingGrid { y = 2, ey = -2, @@ -105,7 +105,7 @@ function craftPage.wizard.pages.resources:enable() else self.grid:setValues({ }) end - return UI.Window.enable(self) + return UI.WizardPage.enable(self) end function craftPage:eventHandler(event) diff --git a/milo/plugins/exportView.lua b/milo/plugins/exportView.lua index 1d50478..caf9a2d 100644 --- a/milo/plugins/exportView.lua +++ b/milo/plugins/exportView.lua @@ -5,7 +5,7 @@ local Util = require('util') local colors = _G.colors local device = _G.device -local exportView = UI.Window { +local exportView = UI.WizardPage { title = 'Export item into inventory', index = 3, grid = UI.ScrollingGrid { diff --git a/milo/plugins/importView.lua b/milo/plugins/importView.lua index 0be12c2..d0572de 100644 --- a/milo/plugins/importView.lua +++ b/milo/plugins/importView.lua @@ -5,7 +5,7 @@ local Util = require('util') local colors = _G.colors local device = _G.device -local importView = UI.Window { +local importView = UI.WizardPage { title = 'Import item from inventory', index = 4, grid = UI.ScrollingGrid { diff --git a/milo/plugins/inputChestView.lua b/milo/plugins/inputChestView.lua index 8a7d752..7c1643f 100644 --- a/milo/plugins/inputChestView.lua +++ b/milo/plugins/inputChestView.lua @@ -11,7 +11,7 @@ local template = Any items placed in this chest will be imported into storage. ]] -local inputChestWizardPage = UI.Window { +local inputChestWizardPage = UI.WizardPage { title = 'Input Chest', index = 2, backgroundColor = colors.cyan, diff --git a/milo/plugins/jobMonitor.lua b/milo/plugins/jobMonitor.lua index 2036321..4b79da3 100644 --- a/milo/plugins/jobMonitor.lua +++ b/milo/plugins/jobMonitor.lua @@ -12,7 +12,7 @@ local device = _G.device local os = _G.os --[[ Configuration Screen ]] -local wizardPage = UI.Window { +local wizardPage = UI.WizardPage { title = 'Crafting Monitor', index = 2, backgroundColor = colors.cyan, diff --git a/milo/plugins/machineLearn.lua b/milo/plugins/machineLearn.lua index b80d11d..dc939b5 100644 --- a/milo/plugins/machineLearn.lua +++ b/milo/plugins/machineLearn.lua @@ -11,7 +11,7 @@ local context = Milo:getContext() local machine local pages = { - machines = UI.Window { + machines = UI.WizardPage { index = 2, validFor = 'Machine Processing', grid = UI.ScrollingGrid { @@ -22,7 +22,7 @@ local pages = { sortColumn = 'displayName', }, }, - confirmation = UI.Window { + confirmation = UI.WizardPage { index = 3, validFor = 'Machine Processing', notice = UI.TextArea { @@ -51,7 +51,7 @@ function pages.machines:enable() end end) self.grid:setValues(t) - UI.Window.enable(self) + UI.WizardPage.enable(self) end function pages.machines:validate() diff --git a/milo/plugins/massStorageView.lua b/milo/plugins/massStorageView.lua index c98701f..f934ee1 100644 --- a/milo/plugins/massStorageView.lua +++ b/milo/plugins/massStorageView.lua @@ -13,7 +13,7 @@ Must an interface for Refined Storage / Applied Energistics. Add all speed upgrades possible. ]] -local wizardPage = UI.Window { +local wizardPage = UI.WizardPage { title = 'Mass Storage', index = 2, backgroundColor = colors.cyan, diff --git a/milo/plugins/remote.lua b/milo/plugins/remote.lua index c2da9f4..fd5ae01 100644 --- a/milo/plugins/remote.lua +++ b/milo/plugins/remote.lua @@ -5,8 +5,6 @@ local Socket = require('socket') local device = _G.device -local SHIELD_SLOT = 2 - local context = Milo:getContext() local function getNameSafe(v) diff --git a/milo/plugins/remote/autostore.lua b/milo/plugins/remote/autostore.lua index 4cc8d8b..8f5761f 100644 --- a/milo/plugins/remote/autostore.lua +++ b/milo/plugins/remote/autostore.lua @@ -23,7 +23,7 @@ local page = UI.Page { }, tabs = UI.Tabs { y = 2, ey = -2, - inventory = UI.Window { + inventory = UI.Tab { tabTitle = 'Inventory', grid = UI.ScrollingGrid { y = 2, ey = -2, @@ -33,7 +33,7 @@ local page = UI.Page { sortColumn = 'displayName', }, }, - autostore = UI.Window { + autostore = UI.Tab { tabTitle = 'Deposit', grid = UI.ScrollingGrid { y = 2, ey = -2, @@ -71,7 +71,7 @@ function page.tabs.inventory:enable() self.grid:setValues(list) itemDB:flush() - return UI.Window.enable(self) + return UI.Tab.enable(self) end function page.tabs.inventory.grid:getRowTextColor(row) @@ -107,7 +107,7 @@ function page.tabs.autostore:enable() end self.grid:setValues(list) - return UI.Window.enable(self) + return UI.Tab.enable(self) end function page.tabs.autostore:eventHandler(event) diff --git a/milo/plugins/speakerView.lua b/milo/plugins/speakerView.lua index da063bd..c35b811 100644 --- a/milo/plugins/speakerView.lua +++ b/milo/plugins/speakerView.lua @@ -11,7 +11,7 @@ if speakerNode then Sound.setVolume(speakerNode.volume) end -local wizardPage = UI.Window { +local wizardPage = UI.WizardPage { title = 'Speaker', index = 2, backgroundColor = colors.cyan, diff --git a/milo/plugins/storageView.lua b/milo/plugins/storageView.lua index 64057f0..6b5c9c5 100644 --- a/milo/plugins/storageView.lua +++ b/milo/plugins/storageView.lua @@ -4,7 +4,7 @@ local UI = require('ui') local colors = _G.colors local device = _G.device -local storageView = UI.Window { +local storageView = UI.WizardPage { title = 'Storage Options - General', index = 2, backgroundColor = colors.cyan, @@ -34,11 +34,6 @@ local storageView = UI.Window { }, } -function storageView:enable() - UI.Window.enable(self) - self:focusFirst() -end - function storageView:validate() return self.form:save() end @@ -64,7 +59,7 @@ end UI:getPage('nodeWizard').wizard:add({ storageGeneral = storageView }) --[[ Locking Page ]]-- -local lockView = UI.Window { +local lockView = UI.WizardPage { title = 'Storage Options - Locking', index = 3, backgroundColor = colors.cyan, @@ -104,11 +99,6 @@ function lockView:showLockTypes() self.grid:draw() end -function lockView:enable() - UI.Window.enable(self) - self:focusFirst() -end - function lockView:validate() return self.form:save() end diff --git a/milo/plugins/trashcanView.lua b/milo/plugins/trashcanView.lua index a5df858..43b7a6f 100644 --- a/milo/plugins/trashcanView.lua +++ b/milo/plugins/trashcanView.lua @@ -5,7 +5,7 @@ local colors = _G.colors local device = _G.device --[[ Configuration Screen ]] -local wizardPage = UI.Window { +local wizardPage = UI.WizardPage { title = 'Trashcan', index = 2, backgroundColor = colors.cyan, @@ -40,11 +40,6 @@ local wizardPage = UI.Window { }, } -function wizardPage:enable() - UI.Window.enable(self) - self:focusFirst() -end - function wizardPage:validate() return self.form:save() end diff --git a/milo/plugins/turtleLearn.lua b/milo/plugins/turtleLearn.lua index 7c7ea19..4212e83 100644 --- a/milo/plugins/turtleLearn.lua +++ b/milo/plugins/turtleLearn.lua @@ -6,7 +6,7 @@ local colors = _G.colors local turtle = _G.turtle local pages = { - turtleCraft = UI.Window { + turtleCraft = UI.WizardPage { index = 2, validFor = 'Turtle Crafting', notice = UI.Text { diff --git a/swshop/shopConfig.lua b/swshop/shopConfig.lua index 6d5c9fe..afc9eef 100644 --- a/swshop/shopConfig.lua +++ b/swshop/shopConfig.lua @@ -5,7 +5,7 @@ local device = _G.device local os = _G.os --[[ Configuration Page ]]-- -local wizardPage = UI.Window { +local wizardPage = UI.WizardPage { title = 'Store Front', index = 2, backgroundColor = colors.cyan,