Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 18 additions & 12 deletions packages/origine2/src/locales/en.po
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,6 @@ msgstr "unlockBgm:;"
msgid "unlockCg:;"
msgstr "unlockCg:;"

msgid "WebGAL Classic"
msgstr "WebGAL Classic"

msgid "WebGAL Standard"
msgstr "WebGAL Standard"

Expand Down Expand Up @@ -877,21 +874,15 @@ msgstr "Sound effect file"
msgid "文件名"
msgstr "File name"

msgid "文件名不可包含特殊符号: '/\\\\:*?\"<>|'"
msgstr "File name cannot contain special characters: '/\\\\:*?\"<>|'"

msgid "文件名不可包含特殊符号"
msgstr "File name cannot contain special characters"

msgid "文件路径含有非法字符"
msgstr "File path contains illegal characters"

msgid "清除提示"
msgstr "Clear tip"

msgid "文件大小"
msgstr "File size"

msgid "文件路径含有非法字符"
msgstr "File path contains illegal characters"

msgid "文字大小"
msgstr "Font size"

Expand Down Expand Up @@ -1060,6 +1051,18 @@ msgstr "Title Button List"
msgid "标题按钮文字"
msgstr "Title Button Text"

msgid "标题按钮文字占位"
msgstr "Title Button Text Placeholder"

msgid "标题按钮文字外层"
msgstr "Title Button Text Outer"

msgid "标题按钮文字内层"
msgstr "Title Button Text Inner"

msgid "标题按钮禁用"
msgstr "Title Button Disabled"

msgid "标题背景图片"
msgstr "Title background image"

Expand Down Expand Up @@ -1177,6 +1180,9 @@ msgstr "Add statement"
msgid "清除当前舞台的特殊效果"
msgstr "Clear special effects of current stage"

msgid "清除提示"
msgstr "Clear tip"

msgid "清除特效"
msgstr "Clear effects"

Expand Down
30 changes: 18 additions & 12 deletions packages/origine2/src/locales/ja.po
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,6 @@ msgstr "unlockBgm:;"
msgid "unlockCg:;"
msgstr "unlockCg:;"

msgid "WebGAL Classic"
msgstr "WebGAL Classic"

msgid "WebGAL Standard"
msgstr "WebGAL Standard"

Expand Down Expand Up @@ -877,21 +874,15 @@ msgstr "効果音ファイル"
msgid "文件名"
msgstr "ファイル名"

msgid "文件名不可包含特殊符号: '/\\\\:*?\"<>|'"
msgstr "ファイル名に特殊記号は使用できません: '/\\\\:*?\"<>|'"

msgid "文件名不可包含特殊符号"
msgstr "ファイル名に使用できない特殊文字"

msgid "文件路径含有非法字符"
msgstr "ファイルパスに無効な文字が含まれています"

msgid "清除提示"
msgstr "チップをクリア"

msgid "文件大小"
msgstr "ファイルサイズ"

msgid "文件路径含有非法字符"
msgstr "ファイルパスに無効な文字が含まれています"

msgid "文字大小"
msgstr "文字サイズ"

Expand Down Expand Up @@ -1060,6 +1051,18 @@ msgstr "タイトルボタンリスト"
msgid "标题按钮文字"
msgstr "タイトルボタンテキスト"

msgid "标题按钮文字占位"
msgstr "タイトルボタンテキストプレースホルダー"

msgid "标题按钮文字外层"
msgstr "タイトルボタンテキスト外層"

msgid "标题按钮文字内层"
msgstr "タイトルボタンテキスト内層"

msgid "标题按钮禁用"
msgstr "タイトルボタン無効"

msgid "标题背景图片"
msgstr "タイトルの背景画像"

Expand Down Expand Up @@ -1177,6 +1180,9 @@ msgstr "ステートメントを追加"
msgid "清除当前舞台的特殊效果"
msgstr "現在のステージの特殊効果をクリア"

msgid "清除提示"
msgstr "チップをクリア"

msgid "清除特效"
msgstr "特殊効果をクリア"

Expand Down
30 changes: 18 additions & 12 deletions packages/origine2/src/locales/zhCn.po
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,6 @@ msgstr "unlockBgm:;"
msgid "unlockCg:;"
msgstr "unlockCg:;"

msgid "WebGAL Classic"
msgstr "WebGAL Classic"

msgid "WebGAL Standard"
msgstr "WebGAL Standard"

Expand Down Expand Up @@ -877,21 +874,15 @@ msgstr "效果音文件"
msgid "文件名"
msgstr "文件名"

msgid "文件名不可包含特殊符号: '/\\\\:*?\"<>|'"
msgstr "文件名不可包含特殊符号: '/\\\\:*?\"<>|'"

msgid "文件名不可包含特殊符号"
msgstr "文件名不可包含特殊符号"

msgid "文件路径含有非法字符"
msgstr "文件路径含有非法字符"

msgid "清除提示"
msgstr "清除提示"

msgid "文件大小"
msgstr "文件大小"

