Skip to content

Commit ef135ac

Browse files
committed
Merge branch 'dev' into feat/wheel-dropdown
2 parents e39212e + d2c3348 commit ef135ac

File tree

17 files changed

+275
-186
lines changed

17 files changed

+275
-186
lines changed

packages/origine2/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
"monaco-editor-wrapper": "~4.2.1",
4545
"monaco-languageclient": "~8.3.1",
4646
"monaco-textmate": "^3.0.1",
47+
"natural-compare-lite": "^1.4.0",
4748
"onigasm": "^2.2.5",
4849
"primereact": "^9.5.0",
4950
"react": "^18.0.0",
@@ -58,6 +59,7 @@
5859
"@lingui/cli": "^4.8.0",
5960
"@lingui/vite-plugin": "^4.8.0",
6061
"@types/lodash": "^4.14.182",
62+
"@types/natural-compare-lite": "^1.4.2",
6163
"@types/react": "^18.0.0",
6264
"@types/react-beautiful-dnd": "^13.1.2",
6365
"@types/react-dom": "^18.0.0",

packages/origine2/src/api/Api.ts

Lines changed: 20 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,6 @@
99
* ---------------------------------------------------------------
1010
*/
1111

12-
export interface CompletionDto {
13-
/** Editor input value for which the completion is required */
14-
editorValue: string;
15-
/** Parameters required for completion */
16-
params: object;
17-
}
18-
1912
export interface CreateNewFileDto {
2013
/** The source path where the directory will be created */
2114
source: string;
@@ -54,6 +47,24 @@ export interface EditTextFileDto {
5447
textFile: string;
5548
}
5649

50+
export interface TemplateConfigDto {
51+
/** The name of the template */
52+
name: string;
53+
/** The webgal version of the template */
54+
'webgal-version': string;
55+
}
56+
57+
export interface GameInfoDto {
58+
/** The name of the game */
59+
name: string;
60+
/** The dir of the game */
61+
dir: string;
62+
/** The cover of the game */
63+
cover: string;
64+
/** The template config of the game */
65+
template: TemplateConfigDto;
66+
}
67+
5768
export interface CreateGameDto {
5869
/** The name of the game to be created */
5970
gameName: string;
@@ -293,23 +304,6 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
293304
...params,
294305
}),
295306

