Skip to content

Commit 70a23d1

Browse files
fix: tablet rendering - chrome over wallpaper, glyph coords, drop corner masks
- Nav/star glyphs were drawing as full-screen bars: normalized coords used a literal +1 overlap; switched to a fractional half-step (step * 1.5) - Status bar (signal/battery/power), screen border, dock, page dots and the nav/star chrome now render ON TOP of the wallpaper. Draw the screen backing first, then the wallpaper, then flushBase, so home/lock chrome is no longer hidden behind it - Removed the rect-based screen-corner masks (they showed as grey staircases); the frame texture's baked recess provides the rounded corners - Changelog: reflect what actually shipped (#89 covers app icons for now)
1 parent 1a666fb commit 70a23d1

3 files changed

Lines changed: 30 additions & 51 deletions

File tree

FS25_FarmTablet.zip

-295 Bytes
Binary file not shown.

src/FarmTabletUI.lua

Lines changed: 28 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -450,17 +450,9 @@ function FarmTabletUI:_drawFrame()
450450

451451
-- The tablet body — rounded bezel, camera, speaker grille, side buttons and
452452
-- the drop shadow — is a baked texture (gui/tablet_frame.dds) rendered in
453-
-- draw(), so the silhouette has real rounded corners. Here we only paint the
454-
-- screen surface and its border on top of that body.
455-
456-
-- Screen backing: black under wallpaper (home/lock), bg-palette in apps.
457-
if self.uiState == "app" then
458-
local pal = FT.BG_PALETTE[self.settings.tabletBgColorIndex or 1] or FT.BG_PALETTE[1]
459-
r:rect(L.screenX, L.screenY, L.screenW, L.screenH, {0,0,0,1})
460-
r:rect(L.screenX, L.screenY, L.screenW, L.screenH, pal.color)
461-
else
462-
r:rect(L.screenX, L.screenY, L.screenW, L.screenH, {0.02,0.03,0.04,1})
463-
end
453+
-- draw(), so the silhouette has real rounded corners. The dark screen
454+
-- backing is painted in draw() (_drawScreenBacking) UNDER the wallpaper;
455+
-- here we only add the inner screen border, which sits on top of everything.
464456

465457
-- Inner screen border (subtle)
466458
local stroke = FT.px(1)
@@ -471,6 +463,21 @@ function FarmTabletUI:_drawFrame()
471463
r:rect(L.screenX + L.screenW - stroke, L.screenY, stroke, L.screenH, {accent[1],accent[2],accent[3],0.18})
472464
end
473465

466+
-- Screen backing fill, drawn immediately in draw() UNDER the wallpaper: the
467+
-- bg-palette colour while in an app, a near-black on the home / lock screens.
468+
-- Kept off the base overlay layer so the rest of the chrome can flush on top
469+
-- of the wallpaper.
470+
function FarmTabletUI:_drawScreenBacking()
471+
local L = FT.LAYOUT
472+
if self.uiState == "app" then
473+
local pal = FT.BG_PALETTE[self.settings.tabletBgColorIndex or 1] or FT.BG_PALETTE[1]
474+
self:_fxRect(L.screenX, L.screenY, L.screenW, L.screenH, {0, 0, 0, 1})
475+
self:_fxRect(L.screenX, L.screenY, L.screenW, L.screenH, pal.color)
476+
else
477+
self:_fxRect(L.screenX, L.screenY, L.screenW, L.screenH, {0.02, 0.03, 0.04, 1})
478+
end
479+
end
480+
474481
-- ── Status bar (clock / battery / wifi / power) ───────────
475482

476483
function FarmTabletUI:_drawStatusBar()
@@ -742,37 +749,6 @@ function FarmTabletUI:_fxRect(x, y, w, h, col)
742749
self._fx:render()
743750
end
744751

