Update LauncherView.lua

This commit is contained in:
bryanthaboi
2026-08-20 09:19:59 -04:00
parent 2468d5042d
commit 7c9c2380d2
+40 -15
View File
@@ -409,13 +409,13 @@ end
local function cartPill(project, x, y, w, h, z, color, alpha) local function cartPill(project, x, y, w, h, z, color, alpha)
local points, radius = {}, h / 2 local points, radius = {}, h / 2
for i = 0, 10 do for i = 0, 10 do
local a = math.pi + math.pi * i / 10 local a = -math.pi / 2 + math.pi * i / 10
points[#points + 1] = { project(x + radius + math.cos(a) * radius, points[#points + 1] = { project(x + w - radius + math.cos(a) * radius,
y + radius + math.sin(a) * radius, z) } y + radius + math.sin(a) * radius, z) }
end end
for i = 0, 10 do for i = 0, 10 do
local a = math.pi * i / 10 local a = math.pi / 2 + math.pi * i / 10
points[#points + 1] = { project(x + w - radius + math.cos(a) * radius, points[#points + 1] = { project(x + radius + math.cos(a) * radius,
y + radius + math.sin(a) * radius, z) } y + radius + math.sin(a) * radius, z) }
end end
cartPolygon(points, color, alpha) cartPolygon(points, color, alpha)
@@ -678,18 +678,43 @@ local function cartridgeButton(imp, x, y, w, h, key, version, gameName, action)
if frontFacing then if frontFacing then
local faceZ = depth + 0.8 local faceZ = depth + 0.8
for i = 0, 4 do -- The shell's grip grooves: a stack beside the label recess on the left,
local ry = mainTop + 7 + i * h * 0.025 -- and one below the top-right corner notch, like the DMG cart.
cartPolygon(cartQuad(project, -halfW + 2, ry, w * 0.13, 2, faceZ), side, 0.7) local grooveW = w * 0.115
cartPolygon(cartQuad(project, halfW - w * 0.13 - 2, ry, w * 0.13, 2, faceZ), side, 0.7) local grooveH = math.max(1, h * 0.009)
for i = 0, 5 do
local ry = mainTop + h * 0.014 + i * h * 0.021
cartPolygon(cartQuad(project, -halfW + w * 0.02, ry,
grooveW, grooveH, faceZ), side, 0.7)
cartPolygon(cartQuad(project, halfW - grooveW - w * 0.02, ry,
grooveW, grooveH, faceZ), side, 0.7)
end end
local recessX, recessY = -w * 0.32, mainTop + h * 0.023 -- The thin diagonal mold ridge cut into each long side a little below
local recessW, recessH = w * 0.64, h * 0.24 -- the grip grooves, mirrored left/right.
cartPolygon(cartQuad(project, recessX, recessY, recessW, recessH, faceZ), shell, 0.88) local function diagonal(x0, y0, x1, y1)
cartPill(project, recessX + w * 0.025, recessY + h * 0.025, local dx, dy = x1 - x0, y1 - y0
recessW - w * 0.05, h * 0.12, faceZ + 0.5, shell, 0.7) local len = math.sqrt(dx * dx + dy * dy)
cartPill(project, recessX + w * 0.045, recessY + h * 0.043, local nx, ny = -dy / len, dx / len
recessW - w * 0.09, h * 0.083, faceZ + 0.8, side, 0.42) local t = math.max(0.6, h * 0.004)
cartPolygon({
{ project(x0 + nx * t, y0 + ny * t, faceZ) },
{ project(x0 - nx * t, y0 - ny * t, faceZ) },
{ project(x1 - nx * t, y1 - ny * t, faceZ) },
{ project(x1 + nx * t, y1 + ny * t, faceZ) },
}, side, 0.7)
end
local dgY = mainTop + h * 0.20
diagonal(-halfW + w * 0.006, dgY, -halfW + w * 0.085, dgY + h * 0.038)
diagonal(halfW - w * 0.006, dgY, halfW - w * 0.085, dgY + h * 0.038)
-- The Nintendo GAME BOY recess: one stadium pill sunk into the shell.
local pillX, pillW = -halfW + w * 0.17, w * 0.62
local pillY, pillH = mainTop + h * 0.024, h * 0.115
cartPill(project, pillX, pillY, pillW, pillH, faceZ + 0.5, side, 0.55)
local inX, inY = w * 0.008, h * 0.008
cartPill(project, pillX + inX, pillY + inY,
pillW - 2 * inX, pillH - 2 * inY, faceZ + 0.8,
{ math.floor(shell[1] * 0.92), math.floor(shell[2] * 0.92),
math.floor(shell[3] * 0.92) }, 1)
local labelX, labelY = -w * 0.33, -h * 0.20 local labelX, labelY = -w * 0.33, -h * 0.20
local labelW, labelH = w * 0.66, h * 0.55 local labelW, labelH = w * 0.66, h * 0.55