296-
/**
297-
* No description
298-
*
299-
* @tags LSP
300-
* @name LspControllerCompile
301-
* @summary Get code completions based on given input
302-
* @request POST:/api/lsp/compile
303-
*/
304-
lspControllerCompile: (data: CompletionDto, params: RequestParams = {}) =>
305-
this.request<void, void>({
306-
path: `/api/lsp/compile`,
307-
method: 'POST',
308-
body: data,
309-
type: ContentType.Json,
310-
...params,
311-
}),
312-
313307
/**
314308
* No description
315309
*
@@ -451,9 +445,10 @@ export class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDa
451445
* @request GET:/api/manageGame/gameList
452446
*/
453447
manageGameControllerGetGameList: (params: RequestParams = {}) =>
454-
this.request<void, any>({
448+
this.request<GameInfoDto[], any>({
455449
path: `/api/manageGame/gameList`,
456450
method: 'GET',
451+
format: 'json',
457452
...params,
458453
}),
459454

packages/origine2/src/components/Assets/Assets.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { dirNameToExtNameMap } from "@/pages/editor/ChooseFile/chooseFileConfig"
1010
import useSWR, { useSWRConfig } from "swr";
1111
import { t } from '@lingui/macro';
1212
import Upload from "./Upload";
13+
import naturalCompare from 'natural-compare-lite';
1314

1415
export interface IFile {
1516
extName: string;
@@ -64,8 +65,8 @@ export default function Assets({ basePath, isProtected = false, fileConfig, file
6465
const dirInfo = (data.dirInfo as IFile[]).map((item) => ({ ...item, path: currentPathString + '/' + item.name }));
6566
const dirs = dirInfo.filter((item) => item.isDir);
6667
const files = dirInfo.filter((item) => !item.isDir).filter(e => e.name !== '.gitkeep');
67-
dirs.sort((a, b) => a.name.localeCompare(b.name));
68-
files.sort((a, b) => a.name.localeCompare(b.name));
68+
dirs.sort((a, b) => naturalCompare(a.name, b.name));
69+
files.sort((a, b) => naturalCompare(a.name, b.name));
6970
return [...dirs, ...files];
7071
} else return [];
7172
};

packages/origine2/src/config/swagger.json

Lines changed: 59 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -15,34 +15,6 @@
1515
]
1616
}
1717
},
18-
"/api/lsp/compile": {
19-
"post": {
20-
"operationId": "LspController_compile",
21-
"summary": "Get code completions based on given input",
22-
"parameters": [],
23-
"requestBody": {
24-
"required": true,
25-
"content": {
26-
"application/json": {
27-
"schema": {
28-
"$ref": "#/components/schemas/CompletionDto"
29-
}
30-
}
31-
}
32-
},
33-
"responses": {
34-
"200": {
35-
"description": "Successfully fetched the completion list."
36-
},
37-
"400": {
38-
"description": "Failed to fetch the completion list."
39-
}
40-
},
41-
"tags": [
42-
"LSP"
43-
]
44-
}
45-
},
4618
"/api/assets/readAssets/{readDirPath}": {
4719
"get": {
4820
"operationId": "AssetsController_readAssets",
@@ -268,7 +240,17 @@
268240
"parameters": [],
269241
"responses": {
270242
"200": {
271-
"description": "Returned game list."
243+
"description": "Returned game list.",
244+
"content": {
245+
"application/json": {
246+
"schema": {
247+
"type": "array",
248+
"items": {
249+
"$ref": "#/components/schemas/GameInfoDto"
250+
}
251+
}
252+
}
253+
}
272254
}
273255
},
274256
"tags": [
@@ -975,23 +957,6 @@
975957
"servers": [],
976958
"components": {
977959
"schemas": {
978-
"CompletionDto": {
979-
"type": "object",
980-
"properties": {
981-
"editorValue": {
982-
"type": "string",
983-
"description": "Editor input value for which the completion is required"
984-
},
985-
"params": {
986-
"type": "object",
987-
"description": "Parameters required for completion"
988-
}
989-
},
990-
"required": [
991-
"editorValue",
992-
"params"
993-
]
994-
},
995960
"CreateNewFileDto": {
996961
"type": "object",
997962
"properties": {
@@ -1084,6 +1049,54 @@
10841049
"textFile"
10851050
]
10861051
},
1052+
"TemplateConfigDto": {
1053+
"type": "object",
1054+
"properties": {
1055+
"name": {
1056+
"type": "string",
1057+
"description": "The name of the template"
1058+
},
1059+
"webgal-version": {
1060+
"type": "string",
1061+
"description": "The webgal version of the template"
1062+
}
1063+
},
1064+
"required": [
1065+
"name",
1066+
"webgal-version"
1067+
]
1068+
},
1069+
"GameInfoDto": {
1070+
"type": "object",
1071+
"properties": {
1072+
"name": {
1073+
"type": "string",
1074+
"description": "The name of the game"
1075+
},
1076+
"dir": {
1077+
"type": "string",
1078+
"description": "The dir of the game"
1079+
},
1080+
"cover": {
1081+
"type": "string",
1082+
"description": "The cover of the game"
1083+
},
1084+
"template": {
1085+
"description": "The template config of the game",
1086+
"allOf": [
1087+
{
1088+
"$ref": "#/components/schemas/TemplateConfigDto"
1089+
}
1090+
]
1091+
}
1092+
},
1093+
"required": [
1094+
"name",
1095+
"dir",
1096+
"cover",
1097+
"template"
1098+
]
1099+
},
10871100
"CreateGameDto": {
10881101
"type": "object",
10891102
"properties": {

packages/origine2/src/locales/en.po

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,14 @@ msgstr "Intro texts"
9494
msgid "intro:;"
9595
msgstr "intro:;"
9696

97+
#: src/pages/editor/GraphicalEditor/SentenceEditor/ChangeFigure.tsx:185
98+
msgid "Live2D 动作"
99+
msgstr "Live2D Motion"
100+
101+
#: src/pages/editor/GraphicalEditor/SentenceEditor/ChangeFigure.tsx:199
102+
msgid "Live2D 表情"
103+
msgstr "Live2D Expression"
104+
97105
#: src/pages/editor/GraphicalEditor/SentenceEditor/index.tsx:173
98106
msgid "miniAvatar:选择小头像;"
99107
msgstr "miniAvatar: Choose a file of avatar;"
@@ -177,12 +185,12 @@ msgstr "z-index"
177185
msgid "一直显示功能区"
178186
msgstr "Always Show Toolbar"
179187

180-
#: src/components/Assets/Assets.tsx:368
181188
#: src/components/Assets/Assets.tsx:369
189+
#: src/components/Assets/Assets.tsx:370
182190
msgid "上传"
183191
msgstr "Upload"
184192

185-
#: src/components/Assets/Assets.tsx:262
193+
#: src/components/Assets/Assets.tsx:263
186194
msgid "上传资源"
187195
msgstr "Upload asset"
188196

@@ -435,8 +443,8 @@ msgstr "Change background"
435443
msgid "切换背景图片"
436444
msgstr "Change background image"
437445

438-
#: src/components/Assets/Assets.tsx:208
439-
#: src/components/Assets/Assets.tsx:248
446+
#: src/components/Assets/Assets.tsx:209
447+
#: src/components/Assets/Assets.tsx:249
440448
#: src/pages/dashboard/Sidebar.tsx:106
441449
#: src/pages/dashboard/TemplateSidebar.tsx:56
442450
msgid "创建"
@@ -481,7 +489,7 @@ msgstr "Delete template"
481489
msgid "删除游戏"
482490
msgstr "Delete game"
483491

484-
#: src/components/Assets/Assets.tsx:275
492+
#: src/components/Assets/Assets.tsx:276
485493
#: src/pages/editor/EditorSidebar/EditorSidebar.tsx:151
486494
msgid "刷新"
487495
msgstr "Refresh"
@@ -749,8 +757,8 @@ msgstr "Left align"
749757
msgid "已创建"
750758
msgstr "Created"
751759

752-
#: src/components/Assets/Assets.tsx:179
753-
#: src/components/Assets/Assets.tsx:227
760+
#: src/components/Assets/Assets.tsx:180
761+
#: src/components/Assets/Assets.tsx:228
754762
#: src/components/Assets/FileElement.tsx:70
755763
msgid "已存在文件或文件夹 {0},请输入其他名称"
756764
msgstr "File or folder already exists {0}, please enter another name"
@@ -819,15 +827,15 @@ msgstr "Manually enter ID"
819827
msgid "打开效果编辑器"
820828
msgstr "Open effect editor"
821829

822-
#: src/components/Assets/Assets.tsx:276
830+
#: src/components/Assets/Assets.tsx:277
823831
msgid "打开文件夹"
824832
msgstr "Open folder"
825833

826834
#: src/pages/editor/GraphicalEditor/GraphicalEditor.tsx:213
827835
msgid "执行到此句"
828836
msgstr "Execute to this sentence"
829837

830-
#: src/components/Assets/Assets.tsx:193
838+
#: src/components/Assets/Assets.tsx:194
831839
msgid "扩展名"
832840
msgstr "Extension name"
833841

@@ -1009,11 +1017,11 @@ msgstr "Text Shadow"
10091017
msgid "文档"
10101018
msgstr "Document"
10111019

1012-
#: src/components/Assets/Assets.tsx:177
1020+
#: src/components/Assets/Assets.tsx:178
10131021
msgid "新建文件"
10141022
msgstr "Create new file"
10151023

1016-
#: src/components/Assets/Assets.tsx:225
1024+
#: src/components/Assets/Assets.tsx:226
10171025
msgid "新建文件夹"
10181026
msgstr "Create new folder"
10191027

@@ -1026,11 +1034,11 @@ msgstr "Create new template"
10261034
msgid "新建游戏"
10271035
msgstr "Create new game"
10281036

1029-
#: src/components/Assets/Assets.tsx:187
1037+
#: src/components/Assets/Assets.tsx:188
10301038
msgid "新文件名"
10311039
msgstr "New file name"
10321040

1033-
#: src/components/Assets/Assets.tsx:234
1041+
#: src/components/Assets/Assets.tsx:235
10341042
msgid "新文件夹名"
10351043
msgstr "New folder name"
10361044

@@ -1069,7 +1077,7 @@ msgstr "Voiceover mode, no role name"
10691077
msgid "旋转角度:"
10701078
msgstr "Rotation angle:"
10711079

1072-
#: src/components/Assets/Assets.tsx:195
1080+
#: src/components/Assets/Assets.tsx:196
10731081
#: src/pages/templateEditor/TemplateGraphicalEditor/WebgalClassEditor/propertyEditor/WGCursor.tsx:16
10741082
msgid "无"
10751083
msgstr "None"
@@ -1665,7 +1673,7 @@ msgstr "Assets"
16651673
msgid "输入目标 ID"
16661674
msgstr "Enter Target ID"
16671675

1668-
#: src/components/Assets/Assets.tsx:284
1676+
#: src/components/Assets/Assets.tsx:285
16691677
msgid "过滤文件"
16701678
msgstr "Filter files"
16711679

0 commit comments

Comments
 (0)