Skip to content
Permalink
Browse files

feat(language): add camera group language

  • Loading branch information...
AmyOrz committed Mar 15, 2019
1 parent 14215de commit ef33b4123389e24e4ce6dadd75d12060c06895a4
@@ -65,53 +65,73 @@ module Method = {
|> StateLogicService.getAndRefreshEngineStateWithFunc;

let buildNearComponent =
((uiState, dispatchFunc), currentGameObjectPerspectiveCamera) =>
(
(uiState, dispatchFunc),
currentGameObjectPerspectiveCamera,
languageType,
) =>
<MainEditorFloatInputBaseComponent
label="Near"
getComponentValueFunc=(
title={
LanguageUtils.getInspectorLanguageDataByType(
"projection-near-describe",
languageType,
)
}
getComponentValueFunc={
PerspectiveCameraProjectionEngineService.getPerspectiveCameraNear(
currentGameObjectPerspectiveCamera,
)
)
changeComponentValueFunc=(
}
changeComponentValueFunc={
changeNear(currentGameObjectPerspectiveCamera)
)
blurValueFunc=(
}
blurValueFunc={
blurNearEvent(
(uiState, dispatchFunc),
currentGameObjectPerspectiveCamera,
)
)
dragDropFunc=(
}
dragDropFunc={
blurNearEvent(
(uiState, dispatchFunc),
currentGameObjectPerspectiveCamera,
)
)
}
/>;

let buildFarComponent =
((uiState, dispatchFunc), currentGameObjectPerspectiveCamera) =>
(
(uiState, dispatchFunc),
currentGameObjectPerspectiveCamera,
languageType,
) =>
<MainEditorFloatInputBaseComponent
label="Far"
getComponentValueFunc=(
title={
LanguageUtils.getInspectorLanguageDataByType(
"projection-far-describe",
languageType,
)
}
getComponentValueFunc={
PerspectiveCameraProjectionEngineService.getPerspectiveCameraFar(
currentGameObjectPerspectiveCamera,
)
)
changeComponentValueFunc=(changeFar(currentGameObjectPerspectiveCamera))
blurValueFunc=(
}
changeComponentValueFunc={changeFar(currentGameObjectPerspectiveCamera)}
blurValueFunc={
blurFarEvent(
(uiState, dispatchFunc),
currentGameObjectPerspectiveCamera,
)
)
dragDropFunc=(
}
dragDropFunc={
blurFarEvent(
(uiState, dispatchFunc),
currentGameObjectPerspectiveCamera,
)
)
}
/>;

/* let buildAspectComponent =
@@ -135,29 +155,39 @@ module Method = {
/>; */

let buildFovyComponent =
((uiState, dispatchFunc), currentGameObjectPerspectiveCamera) =>
(
(uiState, dispatchFunc),
currentGameObjectPerspectiveCamera,
languageType,
) =>
<MainEditorFloatInputBaseComponent
label="Fovy"
getComponentValueFunc=(
title={
LanguageUtils.getInspectorLanguageDataByType(
"projection-fovy-describe",
languageType,
)
}
getComponentValueFunc={
PerspectiveCameraProjectionEngineService.getPerspectiveCameraFovy(
currentGameObjectPerspectiveCamera,
)
)
changeComponentValueFunc=(
}
changeComponentValueFunc={
changeFovy(currentGameObjectPerspectiveCamera)
)
blurValueFunc=(
}
blurValueFunc={
blurFovyEvent(
(uiState, dispatchFunc),
currentGameObjectPerspectiveCamera,
)
)
dragDropFunc=(
}
dragDropFunc={
blurFovyEvent(
(uiState, dispatchFunc),
currentGameObjectPerspectiveCamera,
)
)
}
/>;
};

