Fix generated UI GUIDs
This commit is contained in:
@@ -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',
|
||||
|
||||
@@ -4168,7 +4168,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "dck0032-0000-4000-8000-000000000032",
|
||||
"id": "d00e0032-0000-4000-8000-000000000032",
|
||||
"path": "/ui/DefaultGroup/CardHand/Card5/Cost",
|
||||
"componentNames": "MOD.Core.UITransformComponent,MOD.Core.SpriteGUIRendererComponent,MOD.Core.TextComponent",
|
||||
"jsonString": {
|
||||
@@ -4356,7 +4356,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "dck0033-0000-4000-8000-000000000033",
|
||||
"id": "d00e0033-0000-4000-8000-000000000033",
|
||||
"path": "/ui/DefaultGroup/CardHand/Card5/Name",
|
||||
"componentNames": "MOD.Core.UITransformComponent,MOD.Core.SpriteGUIRendererComponent,MOD.Core.TextComponent",
|
||||
"jsonString": {
|
||||
@@ -4544,7 +4544,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "dck0034-0000-4000-8000-000000000034",
|
||||
"id": "d00e0034-0000-4000-8000-000000000034",
|
||||
"path": "/ui/DefaultGroup/CardHand/Card5/Desc",
|
||||
"componentNames": "MOD.Core.UITransformComponent,MOD.Core.SpriteGUIRendererComponent,MOD.Core.TextComponent",
|
||||
"jsonString": {
|
||||
@@ -4732,7 +4732,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "menu0000-0000-4000-8000-000000000000",
|
||||
"id": "f00d0000-0000-4000-8000-000000000000",
|
||||
"path": "/ui/DefaultGroup/MainMenu",
|
||||
"componentNames": "MOD.Core.UITransformComponent,MOD.Core.SpriteGUIRendererComponent",
|
||||
"jsonString": {
|
||||
@@ -4873,7 +4873,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "menu0001-0000-4000-8000-000000000001",
|
||||
"id": "f00d0001-0000-4000-8000-000000000001",
|
||||
"path": "/ui/DefaultGroup/MainMenu/Title",
|
||||
"componentNames": "MOD.Core.UITransformComponent,MOD.Core.SpriteGUIRendererComponent,MOD.Core.TextComponent",
|
||||
"jsonString": {
|
||||
@@ -5061,7 +5061,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "menu0002-0000-4000-8000-000000000002",
|
||||
"id": "f00d0002-0000-4000-8000-000000000002",
|
||||
"path": "/ui/DefaultGroup/MainMenu/Subtitle",
|
||||
"componentNames": "MOD.Core.UITransformComponent,MOD.Core.SpriteGUIRendererComponent,MOD.Core.TextComponent",
|
||||
"jsonString": {
|
||||
@@ -5249,7 +5249,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "menu0003-0000-4000-8000-000000000003",
|
||||
"id": "f00d0003-0000-4000-8000-000000000003",
|
||||
"path": "/ui/DefaultGroup/MainMenu/NewGameButton",
|
||||
"componentNames": "MOD.Core.UITransformComponent,MOD.Core.SpriteGUIRendererComponent,MOD.Core.ButtonComponent,MOD.Core.TextComponent",
|
||||
"jsonString": {
|
||||
@@ -5484,7 +5484,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "menu0004-0000-4000-8000-000000000004",
|
||||
"id": "f00d0004-0000-4000-8000-000000000004",
|
||||
"path": "/ui/DefaultGroup/MainMenu/ContinueButton",
|
||||
"componentNames": "MOD.Core.UITransformComponent,MOD.Core.SpriteGUIRendererComponent,MOD.Core.ButtonComponent,MOD.Core.TextComponent",
|
||||
"jsonString": {
|
||||
@@ -5719,7 +5719,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "hud0000-0000-4000-8000-000000000000",
|
||||
"id": "feed0000-0000-4000-8000-000000000000",
|
||||
"path": "/ui/DefaultGroup/DeckHud",
|
||||
"componentNames": "MOD.Core.UITransformComponent,MOD.Core.SpriteGUIRendererComponent",
|
||||
"jsonString": {
|
||||
@@ -5860,7 +5860,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "hud0006-0000-4000-8000-000000000006",
|
||||
"id": "feed0006-0000-4000-8000-000000000006",
|
||||
"path": "/ui/DefaultGroup/DeckHud/DrawPile",
|
||||
"componentNames": "MOD.Core.UITransformComponent,MOD.Core.SpriteGUIRendererComponent",
|
||||
"jsonString": {
|
||||
@@ -6001,7 +6001,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "hud0007-0000-4000-8000-000000000007",
|
||||
"id": "feed0007-0000-4000-8000-000000000007",
|
||||
"path": "/ui/DefaultGroup/DeckHud/DrawPile/Label",
|
||||
"componentNames": "MOD.Core.UITransformComponent,MOD.Core.SpriteGUIRendererComponent,MOD.Core.TextComponent",
|
||||
"jsonString": {
|
||||
@@ -6189,7 +6189,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "hud0008-0000-4000-8000-000000000008",
|
||||
"id": "feed0008-0000-4000-8000-000000000008",
|
||||
"path": "/ui/DefaultGroup/DeckHud/DrawPile/Count",
|
||||
"componentNames": "MOD.Core.UITransformComponent,MOD.Core.SpriteGUIRendererComponent,MOD.Core.TextComponent",
|
||||
"jsonString": {
|
||||
@@ -6377,7 +6377,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "hud0009-0000-4000-8000-000000000009",
|
||||
"id": "feed0009-0000-4000-8000-000000000009",
|
||||
"path": "/ui/DefaultGroup/DeckHud/DiscardPile",
|
||||
"componentNames": "MOD.Core.UITransformComponent,MOD.Core.SpriteGUIRendererComponent",
|
||||
"jsonString": {
|
||||
@@ -6518,7 +6518,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "hud000a-0000-4000-8000-00000000000a",
|
||||
"id": "feed000a-0000-4000-8000-00000000000a",
|
||||
"path": "/ui/DefaultGroup/DeckHud/DiscardPile/Label",
|
||||
"componentNames": "MOD.Core.UITransformComponent,MOD.Core.SpriteGUIRendererComponent,MOD.Core.TextComponent",
|
||||
"jsonString": {
|
||||
@@ -6706,7 +6706,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "hud000b-0000-4000-8000-00000000000b",
|
||||
"id": "feed000b-0000-4000-8000-00000000000b",
|
||||
"path": "/ui/DefaultGroup/DeckHud/DiscardPile/Count",
|
||||
"componentNames": "MOD.Core.UITransformComponent,MOD.Core.SpriteGUIRendererComponent,MOD.Core.TextComponent",
|
||||
"jsonString": {
|
||||
@@ -6894,7 +6894,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "hud000c-0000-4000-8000-00000000000c",
|
||||
"id": "feed000c-0000-4000-8000-00000000000c",
|
||||
"path": "/ui/DefaultGroup/DeckHud/EndTurnButton",
|
||||
"componentNames": "MOD.Core.UITransformComponent,MOD.Core.SpriteGUIRendererComponent,MOD.Core.ButtonComponent,MOD.Core.TextComponent",
|
||||
"jsonString": {
|
||||
@@ -7129,7 +7129,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "hud000d-0000-4000-8000-00000000000d",
|
||||
"id": "feed000d-0000-4000-8000-00000000000d",
|
||||
"path": "/ui/DefaultGroup/DeckHud/Energy",
|
||||
"componentNames": "MOD.Core.UITransformComponent,MOD.Core.SpriteGUIRendererComponent,MOD.Core.TextComponent",
|
||||
"jsonString": {
|
||||
|
||||
Reference in New Issue
Block a user