DeckHud/DeckInspect/DeckAll/Combat/Reward/Map/Shop/Rest/Treasure/JobChoice/ JobSelect/Lobby/Board/SoulShop를 각 build 함수로 분리, upsertUi는 emit 한 줄로. 전문 상수(PANEL_BG·TYPE_KO)는 해당 블록에 포함. 산출물 무변경(diffcheck IDENTICAL). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
91 lines
5.1 KiB
JavaScript
91 lines
5.1 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, CARDFRAMES, RARITIES, MAP_ROWS, MAP_COLS, CHEST_CLOSED_RUID, CHEST_OPEN_RUID, NODEICONS, CHARS, CAM, RELICS, POTIONS, luaSoulShopTable, frameRuid, luaFramesTable, luaNodeIconsTable, luaRelicsTable, luaPotionsTable, luaIntentsArray, luaEnemiesTable, luaStr, luaJobsTable, luaCardsTable, luaDeckTable } from '../lib/data.mjs';
|
|
|
|
export function buildSoulShop() {
|
|
const soulShop = [];
|
|
let soulId = 0;
|
|
const soulRoot = entity({
|
|
id: guid('soul', soulId++),
|
|
path: '/ui/DefaultGroup/SoulShopHud',
|
|
modelId: 'uisprite', entryId: 'UISprite',
|
|
componentNames: 'MOD.Core.UITransformComponent,MOD.Core.SpriteGUIRendererComponent',
|
|
displayOrder: 15,
|
|
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.05, g: 0.06, b: 0.09, a: 0.95 }, type: 1, raycast: true }),
|
|
],
|
|
});
|
|
soulRoot.jsonString.enable = false;
|
|
soulShop.push(soulRoot);
|
|
soulShop.push(entity({
|
|
id: guid('soul', soulId++),
|
|
path: '/ui/DefaultGroup/SoulShopHud/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: 700, y: 60 }, pos: { x: 0, y: 410 } }),
|
|
sprite({ color: TRANSPARENT }),
|
|
text({ value: '영혼 상점', fontSize: 44, bold: true, color: { r: 0.6, g: 0.85, b: 1, a: 1 }, alignment: 4 }),
|
|
],
|
|
}));
|
|
soulShop.push(entity({
|
|
id: guid('soul', soulId++),
|
|
path: '/ui/DefaultGroup/SoulShopHud/Souls',
|
|
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: 400, y: 44 }, pos: { x: 0, y: 345 } }),
|
|
sprite({ color: TRANSPARENT }),
|
|
text({ value: '영혼 0', fontSize: 28, bold: true, color: { r: 0.6, g: 0.85, b: 1, a: 1 }, alignment: 4 }),
|
|
],
|
|
}));
|
|
soulShop.push(entity({
|
|
id: guid('soul', soulId++),
|
|
path: '/ui/DefaultGroup/SoulShopHud/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: 200, y: 60 }, pos: { x: 0, y: -400 }, align: ALIGN_CENTER }),
|
|
sprite({ color: { r: 0.2, g: 0.24, b: 0.3, a: 1 }, type: 1, raycast: true }),
|
|
button(),
|
|
text({ value: '닫기', fontSize: 28, bold: true, color: WHITE, alignment: 4 }),
|
|
],
|
|
}));
|
|
for (let i = 1; i <= 4; i++) {
|
|
const ip = `/ui/DefaultGroup/SoulShopHud/Item${i}`;
|
|
const iy = 230 - (i - 1) * 125;
|
|
soulShop.push(entity({
|
|
id: guid('soul', soulId++),
|
|
path: ip, modelId: 'uibutton', entryId: 'UIButton',
|
|
componentNames: 'MOD.Core.UITransformComponent,MOD.Core.SpriteGUIRendererComponent,MOD.Core.ButtonComponent',
|
|
displayOrder: 2,
|
|
components: [
|
|
transform({ parentW: 1920, parentH: 1080, anchor: { x: 0.5, y: 0.5 }, pivot: { x: 0.5, y: 0.5 }, size: { x: 760, y: 104 }, pos: { x: 0, y: iy }, align: ALIGN_CENTER }),
|
|
sprite({ color: { r: 0.14, g: 0.16, b: 0.22, a: 1 }, type: 1, raycast: true }),
|
|
button(),
|
|
],
|
|
}));
|
|
for (const [suffix, x, y, w, fs, color] of [
|
|
['Name', -180, 22, 360, 28, GOLD],
|
|
['Desc', -180, -24, 440, 20, { r: 0.86, g: 0.9, b: 0.94, a: 1 }],
|
|
['Status', 270, 0, 220, 22, { r: 0.6, g: 0.85, b: 1, a: 1 }],
|
|
]) {
|
|
soulShop.push(entity({
|
|
id: guid('soul', soulId++),
|
|
path: `${ip}/${suffix}`, modelId: 'uitext', entryId: 'UIText',
|
|
componentNames: 'MOD.Core.UITransformComponent,MOD.Core.SpriteGUIRendererComponent,MOD.Core.TextComponent',
|
|
displayOrder: 1,
|
|
components: [
|
|
transform({ parentW: 760, parentH: 104, anchor: { x: 0.5, y: 0.5 }, pivot: { x: 0.5, y: 0.5 }, size: { x: w, y: 38 }, pos: { x, y } }),
|
|
sprite({ color: TRANSPARENT }),
|
|
text({ value: '', fontSize: fs, bold: suffix === 'Name', color, alignment: 4 }),
|
|
],
|
|
}));
|
|
}
|
|
}
|
|
return soulShop;
|
|
}
|