Skip to content
Permalink
Browse files

feat(header): fix "New Scene": should operate in stop

(change the warn messge for export package, import package, publish local)
  • Loading branch information...
yyc-git committed May 30, 2019
1 parent b65da2f commit 5792121342b45d3a28e969cb2baece905b0cb2a4
@@ -42,53 +42,67 @@ let initEditorJob = (_, engineState) => {
);
};

let handleNewScene = (dispatchFunc, (editorState, engineState)) => {
let engineState =
engineState
|> SceneEngineService.disposeSceneAllChildrenKeepOrderRemoveGeometryRemoveMaterial
|> JobEngineService.execDisposeJob;

let (editorState, engineState, sceneCamera) =
DefaultSceneUtils.createDefaultScene(
GeometryDataAssetEditorService.unsafeGetDefaultCubeGeometryComponent(
let handleNewScene = (dispatchFunc, (editorState, engineState)) =>
StateEditorService.getIsRun() ?
{
ConsoleUtils.warn(
LanguageUtils.getMessageLanguageDataByType(
"should-in-stop",
LanguageEditorService.unsafeGetType(editorState),
),
editorState,
),
editorState,
engineState,
);
)
|> ignore;

let editorState =
editorState
|> GameViewEditorService.setActivedBasicCameraView(
GameObjectComponentEngineService.unsafeGetBasicCameraViewComponent(
sceneCamera,
engineState,
),
);
(editorState, engineState);
} :
{
let engineState =
engineState
|> SceneEngineService.disposeSceneAllChildrenKeepOrderRemoveGeometryRemoveMaterial
|> JobEngineService.execDisposeJob;

let engineState =
engineState
|> BasicCameraViewEngineService.activeBasicCameraView(
engineState
|> GameObjectComponentEngineService.unsafeGetBasicCameraViewComponent(
editorState |> SceneViewEditorService.unsafeGetEditCamera,
),
);
let (editorState, engineState, sceneCamera) =
DefaultSceneUtils.createDefaultScene(
GeometryDataAssetEditorService.unsafeGetDefaultCubeGeometryComponent(
editorState,
),
editorState,
engineState,
);

editorState
|> SceneTreeSelectCurrentNodeUtils.clearCurrentData
|> StateEditorService.setState
|> ignore;
let editorState =
editorState
|> GameViewEditorService.setActivedBasicCameraView(
GameObjectComponentEngineService.unsafeGetBasicCameraViewComponent(
sceneCamera,
engineState,
),
);

let engineState =
engineState |> StateLogicService.renderEngineStateAndReturnEngineState;
let engineState =
engineState
|> BasicCameraViewEngineService.activeBasicCameraView(
engineState
|> GameObjectComponentEngineService.unsafeGetBasicCameraViewComponent(
editorState |> SceneViewEditorService.unsafeGetEditCamera,
),
);

dispatchFunc(
AppStore.UpdateAction(
Update([|UpdateStore.SceneTree, UpdateStore.Inspector|]),
),
)
|> ignore;
editorState
|> SceneTreeSelectCurrentNodeUtils.clearCurrentData
|> StateEditorService.setState
|> ignore;

let engineState =
engineState |> StateLogicService.renderEngineStateAndReturnEngineState;

dispatchFunc(
AppStore.UpdateAction(
Update([|UpdateStore.SceneTree, UpdateStore.Inspector|]),
),
)
|> ignore;

(StateEditorService.getState(), engineState);
};
(StateEditorService.getState(), engineState);
};
@@ -62,7 +62,7 @@ let exportPackage = packageName => {
{
ConsoleUtils.warn(
LanguageUtils.getMessageLanguageDataByType(
"header-export-package",
"should-in-stop",
languageType,
),
editorState,
@@ -17,7 +17,7 @@ let exportScene = sceneName => {
{
ConsoleUtils.warn(
LanguageUtils.getMessageLanguageDataByType(
"header-export-scene",
"should-in-stop",
languageType,
),
editorState,
@@ -372,7 +372,7 @@ let _import = result => {
let _handleIsRun = (dispatchFunc, languageType, editorState) => {
ConsoleUtils.warn(
LanguageUtils.getMessageLanguageDataByType(
"header-import-package",
"should-in-stop",
languageType,
),
editorState,
@@ -346,7 +346,7 @@ module Publish = {
{
ConsoleUtils.warn(
LanguageUtils.getMessageLanguageDataByType(
"header-publish-local",
"should-in-stop",
LanguageEditorService.unsafeGetType(editorState),
),
editorState,
@@ -9,31 +9,10 @@ let message_language_array = [|
},
},
{
title: "header-export-package",
title: "should-in-stop",
language: {
zh: {j|请在停止状态导出包WPK,现在正在运行 !|j},
en: "should export package when stop, but now is run!",
},
},
{
title: "header-export-scene",
language: {
zh: {j|请在停止状态导出场景模型WDB,现在正在运行 !|j},
en: "should export scene when stop, but now is run!",
},
},
{
title: "header-import-package",
language: {
zh: {j|请在停止状态导入包WPK,现在正在运行 !|j},
en: "should import package when stop, but now is run!",
},
},
{
title: "header-publish-local",
language: {
zh: {j|请在停止状态发布本地包,现在正在运行 !|j},
en: "should publish local when stop, but now is run!",
zh: {j|请在停止状态操作,现在正在运行 !|j},
en: "should operate when stop, but now is run!",
},
},
{
@@ -78,7 +78,7 @@ let _ =
warn
|> expect
|> toCalledWith([|
"should export package when stop, but now is run!",
"should operate when stop, but now is run!",
|]);
})
);
@@ -70,7 +70,7 @@ let _ =

warn
|> expect
|> toCalledWith([|"should export scene when stop, but now is run!"|]);
|> toCalledWith([|"should operate when stop, but now is run!"|]);
})
);

0 comments on commit 5792121

Please sign in to comment.
You can’t perform that action at this time.