gen-slaydeck: 유효한 GUID 생성으로 수정 (DeckHud·카드 자식 entity id)
기존 guid() prefix+4hex는 8-4-4-4-12 형식이 아니어서 Maker가 적용 거부(LEA-3054). 네임스페이스 바이트 기반 hex GUID로 변경하고, 기존 자식 id도 재생성 시 정규화. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -19,7 +19,10 @@ const ALIGN_CENTER = 0;
|
||||
const ALIGN_BOTTOM_CENTER = 6;
|
||||
|
||||
function guid(prefix, n) {
|
||||
return `${prefix}${n.toString(16).padStart(4, '0')}-0000-4000-8000-${n.toString(16).padStart(12, '0')}`;
|
||||
// 유효한 8-4-4-4-12 hex GUID 생성. prefix는 충돌 방지용 네임스페이스 바이트로 매핑.
|
||||
const ns = prefix === 'hud' ? 0xd0 : prefix === 'dck' ? 0xca : 0xfe;
|
||||
const v = (ns * 0x100000 + n) >>> 0;
|
||||
return `${v.toString(16).padStart(8, '0')}-0000-4000-8000-${v.toString(16).padStart(12, '0')}`;
|
||||
}
|
||||
|
||||
function transform({ parentW, parentH, anchor, pivot, size, pos, align = 0 }) {
|
||||
@@ -229,6 +232,7 @@ function upsertUi() {
|
||||
ui.ContentProto.Entities.push(child);
|
||||
byPath.set(path, child);
|
||||
} else {
|
||||
child.id = guid('dck', i * 10 + children.findIndex(([s]) => s === suffix));
|
||||
child.jsonString.enable = true;
|
||||
child.jsonString.visible = true;
|
||||
child.jsonString['@components'][2].Text = cfg.value;
|
||||
|
||||
Reference in New Issue
Block a user