Fix generated UI GUIDs

This commit is contained in:
maple
2026-06-07 23:33:44 +09:00
parent 8c397cbc09
commit 8eab9a75ac
2 changed files with 32 additions and 30 deletions

View File

@@ -164,7 +164,9 @@ function entity({ id, path, modelId, entryId, componentNames, components, displa
function upsertUi() {
const ui = JSON.parse(readFileSync(UI_FILE, 'utf8'));
ui.ContentProto.Entities = ui.ContentProto.Entities.filter(
(e) => !e.path.startsWith('/ui/DefaultGroup/DeckHud') && !e.path.startsWith('/ui/DefaultGroup/MainMenu'),
(e) => !e.path.startsWith('/ui/DefaultGroup/DeckHud')
&& !e.path.startsWith('/ui/DefaultGroup/MainMenu')
&& !e.path.startsWith('/ui/DefaultGroup/CardHand/Card5/'),
);
const byPath = new Map(ui.ContentProto.Entities.map((e) => [e.path, e]));
@@ -202,7 +204,7 @@ function upsertUi() {
let child = byPath.get(path);
if (!child) {
child = entity({
id: guid('dck', i * 10 + (suffix === 'Cost' ? 0 : suffix === 'Name' ? 1 : 2)),
id: guid('d00e', i * 10 + (suffix === 'Cost' ? 0 : suffix === 'Name' ? 1 : 2)),
path,
modelId: 'uitext',
entryId: 'UIText',
@@ -230,7 +232,7 @@ function upsertUi() {
const add = (e) => ents.push(e);
add(entity({
id: guid('menu', 0),
id: guid('f00d', 0),
path: '/ui/DefaultGroup/MainMenu',
modelId: 'uisprite',
entryId: 'UISprite',
@@ -242,7 +244,7 @@ function upsertUi() {
],
}));
add(entity({
id: guid('menu', 1),
id: guid('f00d', 1),
path: '/ui/DefaultGroup/MainMenu/Title',
modelId: 'uitext',
entryId: 'UIText',
@@ -255,7 +257,7 @@ function upsertUi() {
],
}));
add(entity({
id: guid('menu', 2),
id: guid('f00d', 2),
path: '/ui/DefaultGroup/MainMenu/Subtitle',
modelId: 'uitext',
entryId: 'UIText',
@@ -268,7 +270,7 @@ function upsertUi() {
],
}));
add(entity({
id: guid('menu', 3),
id: guid('f00d', 3),
path: '/ui/DefaultGroup/MainMenu/NewGameButton',
modelId: 'uibutton',
entryId: 'UIButton',
@@ -282,7 +284,7 @@ function upsertUi() {
],
}));
add(entity({
id: guid('menu', 4),
id: guid('f00d', 4),
path: '/ui/DefaultGroup/MainMenu/ContinueButton',
modelId: 'uibutton',
entryId: 'UIButton',
@@ -297,7 +299,7 @@ function upsertUi() {
}));
add(entity({
id: guid('hud', 0),
id: guid('feed', 0),
path: '/ui/DefaultGroup/DeckHud',
modelId: 'uiempty',
entryId: 'UIEmpty',
@@ -315,7 +317,7 @@ function upsertUi() {
{ key: 'DiscardPile', x: 590, label: '버린 덱', count: '0', color: { r: 0.22, g: 0.18, b: 0.16, a: 1 } },
]) {
add(entity({
id: guid('hud', ents.length),
id: guid('feed', ents.length),
path: `/ui/DefaultGroup/DeckHud/${pile.key}`,
modelId: 'uisprite',
entryId: 'UISprite',
@@ -327,7 +329,7 @@ function upsertUi() {
],
}));
add(entity({
id: guid('hud', ents.length),
id: guid('feed', ents.length),
path: `/ui/DefaultGroup/DeckHud/${pile.key}/Label`,
modelId: 'uitext',
entryId: 'UIText',
@@ -340,7 +342,7 @@ function upsertUi() {
],
}));
add(entity({
id: guid('hud', ents.length),
id: guid('feed', ents.length),
path: `/ui/DefaultGroup/DeckHud/${pile.key}/Count`,
modelId: 'uitext',
entryId: 'UIText',
@@ -355,7 +357,7 @@ function upsertUi() {
}
add(entity({
id: guid('hud', ents.length),
id: guid('feed', ents.length),
path: '/ui/DefaultGroup/DeckHud/EndTurnButton',
modelId: 'uibutton',
entryId: 'UIButton',
@@ -369,7 +371,7 @@ function upsertUi() {
],
}));
add(entity({
id: guid('hud', ents.length),
id: guid('feed', ents.length),
path: '/ui/DefaultGroup/DeckHud/Energy',
modelId: 'uitext',
entryId: 'UIText',