UI를 메이커 저작으로 전환 — 생성기는 더 이상 .ui를 만들지 않는다. hud/* 15종 + gen-cardhand.mjs를 tools/deck/legacy/로 이동(휴면). (이 커밋 시점 gen-slaydeck import는 깨짐 — Task 3·4에서 정리) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
128 lines
6.8 KiB
JavaScript
128 lines
6.8 KiB
JavaScript
import { UI_FILE, COMMON_FILE, UI_ROOT, GENERATED_UI_SECTIONS, UI_APPEND_ORDER, DISABLED_STOCK_CONTROLS, TRANSPARENT, DARK, GOLD, ATTACK, DEFEND, SKILL, DAMAGE_DIGIT_RUIDS, DAMAGE_POP_MAX_DIGITS, DAMAGE_POP_DIGIT_W, DAMAGE_POP_DIGIT_H, DAMAGE_POP_DIGIT_SPACING, MAX_MONSTERS, HEAD_OFFSET_Y, HP_BAR_W, WHITE, CARD_NAME_TEXT, CARD_DESC_TEXT, cardFaceLayout, CARD_W, CARD_H, CARD_SPACING, CARD_XS, ALIGN_CENTER, ALIGN_BOTTOM_CENTER, guid, transform, sprite, button, text, scrollLayoutGroup, popupLayerFor, uiOrderFor, displayOrderFor, applySortingOverride, entity, uiPath, sectionRoot, isGeneratedUiEntity, appendUiSection } from '../lib/ui-helpers.mjs';
|
|
import { CARDS, ENEMIES, CLASSES, JOBS, SOUL_UNLOCKS, luaSoulShopTable, CARDFRAMES, RARITIES, frameRuid, luaFramesTable, luaNodeIconsTable, MAP_ROWS, MAP_COLS, CHEST_CLOSED_RUID, CHEST_OPEN_RUID, NODEICONS, CHARS, CAM, RELICS, luaRelicsTable, POTIONS, luaPotionsTable, luaIntentsArray, luaEnemiesTable, luaStr, luaJobsTable, luaCardsTable, luaDeckTable } from '../lib/data.mjs';
|
|
|
|
export function buildMainMenu() {
|
|
const menu = [];
|
|
menu.push(entity({
|
|
id: guid('menu', 0),
|
|
path: '/ui/DefaultGroup/MainMenu',
|
|
modelId: 'uisprite',
|
|
entryId: 'UISprite',
|
|
componentNames: 'MOD.Core.UITransformComponent,MOD.Core.SpriteGUIRendererComponent',
|
|
displayOrder: 20,
|
|
components: [
|
|
transform({ parentW: 1920, parentH: 1080, anchor: { x: 0.5, y: 0.5 }, pivot: { x: 0.5, y: 0.5 }, size: { x: 1920, y: 1080 }, pos: { x: 0, y: 0 }, align: ALIGN_CENTER }),
|
|
sprite({ color: { r: 0.06, g: 0.09, b: 0.13, a: 1 }, type: 1, raycast: true }),
|
|
],
|
|
}));
|
|
menu.push(entity({
|
|
id: guid('menu', 50),
|
|
path: '/ui/DefaultGroup/MainMenu/OpaqueBackdrop',
|
|
modelId: 'uisprite',
|
|
entryId: 'UISprite',
|
|
componentNames: 'MOD.Core.UITransformComponent,MOD.Core.SpriteGUIRendererComponent',
|
|
displayOrder: 0,
|
|
components: [
|
|
transform({ parentW: 1920, parentH: 1080, anchor: { x: 0.5, y: 0.5 }, pivot: { x: 0.5, y: 0.5 }, size: { x: 1920, y: 1080 }, pos: { x: 0, y: 0 }, align: ALIGN_CENTER }),
|
|
sprite({ color: TRANSPARENT, type: 1, raycast: false }),
|
|
],
|
|
}));
|
|
menu.push(entity({
|
|
id: guid('menu', 1),
|
|
path: '/ui/DefaultGroup/MainMenu/Title',
|
|
modelId: 'uitext',
|
|
entryId: 'UIText',
|
|
componentNames: 'MOD.Core.UITransformComponent,MOD.Core.SpriteGUIRendererComponent,MOD.Core.TextComponent',
|
|
displayOrder: 0,
|
|
components: [
|
|
transform({ parentW: 1920, parentH: 1080, anchor: { x: 0.5, y: 0.5 }, pivot: { x: 0.5, y: 0.5 }, size: { x: 720, y: 100 }, pos: { x: 0, y: 180 }, align: ALIGN_CENTER }),
|
|
sprite({ color: TRANSPARENT }),
|
|
text({ value: '슬레이 메이플', fontSize: 64, bold: true, color: GOLD, alignment: 0 }),
|
|
],
|
|
}));
|
|
menu.push(entity({
|
|
id: guid('menu', 2),
|
|
path: '/ui/DefaultGroup/MainMenu/Subtitle',
|
|
modelId: 'uitext',
|
|
entryId: 'UIText',
|
|
componentNames: 'MOD.Core.UITransformComponent,MOD.Core.SpriteGUIRendererComponent,MOD.Core.TextComponent',
|
|
displayOrder: 1,
|
|
components: [
|
|
transform({ parentW: 1920, parentH: 1080, anchor: { x: 0.5, y: 0.5 }, pivot: { x: 0.5, y: 0.5 }, size: { x: 760, y: 48 }, pos: { x: 0, y: 104 }, align: ALIGN_CENTER }),
|
|
sprite({ color: TRANSPARENT }),
|
|
text({ value: '카드를 뽑고, 덱을 만들고, 첨탑을 오른다', fontSize: 24, color: { r: 0.82, g: 0.86, b: 0.9, a: 1 }, alignment: 0 }),
|
|
],
|
|
}));
|
|
menu.push(entity({
|
|
id: guid('menu', 3),
|
|
path: '/ui/DefaultGroup/MainMenu/NewGameButton',
|
|
modelId: 'uibutton',
|
|
entryId: 'UIButton',
|
|
componentNames: 'MOD.Core.UITransformComponent,MOD.Core.SpriteGUIRendererComponent,MOD.Core.ButtonComponent,MOD.Core.TextComponent',
|
|
displayOrder: 2,
|
|
components: [
|
|
transform({ parentW: 1920, parentH: 1080, anchor: { x: 0.5, y: 0.5 }, pivot: { x: 0.5, y: 0.5 }, size: { x: 260, y: 68 }, pos: { x: 0, y: -20 }, align: ALIGN_CENTER }),
|
|
sprite({ color: { r: 0.13, g: 0.15, b: 0.18, a: 1 }, type: 1, raycast: true }),
|
|
button(),
|
|
text({ value: '새 게임', fontSize: 30, bold: true, color: GOLD, alignment: 0 }),
|
|
],
|
|
}));
|
|
// 승천 선택 (P11): [-] 라벨 [+]
|
|
menu.push(entity({
|
|
id: guid('menu', 195),
|
|
path: '/ui/DefaultGroup/MainMenu/AscMinus',
|
|
modelId: 'uibutton',
|
|
entryId: 'UIButton',
|
|
componentNames: 'MOD.Core.UITransformComponent,MOD.Core.SpriteGUIRendererComponent,MOD.Core.ButtonComponent,MOD.Core.TextComponent',
|
|
displayOrder: 5,
|
|
components: [
|
|
transform({ parentW: 1920, parentH: 1080, anchor: { x: 0.5, y: 0.5 }, pivot: { x: 0.5, y: 0.5 }, size: { x: 52, y: 52 }, pos: { x: -170, y: -185 }, align: ALIGN_CENTER }),
|
|
sprite({ color: { r: 0.13, g: 0.15, b: 0.18, a: 1 }, type: 1, raycast: true }),
|
|
button(),
|
|
text({ value: '-', fontSize: 30, bold: true, color: GOLD, alignment: 4 }),
|
|
],
|
|
}));
|
|
menu.push(entity({
|
|
id: guid('menu', 196),
|
|
path: '/ui/DefaultGroup/MainMenu/AscLabel',
|
|
modelId: 'uitext',
|
|
entryId: 'UIText',
|
|
componentNames: 'MOD.Core.UITransformComponent,MOD.Core.SpriteGUIRendererComponent,MOD.Core.TextComponent',
|
|
displayOrder: 6,
|
|
components: [
|
|
transform({ parentW: 1920, parentH: 1080, anchor: { x: 0.5, y: 0.5 }, pivot: { x: 0.5, y: 0.5 }, size: { x: 250, y: 40 }, pos: { x: 0, y: -185 }, align: ALIGN_CENTER }),
|
|
sprite({ color: TRANSPARENT }),
|
|
text({ value: '승천 0 / 해금 0', fontSize: 22, bold: true, color: { r: 0.85, g: 0.7, b: 0.95, a: 1 }, alignment: 4 }),
|
|
],
|
|
}));
|
|
menu.push(entity({
|
|
id: guid('menu', 197),
|
|
path: '/ui/DefaultGroup/MainMenu/AscPlus',
|
|
modelId: 'uibutton',
|
|
entryId: 'UIButton',
|
|
componentNames: 'MOD.Core.UITransformComponent,MOD.Core.SpriteGUIRendererComponent,MOD.Core.ButtonComponent,MOD.Core.TextComponent',
|
|
displayOrder: 7,
|
|
components: [
|
|
transform({ parentW: 1920, parentH: 1080, anchor: { x: 0.5, y: 0.5 }, pivot: { x: 0.5, y: 0.5 }, size: { x: 52, y: 52 }, pos: { x: 170, y: -185 }, align: ALIGN_CENTER }),
|
|
sprite({ color: { r: 0.13, g: 0.15, b: 0.18, a: 1 }, type: 1, raycast: true }),
|
|
button(),
|
|
text({ value: '+', fontSize: 30, bold: true, color: GOLD, alignment: 4 }),
|
|
],
|
|
}));
|
|
menu.push(entity({
|
|
id: guid('menu', 4),
|
|
path: '/ui/DefaultGroup/MainMenu/ContinueButton',
|
|
modelId: 'uibutton',
|
|
entryId: 'UIButton',
|
|
componentNames: 'MOD.Core.UITransformComponent,MOD.Core.SpriteGUIRendererComponent,MOD.Core.ButtonComponent,MOD.Core.TextComponent',
|
|
displayOrder: 3,
|
|
components: [
|
|
transform({ parentW: 1920, parentH: 1080, anchor: { x: 0.5, y: 0.5 }, pivot: { x: 0.5, y: 0.5 }, size: { x: 260, y: 58 }, pos: { x: 0, y: -100 }, align: ALIGN_CENTER }),
|
|
sprite({ color: { r: 0.1, g: 0.11, b: 0.13, a: 0.78 }, type: 1, raycast: false }),
|
|
button({ enabled: false }),
|
|
text({ value: '이어하기', fontSize: 24, bold: true, color: { r: 0.55, g: 0.58, b: 0.62, a: 1 }, alignment: 0 }),
|
|
],
|
|
}));
|
|
return menu;
|
|
}
|