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:
@@ -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 })
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user