feat(bunsik): 화면 UI 개편 — 상점 탭 4개(업그레이드 갈래·꾸미기·알바생·내 가게), 꾸미기(배치) 화면, 홍보·손님 러시 버튼, 추천 구매 막대, 쫓아내기 버튼, 가게 이름·무지개 이름판, 4개 언어
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -53,6 +53,8 @@ for _, d in DEVICES do
|
||||
list = L.list,
|
||||
double = L.double,
|
||||
boost = L.boost,
|
||||
promote = L.promote,
|
||||
rush = L.rush,
|
||||
}
|
||||
for name, r in hud do
|
||||
T.check(inside(r, L.width, L.height), `{tag}: {name} 화면 안`)
|
||||
@@ -75,19 +77,50 @@ 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(inside(L.confirm, L.width, L.height), `{tag}: 홍보 확인 창 화면 안`)
|
||||
|
||||
-- 상점 창 안: 탭 4개와 내용 자리가 창 안에, 서로 안 겹침
|
||||
local panelBox = { x = 0, y = 0, w = L.panel.w, h = L.panel.h }
|
||||
T.eq(#L.tabs, 4, `{tag}: 탭 4개`)
|
||||
for i, t in L.tabs do
|
||||
T.check(inside(t, panelBox.w, panelBox.h), `{tag}: 탭 {i} 창 안`)
|
||||
T.check(not overlap(t, L.content), `{tag}: 탭 {i}와 내용 안 겹침`)
|
||||
T.check(t.y >= Layout.HEADER_H, `{tag}: 탭 {i}는 제목 띠 아래`)
|
||||
T.check(t.h * L.scale >= 44 and t.w * L.scale >= 44, `{tag}: 탭 {i} 누르기 쉬움`)
|
||||
if i > 1 then
|
||||
T.check(not overlap(t, L.tabs[i - 1]), `{tag}: 탭 {i - 1}·{i} 안 겹침`)
|
||||
end
|
||||
end
|
||||
T.check(inside(L.content, panelBox.w, panelBox.h), `{tag}: 탭 내용 창 안`)
|
||||
-- 카드 칸(업그레이드 4x2, 꾸미기 5x2, 알바생 3x1): 손가락으로 누를 만큼 큼
|
||||
for _, grid in { { 4, 2 }, { 5, 2 }, { 3, 1 } } do
|
||||
-- ShopWindow의 칸: 내용 자리를 똑같이 나누고 칸마다 8씩 띄움
|
||||
local cw = L.content.w / grid[1] - 8
|
||||
local chh = L.content.h / grid[2] - 8
|
||||
T.check(
|
||||
cw * L.scale >= 90 and chh * L.scale >= 90,
|
||||
`{tag}: {grid[1]}x{grid[2]} 카드가 손가락으로 누를 만큼 큼({math.floor(cw * L.scale)}x{math.floor(
|
||||
chh * L.scale
|
||||
)}px)`
|
||||
)
|
||||
end
|
||||
|
||||
-- 꾸미기 화면 버튼: 화면 안, 서로 안 겹침, 누르기 쉬움
|
||||
local deco: { [string]: Rect } = { exit = L.deco.exit, floor = L.deco.floor, info = L.deco.info }
|
||||
for i, r in L.deco.tools do
|
||||
deco["tool" .. i] = r
|
||||
end
|
||||
local dnames = {}
|
||||
for name, r in deco do
|
||||
T.check(inside(r, L.width, L.height), `{tag}: 꾸미기 {name} 화면 안`)
|
||||
table.insert(dnames, name)
|
||||
end
|
||||
table.sort(dnames)
|
||||
for i, a in dnames do
|
||||
for j = i + 1, #dnames do
|
||||
T.check(not overlap(deco[a], deco[dnames[j]]), `{tag}: 꾸미기 {a}와 {dnames[j]} 안 겹침`)
|
||||
end
|
||||
end
|
||||
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만`)
|
||||
@@ -100,6 +133,8 @@ for _, d in DEVICES do
|
||||
list = L.list,
|
||||
double = L.double,
|
||||
boost = L.boost,
|
||||
promote = L.promote,
|
||||
rush = L.rush,
|
||||
}
|
||||
for name, r in buttons do
|
||||
local p = px(r, L.scale)
|
||||
@@ -107,6 +142,13 @@ for _, d in DEVICES do
|
||||
T.check(not overlap(p, zones.jump), `{tag}: {name} 버튼이 점프 버튼 자리 피함`)
|
||||
T.check(p.h >= 44, `{tag}: {name} 버튼 높이 {math.floor(p.h)}px ≥ 44(어린이 손가락)`)
|
||||
end
|
||||
for name, r in deco do
|
||||
local p = px(r, L.scale)
|
||||
T.check(not overlap(p, zones.jump), `{tag}: 꾸미기 {name}이 점프 버튼 자리 피함`)
|
||||
if name ~= "info" then
|
||||
T.check(p.h >= 44, `{tag}: 꾸미기 {name} 버튼 높이 {math.floor(p.h)}px ≥ 44`)
|
||||
end
|
||||
end
|
||||
T.check(L.rows.langButtonH * L.scale >= 36, `{tag}: 언어 버튼 누르기 쉬움`)
|
||||
T.check(L.rows.toggleH * L.scale >= 34, `{tag}: 켜기/끄기 버튼 누르기 쉬움`)
|
||||
end
|
||||
|
||||
@@ -5,6 +5,52 @@ local Locale = require("../src/shared/Locale")
|
||||
local Recipes = require("../src/shared/Recipes")
|
||||
local T = require("./check")
|
||||
|
||||
local NOTIFY = {
|
||||
"upgraded",
|
||||
"newMenu",
|
||||
"expanded",
|
||||
"floor2",
|
||||
"seatAdded",
|
||||
"tableAdded",
|
||||
"decorAdded",
|
||||
"noSpace",
|
||||
"seatMax",
|
||||
"tableMax",
|
||||
"tableFull",
|
||||
"needStage",
|
||||
"placeFail",
|
||||
"hired",
|
||||
"fired",
|
||||
"staffLocked",
|
||||
"staffMax",
|
||||
"strike",
|
||||
"strikeOver",
|
||||
"renamed",
|
||||
"nameRejected",
|
||||
"designSet",
|
||||
"designLocked",
|
||||
"promoted",
|
||||
"promoteNone",
|
||||
"promoteFull",
|
||||
"promoteWait",
|
||||
"adUnavailable",
|
||||
"kicked",
|
||||
"kickedBy",
|
||||
"shielded",
|
||||
"kickOwn",
|
||||
"rushOn",
|
||||
"notEnough",
|
||||
"boostGot",
|
||||
"guestBonus",
|
||||
"guestArrived",
|
||||
"guestSeated",
|
||||
"guestAte",
|
||||
"guestHungry",
|
||||
"visitFull",
|
||||
"tutDone",
|
||||
"devResetDone",
|
||||
}
|
||||
|
||||
local ko = Locale.keys("ko")
|
||||
table.sort(ko)
|
||||
for _, lang in Locale.LANGS do
|
||||
@@ -25,8 +71,38 @@ for _, lang in Locale.LANGS 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}`)
|
||||
local function has(key: string, what: string)
|
||||
T.check(Locale.t(lang, key) ~= key, `{lang} {what} {key}`)
|
||||
end
|
||||
for _, t in Economy.TRACKS do
|
||||
has("track_" .. t.id, "업그레이드 갈래 이름")
|
||||
has("fx_" .. t.id, "업그레이드 효과")
|
||||
for _, lv in t.levels do
|
||||
if t.id == "Stage" then
|
||||
has(`stage_{lv.value}`, "건물 단계 이름")
|
||||
end
|
||||
end
|
||||
end
|
||||
has("stage_1", "건물 단계 이름")
|
||||
for _, r in Economy.ROLES do
|
||||
has("role_" .. r.id, "알바 역할")
|
||||
has("roleDesc_" .. r.id, "알바 역할 설명")
|
||||
end
|
||||
for _, d in Economy.DECOR do
|
||||
has("decor_" .. d.id, "소품 이름")
|
||||
end
|
||||
for _, d in Economy.DESIGNS do
|
||||
has("design_" .. d.id, "디자인 이름")
|
||||
end
|
||||
for _, why in { "bounds", "overlap", "reserved", "floor", "blocked", "chair", "none" } do
|
||||
has("why_" .. why, "배치 실패 이유")
|
||||
end
|
||||
for i = 1, 4 do
|
||||
has(`side_{i}`, "의자 쪽")
|
||||
end
|
||||
-- 서버가 보내는 알림 키(NETWORK.md)
|
||||
for _, key in NOTIFY do
|
||||
has(key, "알림")
|
||||
end
|
||||
-- 치환 자리({money} 등)가 한국어와 같아야 함
|
||||
for _, k in ko do
|
||||
@@ -76,7 +152,7 @@ T.eq(
|
||||
"같은 자리 두 번 치환"
|
||||
)
|
||||
T.eq(Locale.menuName("zh", "Gimbap"), "紫菜包饭", "중국어 메뉴 이름")
|
||||
T.eq(Locale.itemName("en", "Expand"), "Indoor Shop", "영어 업그레이드 이름")
|
||||
T.eq(Locale.t("en", "track_Speed"), "Customer Speed", "영어 갈래 이름")
|
||||
T.eq(Locale.number(1234567), "1,234,567", "쉼표")
|
||||
T.eq(Locale.number(999), "999", "쉼표 없음")
|
||||
T.eq(Locale.number(0), "0", "0")
|
||||
|
||||
@@ -152,67 +152,124 @@ local function shot(name: string, dev: { [string]: any }, attrs: { [string]: any
|
||||
end
|
||||
return t
|
||||
end
|
||||
-- 상태 묶음(NETWORK.md 플레이어 속성). 갈래 레벨은 Levels 글자로
|
||||
local function shopState(levels: string, seats: number, tables: number, extra: { [string]: any }): { [string]: any }
|
||||
local t: { [string]: any } = { Levels = levels, Seats = seats, Tables = tables }
|
||||
local stage = 1 + (tonumber(string.match(levels, "Stage=(%d)")) or 0)
|
||||
t.Stage = stage
|
||||
for k, v in extra do
|
||||
t[k] = v
|
||||
end
|
||||
return t
|
||||
end
|
||||
local EARLY = "Stage=0,Menu=1,Price=0,Speed=1,Stove=0,Tray=0,Staff=0"
|
||||
local MID = "Stage=1,Menu=2,Price=2,Speed=3,Stove=1,Tray=1,Staff=1"
|
||||
local LATE = "Stage=2,Menu=4,Price=4,Speed=5,Stove=3,Tray=2,Staff=1"
|
||||
local LAYOUT = '{"stove":{"x":0,"z":-26,"r":0},"tables":[{"x":-9,"z":-10,"f":1},{"x":9,"z":-10,"f":1}],'
|
||||
.. '"chairs":[{"t":1,"s":1},{"t":1,"s":3},{"t":2,"s":1}],"decor":[{"k":"Plant","x":-31,"z":-35,"f":1,"r":0}]}'
|
||||
local SHOTS = {
|
||||
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_main",
|
||||
PHONE,
|
||||
shopState(EARLY, 2, 1, { Money = 85, Carry = 1, Hand = "Gimbap", Tut = 0 }),
|
||||
{ toast = true }
|
||||
),
|
||||
shot("phone_tut", PHONE, shopState("", 1, 1, { Money = 15, Tut = 3 })),
|
||||
shot("phone_shop", PHONE, shopState(EARLY, 2, 1, { Money = 150 }), { open = "shop" }),
|
||||
shot(
|
||||
"phone_shop_decor",
|
||||
PHONE,
|
||||
shopState(MID, 3, 2, { Money = 400, Layout = LAYOUT }),
|
||||
{ open = "shop", tab = "decor" }
|
||||
),
|
||||
shot(
|
||||
"phone_shop_staff",
|
||||
PHONE,
|
||||
shopState(MID, 3, 2, { Money = 600, Staff = "Cook=1,Server=0,Promoter=0", Wage = 18 }),
|
||||
{ open = "shop", tab = "staff" }
|
||||
),
|
||||
shot(
|
||||
"phone_shop_mine",
|
||||
PHONE,
|
||||
shopState(MID, 3, 2, { Money = 600, ShopName = "떡볶이 천국", Design = "Mint", RainbowOwned = false }),
|
||||
{ open = "shop", tab = "mine" }
|
||||
),
|
||||
shot("phone_promote", PHONE, shopState(EARLY, 2, 1, { Money = 150 }), { open = "promote" }),
|
||||
shot("phone_settings", PHONE, shopState(EARLY, 2, 1, { Money = 150 }), { open = "settings" }),
|
||||
shot(
|
||||
"phone_kitchen_menu",
|
||||
PHONE,
|
||||
{ Money = 300, Bought = 6, Orders = "Tteokbokki=1,Gimbap=2", Tut = 1 },
|
||||
shopState(EARLY, 2, 1, { Money = 300, Orders = "Tteokbokki=1,Gimbap=2", Tut = 1 }),
|
||||
{ kitchen = { menu = nil } }
|
||||
),
|
||||
shot(
|
||||
"phone_kitchen_tteok",
|
||||
PHONE,
|
||||
{ Money = 300, Bought = 6, Orders = "Tteokbokki=1" },
|
||||
shopState(EARLY, 2, 1, { Money = 300, 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_main", PC, shopState(EARLY, 2, 1, { Money = 1234, Carry = 1, Hand = "Tteokbokki" }), { toast = true }),
|
||||
shot("pc_buyable", PC, shopState(EARLY, 2, 1, { Money = 160, Carry = 0, Tut = 0 })),
|
||||
shot("pc_shop", PC, shopState(MID, 4, 2, { Money = 760, Double = true }), { open = "shop" }),
|
||||
shot("pc_shop_staff_locked", PC, shopState(EARLY, 2, 1, { Money = 760 }), { open = "shop", tab = "staff" }),
|
||||
shot(
|
||||
"pc_shop_staff_strike",
|
||||
PC,
|
||||
shopState(LATE, 10, 4, { Money = 0, Staff = "Cook=2,Server=1,Promoter=1", Strike = true, Wage = 120 }),
|
||||
{ open = "shop", tab = "staff" }
|
||||
),
|
||||
shot(
|
||||
"pc_shop_mine",
|
||||
PC,
|
||||
shopState(
|
||||
LATE,
|
||||
10,
|
||||
4,
|
||||
{ Money = 760, Design = "Candy", DesignsOwned = "Candy", RainbowOwned = true, Rainbow = true }
|
||||
),
|
||||
{ open = "shop", tab = "mine" }
|
||||
),
|
||||
shot("pc_settings", PC, shopState(MID, 4, 2, { Money = 760, Dev = true }), { open = "settings" }),
|
||||
shot(
|
||||
"pc_kitchen_menu",
|
||||
PC,
|
||||
{ Money = 300, Bought = 13, Orders = "Gimbap=1,Sundae=2,Eomuk=1" },
|
||||
shopState(MID, 4, 2, { Money = 300, Orders = "Gimbap=1,Sundae=2,Eomuk=1" }),
|
||||
{ kitchen = { menu = nil } }
|
||||
),
|
||||
shot(
|
||||
"pc_kitchen_gimbap",
|
||||
PC,
|
||||
{ Money = 300, Bought = 13, Orders = "Gimbap=1" },
|
||||
shopState(MID, 4, 2, { Money = 300, Orders = "Gimbap=1" }),
|
||||
{ kitchen = { menu = "Gimbap", step = 2, frac = 0.6 } }
|
||||
),
|
||||
shot(
|
||||
"pc_kitchen_sundae",
|
||||
PC,
|
||||
{ Money = 300, Bought = 13, Orders = "Sundae=1" },
|
||||
shopState(MID, 4, 2, { Money = 300, Orders = "Sundae=1" }),
|
||||
{ kitchen = { menu = "Sundae", step = 2, frac = 0.7 } }
|
||||
),
|
||||
shot(
|
||||
"pc_kitchen_eomuk",
|
||||
PC,
|
||||
{ Money = 300, Bought = 13, Orders = "Eomuk=1" },
|
||||
shopState(LATE, 4, 2, { Money = 300, Orders = "Eomuk=1" }),
|
||||
{ kitchen = { menu = "Eomuk", step = 2, frac = 0.4 } }
|
||||
),
|
||||
shot(
|
||||
"pc_kitchen_twigim",
|
||||
PC,
|
||||
{ Money = 300, Bought = 17, Orders = "Twigim=1" },
|
||||
shopState(LATE, 4, 2, { Money = 300, Orders = "Twigim=1" }),
|
||||
{ kitchen = { menu = "Twigim", step = 3, frac = 0.5 } }
|
||||
),
|
||||
shot(
|
||||
"pc_kitchen_done",
|
||||
PC,
|
||||
{ Money = 300, Bought = 6, Orders = "Tteokbokki=1" },
|
||||
shopState(EARLY, 2, 1, { Money = 300, 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" }
|
||||
shopState(LATE, 10, 4, { Money = 98765, Carry = 2, Hand = "Eomuk,Sundae" })
|
||||
),
|
||||
}
|
||||
|
||||
@@ -231,10 +288,10 @@ for _, s in SHOTS do
|
||||
state:SetAttribute("Tut", 0)
|
||||
end
|
||||
if s.toast then
|
||||
hud.notify("purchased", { item = "Stove1" })
|
||||
hud.notify("upgraded", { track = "Speed", level = 2 })
|
||||
end
|
||||
if s.open then
|
||||
hud.open(s.open)
|
||||
hud.open(s.open, s.tab)
|
||||
end
|
||||
local k = s.kitchen
|
||||
if k then
|
||||
|
||||
Reference in New Issue
Block a user