Skip to content
Permalink
Browse files

feat(language): fix language data

  • Loading branch information...
yyc-git authored and AmyOrz committed Mar 16, 2019
1 parent ce4b198 commit b7fae2924c8f97564962425cbb50a581adab6716
Showing with 328 additions and 202 deletions.
  1. +11 −2 ...ble_component/controller/atom_component/transformGizmo/ui/TransformGizmoCoordinateSystemSwitch.re
  2. +28 −8 src/core/composable_component/controller/atom_component/transformGizmo/ui/TransformGizmoSwitch.re
  3. +17 −7 src/core/composable_component/controller/ui/Controller.re
  4. +2 −2 src/core/composable_component/header/atom_component/notice/HeaderNotice.re
  5. +76 −30 .../composable_component/assetTree_Inspector/atom_component/texture_Inspector/ui/TextureInspector.re
  6. +1 −1 ...osable_component/sceneTree_Inspector/composable_component/cameraGroup/ui/MainEditorCameraGroup.re
  7. +1 −1 ...r/composable_component/sceneTree_Inspector/composable_component/geometry/ui/MainEditorGeometry.re
  8. +2 −2 ..._component/renderGroup/material/composable_component/light_material/ui/MainEditorLightMaterial.re
  9. +1 −1 ..._component/sceneTree_Inspector/composable_component/renderGroup/material/ui/MainEditorMaterial.re
  10. +2 −2 ...osable_component/sceneTree_Inspector/composable_component/renderGroup/ui/MainEditorRenderGroup.re
  11. +4 −4 .../composable_component/mainEditor/composable_component/inspector/utils/InspectorGameObjectUtils.re
  12. +4 −4 src/core/config/data/LanguageAssetData.re
  13. +45 −3 src/core/config/data/LanguageControllerData.re
  14. +27 −34 src/core/config/data/LanguageHeaderData.re
  15. +98 −98 src/core/config/data/LanguageInspectorData.re
  16. +3 −3 src/core/config/data/LanguageSceneTreeData.re
  17. +6 −0 src/core/utils/language/LanguageUtils.re
@@ -40,17 +40,26 @@ let render =
isDisable,
onChangeFunc,
({state, send}: ReasonReact.self('a, 'b, 'c)) as self,
) =>
) => {
let languageType =
LanguageEditorService.unsafeGetType |> StateLogicService.getEditorState;

<article
key="TransformGizmoCoordinateSystemSwitch"
className="transform-gizmo-coordinate-system-switch">
<button
disabled=isDisable
title="switch coordinate system"
title={
LanguageUtils.getControllerLanguageDataByType(
"coordinate-system-describe",
languageType,
)
}
onClick={_e => Method.change((state, send), onChangeFunc)}>
{DomHelper.textEl(Method.getText(state.selectedCoordinateSystem))}
</button>
</article>;
};

let make = (~defaultCoordinateSystem, ~isDisable, ~onChange, _children) => {
...component,
@@ -15,21 +15,33 @@ module Method = {
}
);

let _getTitle = type_ =>
let _getTitle = (type_, languageType) =>
SceneViewType.(
switch (type_) {
| Translation => "translation"
| Rotation => "rotation"
| Scale => "scale"
| Translation =>
LanguageUtils.getControllerLanguageDataByType(
"translation-gizmo-describe",
languageType,
)
| Rotation =>
LanguageUtils.getControllerLanguageDataByType(
"rotation-gizmo-describe",
languageType,
)
| Scale =>
LanguageUtils.getControllerLanguageDataByType(
"scale-gizmo-describe",
languageType,
)
}
);

