Skip to content

Commit 934193c

Browse files
committed
feat: continue "load custom model"
add lod2;
1 parent afb15ca commit 934193c

8 files changed

Lines changed: 31 additions & 13 deletions

File tree

contributes/meta3d-action-mod-unit-init/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "meta3d-action-mod-unit-init",
3-
"version": "1.3.77",
3+
"version": "1.3.78",
44
"publisher": "meta3d",
55
"protocol": {
66
"name": "meta3d-action-mod-unit-init-protocol"

contributes/meta3d-action-mod-unit-publish-to-game/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "meta3d-action-mod-unit-publish-to-game",
3-
"version": "1.3.41",
3+
"version": "1.3.42",
44
"publisher": "meta3d",
55
"protocol": {
66
"name": "meta3d-action-mod-unit-publish-to-game-protocol"

contributes/meta3d-action-mod-unit-publish-to-game/src/Main.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@ import { state as meta3dState, getContribute as getContributeMeta3D, api } from
33
import { actionContribute, service as editorWholeService } from "meta3d-editor-whole-protocol/src/service/ServiceType"
44
import { actionName, state, uiData } from "meta3d-action-mod-unit-publish-to-game-protocol"
55
import { actionName as initActionName, state as initState } from "meta3d-action-mod-unit-init-protocol"
6+
import { actionName as uploadModelFileActionName, state as uploadModelFileState } from "meta3d-action-mod-unit-upload-model-file-protocol"
7+
import { actionName as uploadModelSnapshotActionName, state as uploadModelSnapshotState } from "meta3d-action-mod-unit-upload-model-snapshot-protocol"
68
import { actionName as infoActionName, state as infoState } from "meta3d-action-mod-career-info-protocol"
79
import { eventName, inputData } from "meta3d-action-mod-unit-publish-to-game-protocol/src/EventType"
810
import { publish, getUserName, checkModData, buildUniqueName } from "meta3d-action-mod-unit-publish-utils/src/Main"
911
import { getLanguageTextData, isChinese } from "meta3d-language-utils/src/Main"
1012
import { languageKey } from "meta3d-language-utils/src/Type"
1113

12-
let _checkPublishData = (api: api, meta3dState: meta3dState, { languageTextData, displayNameCN, displayNameEN, description, modIconBase64 }: initState, isChinese: boolean) => {
14+
let _checkPublishData = (api: api, meta3dState: meta3dState, { selectedModelIndex, languageTextData, displayNameCN, displayNameEN, description, modIconBase64 }: initState, isChinese: boolean) => {
1315
let message = api.nullable.getEmpty<string>()
1416

1517
if (isChinese && displayNameCN.length <= 0) {
@@ -25,6 +27,19 @@ let _checkPublishData = (api: api, meta3dState: meta3dState, { languageTextData,
2527
// message = api.nullable.return(getLanguageTextData(api, meta3dState, languageTextData, languageKey.NeedModIcon))
2628
// }
2729

30+
if (api.nullable.isNullable(selectedModelIndex)) {
31+
let uploadModelFileState = api.action.getActionState<uploadModelFileState>(meta3dState, uploadModelFileActionName)
32+
let uploadModelSnapshotState = api.action.getActionState<uploadModelSnapshotState>(meta3dState, uploadModelSnapshotActionName)
33+
34+
if (!(
35+
uploadModelFileState.files.has("lod1") && uploadModelFileState.files.has("lod2")
36+
&& !api.nullable.isNullable(uploadModelSnapshotState.snapshot)
37+
)
38+
) {
39+
message = api.nullable.return(getLanguageTextData(api, meta3dState, languageTextData, languageKey.NeedLOD1LOD2SnapshotModelFile))
40+
}
41+
}
42+
2843
return api.nullable.getWithDefault(
2944
api.nullable.map((message) => {
3045
api.message.warn(message)

defaults/meta3d-commonlib/lib/bs/.bsdeps

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ src\log 0x1.a637238e70695p+30
1818
src\copy 0x1.a637238e70695p+30
1919
src\contract 0x1.a637238e70695p+30
2020
===
21-
D:\Github\Meta3D\node_modules\rescript\win32\rescript.exe 0x1.a7da50814616ap+30
21+
D:\Github\Meta3D\node_modules\rescript\win32\rescript.exe 0x1.a7da83d1e9e1ep+30
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
#Start(-434609648)
2-
#Done(-434608631)
1+
#Start(-431326102)
2+
#Done(-431326095)

doc/1.3.1.org

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2897,25 +2897,25 @@ update _loadSceneResourceHandler
28972897

28982898

28992899

2900-
** TODO add lod2 upload
2900+
** DONE add lod2 upload
29012901

29022902

2903-
** TODO after upload model lod1, show upload lod2 button
2903+
** DONE after upload model lod1, show upload lod2 button
29042904

29052905

29062906

2907-
** TODO update publish check
2907+
** DONE update publish check
29082908
if upload:
29092909
should has model lod1, lod2, snapshot
29102910
should has none select model
29112911

2912-
if select model:
2913-
should has no model lod1, lod2, snapshot
2914-
should has select model
2912+
# if select model:
2913+
# should has no model lod1, lod2, snapshot
2914+
# should has select model
29152915

29162916

29172917

2918-
** TODO pass Play run test
2918+
** DONE pass Play run test
29192919

29202920

29212921
# ** TODO refactor: add fbxPaths?

utils/meta3d-language-utils/src/Data.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ export let getTextData = (): languageTextData => {
3636
[languageKey.NeedAtLeastOneGenerateData]: "需要为至少一个关卡加入生成数据",
3737
[languageKey.NeedSmallSkillObjectEmitterData]: "需要加入针对小型单位的技能->弹药数据",
3838
[languageKey.NeedBigSkillObjectEmitterData]: "需要加入针对大型单位的技能->弹药数据",
39+
[languageKey.NeedLOD1LOD2SnapshotModelFile]: "需要上传LOD1和LOD2的模型FBX文件和模型快照",
3940

4041

4142
[category.EliteGiantess]: "精英巨大娘",
@@ -171,6 +172,7 @@ export let getTextData = (): languageTextData => {
171172
[languageKey.NeedAtLeastOneGenerateData]: "Generation data for at least one level is required",
172173
[languageKey.NeedSmallSkillObjectEmitterData]: "Ammo data for small unit skills is required",
173174
[languageKey.NeedBigSkillObjectEmitterData]: "Ammo data for large unit skills is required",
175+
[languageKey.NeedLOD1LOD2SnapshotModelFile]: "LOD1 and LOD2 model file and snapshot are required",
174176

175177
[category.EliteGiantess]: "Elite Giantess",
176178
[model.EliteGiantess1]: "Elite Giantess 1",

utils/meta3d-language-utils/src/Type.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export enum languageKey {
3838
NeedAtLeastOneGenerateData,
3939
NeedSmallSkillObjectEmitterData,
4040
NeedBigSkillObjectEmitterData,
41+
NeedLOD1LOD2SnapshotModelFile,
4142

4243

4344
}

0 commit comments

Comments
 (0)