main의 5개 PR(#62 exhaust+tooltip, #66 dex/thorns, #67 캐릭터 덱버튼 제거, #68 스크롤바, #69 표창카드)을 모듈화 브랜치에 병합. 충돌은 tools/deck/gen-slaydeck.mjs 한 파일 — main이 그 단일체를 콘텐츠 변경 (구조/emit/top-level 상수는 불변)한 반면 본 브랜치는 모듈로 재구조화. 해결: main 버전(theirs)을 취해 **콘텐츠 마커 기반으로 재모듈화**(라인인덱스 X, 이름 자동 파생) → lib/data·lib/ui-helpers + hud/*.mjs 16종 재생성. 검증(손실 0): 재모듈화 생성기 출력이 origin/main 산출물과 **바이트 동일** (diffcheck: ui/DefaultGroup.ui·SlayDeckController.codeblock IDENTICAL). common.gamelogic은 origin/main 그대로 채택(유일 차이는 main의 stale `.0` 정수표기 — origin/main 원본 생성기도 정수를 만듦을 확인). 미러 테스트 sim-balance·rogue-map 통과. RULES.md는 §1(모듈구조)+§4/§7(main) 자동 병합. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
160 lines
8.0 KiB
JavaScript
160 lines
8.0 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 buildDeckAll() {
|
|
const allDeck = [];
|
|
const allHud = entity({
|
|
id: guid('all', 0),
|
|
path: '/ui/DefaultGroup/DeckAllHud',
|
|
modelId: 'uisprite',
|
|
entryId: 'UISprite',
|
|
componentNames: 'MOD.Core.UITransformComponent,MOD.Core.SpriteGUIRendererComponent',
|
|
displayOrder: 16,
|
|
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.04, g: 0.05, b: 0.07, a: 0.78 }, type: 1, raycast: true }),
|
|
],
|
|
});
|
|
allHud.jsonString.enable = false;
|
|
allDeck.push(allHud);
|
|
allDeck.push(entity({
|
|
id: guid('all', 1),
|
|
path: '/ui/DefaultGroup/DeckAllHud/Panel',
|
|
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: 1080, y: 800 }, pos: { x: 0, y: 0 }, align: ALIGN_CENTER }),
|
|
sprite({ color: { r: 0.08, g: 0.09, b: 0.11, a: 0.96 }, type: 1 }),
|
|
],
|
|
}));
|
|
allDeck.push(entity({
|
|
id: guid('all', 2),
|
|
path: '/ui/DefaultGroup/DeckAllHud/Title',
|
|
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: 54 }, pos: { x: 0, y: 380 } }),
|
|
sprite({ color: TRANSPARENT }),
|
|
text({ value: '모든 덱', fontSize: 34, bold: true, color: GOLD, alignment: 4 }),
|
|
],
|
|
}));
|
|
allDeck.push(entity({
|
|
id: guid('all', 3),
|
|
path: '/ui/DefaultGroup/DeckAllHud/Close',
|
|
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: 78, y: 52 }, pos: { x: 486, y: 380 } }),
|
|
sprite({ color: { r: 0.16, g: 0.18, b: 0.22, a: 1 }, type: 1, raycast: true }),
|
|
button(),
|
|
text({ value: 'X', fontSize: 26, bold: true, color: GOLD, alignment: 4 }),
|
|
],
|
|
}));
|
|
const deckTabs = [
|
|
{ key: 'Warrior', label: '전사', x: -210 },
|
|
{ key: 'Thief', label: '도적', x: 0 },
|
|
{ key: 'Mage', label: '마법사', x: 210 },
|
|
];
|
|
for (let i = 0; i < deckTabs.length; i++) {
|
|
const tab = deckTabs[i];
|
|
allDeck.push(entity({
|
|
id: guid('all', 10 + i),
|
|
path: `/ui/DefaultGroup/DeckAllHud/${tab.key}Tab`,
|
|
modelId: 'uibutton',
|
|
entryId: 'UIButton',
|
|
componentNames: 'MOD.Core.UITransformComponent,MOD.Core.SpriteGUIRendererComponent,MOD.Core.ButtonComponent,MOD.Core.TextComponent',
|
|
displayOrder: 3 + i,
|
|
components: [
|
|
transform({ parentW: 1920, parentH: 1080, anchor: { x: 0.5, y: 0.5 }, pivot: { x: 0.5, y: 0.5 }, size: { x: 170, y: 46 }, pos: { x: tab.x, y: 318 } }),
|
|
sprite({ color: { r: 0.11, g: 0.13, b: 0.16, a: 1 }, type: 1, raycast: true }),
|
|
button(),
|
|
text({ value: tab.label, fontSize: 22, bold: true, color: GOLD, alignment: 4 }),
|
|
],
|
|
}));
|
|
}
|
|
allDeck.push(entity({
|
|
id: guid('all', 4),
|
|
path: '/ui/DefaultGroup/DeckAllHud/Empty',
|
|
modelId: 'uitext',
|
|
entryId: 'UIText',
|
|
componentNames: 'MOD.Core.UITransformComponent,MOD.Core.SpriteGUIRendererComponent,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: 600, y: 50 }, pos: { x: 0, y: 40 } }),
|
|
sprite({ color: TRANSPARENT }),
|
|
text({ value: '덱이 없습니다', fontSize: 28, bold: true, color: { r: 0.82, g: 0.86, b: 0.9, a: 1 }, alignment: 4 }),
|
|
],
|
|
}));
|
|
allDeck.push(entity({
|
|
id: guid('all', 5),
|
|
path: '/ui/DefaultGroup/DeckAllHud/Grid',
|
|
modelId: 'uiempty',
|
|
entryId: 'UIEmpty',
|
|
componentNames: 'MOD.Core.UITransformComponent,MOD.Core.SpriteGUIRendererComponent,MOD.Core.ScrollLayoutGroupComponent',
|
|
displayOrder: 4,
|
|
components: [
|
|
transform({ parentW: 1920, parentH: 1080, anchor: { x: 0.5, y: 0.5 }, pivot: { x: 0.5, y: 0.5 }, size: { x: 980, y: 620 }, pos: { x: 0, y: 0 } }),
|
|
sprite({ color: TRANSPARENT, type: 1, raycast: true }),
|
|
scrollLayoutGroup({ cellSize: { x: 158, y: 214 }, spacing: { x: 22, y: 22 }, columns: 5 }),
|
|
],
|
|
}));
|
|
const ALL_DECK_CARD_COUNT = 120;
|
|
const ALL_DECK_CARD_W = 158;
|
|
const ALL_DECK_CARD_H = 214;
|
|
// 카드 단위 엔티티 v2 네임스페이스 — DeckInspectHud 주석 참조
|
|
for (let i = 1; i <= ALL_DECK_CARD_COUNT; i++) {
|
|
const allBase = 6 + (i - 1) * 7;
|
|
const cardPath = `/ui/DefaultGroup/DeckAllHud/Grid/Card${i}`;
|
|
const card = entity({
|
|
id: guid('all2', allBase),
|
|
path: cardPath,
|
|
modelId: 'uisprite',
|
|
entryId: 'UISprite',
|
|
componentNames: 'MOD.Core.UITransformComponent,MOD.Core.SpriteGUIRendererComponent',
|
|
displayOrder: i,
|
|
components: [
|
|
transform({ parentW: 980, parentH: 620, anchor: { x: 0.5, y: 0.5 }, pivot: { x: 0.5, y: 0.5 }, size: { x: ALL_DECK_CARD_W, y: ALL_DECK_CARD_H }, pos: { x: 0, y: 0 } }),
|
|
sprite({ dataId: CARDFRAMES.frames.warrior.normal, color: WHITE, type: 0 }),
|
|
],
|
|
});
|
|
card.jsonString.enable = false;
|
|
allDeck.push(card);
|
|
const allDeckLayout = cardFaceLayout(ALL_DECK_CARD_W);
|
|
for (const [tIdx, [suffix, cfg]] of allDeckLayout.texts.map(([sfx, c]) => [sfx, { ...c, value: sfx === 'Cost' ? '1' : '' }]).entries()) {
|
|
const dOrder = suffix === 'Cost' ? 7 : suffix === 'Name' ? 6 : 8;
|
|
allDeck.push(entity({
|
|
id: guid('all2', allBase + 1 + tIdx),
|
|
path: `${cardPath}/${suffix}`,
|
|
modelId: 'uitext',
|
|
entryId: 'UIText',
|
|
componentNames: 'MOD.Core.UITransformComponent,MOD.Core.SpriteGUIRendererComponent,MOD.Core.TextComponent',
|
|
displayOrder: dOrder,
|
|
components: [
|
|
transform({ parentW: ALL_DECK_CARD_W, parentH: ALL_DECK_CARD_H, anchor: { x: 0.5, y: 0.5 }, pivot: { x: 0.5, y: 0.5 }, size: cfg.size, pos: cfg.pos }),
|
|
sprite({ color: TRANSPARENT }),
|
|
text({ value: cfg.value, fontSize: cfg.fontSize, bold: cfg.bold, color: cfg.color, dropShadow: cfg.dropShadow, outlineWidth: cfg.outlineWidth }),
|
|
],
|
|
}));
|
|
}
|
|
allDeck.push(entity({
|
|
id: guid('all2', allBase + 6),
|
|
path: `${cardPath}/Art`,
|
|
modelId: 'uisprite',
|
|
entryId: 'UISprite',
|
|
componentNames: 'MOD.Core.UITransformComponent,MOD.Core.SpriteGUIRendererComponent',
|
|
displayOrder: 5,
|
|
components: [
|
|
transform({ parentW: ALL_DECK_CARD_W, parentH: ALL_DECK_CARD_H, anchor: { x: 0.5, y: 0.5 }, pivot: { x: 0.5, y: 0.5 }, size: allDeckLayout.art.size, pos: allDeckLayout.art.pos }),
|
|
sprite({ color: WHITE, type: 0, raycast: false }),
|
|
],
|
|
}));
|
|
}
|
|
return allDeck;
|
|
}
|