Files
maplecontest/tools/deck/cb/layout.mjs
gahusb 0c1dfd3162 refactor(cb): 분리 모듈 단일문자 지역변수 의미명으로 개명
손댄 모듈(screens·navigation·layout)의 단일문자 Lua 지역변수를
의미가 드러나는 이름으로 변경(규칙 시연):
- ActivateUIGroups: grp/n/g → enableGroup/name/group
- RenderSoulLabel: s → soulPoints
- BindLobbyButtons: e/fn → entity/handler
- GoLobbyMap: lp/go → localPlayer/tryTeleport
- TeleportToActMap: lp → localPlayer
- PositionMonsterSlot: m/tr/wp/e → monster/transform/worldPos/slotEntity

검증: cbset = 위 6개 메서드만 본문 변경(추가/삭제 0), cbgap GAP 0, 테스트 93/93.
산출물 재생성(SlayDeckController.codeblock) 포함.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 18:39:39 +09:00

22 lines
1.9 KiB
JavaScript

import { method, RUN_LENGTH, GOLD_PER_WIN, CARD_PRICE, REST_HEAL, RELIC_PRICE, ACT_COUNT, ACT_MAPS, LOBBY_MAP, LOBBY_SPAWN } from '../lib/codeblock.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';
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';
export const layoutMethods = [
method('PositionMonsterSlot', `local monster = self.Monsters[slot]
if monster == nil or monster.entity == nil or not isvalid(monster.entity) then
return
end
local transform = monster.entity.TransformComponent
if transform == nil then
return
end
local worldPos = transform.WorldPosition
local screen = _UILogic:WorldToScreenPosition(Vector2(worldPos.x, worldPos.y + ${HEAD_OFFSET_Y}))
local uipos = _UILogic:ScreenToUIPosition(screen)
local slotEntity = _EntityService:GetEntityByPath("/ui/RunUIGroup/CombatHud/MonsterStatus" .. tostring(slot))
if slotEntity ~= nil and slotEntity.UITransformComponent ~= nil then
slotEntity.UITransformComponent.anchoredPosition = uipos
end`, [{ Type: 'number', DefaultValue: null, SyncDirection: 0, Attributes: [], Name: 'slot' }]),
];