diff --git a/packages/origine2/src/locales/en.po b/packages/origine2/src/locales/en.po index 491412dad..f2eaae959 100644 --- a/packages/origine2/src/locales/en.po +++ b/packages/origine2/src/locales/en.po @@ -134,9 +134,6 @@ msgstr "unlockBgm:;" msgid "unlockCg:;" msgstr "unlockCg:;" -msgid "WebGAL Classic" -msgstr "WebGAL Classic" - msgid "WebGAL Standard" msgstr "WebGAL Standard" @@ -1061,6 +1058,15 @@ msgstr "Title Button List" msgid "标题按钮文字" msgstr "Title Button Text" +msgid "标题按钮文字内层" +msgstr "Title Button Text Inner" + +msgid "标题按钮文字外层" +msgstr "Title Button Text Outer" + +msgid "标题按钮禁用" +msgstr "Title Button Disabled" + msgid "标题背景图片" msgstr "Title background image" diff --git a/packages/origine2/src/locales/ja.po b/packages/origine2/src/locales/ja.po index 2165ac961..330574848 100644 --- a/packages/origine2/src/locales/ja.po +++ b/packages/origine2/src/locales/ja.po @@ -134,9 +134,6 @@ msgstr "unlockBgm:;" msgid "unlockCg:;" msgstr "unlockCg:;" -msgid "WebGAL Classic" -msgstr "WebGAL Classic" - msgid "WebGAL Standard" msgstr "WebGAL Standard" @@ -1061,6 +1058,15 @@ msgstr "タイトルボタンリスト" msgid "标题按钮文字" msgstr "タイトルボタンテキスト" +msgid "标题按钮文字内层" +msgstr "タイトルボタンテキスト内層" + +msgid "标题按钮文字外层" +msgstr "タイトルボタンテキスト外層" + +msgid "标题按钮禁用" +msgstr "タイトルボタン無効" + msgid "标题背景图片" msgstr "タイトルの背景画像" diff --git a/packages/origine2/src/locales/zhCn.po b/packages/origine2/src/locales/zhCn.po index b6257709d..db7a01709 100644 --- a/packages/origine2/src/locales/zhCn.po +++ b/packages/origine2/src/locales/zhCn.po @@ -134,9 +134,6 @@ msgstr "unlockBgm:;" msgid "unlockCg:;" msgstr "unlockCg:;" -msgid "WebGAL Classic" -msgstr "WebGAL Classic" - msgid "WebGAL Standard" msgstr "WebGAL Standard" @@ -1061,6 +1058,15 @@ msgstr "标题按钮列表" msgid "标题按钮文字" msgstr "标题按钮文字" +msgid "标题按钮文字内层" +msgstr "标题按钮文字内层" + +msgid "标题按钮文字外层" +msgstr "标题按钮文字外层" + +msgid "标题按钮禁用" +msgstr "标题按钮禁用" + msgid "标题背景图片" msgstr "标题背景图片" diff --git a/packages/origine2/src/pages/dashboard/Sidebar.tsx b/packages/origine2/src/pages/dashboard/Sidebar.tsx index 8368b9cc2..5d2a57bf4 100644 --- a/packages/origine2/src/pages/dashboard/Sidebar.tsx +++ b/packages/origine2/src/pages/dashboard/Sidebar.tsx @@ -34,8 +34,8 @@ export default function Sidebar(props: ISidebarProps) { const [createGameFormOpen, setCreateGameFormOpen] = useState(false); const [gameName, setGameName] = useState(t`新的游戏`); const [gameDir, setGameDir] = useState(t`新的游戏`); - const [derivative, setDerivative] = useState('__STANDARD__WG__'); - const [templateName, setTemplateName] = useState('__STANDARD__WG__'); + const [derivative, setDerivative] = useState(undefined); + const [templateDir, setTemplateDir] = useState(undefined); // 可用的衍生版 const derivativeEnginesResp = useSWR('derivativeEngines', async () => { @@ -45,28 +45,40 @@ export default function Sidebar(props: ISidebarProps) { const templatesResp = useSWR('template-list-selector', async () => { const resp = await api.manageTemplateControllerGetTemplateList(); - return resp.data as unknown as { name: string }[]; + return resp.data as unknown as { name: string; dir: string }[]; }); + const DEFAULT_OPTION = '__DEFAULT__'; + const defaultTemplateName = 'WebGAL Refine 2026'; - const selector = { - setDerivative(elem.optionValue); + const getTemplateDisplayName = (dir: string | undefined): string => { + if (!dir) return defaultTemplateName; + return templatesResp.data?.find(e => e.dir === dir)?.name ?? dir; + }; + + const getDerivativeDisplayName = (val: string | undefined): string => { + if (!val) return t`WebGAL Standard`; + return val; + }; + + const selector = { + setDerivative(elem.optionValue === DEFAULT_OPTION ? undefined : elem.optionValue); }}> - + {(derivativeEnginesResp.data ?? []).map(e => )} ; - const selectorTemplate = { - setTemplateName(elem.optionValue); + setTemplateDir(elem.optionValue === DEFAULT_OPTION ? undefined : elem.optionValue); }}> - + {(templatesResp.data ?? []).map(e => - + )} ; @@ -75,8 +87,8 @@ export default function Sidebar(props: ISidebarProps) { props.createGame({ gameName: gameName.trim(), gameDir, - derivative: derivative === '__STANDARD__WG__' ? undefined : derivative, - templateDir: templateName === '__STANDARD__WG__' ? undefined : templateName, + derivative, + templateDir, }); setCreateGameFormOpen(false); setGameName(t`新的游戏`); diff --git a/packages/origine2/src/pages/templateEditor/TemplateEditorSidebar/ComponentTree/ComponentTree.tsx b/packages/origine2/src/pages/templateEditor/TemplateEditorSidebar/ComponentTree/ComponentTree.tsx index 6ad871889..f747ea160 100644 --- a/packages/origine2/src/pages/templateEditor/TemplateEditorSidebar/ComponentTree/ComponentTree.tsx +++ b/packages/origine2/src/pages/templateEditor/TemplateEditorSidebar/ComponentTree/ComponentTree.tsx @@ -24,7 +24,10 @@ export const useComponentTreeTitle = () => { { name: t`标题按钮列表`, class: 'Title_buttonList' }, { name: t`标题按钮`, class: 'Title_button' }, { name: t`标题按钮文字`, class: 'Title_button_text' }, + { name: t`标题按钮文字外层`, class: 'Title_button_text_outer' }, + { name: t`标题按钮文字内层`, class: 'Title_button_text_inner' }, { name: t`标题备用背景`, class: 'Title_backup_background' }, + { name: t`标题按钮禁用`, class: 'Title_button_disabled' }, ], }; }; diff --git a/packages/terre2/.gitignore b/packages/terre2/.gitignore index d4fcacc82..8f8bed508 100644 --- a/packages/terre2/.gitignore +++ b/packages/terre2/.gitignore @@ -43,6 +43,7 @@ public/templates/* /assets/templates/Derivative_Engine/* !/assets/templates/Derivative_Engine/.gitkeep !public/templates/WebGAL Black +!public/templates/WebGAL_Classic /assets/templates/WebGAL_Template/assets /assets/templates/WebGAL_Template/index.html /assets/templates/WebGAL_Template/webgal-serviceworker.js diff --git a/packages/terre2/assets/templates/WebGAL_Default_Template/Stage/TextBox/textbox.scss b/packages/terre2/assets/templates/WebGAL_Default_Template/Stage/TextBox/textbox.scss index 47d9b8050..1b14fd514 100644 --- a/packages/terre2/assets/templates/WebGAL_Default_Template/Stage/TextBox/textbox.scss +++ b/packages/terre2/assets/templates/WebGAL_Default_Template/Stage/TextBox/textbox.scss @@ -1,16 +1,16 @@ .TextBox_main { z-index: 3; position: absolute; - right: 25px; - min-height: 330px; - max-height: 330px; + min-height: 430px; + max-height: 430px; background-blend-mode: darken; - border-radius: 165px 20px 20px 165px; - bottom: 20px; - left: 275px; + border-radius: 0; + bottom: -2px; + right: -2px; + left: 0; font-weight: bold; color: white; - padding: 1em 50px 70px 200px; + padding: calc(1em + 100px) 50px 70px 490px; box-sizing: border-box; display: flex; flex-flow: column; @@ -20,12 +20,18 @@ } .TextBox_main_miniavatarOff { - left: 25px; + left: 0; } .TextBox_Background { z-index: 2; - background: linear-gradient(rgba(245, 247, 250, 1) 0%, rgba(189, 198, 222, 1) 100%); + background-color: rgba(167, 186, 214, 0.28); + background-image: + linear-gradient(118deg, rgba(147, 165, 207, 0.9) 0%, rgba(182, 198, 222, 0.82) 48%, rgba(228, 239, 233, 0.82) 100%); + mask-image: + linear-gradient(to bottom, rgba(0, 0, 0, 0.04) 0, rgba(0, 0, 0, 0.28) 10%, #000 75%), + linear-gradient(to right, rgba(0, 0, 0, 0.08) 0, rgba(0, 0, 0, 0.28) 10%, #000 42%); + mask-composite: intersect; } @keyframes showSoftly { @@ -49,7 +55,7 @@ white-space: nowrap; left: 0; top: 0; - background-image: linear-gradient(#0B346E 0%, #141423 100%); + background-image: linear-gradient(#005CAF 0%, #1D1D1F 100%); background-clip: text; -webkit-background-clip: text; color: transparent; @@ -79,22 +85,35 @@ .TextBox_showName { font-size: 85%; - padding: 0 2em 0 2em; + padding: 0 1em 10px 0; + min-width: 50%; position: absolute; - left: 150px; - top: -68px; - height: 80px; + left: 490px; + top: 26px; + height: 90px; line-height: 68px; - border-radius: 40px; + border-radius: 0; z-index: 3; border: 4px solid rgba(255, 255, 255, 0); } .TextBox_ShowName_Background { z-index: 2; - background: rgba(11, 52, 110, 1); - border: 4px solid rgba(255, 255, 255, 0.75); - box-shadow: 3px 3px 10px rgba(100, 100, 100, 0.5); + background: transparent; + border: 0; + border-bottom: 3px solid transparent; + border-image: linear-gradient( + to right, + rgba(255, 255, 255, 0.2) 0%, + rgba(255, 255, 255, 0.85) 5%, + rgba(255, 255, 255, 0) 100% + ) + 1; + box-shadow: none; + -webkit-backdrop-filter: none; + backdrop-filter: none; + -webkit-mask-image: none; + mask-image: none; } @keyframes TextDelayShow { @@ -112,9 +131,8 @@ height: 450px; width: 450px; bottom: 0; - left: -250px; - border-radius: 100% 0 0 100%; - overflow: hidden; + left: 0; + overflow: visible; } .miniAvatarImg { @@ -135,18 +153,18 @@ position: absolute; left: 0; top: 0; - background: linear-gradient(150deg, rgb(255, 255, 255) 0%, rgb(255, 255, 255) 35%, rgb(165, 212, 228) 100%); - background-clip: text; - -webkit-background-clip: text; - color: transparent; + color: #0B346E; z-index: 2; + text-shadow: 0 2px 8px rgba(255, 255, 255, 0.35), 0 2px 6px rgba(0, 0, 0, 0.18); } .innerName { position: absolute; left: 0; top: 0; + -webkit-text-stroke: 0.08em rgba(255, 255, 255, 0.98); z-index: 1; + text-shadow: 0 1px 4px rgba(0, 0, 0, 0.18); } .text { diff --git a/packages/terre2/assets/templates/WebGAL_Default_Template/UI/Title/title.scss b/packages/terre2/assets/templates/WebGAL_Default_Template/UI/Title/title.scss index 48073c96b..ec0dbdcef 100644 --- a/packages/terre2/assets/templates/WebGAL_Default_Template/UI/Title/title.scss +++ b/packages/terre2/assets/templates/WebGAL_Default_Template/UI/Title/title.scss @@ -21,32 +21,70 @@ .Title_button { font-weight: bold; - text-align: center; + text-align: left; flex: 0 1 auto; cursor: pointer; - padding: 1em 2em 1em 2em; - margin: 20px 0; - transition: all 0.33s; - background: rgba(255, 255, 255, 0.15); - backdrop-filter: blur(5px); - border-radius: 4px; - transform: skewX(-10deg); - background: linear-gradient(to right, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.1)); + padding: 0.7em 0; + margin: 18px 0; + transition: transform 0.22s ease, opacity 0.22s ease; + background: transparent; + backdrop-filter: none; + border: 0; + border-radius: 0; + transform: none; + overflow: visible; + text-shadow: none; &:hover { - text-shadow: 0 0 10px rgba(255, 255, 255, 1); - padding: 1em 6em 1em 3em; + transform: translate3d(0, -3px, 0) scale(1.02); + padding: 0.7em 0; + filter: drop-shadow(0 10px 16px rgba(6, 10, 18, 0.12)) + drop-shadow(0 5px 8px rgba(6, 10, 18, 0.07)) + drop-shadow(1px 1px 0 rgba(6, 10, 18, 0.05)); } } .Title_button_text { - color: transparent; - background: linear-gradient(135deg, #fdfbfb 0%, #dcddde 100%); - -webkit-background-clip: text; - padding: 0 0.5em 0 0.5em; + position: relative; + z-index: 1; + display: inline-block; + padding: 0.08em 0.55em 0.12em 0.35em; font-size: 200%; font-family: WebgalUI, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif; - letter-spacing: 0.15em; + letter-spacing: 0.16em; + line-height: 1.2; + transform-origin: left center; + transition: transform 0.22s ease; + color: transparent; + white-space: nowrap; +} + +.Title_button_text_outer { + display: block; + position: absolute; + left: 0; + top: 0; + white-space: nowrap; + background-image: none; + background-clip: border-box; + -webkit-background-clip: border-box; + color: #ffffff; + -webkit-text-fill-color: #ffffff; + z-index: 2; + text-shadow: + 0 3px 10px rgba(7, 12, 20, 0.22), + 0 1px 3px rgba(7, 12, 20, 0.16); +} + +.Title_button_text_inner { + display: block; + white-space: nowrap; + position: absolute; + left: 0; + top: 0; + color: inherit; + -webkit-text-stroke: 0.09em rgba(12, 20, 32, 0.7); + z-index: 1; } .Title_backup_background { @@ -56,3 +94,8 @@ z-index: 13; background: linear-gradient(135deg, #fdfbfb 0%, #dcddde 100%); } + +.Title_button_disabled { + cursor: not-allowed !important; + opacity: 0.45; +} diff --git a/packages/terre2/assets/templates/WebGAL_Default_Template/template.json b/packages/terre2/assets/templates/WebGAL_Default_Template/template.json index 67f7a4542..f0ef8309c 100644 --- a/packages/terre2/assets/templates/WebGAL_Default_Template/template.json +++ b/packages/terre2/assets/templates/WebGAL_Default_Template/template.json @@ -1,5 +1,4 @@ { - "name":"WebGAL Classic", - "id":"5488d7cf-3523-44f8-bac7-f04ba7a77aa4", - "webgal-version":"4.5.5" + "name":"WebGAL Refine 2026", + "webgal-version":"4.5.19" } diff --git a/packages/terre2/assets/templates/WebGAL_Template/game/template/template.json b/packages/terre2/assets/templates/WebGAL_Template/game/template/template.json index 68a34719e..e883dc6de 100644 --- a/packages/terre2/assets/templates/WebGAL_Template/game/template/template.json +++ b/packages/terre2/assets/templates/WebGAL_Template/game/template/template.json @@ -1,5 +1,5 @@ { - "name":"WebGAL Classic", + "name":"WebGAL Refine 2026", "id":"5488d7cf-3523-44f8-bac7-f04ba7a77aa4", - "webgal-version":"4.5.18" + "webgal-version":"4.5.19" } diff --git a/packages/terre2/public/templates/WebGAL_Classic/Stage/Choose/choose.scss b/packages/terre2/public/templates/WebGAL_Classic/Stage/Choose/choose.scss new file mode 100644 index 000000000..4040078bc --- /dev/null +++ b/packages/terre2/public/templates/WebGAL_Classic/Stage/Choose/choose.scss @@ -0,0 +1,54 @@ +.Choose_Main { + position: absolute; + width: 100%; + height: 100%; + display: flex; + flex-flow: column; + justify-content: center; + align-items: center; + z-index: 13; + background: rgba(0, 0, 0, 0.05); +} + +.Choose_item { + font-family: "WebgalUI", serif; + cursor: pointer; + min-width: 50%; + padding: 0.25em 1em 0.25em 1em; + font-size: 265%; + color: #8E354A; + text-align: center; + border-radius: 4px; + border: 3px solid rgba(0, 0, 0, 0); + box-shadow: 0 0 25px rgba(0, 0, 0, 0.25); + background: rgba(255, 255, 255, 0.65); + margin: 0.25em 0 0.25em 0; + transition: background-color 0.5s, border 0.5s, font-weight 0.5s, box-shadow 0.5s; + + &:hover { + background: rgba(255, 255, 255, 0.9); + box-shadow: 0 0 25px rgba(0, 0, 0, 0.35); + border: 3px solid #8E354A; + } +} + +.Choose_item_disabled { + font-family: "WebgalUI", serif; + cursor: not-allowed; + min-width: 50%; + padding: 0.25em 1em 0.25em 1em; + font-size: 265%; + color: rgba(142, 53, 74, 0.5); + text-align: center; + border-radius: 4px; + border: 3px solid rgba(0, 0, 0, 0); + box-shadow: 0 0 25px rgba(0, 0, 0, 0.25); + background: rgba(255, 255, 255, 0.5); + margin: 0.25em 0 0.25em 0; + transition: background-color 0.5s, border 0.5s, font-weight 0.5s, box-shadow 0.5s; +} + +.Choose_item_outer { + color: #000; + min-width: 50%; +} diff --git a/packages/terre2/public/templates/WebGAL_Classic/Stage/TextBox/textbox.scss b/packages/terre2/public/templates/WebGAL_Classic/Stage/TextBox/textbox.scss new file mode 100644 index 000000000..47d9b8050 --- /dev/null +++ b/packages/terre2/public/templates/WebGAL_Classic/Stage/TextBox/textbox.scss @@ -0,0 +1,154 @@ +.TextBox_main { + z-index: 3; + position: absolute; + right: 25px; + min-height: 330px; + max-height: 330px; + background-blend-mode: darken; + border-radius: 165px 20px 20px 165px; + bottom: 20px; + left: 275px; + font-weight: bold; + color: white; + padding: 1em 50px 70px 200px; + box-sizing: border-box; + display: flex; + flex-flow: column; + align-items: flex-start; + letter-spacing: 0.2em; + transition: left 0.33s; +} + +.TextBox_main_miniavatarOff { + left: 25px; +} + +.TextBox_Background { + z-index: 2; + background: linear-gradient(rgba(245, 247, 250, 1) 0%, rgba(189, 198, 222, 1) 100%); +} + +@keyframes showSoftly { + 0% { + opacity: 0; + } + + 100% { + opacity: 1; + } +} + +.TextBox_textElement_start { + position: relative; + animation: TextDelayShow 1000ms ease-out forwards; + opacity: 0; +} + +.outer { + position: absolute; + white-space: nowrap; + left: 0; + top: 0; + background-image: linear-gradient(#0B346E 0%, #141423 100%); + background-clip: text; + -webkit-background-clip: text; + color: transparent; + z-index: 2; +} + +.inner { + white-space: nowrap; + position: absolute; + left: 0; + top: 0; + -webkit-text-stroke: 0.1em rgba(255, 255, 255, 1); + z-index: 1; +} + +.zhanwei { + color: transparent; + white-space: nowrap; +} + + +.TextBox_textElement_Settled { + position: relative; + opacity: 1; +} + + +.TextBox_showName { + font-size: 85%; + padding: 0 2em 0 2em; + position: absolute; + left: 150px; + top: -68px; + height: 80px; + line-height: 68px; + border-radius: 40px; + z-index: 3; + border: 4px solid rgba(255, 255, 255, 0); +} + +.TextBox_ShowName_Background { + z-index: 2; + background: rgba(11, 52, 110, 1); + border: 4px solid rgba(255, 255, 255, 0.75); + box-shadow: 3px 3px 10px rgba(100, 100, 100, 0.5); +} + +@keyframes TextDelayShow { + 0% { + opacity: 0; + } + + 100% { + opacity: 1; + } +} + +.miniAvatarContainer { + position: absolute; + height: 450px; + width: 450px; + bottom: 0; + left: -250px; + border-radius: 100% 0 0 100%; + overflow: hidden; +} + +.miniAvatarImg { + max-height: 100%; + max-width: 100%; + position: absolute; + bottom: 0; + filter: drop-shadow(15px 0 3px rgba(0, 0, 0, 0.5)); +} + +.nameContainer { + position: absolute; + left: 2em; + top: -3.5em; +} + +.outerName { + position: absolute; + left: 0; + top: 0; + background: linear-gradient(150deg, rgb(255, 255, 255) 0%, rgb(255, 255, 255) 35%, rgb(165, 212, 228) 100%); + background-clip: text; + -webkit-background-clip: text; + color: transparent; + z-index: 2; +} + +.innerName { + position: absolute; + left: 0; + top: 0; + z-index: 1; +} + +.text { + overflow: hidden; +} diff --git a/packages/terre2/public/templates/WebGAL_Classic/UI/Title/title.scss b/packages/terre2/public/templates/WebGAL_Classic/UI/Title/title.scss new file mode 100644 index 000000000..48073c96b --- /dev/null +++ b/packages/terre2/public/templates/WebGAL_Classic/UI/Title/title.scss @@ -0,0 +1,58 @@ +.Title_main { + width: 100%; + height: 100%; + position: absolute; + z-index: 13; +} + +.Title_buttonList { + font-family: "思源宋体", serif; + display: flex; + position: absolute; + left: 0; + min-width: 25%; + height: 100%; + justify-content: center; + align-items: flex-start; + flex-flow: column; + transition: background 0.75s; + padding-left: 120px; +} + +.Title_button { + font-weight: bold; + text-align: center; + flex: 0 1 auto; + cursor: pointer; + padding: 1em 2em 1em 2em; + margin: 20px 0; + transition: all 0.33s; + background: rgba(255, 255, 255, 0.15); + backdrop-filter: blur(5px); + border-radius: 4px; + transform: skewX(-10deg); + background: linear-gradient(to right, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.1)); + + &:hover { + text-shadow: 0 0 10px rgba(255, 255, 255, 1); + padding: 1em 6em 1em 3em; + } +} + +.Title_button_text { + color: transparent; + background: linear-gradient(135deg, #fdfbfb 0%, #dcddde 100%); + -webkit-background-clip: text; + padding: 0 0.5em 0 0.5em; + font-size: 200%; + font-family: WebgalUI, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif; + letter-spacing: 0.15em; +} + +.Title_backup_background { + width: 100%; + height: 100%; + position: absolute; + z-index: 13; + background: linear-gradient(135deg, #fdfbfb 0%, #dcddde 100%); +} diff --git a/packages/terre2/public/templates/WebGAL_Classic/assets/.gitkeep b/packages/terre2/public/templates/WebGAL_Classic/assets/.gitkeep new file mode 100644 index 000000000..e69de29bb diff --git a/packages/terre2/public/templates/WebGAL_Classic/template.json b/packages/terre2/public/templates/WebGAL_Classic/template.json new file mode 100644 index 000000000..67f7a4542 --- /dev/null +++ b/packages/terre2/public/templates/WebGAL_Classic/template.json @@ -0,0 +1,5 @@ +{ + "name":"WebGAL Classic", + "id":"5488d7cf-3523-44f8-bac7-f04ba7a77aa4", + "webgal-version":"4.5.5" +} diff --git a/packages/terre2/src/Modules/manage-game/manage-game.service.ts b/packages/terre2/src/Modules/manage-game/manage-game.service.ts index f30d6a36d..9e09ff495 100644 --- a/packages/terre2/src/Modules/manage-game/manage-game.service.ts +++ b/packages/terre2/src/Modules/manage-game/manage-game.service.ts @@ -125,9 +125,32 @@ export class ManageGameService { `Game_name:${gameName};`, ); + // Always apply a template: delete the scaffold template first, then copy the selected or default one + const gameTemplatePath = this.webgalFs.getPathFromRoot( + `/public/games/${gameDir}/game/template`, + ); + await this.webgalFs.deleteFileOrDirectory(gameTemplatePath); + + let templateApplied = false; if (templateDir) { + const templatePath = this.webgalFs.getPathFromRoot( + `/public/templates/${templateDir}/`, + ); + if (await this.webgalFs.existsDir(templatePath)) { + await this.webgalFs.copy( + templatePath, + this.webgalFs.getPathFromRoot( + `/public/games/${gameDir}/game/template/`, + ), + ); + templateApplied = true; + } + } + if (!templateApplied) { await this.webgalFs.copy( - this.webgalFs.getPathFromRoot(`/public/templates/${templateDir}/`), + this.webgalFs.getPathFromRoot( + '/assets/templates/WebGAL_Default_Template/', + ), this.webgalFs.getPathFromRoot( `/public/games/${gameDir}/game/template/`, ),