feat(bunsik): 화면 UI 전면 개편 — 시뮬레이터 스타일(굵은 테두리·그러데이션·입체 버튼·직접 그린 아이콘·애니메이션)
- Theme 모듈: 색, 테두리, 입체 버튼(누르면 들어감, PC 마우스 올리면 커짐), 반짝임, 배지 - 아이콘 32개를 직접 그린 한 장(art/ui_icons.png, tools/icons.py)으로 올리고 Icons 모듈로 잘라 씀 - 돈 알약+동전, +돈 떠오름, 네모 아이콘 버튼, 다음 업그레이드 카드(이름표·아이콘·진행 막대), 업그레이드/설정 창(리본 제목·빨간 X·뒤 어둡게·튀어나오며 열림·다음 줄로 자동 스크롤) - 손님 말풍선·+돈 글자 테두리 색 통일 - 미리보기 도구: tests/cloud/dump_gui.luau + tools/gui_render.py + tools/preview.sh - 통합 테스트 668/668, Layout 1522 검사 통과 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -398,6 +398,7 @@ 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)
|
||||
@@ -409,33 +410,77 @@ local hud = Hud.build(holder, state, function(kind, arg)
|
||||
table.insert(sent, { kind, arg })
|
||||
end)
|
||||
local root = hud.gui:FindFirstChild("Root") :: Frame
|
||||
local moneyText = root:FindFirstChild("Money"):FindFirstChild("Text") :: TextLabel
|
||||
eq(moneyText.Text, "💰 25원", "돈 표시")
|
||||
local nextTitle = root:FindFirstChild("Next"):FindFirstChild("Title") :: TextLabel
|
||||
eq(nextTitle.Text, "다음: 김밥 해금", "다음 업그레이드")
|
||||
local function label(o: Instance?): string?
|
||||
local t = o and o:FindFirstChild("Label", true) :: TextLabel?
|
||||
return t and t.Text
|
||||
end
|
||||
local moneyText = root:FindFirstChild("Money"):FindFirstChild("Text", true) :: TextLabel
|
||||
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, "튜토리얼 안내 보임")
|
||||
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 listButton = root:FindFirstChild("ListButton") :: TextButton
|
||||
check(not (listButton:FindFirstChild("Badge") :: Frame).Visible, "돈이 모자라면 업그레이드 배지 없음")
|
||||
state:SetAttribute("Money", 60)
|
||||
check((buyBtn:FindFirstChild("Shine", true) :: Frame).Visible, "살 수 있으면 [사기] 반짝임")
|
||||
check((listButton:FindFirstChild("Badge") :: Frame).Visible, "살 수 있으면 업그레이드 버튼에 ! 배지")
|
||||
check(root:FindFirstChild("Gain") ~= nil, "돈이 늘면 +돈 글자가 떠오름")
|
||||
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
|
||||
state:SetAttribute("Lang", "en")
|
||||
eq(moneyText.Text, "💰 ₩25", "영어 돈 표시")
|
||||
eq(nextTitle.Text, "Next: Unlock Gimbap", "영어 다음 업그레이드")
|
||||
eq(moneyText.Text, "₩60", "영어 돈 표시")
|
||||
eq(nextTitle.Text, "Unlock Gimbap", "영어 다음 업그레이드")
|
||||
state:SetAttribute("Lang", "zh")
|
||||
eq(nextTitle.Text, "下一个: 解锁紫菜包饭", "중국어 다음 업그레이드")
|
||||
eq(nextTitle.Text, "解锁紫菜包饭", "중국어 다음 업그레이드")
|
||||
state:SetAttribute("Lang", "en")
|
||||
check(root:FindFirstChild("Lang") == nil, "언어 버튼 대신")
|
||||
local settingsBtn = root:FindFirstChild("Settings") :: TextButton
|
||||
check(settingsBtn ~= nil, "오른쪽 위 설정 버튼")
|
||||
eq(settingsBtn and settingsBtn.Text, "⚙️ Settings", "설정 버튼 글자")
|
||||
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
|
||||
check(settingsPanel:FindFirstChild("Lang_" .. l) ~= nil, `설정 창 언어 버튼 {l}`)
|
||||
end
|
||||
eq((settingsPanel:FindFirstChild("Lang_ja") :: TextButton).Text, "日本語", "언어 이름은 그 나라 말")
|
||||
eq((settingsPanel:FindFirstChild("MouseLook") :: TextButton).Text, "On", "마우스 회전 기본 켜짐")
|
||||
eq(label(settingsPanel:FindFirstChild("Lang_ja")), "日本語", "언어 이름은 그 나라 말")
|
||||
eq(label(settingsPanel:FindFirstChild("MouseLook")), "On", "마우스 회전 기본 켜짐")
|
||||
state:SetAttribute("Sfx", false)
|
||||
eq((settingsPanel:FindFirstChild("Sfx") :: TextButton).Text, "Off", "효과음 끔 표시")
|
||||
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(
|
||||
rowsFrame:FindFirstChild("Row2"):FindFirstChild("BuyRow") ~= nil,
|
||||
"목록의 다음 업그레이드에 사기 버튼"
|
||||
)
|
||||
check(rowsFrame:FindFirstChild("Row1"):FindFirstChild("Done") ~= nil, "산 업그레이드는 체크 표시")
|
||||
check(
|
||||
rowsFrame:FindFirstChild("Row5"):FindFirstChild("IconBox"):FindFirstChild("Lock") ~= 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, "창 닫기")
|
||||
state:SetAttribute("Bought", #Economy.PURCHASES)
|
||||
check(not (root:FindFirstChild("Next"):FindFirstChild("Buy") :: TextButton).Visible, "다 사면 사기 버튼 숨김")
|
||||
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, "개발자 버튼은 기본으로 숨김")
|
||||
@@ -443,10 +488,20 @@ local setH = settingsPanel.Size.Y.Offset
|
||||
state:SetAttribute("Dev", true)
|
||||
check(devMoneyBtn.Visible, "게임 주인에게 개발자 버튼(설정 창)")
|
||||
check(settingsPanel.Size.Y.Offset > setH, "개발자 줄만큼 설정 창이 길어짐")
|
||||
check((root:FindFirstChild("Double") :: TextButton).Visible, "2배 수익 버튼(상품 ID 설정됨)")
|
||||
local doubleBtn = root:FindFirstChild("Double") :: TextButton
|
||||
check(doubleBtn.Visible, "2배 수익 버튼(상품 ID 설정됨)")
|
||||
eq(label(doubleBtn), "Double Money", "2배 수익 버튼 글자")
|
||||
state:SetAttribute("Double", true)
|
||||
eq(label(doubleBtn), "Active", "2배 수익 산 뒤")
|
||||
check((doubleBtn:FindFirstChild("Owned") :: ImageLabel).Visible, "2배 수익 산 뒤 체크")
|
||||
hud.notify("purchased", { item = "Table2" })
|
||||
local toastText = root.Toasts:FindFirstChild("Toast"):FindFirstChild("Text") :: TextLabel
|
||||
eq(toastText.Text, "Table 2 bought!", "구매 알림에 업그레이드 이름(내 언어)")
|
||||
eq(
|
||||
(root.Toasts:FindFirstChild("Toast"):FindFirstChild("Icon") :: ImageLabel).ImageRectOffset,
|
||||
Icons.OFFSET.check,
|
||||
"구매 알림 아이콘"
|
||||
)
|
||||
-- 휴대폰 배치(아이폰 15 가로, 상단 바·노치 뺀 영역): 루트가 화면을 채우고, 결제 버튼은 왼쪽 위, 마우스 줄 숨김
|
||||
hud.setLayout(Vector2.new(750, 332), true)
|
||||
local lay = hud.layout()
|
||||
@@ -460,10 +515,11 @@ check(
|
||||
"휴대폰: 루트 높이 = 화면"
|
||||
)
|
||||
eq(
|
||||
(root:FindFirstChild("Double") :: TextButton).Position.Y.Offset,
|
||||
lay.double.y,
|
||||
"휴대폰: 2배 수익 버튼 위치"
|
||||
doubleBtn.Position.Y.Offset,
|
||||
lay.double.y + lay.double.h / 2,
|
||||
"휴대폰: 2배 수익 버튼 위치(가운데 기준)"
|
||||
)
|
||||
eq(doubleBtn.Size.Y.Offset, lay.double.h, "휴대폰: 2배 수익 버튼 크기")
|
||||
check(lay.double.y + lay.double.h < lay.height / 3, "휴대폰: 결제 버튼은 조이스틱 자리 위")
|
||||
check(not (settingsPanel:FindFirstChild("MouseLook") :: TextButton).Visible, "휴대폰: 마우스 회전 줄 숨김")
|
||||
check(scaleObj.Scale > 0.8, `휴대폰: 글자 배율 {scaleObj.Scale}`)
|
||||
@@ -500,6 +556,20 @@ 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+"))
|
||||
local okInfo, info = pcall(function()
|
||||
return game:GetService("MarketplaceService"):GetProductInfoAsync(num :: number, Enum.InfoType.Asset)
|
||||
end)
|
||||
check(okInfo, "아이콘 그림 정보 조회")
|
||||
if okInfo then
|
||||
eq(info.AssetTypeId, 1, "아이콘 그림은 이미지")
|
||||
eq(info.Creator.CreatorTargetId, game.CreatorId, "아이콘 그림은 게임 주인 소유")
|
||||
end
|
||||
end
|
||||
|
||||
section("Products")
|
||||
local Products = require(ReplicatedStorage.Shared.Products)
|
||||
local MarketplaceService = game:GetService("MarketplaceService")
|
||||
|
||||
Reference in New Issue
Block a user