let renderContent = ((state, send), data) =>
let renderContent = ((state, send), languageType, data) =>
data
|> Js.Array.map(({type_, onChangeFunc}) =>
<div
key={DomHelper.getRandomKey()}
title={_getTitle(type_)}
title={_getTitle(type_, languageType)}
className={
ClassNameService.buildMultipleClassName([|
_getTypeClassName(type_),
@@ -51,10 +63,18 @@ let reducer = (action, state) =>
)
};

let render = (data, {state, send}: ReasonReact.self('a, 'b, 'c)) =>
let render = (data, {state, send}: ReasonReact.self('a, 'b, 'c)) => {
let languageType =
LanguageEditorService.unsafeGetType |> StateLogicService.getEditorState;

<article key="TransformGizmoSwitch" className="transform-gizmo-switch">
{ReasonReact.array(Method.renderContent((state, send), data))}
{
ReasonReact.array(
Method.renderContent((state, send), languageType, data),
)
}
</article>;
};

let make = (~data, ~defaultType, _children) => {
...component,
@@ -47,11 +47,16 @@ module Method = {
key={DomHelper.getRandomKey()}
label={
LanguageUtils.getControllerLanguageDataByType(
"controller-light",
"controller-ambient",
languageType,
)
}
title={
LanguageUtils.getControllerLanguageDataByType(
"ambient-describe",
languageType,
)
}
title="ambient color"
getColorFunc=getColor
changeColorFunc=changeColor
closeColorPickFunc={closeColorPick((uiState, dispatchFunc), ())}
@@ -101,7 +106,7 @@ module Method = {
| _ => false
};

let buildTransformComponent = (uiState, dispatchFunc) =>
let buildTransformComponent = (uiState, dispatchFunc, languageType) =>
<div className="header-item">
<div className="component-item">
<TransformGizmoSwitch
@@ -134,10 +139,15 @@ module Method = {
</div>
</div>;

let renderRunAndStop = (uiState, dispatchFunc) =>
let renderRunAndStop = (uiState, dispatchFunc, languageType) =>
<div
className="controller-runAndStop"
title="run/stop"
title={
LanguageUtils.getControllerLanguageDataByType(
"run-describe",
languageType,
)
}
onClick={
_e => {
StateEditorService.getIsRun() ?
@@ -178,9 +188,9 @@ let render =
}
</div>
<div className="controller-transform">
{Method.buildTransformComponent(uiState, dispatchFunc)}
{Method.buildTransformComponent(uiState, dispatchFunc, languageType)}
</div>
{Method.renderRunAndStop(uiState, dispatchFunc)}
{Method.renderRunAndStop(uiState, dispatchFunc, languageType)}
<div className="controller-other">
<div
className="other-language"
@@ -86,8 +86,8 @@ module Method = {
<div className="content-text" key="text1">
{
DomHelper.textEl(
LanguageUtils.getHeaderLanguageDataByType(
"version-content",
LanguageUtils.getHeaderVersionUpgradeContentLanguageDataByType(
newVersion,
languageType,
),
)
@@ -1,97 +1,143 @@
module Method = {
let renderWrapSSelect = (dispatchFunc, textureComponent) =>
let renderWrapSSelect = (dispatchFunc, textureComponent, languageType) =>
<Select
label="WrapS"
options=(TextureWrapUtils.getWrapOptions())
selectedKey=(
title={
LanguageUtils.getInspectorLanguageDataByType(
"texture-wraps-describe",
languageType,
)
}
options={TextureWrapUtils.getWrapOptions()}
selectedKey={
BasicSourceTextureEngineService.getWrapS(textureComponent)
|> StateLogicService.getEngineStateToGetData
|> TextureTypeUtils.convertWrapToInt
)
onChange=(
}
onChange={
value =>
InspectorChangeTextureWrapSEventHandler.MakeEventHandler.pushUndoStackWithTwoHandleFunc(
(UIStateService.getState(), dispatchFunc),
(),
(textureComponent, value),
)
)
}
/>;

let renderWrapTSelect = (dispatchFunc, textureComponent) =>
let renderWrapTSelect = (dispatchFunc, textureComponent, languageType) =>
<Select
label="WrapT"
options=(TextureWrapUtils.getWrapOptions())
selectedKey=(
title={
LanguageUtils.getInspectorLanguageDataByType(
"texture-wrapt-describe",
languageType,
)
}
options={TextureWrapUtils.getWrapOptions()}
selectedKey={
BasicSourceTextureEngineService.getWrapT(textureComponent)
|> StateLogicService.getEngineStateToGetData
|> TextureTypeUtils.convertWrapToInt
)
onChange=(
}
onChange={
value =>
InspectorChangeTextureWrapTEventHandler.MakeEventHandler.pushUndoStackWithTwoHandleFunc(
(UIStateService.getState(), dispatchFunc),
(),
(textureComponent, value),
)
)
}
/>;
let renderMagFilterSelect = (dispatchFunc, textureComponent) =>
let renderMagFilterSelect = (dispatchFunc, textureComponent, languageType) =>
<Select
label="Mag Filter"
options=(TextureFilterUtils.getMagFilterOptions())
selectedKey=(
title={
LanguageUtils.getInspectorLanguageDataByType(
"texture-mag-filter-describe",
languageType,
)
}
options={TextureFilterUtils.getMagFilterOptions()}
selectedKey={
BasicSourceTextureEngineService.getMagFilter(textureComponent)
|> StateLogicService.getEngineStateToGetData
|> TextureTypeUtils.convertFilterToInt
)
onChange=(
}
onChange={
value =>
InspectorChangeTextureMagFilterEventHandler.MakeEventHandler.pushUndoStackWithTwoHandleFunc(
(UIStateService.getState(), dispatchFunc),
(),
(textureComponent, value),
)
)
}
/>;

let renderMinFilterSelect = (dispatchFunc, textureComponent) =>
let renderMinFilterSelect = (dispatchFunc, textureComponent, languageType) =>
<Select
label="Min Filter"
options=(TextureFilterUtils.getMinFilterOptions())
selectedKey=(
title={
LanguageUtils.getInspectorLanguageDataByType(
"texture-min-filter-describe",
languageType,
)
}
options={TextureFilterUtils.getMinFilterOptions()}
selectedKey={
BasicSourceTextureEngineService.getMinFilter(textureComponent)
|> StateLogicService.getEngineStateToGetData
|> TextureTypeUtils.convertFilterToInt
)
onChange=(
}
onChange={
value =>
InspectorChangeTextureMinFilterEventHandler.MakeEventHandler.pushUndoStackWithTwoHandleFunc(
(UIStateService.getState(), dispatchFunc),
(),
(textureComponent, value),
)
)
}
/>;
};

let component = ReasonReact.statelessComponent("TextureInspector");

let render = ((dispatchFunc, renameFunc), name, textureComponent, _self) =>
let render = ((dispatchFunc, renameFunc), name, textureComponent, _self) => {
let languageType =
LanguageEditorService.unsafeGetType |> StateLogicService.getEditorState;

<article key="TextureInspector" className="wonder-texture-assetTree">
<h1> (DomHelper.textEl("Texture")) </h1>
<h1> {DomHelper.textEl("Texture")} </h1>
<hr />
<StringInput
label="Name"
title={
LanguageUtils.getInspectorLanguageDataByType(
"texture-name-describe",
languageType,
)
}
defaultValue=name
onBlur=renameFunc
canBeNull=false
/>
(Method.renderWrapSSelect(dispatchFunc, textureComponent))
(Method.renderWrapTSelect(dispatchFunc, textureComponent))
(Method.renderMagFilterSelect(dispatchFunc, textureComponent))
(Method.renderMinFilterSelect(dispatchFunc, textureComponent))
{Method.renderWrapSSelect(dispatchFunc, textureComponent, languageType)}
{Method.renderWrapTSelect(dispatchFunc, textureComponent, languageType)}
{
Method.renderMagFilterSelect(
dispatchFunc,
textureComponent,
languageType,
)
}
{
Method.renderMinFilterSelect(
dispatchFunc,
textureComponent,
languageType,
)
}
</article>;
};

let make =
(
@@ -14,7 +14,7 @@ let render = ((uiState, dispatchFunc), _self) => {
languageType,
)
}>
{DomHelper.textEl("Camera View")}
{DomHelper.textEl("CameraView")}
</div>
<hr />
<div className="component-content">
@@ -173,7 +173,7 @@ let render =
className="item-header"
title={
LanguageUtils.getInspectorLanguageDataByType(
"geometry-describe",
"geometry-geometry-describe",
languageType,
)
}>
@@ -67,7 +67,7 @@ let render = ((uiState, dispatchFunc), materialComponent, _self) => {
label="Diffuse Color"
title={
LanguageUtils.getInspectorLanguageDataByType(
"material-color-describe",
"material-diffuseColor-describe",
languageType,
)
}
@@ -84,7 +84,7 @@ let render = ((uiState, dispatchFunc), materialComponent, _self) => {
label="Diffuse Map"
title={
LanguageUtils.getInspectorLanguageDataByType(
"rotation-describe",
"material-diffuseMap-describe",
languageType,
)
}
@@ -226,7 +226,7 @@ let _renderSelectMaterial =
className="item-header"
title={
LanguageUtils.getInspectorLanguageDataByType(
"material-describe",
"material-material-describe",
languageType,
)
}>
@@ -26,11 +26,11 @@ let render = ((uiState, dispatchFunc), currentSceneTreeNode, _self) => {
className="component-title"
title={
LanguageUtils.getInspectorLanguageDataByType(
"material-type-describe",
"material-describe",
languageType,
)
}>
{DomHelper.textEl("Material Type")}
{DomHelper.textEl("Material")}
</div>
<hr />
<div className="component-content">

0 comments on commit b7fae29

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