feat(bunsik): 메뉴별 요리 창(메뉴 고르기→2~3단계 조리→완성) + 어린이용 화면 UI 새 디자인

- 요리: 조리대 버튼 → 요리 창. 주문 있는 메뉴만 고름(서버도 검사), 메뉴마다 다른 단계
  (톡톡/꾹/문지르기, 실패 없음), 화구 업그레이드로 누르는 양 감소. Recipes(순수 로직)+Kitchen(화면)
- 서버: cook에 메뉴 인자, 조리대 거리 검사, Orders/Hand 속성, 주문 말풍선을 그림으로(받으면 하트)
- 경제: 한 접시에 손이 더 가므로 떡볶이·김밥·순대 15·25·40원, 시뮬레이터가 요리 창 시간 반영(확장 9:47)
- UI: 사탕색 테마(흰 바탕·같은 계열 테두리·숫자는 Fredoka), 버튼 묶음 정리, 상점 5x2 카드,
  마스코트 떡이 튜토리얼 말풍선, 손에 든 음식 표시, 알림 3개 제한, 움직임은 살 수 있는 것에만
- 그림: 요리 재료·도구 33칸 추가(ui_icons v2), 조리 도구·마스코트 큰 그림(kitchen.png), 톡톡 효과음
- 검사: 단위 테스트(Recipes 71, Layout 1642 등) + 로블록스 서버 통합 테스트 801/801

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
EJClaw
2026-10-13 16:14:23 +09:00
parent 05848d19d6
commit 02df9101bb
36 changed files with 3432 additions and 860 deletions

View File