745-
-- Round the screen's four corners so the screen reads as a recessed, rounded
746-
-- screen instead of a flat sheet pasted on the frame. The frame texture bakes a
747-
-- rounded recess (gen_icons srad ≈ 3% of screen width), but the square screen
748-
-- surface is painted over it and hides that rounding. We mask each corner's
749-
-- outer nook with the body graphite. Drawn immediately, over the screen content.
750-
function FarmTabletUI:_drawScreenCorners()
751-
if not self._fx then return end
752-
local L = FT.LAYOUT
753-
local R = L.screenW * 0.03 -- matches the baked recess radius
754-
if R <= 0 then return end
755-
local N = 6
756-
local step = R / N
757-
local x0, x1 = L.screenX, L.screenX + L.screenW
758-
local y0, y1 = L.screenY, L.screenY + L.screenH -- y0 = bottom, y1 = top
759-
local topC = {0.165, 0.176, 0.208, 1} -- body graphite (top)
760-
local botC = {0.059, 0.067, 0.086, 1} -- body graphite (bottom)
761-
for i = 0, N - 1 do
762-
local a = (i + 0.5) * step -- inward from the outer edge
763-
local nook = R - math.sqrt(math.max(0, R*R - (R - a)*(R - a)))
764-
if nook > 0 then
765-
local h = step * 1.5
766-
local yT = (y1 - a) - h * 0.5
767-
local yB = (y0 + a) - h * 0.5
768-
self:_fxRect(x0, yT, nook, h, topC) -- top-left
769-
self:_fxRect(x1 - nook, yT, nook, h, topC) -- top-right
770-
self:_fxRect(x0, yB, nook, h, botC) -- bottom-left
771-
self:_fxRect(x1 - nook, yB, nook, h, botC) -- bottom-right
772-
end
773-
end
774-
end
775-
776752
function FarmTabletUI:_drawAnim()
777753
local a = self._anim
778754
if not a then return end
@@ -893,25 +869,28 @@ function FarmTabletUI:draw()
893869
self:_fxRect(L.tabletX, L.tabletY, L.tabletW, L.tabletH, {0.10, 0.11, 0.13, 1})
894870
end
895871

896-
-- 1. Screen surface + chrome (drawn over the body)
897-
self.r:flushBase()
872+
-- 0b. Screen backing — the dark/palette fill that sits UNDER the wallpaper.
873+
-- Drawn before the wallpaper; all other chrome goes on top of it.
874+
self:_drawScreenBacking()
898875

899-
-- 2. Wallpaper (home / lock) — custom image if set, else default
876+
-- 1. Wallpaper (home / lock) — custom image if set, else default
900877
if self._useWallpaper then
901878
self:_drawWallpaper()
902879
end
903880

904-
-- 3. Screen content (status bar, app content, labels, text)
881+
-- 2. Screen chrome (status bar signal/battery/power, screen border, dock,
882+
-- page dots, app bar, nav + star). On the base layer, flushed AFTER the
883+
-- wallpaper so it is never hidden behind it on the home / lock screens.
884+
self.r:flushBase()
885+
886+
-- 3. Screen content (app content, labels, text)
905887
local clipY, clipH = nil, nil
906888
if self.uiState == "app" then clipY = L.contentY; clipH = L.contentH end
907889
self.r:flushContent(clipY, clipH)
908890

909891
-- 4. App icons
910892
self:_drawIconQueue()
911893

912-
-- 4b. Round the screen corners to match the baked frame recess
913-
self:_drawScreenCorners()
914-
915894
-- 5. Transient animation overlay
916895
self:_drawAnim()
917896

src/apps/UpdatesApp.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ local CHANGELOG = {
1212
"New: clearer app-bar buttons — a little house for Home and a real left arrow for Back",
1313
"New: Back now steps up one level (leaves a sub-page first) instead of always jumping straight home",
1414
"New: customise the app-icon labels in Settings — show or hide them, and change their size and colour",
15-
"Fix: the tablet screen now has rounded corners that match the frame instead of looking pasted on",
16-
"Fix: tablet textures are now mipmapped DDS, clearing the texture/performance warnings from log.txt",
15+
"Fix: the status bar signal/battery/power, dock and home indicator now render on the home and lock screens",
16+
"Fix: app-icon textures are now mipmapped DDS, clearing most of the texture warnings from log.txt",
1717
"Fix: the Worker Costs app roster now scrolls past the first 5 staff",
1818
},
1919
},

0 commit comments

Comments
 (0)