@@ -171,39 +201,50 @@ let render = ((uiState, dispatchFunc), _self) => {
SceneTreeEditorService.unsafeGetCurrentSceneTreeNode
|> StateLogicService.getEditorState,
);
let languageType =
LanguageUtils.getLanguageType(WindowType.window##wonderLanguage);

<article
key="MainEditorCameraProjection" className="wonder-camera-projection">
<Select
label="Type"
options=(MainEditorCameraProjectionUtils.getCameraProjectionOptions())
onChange=(value => ())
selectedKey=(PerspectiveCamera |> convertCameraProjectionTypeToInt)
title={
LanguageUtils.getInspectorLanguageDataByType(
"projection-type-describe",
languageType,
)
}
options={MainEditorCameraProjectionUtils.getCameraProjectionOptions()}
onChange={value => ()}
selectedKey={PerspectiveCamera |> convertCameraProjectionTypeToInt}
/>
(
{
Method.buildNearComponent(
(uiState, dispatchFunc),
currentGameObjectPerspectiveCamera,
languageType,
)
)
(
}
{
Method.buildFarComponent(
(uiState, dispatchFunc),
currentGameObjectPerspectiveCamera,
languageType,
)
)
}
/* (
Method.buildAspectComponent(
(uiState, dispatchFunc),
currentGameObjectPerspectiveCamera,
)
) */
(
{
Method.buildFovyComponent(
(uiState, dispatchFunc),
currentGameObjectPerspectiveCamera,
languageType,
)
)
}
</article>;
};

@@ -29,25 +29,43 @@ let render = ((uiState, dispatchFunc), _self) => {
StateEditorService.getState(),
);

let languageType =
LanguageUtils.getLanguageType(WindowType.window##wonderLanguage);

<article key="MainEditorCameraView" className="wonder-camera-view">
<Select
label="Type"
options=(MainEditorCameraViewUtils.getCameraViewOptions())
selectedKey=(BasicCameraView |> convertCameraViewTypeToInt)
onChange=(value => ())
title={
LanguageUtils.getInspectorLanguageDataByType(
"view-type-describe",
languageType,
)
}
options={MainEditorCameraViewUtils.getCameraViewOptions()}
selectedKey={BasicCameraView |> convertCameraViewTypeToInt}
onChange={value => ()}
/>
<div className="inspector-item">
<div className="item-header"> (DomHelper.textEl("CurrentCamera")) </div>
<div
className="item-header"
title={
LanguageUtils.getInspectorLanguageDataByType(
"current-camera-describe",
languageType,
)
}>
{DomHelper.textEl("CurrentCamera")}
</div>
<div className="item-content">
<input
type_="checkbox"
defaultChecked=isCurrentCamera
onClick=(
onClick={
Method.setCurrentCamera(
(uiState, dispatchFunc),
currentSceneTreeNodeBasicCameraViewComponent,
)
)
}
disabled=isCurrentCamera
/>
</div>
@@ -1,24 +1,44 @@
let component = ReasonReact.statelessComponent("MainEditorCameraGroup");

let render = ((uiState, dispatchFunc), _self) =>
let render = ((uiState, dispatchFunc), _self) => {
let languageType =
LanguageUtils.getLanguageType(WindowType.window##wonderLanguage);

<article key="MainEditorCameraGroup" className="wonder-camera-group">
<div className="inspector-component">
<div className="component-title"> (DomHelper.textEl("CameView")) </div>
<div
className="component-title"
title={
LanguageUtils.getInspectorLanguageDataByType(
"camera-view-describe",
languageType,
)
}>
{DomHelper.textEl("Camera View")}
</div>
<hr />
<div className="component-content">
<MainEditorCameraView uiState dispatchFunc />
</div>
</div>
<div className="inspector-component">
<div className="component-title">
(DomHelper.textEl("Projection"))
<div
className="component-title"
title={
LanguageUtils.getInspectorLanguageDataByType(
"camera-projection-describe",
languageType,
)
}>
{DomHelper.textEl("Projection")}
</div>
<hr />
<div className="component-content">
<MainEditorCameraProjection uiState dispatchFunc />
</div>
</div>
</article>;
};

let make = (~uiState, ~dispatchFunc, _children) => {
...component,
@@ -149,7 +149,7 @@ let inspector_language_array = [|
},
},
{
title: "projection-describe",
title: "camera-projection-describe",
language: {
zh: {j|自定义名词|j},
en: "name for yourself",

0 comments on commit ef33b41

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