@@ -46,9 +46,9 @@ T.eq(Economy.statsAt(99).seats, 8, "범위를 넘어도 안전")
Economy.statsAt(20)
T.eq(#Economy.START.menus, 1, "START.menus 불변")
T.eq(Economy.dishPrice("Tteokbokki", s0, 1), 10, "떡볶이 10")
T.eq(Economy.dishPrice("Sundae", Economy.statsAt(7), 1), 52, "순대 35 x 1.5 = 52(내림)")
T.eq(Economy.dishPrice("Tteokbokki", s0, 2), 20, "2배 수익")
T.eq(Economy.dishPrice("Tteokbokki", s0, 1), 15, "떡볶이 15")
T.eq(Economy.dishPrice("Gimbap", Economy.statsAt(7), 1), 37, "김밥 25 x 1.5 = 37(내림)")
T.eq(Economy.dishPrice("Tteokbokki", s0, 2), 30, "2배 수익")
T.eq(
Economy.boostAmount(s0),

View File

@@ -74,6 +74,21 @@ for _, d in DEVICES do
-- 창(업그레이드 목록, 설정)은 화면 안에 다 들어감
T.check(inside(L.panel, L.width, L.height), `{tag}: 업그레이드 창 화면 안`)
T.check(inside(L.settingsPanel, L.width, L.height), `{tag}: 설정 창 화면 안`)
T.check(inside(L.kitchen, L.width, L.height), `{tag}: 요리 창 화면 안`)
local g = L.grid
T.check(
g.pad * 2 + g.cols * g.cardW + (g.cols - 1) * g.gap <= L.panel.w + 1e-6,
`{tag}: 상점 카드가 창 너비 안`
)
T.check(
g.top + g.rows * g.cardH + (g.rows - 1) * g.gap + g.pad <= L.panel.h + 1e-6,
`{tag}: 상점 카드가 창 높이 안`
)
T.check(
g.cardW * L.scale >= 90 and g.cardH * L.scale >= 90,
`{tag}: 상점 카드가 손가락으로 누를 만큼 큼`
)
T.check(L.kitchen.w * L.scale >= 0.6 * d.w or L.kitchen.w >= 780, `{tag}: 요리 창이 충분히 큼`)
T.eq(L.rows.devY ~= nil, dev, `{tag}: 개발자 줄은 주인에게만`)
T.eq(L.rows.mouseY == nil, d.touch, `{tag}: 마우스 회전 줄은 PC만`)
@@ -90,7 +105,7 @@ for _, d in DEVICES do
local p = px(r, L.scale)
T.check(not overlap(p, zones.stick), `{tag}: {name} 버튼이 조이스틱 자리 피함`)
T.check(not overlap(p, zones.jump), `{tag}: {name} 버튼이 점프 버튼 자리 피함`)
T.check(p.h >= 36, `{tag}: {name} 버튼 높이 {math.floor(p.h)}px ≥ 36`)
T.check(p.h >= 44, `{tag}: {name} 버튼 높이 {math.floor(p.h)}px ≥ 44(어린이 손가락)`)
end
T.check(L.rows.langButtonH * L.scale >= 36, `{tag}: 언어 버튼 누르기 쉬움`)
T.check(L.rows.toggleH * L.scale >= 34, `{tag}: 켜기/끄기 버튼 누르기 쉬움`)

View File

@@ -2,6 +2,7 @@
local fs = require("@lune/fs")
local Economy = require("../src/shared/Economy")
local Locale = require("../src/shared/Locale")
local Recipes = require("../src/shared/Recipes")
local T = require("./check")
local ko = Locale.keys("ko")
@@ -19,6 +20,11 @@ for _, lang in Locale.LANGS do
for key in Economy.MENUS do
T.check(Locale.menuName(lang, key) ~= "menu_" .. key, `{lang} 메뉴 이름 {key}`)
end
for _, r in Recipes.LIST do
for _, st in r.steps do
T.check(Locale.t(lang, st.key) ~= st.key, `{lang} 요리 안내 {st.key}`)
end
end
for _, p in Economy.PURCHASES do
T.check(Locale.itemName(lang, p.id) ~= "item_" .. p.id, `{lang} 업그레이드 이름 {p.id}`)
end

View File

@@ -0,0 +1,74 @@
-- 요리 과정 검사: lune run tests/Recipes.spec.luau
local Economy = require("../src/shared/Economy")
local Recipes = require("../src/shared/Recipes")
local T = require("./check")
T.eq(Recipes.BASE_COOK, Economy.START.cook, "기준 화구 수준 = 처음 조리 시간")
for _, menu in Economy.MENU_ORDER do
local r = Recipes.LIST[menu]
T.check(r ~= nil, `{menu} 요리 과정 있음`)
T.check(#r.steps >= 2 and #r.steps <= 3, `{menu} 단계 2~3개`)
local kinds = {}
for i, s in r.steps do
T.eq(s.key, `cook_{menu}_{i}`, `{menu} {i}단계 안내 글 키`)
kinds[s.kind] = true
end
local n = 0
for _ in kinds do
n += 1
end
T.check(n >= 2, `{menu}: 단계마다 조작이 달라 지루하지 않음`)
-- 아이가 한 접시에 쓰는 시간: 처음 3~7초, 화구를 다 사면 더 짧아짐
local t0 = Recipes.expectedTime(menu, 2.5)
local t2 = Recipes.expectedTime(menu, 1)
T.check(t0 >= 3 and t0 <= 7, `{menu} 처음 {t0}초`)
T.check(t2 < t0 * 0.75, `{menu} 화구 Lv2면 {t2}초로 빨라짐`)
end
-- 서로 다른 메뉴는 과정이 다름
local seen = {}
for menu, r in Recipes.LIST do
local sig = r.stage
for _, s in r.steps do
sig ..= s.kind .. s.tool
end
T.check(seen[sig] == nil, `{menu} 과정이 다른 메뉴와 같지 않음`)
seen[sig] = true
end
-- 누르는 횟수는 정수, 최소 2번
T.eq(Recipes.need({ kind = "tap", key = "", base = 4, tool = "" }, 2.5), 4, "화구 Lv0: 4번")
T.eq(Recipes.need({ kind = "tap", key = "", base = 4, tool = "" }, 1.5), 2, "화구 Lv1: 2번(2.4 반올림)")
T.eq(Recipes.need({ kind = "tap", key = "", base = 4, tool = "" }, 1), 2, "화구 Lv2: 최소 2번")
T.check(
math.abs(Recipes.need({ kind = "hold", key = "", base = 1, tool = "" }, 1.5) - 0.6) < 1e-9,
"꾹 누르기 0.6초"
)
-- 진행 상태: 떡볶이(톡톡 4 → 꾹 1초 → 문지르기 3)
local f = Recipes.newFlow(2.5)
T.eq(Recipes.input(f, "tap", 1), nil, "메뉴 고르기 전에는 입력 무시")
T.eq(Recipes.choose(f, "Nope"), false, "없는 메뉴는 못 고름")
T.eq(Recipes.choose(f, "Tteokbokki"), true, "떡볶이 고름")
T.eq(f.phase, "cook", "조리 시작")
T.eq(Recipes.choose(f, "Gimbap"), false, "조리 중에는 다시 못 고름")
T.eq(Recipes.input(f, "hold", 1), nil, "다른 조작은 무시(실패 없음)")
T.eq(Recipes.input(f, "tap", 1), "progress", "톡 1")
T.eq(Recipes.input(f, "tap", 1), "progress", "톡 2")
T.eq(Recipes.input(f, "tap", 1), "progress", "톡 3")
T.eq(Recipes.fraction(f), (0 + 3 / 4) / 3, "전체 진행률")
T.eq(Recipes.input(f, "tap", 1), "step", "톡 4 → 다음 단계")
T.eq(f.step, 2, "2단계")
T.eq(Recipes.input(f, "hold", 0.5), "progress", "꾹 0.5초")
T.eq(Recipes.input(f, "hold", 0.6), "step", "꾹 1초 넘음 → 다음 단계")
T.eq(Recipes.input(f, "rub", 0), nil, "움직임 0은 무시")
T.eq(Recipes.input(f, "rub", 2), "progress", "문지르기 2")
T.eq(Recipes.input(f, "rub", 5), "done", "문지르기 끝 → 완성")
T.eq(f.phase, "done", "완성 상태")
T.eq(Recipes.fraction(f), 1, "완성 진행률 1")
T.eq(Recipes.input(f, "tap", 1), nil, "완성 뒤 입력 무시")
Recipes.reset(f, 1)
T.eq(f.phase, "menu", "다음 접시: 메뉴 고르기로")
T.eq(f.cook, 1, "화구 수준 갱신")
T.done("Recipes.spec")

View File

@@ -28,8 +28,8 @@ T.eq(Shop.cook(s), "Tteokbokki", "조리하면 떡볶이")
T.eq(Shop.cook(s), nil, "손이 꽉 차면 더 못 만듦")
T.eq(Shop.nextCookMenu(s), nil, "열린 주문 없음")
local earn = Shop.serve(s, 1)
T.eq(earn, 10, "떡볶이 10원")
T.eq(s.money, 10, "돈 10")
T.eq(earn, 15, "떡볶이 15원")
T.eq(s.money, 15, "돈 15")
T.eq(#s.hand, 0, "접시를 내려놓음")
T.eq(Shop.serve(s, 1), nil, "같은 손님에게 두 번 못 줌")
T.eq(s.customers[1].state, "eating", "먹는 중")
@@ -49,7 +49,7 @@ T.eq(s.customers[1], nil, "손님 목록에서 빠짐")
local p, err = Shop.buyNext(s)
T.eq(p and p.id, "Table2", "첫 구매는 테이블 2")
T.eq(err, nil, "구매 성공")
T.eq(s.money, 0, "돈 차감")
T.eq(s.money, 5, "돈 차감(15 - 10)")
T.eq(s.stats.seats, 2, "테이블 2개")
local p2, err2 = Shop.buyNext(s)
T.eq(p2, nil, "돈이 모자라면 실패")
@@ -61,7 +61,7 @@ d.moneyMult = 2
Shop.tick(d, 0)
Shop.tick(d, 3)
Shop.cook(d)
T.eq(Shop.serve(d, 1), 20, "2배 수익이면 20원")
T.eq(Shop.serve(d, 1), 30, "2배 수익이면 30원")
-- 메뉴는 해금된 것을 돌아가며 주문
local m = Shop.new(0, 2, 0) -- 테이블2, 김밥 해금
@@ -74,7 +74,20 @@ T.eq(m.customers[2].menu, "Gimbap", "두 번째 손님 김밥")
Shop.tick(m, 9)
T.eq(Shop.cook(m), "Tteokbokki", "먼저 온 손님 메뉴부터")
T.eq(Shop.serve(m, 2), nil, "김밥 손님에게 떡볶이 불가")
T.eq(Shop.serve(m, 1), 10, "떡볶이 손님에게 성공")
T.eq(Shop.serve(m, 1), 15, "떡볶이 손님에게 성공")
-- 요리 화면에서 메뉴 고르기: 주문이 있는 메뉴만 만들 수 있음
local pick = Shop.new(0, 2, 0)
Shop.tick(pick, 0)
Shop.tick(pick, 6)
local counts = Shop.openCounts(pick)
T.eq(counts.Tteokbokki, 1, "떡볶이 주문 1")
T.eq(counts.Gimbap, 1, "김밥 주문 1")
T.eq(Shop.cook(pick, "Sundae"), nil, "주문 없는 메뉴는 못 만듦")
T.eq(Shop.cook(pick, "Gimbap"), "Gimbap", "나중에 온 손님 메뉴를 골라 만들 수 있음")
T.eq(Shop.openCounts(pick).Gimbap, nil, "만든 김밥만큼 주문이 채워짐")
T.eq(Shop.openCounts(pick).Tteokbokki, 1, "떡볶이 주문은 그대로")
T.eq(Shop.cook(pick, "Tteokbokki"), nil, "손이 꽉 차면 못 만듦")
-- 알바생: 카운터에 접시를 만들어 두고, 플레이어는 집어서 나름
local h = Shop.new(0, 8, 0)
@@ -140,11 +153,11 @@ for _, e in Shop.tick(g, 6.5) do
end
T.check(not spawnedWhileFull, "플레이어 손님 자리에는 NPC가 안 옴")
Shop.cook(g) -- 1번 손님 떡볶이
T.eq(Shop.serve(g, 1), 10, "NPC 손님은 1배")
T.eq(Shop.serve(g, 1), 15, "NPC 손님은 1배")
local gid = (guest :: any).id
T.eq(Shop.nextCookMenu(g), (guest :: any).menu, "플레이어 손님 주문도 조리대에 뜸")
Shop.cook(g)
T.eq(Shop.serve(g, gid), 20, "플레이어 손님은 2배")
T.eq(Shop.serve(g, gid), 30, "플레이어 손님은 2배")
local guestLeave = nil
for _, e in Shop.tick(g, 6.5 + Economy.EAT + 0.1) do
if e.kind == "leave" and e.guest then

View File

@@ -56,6 +56,7 @@ local function dump(o: Instance, i: number): { [string]: any }?
d.BackgroundColor3 = c3(o.BackgroundColor3)
d.BackgroundTransparency = o.BackgroundTransparency
d.ClipsDescendants = o.ClipsDescendants
d.SizeConstraint = o.SizeConstraint.Name
end
if o:IsA("ScrollingFrame") then
d.CanvasPosition = { o.CanvasPosition.X, o.CanvasPosition.Y }
@@ -139,61 +140,80 @@ local function dump(o: Instance, i: number): { [string]: any }?
return d
end
local Recipes = require(game:GetService("ReplicatedStorage").Shared.Recipes)
-- kitchen = { menu, step, frac } 이면 요리 창을 열어 그 단계까지 진행합니다(step = "done"이면 완성 화면).
local PHONE = { w = 750, h = 332, inset = 58, touch = true }
local PC = { w = 1366, h = 710, inset = 58, touch = false }
local function shot(name: string, dev: { [string]: any }, attrs: { [string]: any }, extra: { [string]: any }?)
local t = { name = name, w = dev.w, h = dev.h, inset = dev.inset, touch = dev.touch, attrs = attrs }
for k, v in extra or {} do
t[k] = v
end
return t
end
local SHOTS = {
{
name = "phone_iphone15",
w = 750,
h = 332,
inset = 58,
touch = true,
attrs = { Money = 1234, Bought = 4, Carry = 1, Tut = 0 },
},
{ name = "phone_tut", w = 750, h = 332, inset = 58, touch = true, attrs = { Money = 12, Bought = 0, Tut = 3 } },
{
name = "phone_shop",
w = 750,
h = 332,
inset = 58,
touch = true,
attrs = { Money = 150, Bought = 5 },
open = "Panel",
},
{
name = "phone_settings",
w = 750,
h = 332,
inset = 58,
touch = true,
attrs = { Money = 150, Bought = 5 },
open = "SettingsPanel",
},
{ name = "pc_1366", w = 1366, h = 710, inset = 58, touch = false, attrs = { Money = 1234, Bought = 4, Carry = 1 } },
{
name = "pc_shop",
w = 1366,
h = 710,
inset = 58,
touch = false,
attrs = { Money = 760, Bought = 12, Double = true },
open = "Panel",
},
{
name = "pc_settings",
w = 1366,
h = 710,
inset = 58,
touch = false,
attrs = { Money = 760, Bought = 12, Dev = true },
open = "SettingsPanel",
},
{
name = "tablet_ipad",
w = 1024,
h = 710,
inset = 58,
touch = true,
attrs = { Money = 98765, Bought = 15, Carry = 2 },
},
shot("phone_main", PHONE, { Money = 85, Bought = 4, Carry = 1, Hand = "Gimbap", Tut = 0 }, { toast = true }),
shot("phone_tut", PHONE, { Money = 15, Bought = 0, Tut = 3 }),
shot("phone_shop", PHONE, { Money = 150, Bought = 5 }, { open = "shop" }),
shot("phone_settings", PHONE, { Money = 150, Bought = 5 }, { open = "settings" }),
shot(
"phone_kitchen_menu",
PHONE,
{ Money = 300, Bought = 6, Orders = "Tteokbokki=1,Gimbap=2", Tut = 1 },
{ kitchen = { menu = nil } }
),
shot(
"phone_kitchen_tteok",
PHONE,
{ Money = 300, Bought = 6, Orders = "Tteokbokki=1" },
{ kitchen = { menu = "Tteokbokki", step = 3, frac = 0.5 } }
),
shot("pc_main", PC, { Money = 1234, Bought = 4, Carry = 1, Hand = "Tteokbokki" }, { toast = true }),
shot("pc_buyable", PC, { Money = 160, Bought = 5, Carry = 0, Tut = 0 }),
shot("pc_shop", PC, { Money = 760, Bought = 12, Double = true }, { open = "shop" }),
shot("pc_settings", PC, { Money = 760, Bought = 12, Dev = true }, { open = "settings" }),
shot(
"pc_kitchen_menu",
PC,
{ Money = 300, Bought = 13, Orders = "Gimbap=1,Sundae=2,Eomuk=1" },
{ kitchen = { menu = nil } }
),
shot(
"pc_kitchen_gimbap",
PC,
{ Money = 300, Bought = 13, Orders = "Gimbap=1" },
{ kitchen = { menu = "Gimbap", step = 2, frac = 0.6 } }
),
shot(
"pc_kitchen_sundae",
PC,
{ Money = 300, Bought = 13, Orders = "Sundae=1" },
{ kitchen = { menu = "Sundae", step = 2, frac = 0.7 } }
),
shot(
"pc_kitchen_eomuk",
PC,
{ Money = 300, Bought = 13, Orders = "Eomuk=1" },
{ kitchen = { menu = "Eomuk", step = 2, frac = 0.4 } }
),
shot(
"pc_kitchen_twigim",
PC,
{ Money = 300, Bought = 17, Orders = "Twigim=1" },
{ kitchen = { menu = "Twigim", step = 3, frac = 0.5 } }
),
shot(
"pc_kitchen_done",
PC,
{ Money = 300, Bought = 6, Orders = "Tteokbokki=1" },
{ kitchen = { menu = "Tteokbokki", step = "done" } }
),
shot(
"tablet_ipad",
{ w = 1024, h = 710, inset = 58, touch = true },
{ Money = 98765, Bought = 15, Carry = 2, Hand = "Eomuk,Sundae" }
),
}
local shots = {}
@@ -210,14 +230,32 @@ for _, s in SHOTS do
if s.attrs.Tut == nil then
state:SetAttribute("Tut", 0)
end
if s.name == "phone_iphone15" or s.name == "pc_1366" then
if s.toast then
hud.notify("purchased", { item = "Stove1" })
end
if s.open then
hud.open(if s.open == "Panel" then "shop" else "settings")
hud.open(s.open)
end
local k = s.kitchen
if k then
hud.open("kitchen")
if k.menu then
hud.kitchen.choose(k.menu)
local r = Recipes.LIST[k.menu]
local cook = hud.kitchen.flow().cook
for i, st in r.steps do
local need = Recipes.need(st, cook)
if k.step == "done" or i < k.step then
hud.kitchen.input(st.kind, need)
elseif i == k.step then
hud.kitchen.input(st.kind, need * k.frac)
break
end
end
end
end
hud.refresh()
task.wait(0.2)
task.wait(0.3)
local zones = Layout.touchZones(s.w, s.h)
table.insert(shots, {
name = s.name,
@@ -233,4 +271,5 @@ end
local images = {}
images[Icons.ASSET:match("%d+")] = "art/ui_icons.png"
images[Icons.KITCHEN_ASSET:match("%d+")] = "art/kitchen.png"
return HttpService:JSONEncode({ shots = shots, images = images })

View File

@@ -26,7 +26,9 @@ local function section(name: string)
end
local Economy = require(ReplicatedStorage.Shared.Economy)
local Icons = require(ReplicatedStorage.Shared.Icons)
local Locale = require(ReplicatedStorage.Shared.Locale)
local Recipes = require(ReplicatedStorage.Shared.Recipes)
section("맵")
local World = require(Server.World)
@@ -98,7 +100,10 @@ local customers = 0
for _, ch in dyn:GetChildren() do
if ch.Name == "Customer" then
customers += 1
check(ch:FindFirstChild("Order", true) ~= nil, "손님 주문 말풍선")
local bubble = ch:FindFirstChild("Order", true)
check(bubble ~= nil, "손님 주문 말풍선")
local icon = bubble and bubble:FindFirstChild("Icon", true) :: ImageLabel?
eq(icon and icon.ImageRectOffset, Icons.OFFSET.Tteokbokki, "말풍선에 떡볶이 그림")
end
end
eq(customers, 1, "첫 손님 NPC 1명")
@@ -107,13 +112,23 @@ eq(slots[1].refs.stove:GetAttribute("OwnerId"), 111, "조리대 주인")
check((owner:FindFirstChild("Guide") :: ObjectValue).Value ~= nil, "튜토리얼 화살표 목표(조리대)")
c:update(3)
eq(c.shop.customers[1].state, "waiting", "손님이 앉음")
eq(c:cook(), "Tteokbokki", "조리")
eq(owner:GetAttribute("Orders"), "Tteokbokki=1", "요리 창에 보여 줄 주문 수")
eq(c:cook("Gimbap"), nil, "주문 없는 메뉴(김밥)는 못 만듦")
eq(c:cook("Tteokbokki"), "Tteokbokki", "고른 메뉴로 조리")
eq(owner:GetAttribute("Hand"), "Tteokbokki", "손에 든 접시 종류")
eq(owner:GetAttribute("Orders"), "", "주문이 다 채워짐")
eq(owner:GetAttribute("Tut"), 2, "튜토리얼 2단계")
eq(owner:GetAttribute("Carry"), 1, "접시 1개 듦")
eq(slots[1].refs.stove:GetAttribute("CookMenu"), "", "더 만들 것 없음")
eq(c:serve(1), 10, "서빙 10원")
eq(owner:GetAttribute("Money"), 10, "돈 10")
eq(data.Money, 10, "세이브 데이터 돈 10")
eq(c:serve(1), 15, "서빙 15원")
eq(owner:GetAttribute("Money"), 15, "돈 15")
eq(data.Money, 15, "세이브 데이터 돈 15")
local served1 = dyn:FindFirstChild("Customer"):FindFirstChild("Order", true)
eq(
served1 and (served1:FindFirstChild("Icon", true) :: ImageLabel).ImageRectOffset,
Icons.OFFSET.heart,
"받은 손님 말풍선은 하트"
)
eq(owner:GetAttribute("Tut"), 3, "튜토리얼 3단계")
check(dyn:FindFirstChild("Dish_Tteokbokki") ~= nil, "테이블에 접시")
local ok = c:buy()
@@ -398,7 +413,6 @@ eq(
section("화면 UI(서버에서 생성)")
local Hud = require(StarterPlayer.StarterPlayerScripts.Client.Hud)
local Icons = require(ReplicatedStorage.Shared.Icons)
local state = Instance.new("Folder")
state:SetAttribute("Lang", "ko")
state:SetAttribute("Money", 25)
@@ -415,42 +429,57 @@ local function label(o: Instance?): string?
return t and t.Text
end
local moneyText = root:FindFirstChild("Money"):FindFirstChild("Text", true) :: TextLabel
eq(moneyText.Text, "25원", "돈 표시")
eq(moneyText.Text, "25", "돈 표시(숫자만, 동전 그림 옆)")
local nextCard = root:FindFirstChild("Next") :: Frame
local nextTitle = nextCard:FindFirstChild("Title", true) :: TextLabel
eq(nextTitle.Text, "김밥 해금", "다음 업그레이드")
eq(
(nextCard:FindFirstChild("Tab", true):FindFirstChild("Text") :: TextLabel).Text,
"다음 업그레이드",
"카드 이름표"
)
local nextIcon = nextCard:FindFirstChild("IconBox", true):FindFirstChild("Icon") :: ImageLabel
eq(nextIcon.Image, Icons.ASSET, "다음 업그레이드 아이콘 그림")
eq(nextIcon.ImageRectOffset, Icons.OFFSET.Gimbap, "김밥 해금 아이콘")
check((root:FindFirstChild("Hint") :: Frame).Visible, "튜토리얼 안내 보임")
eq((nextCard:FindFirstChild("Cost", true) :: TextLabel).Text, "25 / 40", "진행 막대 글자")
local hintFrame = root:FindFirstChild("Hint") :: Frame
check(hintFrame.Visible, "튜토리얼 말풍선 보임")
check(hintFrame:FindFirstChild("Mascot") ~= nil, "말풍선에 마스코트")
check((nextCard:FindFirstChild("Pointer") :: ImageLabel).Visible, "튜토리얼 3: [사기] 가리키는 손")
local buyBtn = nextCard:FindFirstChild("Buy") :: TextButton
eq(label(buyBtn), "사기", "사기 버튼 글자")
check(not (buyBtn:FindFirstChild("Shine", true) :: Frame).Visible, "돈이 모자라면 반짝임 없음")
local Theme = require(StarterPlayer.StarterPlayerScripts.Client.Theme)
eq(
(buyBtn:FindFirstChild("Base") :: Frame).BackgroundColor3,
Theme.darken(Theme.GRAY, 0.3),
"돈이 모자라면 회색"
)
local listButton = root:FindFirstChild("ListButton") :: TextButton
check(not (listButton:FindFirstChild("Badge") :: Frame).Visible, "돈이 모자라면 업그레이드 배지 없음")
eq(label(listButton), "상점", "상점 버튼 글자(짧게)")
check(not (listButton:FindFirstChild("Badge") :: Frame).Visible, "돈이 모자라면 상점 배지 없음")
state:SetAttribute("Money", 60)
check((buyBtn:FindFirstChild("Shine", true) :: Frame).Visible, "살 수 있으면 [사기] 반짝임")
check((listButton:FindFirstChild("Badge") :: Frame).Visible, "살 수 있으면 업그레이드 버튼에 ! 배지")
eq((buyBtn:FindFirstChild("Base") :: Frame).BackgroundColor3, Theme.darken(Theme.MINT, 0.3), "살 수 있으면 초록")
check((listButton:FindFirstChild("Badge") :: Frame).Visible, "살 수 있으면 상점 버튼에 ! 배지")
check(root:FindFirstChild("Gain") ~= nil, "돈이 늘면 +돈 글자가 떠오름")
eq((root:FindFirstChild("Gain") :: TextLabel).Text, "+35원", "늘어난 돈")
eq((root:FindFirstChild("Gain") :: TextLabel).Text, "+35", "늘어난 돈")
for _, d in Icons.OFFSET do
check(d.X % 128 == 0 and d.Y % 128 == 0 and d.X < 1024 and d.Y < 1024, "아이콘 칸 위치")
end
for _, d in Icons.KITCHEN do
check(d.X % 256 == 0 and d.Y % 256 == 0 and d.X < 1024 and d.Y < 1024, "요리 그림 칸 위치")
end
-- 손에 든 접시
local carryFrame = root:FindFirstChild("Carry") :: Frame
check(not carryFrame.Visible, "빈손이면 접시 표시 숨김")
state:SetAttribute("Carry", 1)
state:SetAttribute("Hand", "Tteokbokki")
check(carryFrame.Visible, "접시를 들면 표시")
eq((carryFrame:FindFirstChild("Slot1") :: ImageLabel).ImageRectOffset, Icons.OFFSET.Tteokbokki, "든 음식 그림")
state:SetAttribute("Carry", 0)
state:SetAttribute("Hand", "")
state:SetAttribute("Lang", "en")
eq(moneyText.Text, "₩60", "영어 돈 표시")
eq(moneyText.Text, "60", "영어 돈 표시")
eq(nextTitle.Text, "Unlock Gimbap", "영어 다음 업그레이드")
state:SetAttribute("Lang", "zh")
eq(nextTitle.Text, "解锁紫菜包饭", "중국어 다음 업그레이드")
state:SetAttribute("Lang", "en")
local settingsBtn = root:FindFirstChild("Settings") :: TextButton
check(settingsBtn ~= nil, "오른쪽 위 설정 버튼")
eq(label(settingsBtn), "Settings", "설정 버튼 글자")
local settingsPanel = root:FindFirstChild("SettingsPanel") :: Frame
check(settingsPanel ~= nil and not settingsPanel.Visible, "설정 창은 처음엔 닫힘")
for _, l in { "auto", "ko", "en", "ja", "zh" } do
@@ -462,26 +491,29 @@ state:SetAttribute("Sfx", false)
eq(label(settingsPanel:FindFirstChild("Sfx")), "Off", "효과음 끔 표시")
check(not hud.menuOpen(), "창 닫힘")
hud.open("shop")
check(hud.menuOpen() and (root:FindFirstChild("Panel") :: Frame).Visible, "업그레이드 창 열기")
check((root:FindFirstChild("Dim") :: Frame).Visible, "창 뒤 어둡게")
local rowsFrame = root:FindFirstChild("Panel"):FindFirstChild("List", true) :: ScrollingFrame
check(hud.menuOpen() and (root:FindFirstChild("Panel") :: Frame).Visible, "상점 창 열기")
check((root:FindFirstChild("Dim") :: TextButton).Visible, "창 뒤 어둡게")
local cardsFrame = root:FindFirstChild("Panel"):FindFirstChild("Cards", true) :: Frame
local n1 = 0
for _, ch in cardsFrame:GetChildren() do
if ch.Name:sub(1, 3) == "Row" then
n1 += 1
end
end
eq(n1, 10, "상점: 지금 단계 10개가 한 화면에(넘기지 않음)")
check(
rowsFrame:FindFirstChild("Row2"):FindFirstChild("BuyRow") ~= nil,
"목록의 다음 업그레이드에 사기 버튼"
)
check(rowsFrame:FindFirstChild("Row1"):FindFirstChild("Done") ~= nil, "산 업그레이드는 체크 표시")
check(
rowsFrame:FindFirstChild("Row5"):FindFirstChild("IconBox"):FindFirstChild("Lock") ~= nil,
"잠긴 업그레이드 자물쇠"
cardsFrame:FindFirstChild("Row2"):FindFirstChild("BuyRow") ~= nil,
"상점의 다음 업그레이드에 사기 버튼"
)
check(cardsFrame:FindFirstChild("Row1"):FindFirstChild("Done", true) ~= nil, "산 업그레이드는 체크 표시")
check(cardsFrame:FindFirstChild("Row5"):FindFirstChild("Lock", true) ~= nil, "잠긴 업그레이드 자물쇠")
hud.open("settings")
check(settingsPanel.Visible and not (root:FindFirstChild("Panel") :: Frame).Visible, "창은 하나만 열림")
hud.open(nil)
check(not hud.menuOpen() and not (root:FindFirstChild("Dim") :: Frame).Visible, "창 닫기")
check(not hud.menuOpen() and not (root:FindFirstChild("Dim") :: TextButton).Visible, "창 닫기")
state:SetAttribute("Bought", #Economy.PURCHASES)
check(not buyBtn.Visible, "다 사면 사기 버튼 숨김")
check(not (root:FindFirstChild("Boost") :: TextButton).Visible, "다 사면 돈 부스트 숨김")
check(root:FindFirstChild("Dev") == nil, "개발자 버튼은 설정 창 안으로")
local devMoneyBtn = settingsPanel:FindFirstChild("devMoney") :: TextButton
check(not devMoneyBtn.Visible, "개발자 버튼은 기본으로 숨김")
local setH = settingsPanel.Size.Y.Offset
@@ -490,7 +522,7 @@ check(devMoneyBtn.Visible, "게임 주인에게 개발자 버튼(설정 창)")
check(settingsPanel.Size.Y.Offset > setH, "개발자 줄만큼 설정 창이 길어짐")
local doubleBtn = root:FindFirstChild("Double") :: TextButton
check(doubleBtn.Visible, "2배 수익 버튼(상품 ID 설정됨)")
eq(label(doubleBtn), "Double Money", "2배 수익 버튼 글자")
eq(label(doubleBtn), "2x Cash", "2배 수익 버튼 글자")
state:SetAttribute("Double", true)
eq(label(doubleBtn), "Active", "2배 수익 산 뒤")
check((doubleBtn:FindFirstChild("Owned") :: ImageLabel).Visible, "2배 수익 산 뒤 체크")
@@ -502,7 +534,17 @@ eq(
Icons.OFFSET.check,
"구매 알림 아이콘"
)
-- 휴대폰 배치(아이폰 15 가로, 상단 바·노치 뺀 영역): 루트가 화면을 채우고, 결제 버튼은 왼쪽 위, 마우스 줄 숨김
for _ = 1, 5 do
hud.notify("purchased", { item = "Table2" })
end
local toastCount = 0
for _, ch in root.Toasts:GetChildren() do
if ch:IsA("Frame") then
toastCount += 1
end
end
check(toastCount <= 3, `알림은 3개까지만 쌓임 ({toastCount})`)
-- 휴대폰 배치(아이폰 15 가로, 상단 바·노치 뺀 영역): 루트가 화면을 채우고, 버튼 묶음은 왼쪽 위, 마우스 줄 숨김
hud.setLayout(Vector2.new(750, 332), true)
local lay = hud.layout()
local scaleObj = root:FindFirstChildOfClass("UIScale") :: UIScale
@@ -528,7 +570,130 @@ check((settingsPanel:FindFirstChild("MouseLook") :: TextButton).Visible, "PC:
check(math.abs(scaleObj.Scale - math.min(1366 / 1100, 710 / 620)) < 1e-6, "PC: 배율(상단 바 뺀 높이 기준)")
hud.destroy()
section("조리 버튼(클라이언트 모듈)")
section("요리 창(메뉴 고르기 → 조리 과정 → 완성)")
local kstate = Instance.new("Folder")
kstate:SetAttribute("Lang", "ko")
kstate:SetAttribute("Money", 0)
kstate:SetAttribute("Bought", 6) -- 떡볶이·김밥·순대 해금
kstate:SetAttribute("Tut", 1)
kstate:SetAttribute("Orders", "Gimbap=2")
local ksent = {}
local khud = Hud.build(Instance.new("Folder"), kstate, function(kind, arg)
table.insert(ksent, { kind, arg })
end)
local kroot = khud.gui:FindFirstChild("Root") :: Frame
local kitchen = khud.kitchen
local kframe = kroot:FindFirstChild("Kitchen") :: Frame
check(not kframe.Visible, "요리 창은 처음엔 닫힘")
khud.open("kitchen")
check(kframe.Visible and kitchen.isOpen() and khud.menuOpen(), "요리 창 열림(커서 풀림)")
check((kroot:FindFirstChild("Dim") :: TextButton).Visible, "요리 창 뒤 어둡게")
local menuPage = kframe:FindFirstChild("MenuPage", true) :: Frame
check(menuPage.Visible, "처음엔 메뉴 고르기")
local function menuCard(m: string): Frame
return menuPage:FindFirstChild("Menu_" .. m, true) :: Frame
end
for _, m in Economy.MENU_ORDER do
check(menuCard(m) ~= nil, `메뉴 카드 {m}`)
end
check((menuCard("Gimbap"):FindFirstChild("Orders", true) :: Frame).Visible, "주문 있는 김밥에 손님 표시")
eq((menuCard("Gimbap"):FindFirstChild("Orders", true):FindFirstChild("Text") :: TextLabel).Text, "x2", "주문 수 2")
check(
not (menuCard("Tteokbokki"):FindFirstChild("Orders", true) :: Frame).Visible,
"주문 없는 떡볶이는 표시 없음"
)
check((menuCard("Eomuk"):FindFirstChild("Lock", true) :: ImageLabel).Visible, "안 산 어묵은 자물쇠")
check(not (menuCard("Sundae"):FindFirstChild("Lock", true) :: ImageLabel).Visible, "산 순대는 자물쇠 없음")
check(
(menuPage:FindFirstChild("Pointer") or menuCard("Gimbap"):FindFirstChild("Pointer", true)) ~= nil,
"튜토리얼 손가락"
)
eq(kitchen.choose("Tteokbokki"), false, "주문 없는 메뉴는 못 고름")
eq(kitchen.choose("Eomuk"), false, "안 산 메뉴는 못 고름")
eq(kitchen.choose("Gimbap"), true, "김밥 고름")
local cookPage = kframe:FindFirstChild("CookPage", true) :: Frame
check(cookPage.Visible and not menuPage.Visible, "조리 화면으로")
eq((cookPage:FindFirstChild("Instruction") :: TextLabel).Text, "김 위에 재료를 올려요", "1단계 안내")
check(
(cookPage:FindFirstChild("Base", true) :: ImageLabel).Image == Icons.KITCHEN_ASSET,
"조리 도구 그림(도마)"
)
eq((cookPage:FindFirstChild("Base", true) :: ImageLabel).ImageRectOffset, Icons.KITCHEN.board, "김밥은 도마")
local flowK = kitchen.flow()
local need1 = flowK.need
eq((cookPage:FindFirstChild("Gesture") :: TextLabel).Text, `톡톡! {need1}번`, "톡톡 남은 횟수")
eq(kitchen.input("hold", 1), nil, "다른 동작은 무시")
eq(kitchen.input("tap", 1), "progress", "톡 1")
eq((cookPage:FindFirstChild("Gesture") :: TextLabel).Text, `톡톡! {need1 - 1}번`, "남은 횟수 줄어듦")
local strip1 = cookPage:FindFirstChild("Strip1", true) :: Frame
check(strip1 ~= nil and strip1.Visible, "누를 때마다 재료가 올라감")
for _ = 2, need1 do
kitchen.input("tap", 1)
end
eq(flowK.step, 2, "2단계(말기)")
eq((cookPage:FindFirstChild("Instruction") :: TextLabel).Text, "돌돌 말아요", "2단계 안내")
eq((cookPage:FindFirstChild("Gesture") :: TextLabel).Text, "문질문질!", "문지르기 안내")
eq(kitchen.input("rub", flowK.need), "step", "다 문지름 → 3단계")
check((cookPage:FindFirstChild("Roll", true) :: ImageLabel).Visible, "김밥이 말림")
eq(#ksent, 0, "완성 전에는 서버에 안 보냄")
eq(kitchen.input("tap", flowK.need), "done", "썰기 끝 → 완성")
eq(ksent[1] and ksent[1][1], "cook", "서버에 cook")
eq(ksent[1] and ksent[1][2], "Gimbap", "고른 메뉴를 보냄")
local donePage = kframe:FindFirstChild("DonePage", true) :: Frame
check(donePage.Visible, "완성 화면")
eq((donePage:FindFirstChild("Dish") :: ImageLabel).ImageRectOffset, Icons.OFFSET.Gimbap, "완성 접시 그림")
-- 주문이 남아 있고 손에 자리가 있으면 다시 메뉴 고르기, 아니면 닫힘
kstate:SetAttribute("Orders", "Gimbap=1")
kstate:SetAttribute("Carry", 0)
task.wait(1.5)
check(kitchen.isOpen() and menuPage.Visible, "주문이 남으면 다음 접시 고르기")
kitchen.choose("Gimbap")
for _ = 1, 20 do
local st = Recipes.current(kitchen.flow())
if not st then
break
end
kitchen.input(st.kind, kitchen.flow().need)
end
kstate:SetAttribute("Carry", 1) -- 손이 꽉 참(쟁반 없음)
kstate:SetAttribute("Orders", "")
task.wait(1.5)
check(not kitchen.isOpen() and not kframe.Visible, "더 만들 것이 없으면 창이 닫힘")
check(not (kroot:FindFirstChild("Dim") :: TextButton).Visible, "닫히면 어둡게도 꺼짐")
-- 메뉴마다 과정이 다르고 끝까지 갈 수 있음
for _, m in Economy.MENU_ORDER do
kstate:SetAttribute("Bought", 20)
kstate:SetAttribute("Carry", 0)
kstate:SetAttribute("Orders", `{m}=1`)
khud.open("kitchen")
check(kitchen.choose(m), `{m} 고름`)
eq(
(cookPage:FindFirstChild("Base", true) :: ImageLabel).ImageRectOffset,
Icons.KITCHEN[Recipes.LIST[m].stage],
`{m} 조리 도구 그림`
)
local guard = 0
while kitchen.flow().phase == "cook" and guard < 10 do
local st = Recipes.current(kitchen.flow()) :: Recipes.Step
check(
Icons.OFFSET[({ roll = "mat", fire = "flame", skewer = "Eomuk" } :: any)[st.tool] or st.tool] ~= nil,
`{m} 도구 그림 {st.tool}`
)
kitchen.input(st.kind, kitchen.flow().need)
guard += 1
end
eq(kitchen.flow().phase, "done", `{m} 완성`)
eq(ksent[#ksent][2], m, `{m} 서버에 보냄`)
khud.open(nil)
check(not kitchen.isOpen(), `{m} 창 닫기`)
end
-- 요리 창은 화면 안에(휴대폰)
khud.setLayout(Vector2.new(667, 317), true)
local kl = khud.layout().kitchen
check(kl.x >= 0 and kl.y >= 0 and kl.x + kl.w <= khud.layout().width + 1e-6, "휴대폰: 요리 창 화면 안")
khud.destroy()
section("조리대 버튼(클라이언트 모듈)")
local Stove = require(StarterPlayer.StarterPlayerScripts.Client.Stove)
local stove = slots[3].refs.stove
local pstate = Instance.new("Folder")
@@ -536,10 +701,9 @@ pstate:SetAttribute("Lang", "ko")
local prompt = Stove.attach(stove, pstate, function() end)
check(not prompt.Enabled, "주문 없으면 버튼 꺼짐")
stove:SetAttribute("CookMenu", "Gimbap")
stove:SetAttribute("CookTime", 1.5)
check(prompt.Enabled, "주문 있으면 버튼 켜짐")
eq(prompt.ActionText, "🍙 김밥 만들기", "버튼 글자")
eq(prompt.HoldDuration, 1.5, "누르는 시간")
eq(prompt.ActionText, "요리하기", "버튼 글자")
eq(prompt.HoldDuration, 0, "누르면 바로 요리 창(꾹 누르지 않음)")
prompt:Destroy()
section("효과음(직접 만든 오디오 에셋)")
@@ -556,17 +720,16 @@ for name, id in Sounds do
end
end
section("UI 아이콘 그림(직접 그린 이미지 에셋)")
do
local Icons = require(ReplicatedStorage.Shared.Icons)
local num = tonumber(string.match(Icons.ASSET, "%d+"))
section("UI 그림(직접 그린 이미지 에셋)")
for _, asset in { Icons.ASSET, Icons.KITCHEN_ASSET } do
local num = tonumber(string.match(asset, "%d+"))
local okInfo, info = pcall(function()
return game:GetService("MarketplaceService"):GetProductInfoAsync(num :: number, Enum.InfoType.Asset)
end)
check(okInfo, "아이콘 그림 정보 조회")
check(okInfo, `그림 {num} 정보 조회`)
if okInfo then
eq(info.AssetTypeId, 1, "아이콘 그림은 이미지")
eq(info.Creator.CreatorTargetId, game.CreatorId, "아이콘 그림은 게임 주인 소유")
eq(info.AssetTypeId, 1, `그림 {num}은 이미지`)
eq(info.Creator.CreatorTargetId, game.CreatorId, `그림 {num}은 게임 주인 소유`)
end
end