msgid "文件路径含有非法字符"
msgstr "文件路径含有非法字符"

msgid "文字大小"
msgstr "文字大小"

Expand Down Expand Up @@ -1060,6 +1051,18 @@ msgstr "标题按钮列表"
msgid "标题按钮文字"
msgstr "标题按钮文字"

msgid "标题按钮文字占位"
msgstr "标题按钮文字占位"

msgid "标题按钮文字外层"
msgstr "标题按钮文字外层"

msgid "标题按钮文字内层"
msgstr "标题按钮文字内层"

msgid "标题按钮禁用"
msgstr "标题按钮禁用"

msgid "标题背景图片"
msgstr "标题背景图片"

Expand Down Expand Up @@ -1177,6 +1180,9 @@ msgstr "添加语句"
msgid "清除当前舞台的特殊效果"
msgstr "清除当前舞台的特殊效果"

msgid "清除提示"
msgstr "清除提示"

msgid "清除特效"
msgstr "清除特效"

Expand Down
30 changes: 16 additions & 14 deletions packages/origine2/src/pages/dashboard/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<string | undefined>('__STANDARD__WG__');
const [templateName, setTemplateName] = useState<string | undefined>('__STANDARD__WG__');
const [derivative, setDerivative] = useState<string | undefined>(undefined);
const [templateName, setTemplateName] = useState<string | undefined>(undefined);

// 可用的衍生版
const derivativeEnginesResp = useSWR('derivativeEngines', async () => {
Expand All @@ -45,28 +45,30 @@ 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 defaultDerivativeValue = 'WebGAL Standard';
const defaultTemplateValue = 'WebGAL Refine 2026';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

硬编码的字符串 'WebGAL Refine 2026' 没有被国际化,这会影响多语言支持。建议使用 t 宏进行翻译(例如 t\WebGAL Refine 2026`),并将其添加到 .po` 文件中,以确保在不同语言环境下能正确显示。


const selector = <Dropdown value={derivative === '__STANDARD__WG__' ? t`WebGAL Standard` : derivative}
selectedOptions={[derivative ?? '__STANDARD__WG__']} onOptionSelect={(_, elem) => {
setDerivative(elem.optionValue);
const selector = <Dropdown value={derivative ?? t`WebGAL Standard`}
selectedOptions={[derivative ?? defaultDerivativeValue]} onOptionSelect={(_, elem) => {
setDerivative(elem.optionValue === defaultDerivativeValue ? undefined : elem.optionValue);
}}>
<Option key="__standard" value="__STANDARD__WG__">{t`WebGAL Standard`}</Option>
<Option key="default-engine" value={defaultDerivativeValue}>{t`WebGAL Standard`}</Option>
{(derivativeEnginesResp.data ?? []).map(e =>
<Option key={e} value={e}>{e}</Option>
)}
</Dropdown>;

const selectorTemplate = <Dropdown value={templateName === '__STANDARD__WG__' ? t`WebGAL Classic` : templateName}
selectedOptions={[templateName ?? '__STANDARD__WG__']}
const selectorTemplate = <Dropdown value={templateName ?? defaultTemplateValue}
selectedOptions={[templateName ?? defaultTemplateValue]}
onOptionSelect={(_, elem) => {
setTemplateName(elem.optionValue);
setTemplateName(elem.optionValue === defaultTemplateValue ? undefined : elem.optionValue);
}}>
<Option key="__standard" value="__STANDARD__WG__">{t`WebGAL Classic`}</Option>
<Option key="default-template" value={defaultTemplateValue}>{defaultTemplateValue}</Option>
{(templatesResp.data ?? []).map(e =>
<Option key={e.name} value={e.name}>{e.name}</Option>
<Option key={e.dir} value={e.dir}>{e.name}</Option>
)}
</Dropdown>;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

这段代码存在两个可以改进的地方:

  1. 显示问题: 当用户选择一个非默认模板时,下拉菜单会显示该模板的目录名(例如 WebGAL_Classic),而不是更友好的显示名称(例如 WebGAL Classic)。这是因为 value 属性直接使用了 templateName 状态,而该状态存储的是目录。
  2. 健壮性问题: onOptionSelect 回调中使用显示名称 defaultTemplateValue ('WebGAL Refine 2026') 作为特殊值来判断是否选择了默认模板。如果未来有一个模板的目录名也叫 'WebGAL Refine 2026',将会导致逻辑判断错误。

建议重构此部分,以解决上述问题。例如,可以为默认选项使用一个唯一的内部值(如 '__DEFAULT__'),并始终根据模板目录从 templatesResp.data 中查找并显示正确的模板名称。


Expand All @@ -75,8 +77,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: templateName,
});
setCreateGameFormOpen(false);
setGameName(t`新的游戏`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ 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_placeholder' },
{ 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' },
],
};
};
Expand Down
1 change: 1 addition & 0 deletions packages/terre2/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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 {
Expand Down Expand Up @@ -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.5) 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 {
Expand All @@ -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 {
Expand All @@ -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 {
Expand Down
Loading
Loading