Compare commits

...

2 Commits

Author SHA1 Message Date
MayaTheShy
432a9feff9 Implemented the usage of the standarised ui library. 2026-03-22 20:23:06 -04:00
MayaTheShy
ee76a61240 Refactor turtle status check in smelter page
- Updated the turtle status check logic to use ctx.craftTurtleOk for determining if the crafting turtle is available.
- Adjusted the logic to fall back on checking ctx.craftTurtleName and its peripheral presence if ctx.craftTurtleOk is not set.
2026-03-22 20:20:07 -04:00
3 changed files with 238 additions and 2409 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -958,8 +958,9 @@ local function buildSmelterPage()
turtleStatus = UI.Window {
x = -14, y = 0, width = 14, height = 1,
draw = function(self)
local turtleOk = ctx.craftTurtleName
and peripheral.isPresent(ctx.craftTurtleName)
local turtleOk = ctx.craftTurtleOk
or (ctx.craftTurtleName
and peripheral.isPresent(ctx.craftTurtleName))
local label = turtleOk and " Turtle OK " or " No Turtle "
local bg = turtleOk and colors.lime or colors.red
local fg = turtleOk and colors.black or colors.white
@@ -1140,8 +1141,9 @@ local function buildSmelterPage()
local recipeIdx = event.selected.idx
local recipe = cfg.CRAFTABLE[recipeIdx]
if recipe then
local turtleOk = ctx.craftTurtleName
and peripheral.isPresent(ctx.craftTurtleName)
local turtleOk = ctx.craftTurtleOk
or (ctx.craftTurtleName
and peripheral.isPresent(ctx.craftTurtleName))
if not turtleOk then
self.notification:error("No crafting turtle!")
return true