|
@@ -4,12 +4,14 @@
|
|
|
|
|
|
Menubar.Add = function ( editor ) {
|
|
|
|
|
|
+ var strings = editor.strings;
|
|
|
+
|
|
|
var container = new UI.Panel();
|
|
|
container.setClass( 'menu' );
|
|
|
|
|
|
var title = new UI.Panel();
|
|
|
title.setClass( 'title' );
|
|
|
- title.setTextContent( 'Add' );
|
|
|
+ title.setTextContent( strings.getKey( 'menubar/add' ) );
|
|
|
container.add( title );
|
|
|
|
|
|
var options = new UI.Panel();
|
|
@@ -20,7 +22,7 @@ Menubar.Add = function ( editor ) {
|
|
|
|
|
|
var option = new UI.Row();
|
|
|
option.setClass( 'option' );
|
|
|
- option.setTextContent( 'Group' );
|
|
|
+ option.setTextContent( strings.getKey( 'menubar/add/group' ) );
|
|
|
option.onClick( function () {
|
|
|
|
|
|
var mesh = new THREE.Group();
|
|
@@ -39,7 +41,7 @@ Menubar.Add = function ( editor ) {
|
|
|
|
|
|
var option = new UI.Row();
|
|
|
option.setClass( 'option' );
|
|
|
- option.setTextContent( 'Plane' );
|
|
|
+ option.setTextContent( strings.getKey( 'menubar/add/plane' ) );
|
|
|
option.onClick( function () {
|
|
|
|
|
|
var geometry = new THREE.PlaneBufferGeometry( 1, 1, 1, 1 );
|
|
@@ -56,7 +58,7 @@ Menubar.Add = function ( editor ) {
|
|
|
|
|
|
var option = new UI.Row();
|
|
|
option.setClass( 'option' );
|
|
|
- option.setTextContent( 'Box' );
|
|
|
+ option.setTextContent( strings.getKey( 'menubar/add/box' ) );
|
|
|
option.onClick( function () {
|
|
|
|
|
|
var geometry = new THREE.BoxBufferGeometry( 1, 1, 1, 1, 1, 1 );
|
|
@@ -72,7 +74,7 @@ Menubar.Add = function ( editor ) {
|
|
|
|
|
|
var option = new UI.Row();
|
|
|
option.setClass( 'option' );
|
|
|
- option.setTextContent( 'Circle' );
|
|
|
+ option.setTextContent( strings.getKey( 'menubar/add/circle' ) );
|
|
|
option.onClick( function () {
|
|
|
|
|
|
var geometry = new THREE.CircleBufferGeometry( 1, 8, 0, Math.PI * 2 );
|
|
@@ -88,7 +90,7 @@ Menubar.Add = function ( editor ) {
|
|
|
|
|
|
var option = new UI.Row();
|
|
|
option.setClass( 'option' );
|
|
|
- option.setTextContent( 'Cylinder' );
|
|
|
+ option.setTextContent( strings.getKey( 'menubar/add/cylinder' ) );
|
|
|
option.onClick( function () {
|
|
|
|
|
|
var geometry = new THREE.CylinderBufferGeometry( 1, 1, 1, 8, 1, false, 0, Math.PI * 2 );
|
|
@@ -104,7 +106,7 @@ Menubar.Add = function ( editor ) {
|
|
|
|
|
|
var option = new UI.Row();
|
|
|
option.setClass( 'option' );
|
|
|
- option.setTextContent( 'Sphere' );
|
|
|
+ option.setTextContent( strings.getKey( 'menubar/add/sphere' ) );
|
|
|
option.onClick( function () {
|
|
|
|
|
|
var geometry = new THREE.SphereBufferGeometry( 1, 8, 6, 0, Math.PI * 2, 0, Math.PI );
|
|
@@ -120,7 +122,7 @@ Menubar.Add = function ( editor ) {
|
|
|
|
|
|
var option = new UI.Row();
|
|
|
option.setClass( 'option' );
|
|
|
- option.setTextContent( 'Icosahedron' );
|
|
|
+ option.setTextContent( strings.getKey( 'menubar/add/icosahedron' ) );
|
|
|
option.onClick( function () {
|
|
|
|
|
|
var geometry = new THREE.IcosahedronGeometry( 1, 0 );
|
|
@@ -136,7 +138,7 @@ Menubar.Add = function ( editor ) {
|
|
|
|
|
|
var option = new UI.Row();
|
|
|
option.setClass( 'option' );
|
|
|
- option.setTextContent( 'Torus' );
|
|
|
+ option.setTextContent( strings.getKey( 'menubar/add/torus' ) );
|
|
|
option.onClick( function () {
|
|
|
|
|
|
var geometry = new THREE.TorusBufferGeometry( 1, 0.4, 8, 6, Math.PI * 2 );
|
|
@@ -152,7 +154,7 @@ Menubar.Add = function ( editor ) {
|
|
|
|
|
|
var option = new UI.Row();
|
|
|
option.setClass( 'option' );
|
|
|
- option.setTextContent( 'TorusKnot' );
|
|
|
+ option.setTextContent( strings.getKey( 'menubar/add/torusknot' ) );
|
|
|
option.onClick( function () {
|
|
|
|
|
|
var geometry = new THREE.TorusKnotBufferGeometry( 1, 0.4, 64, 8, 2, 3 );
|
|
@@ -197,7 +199,7 @@ Menubar.Add = function ( editor ) {
|
|
|
|
|
|
var option = new UI.Row();
|
|
|
option.setClass( 'option' );
|
|
|
- option.setTextContent( 'Lathe' );
|
|
|
+ option.setTextContent( strings.getKey( 'menubar/add/lathe' ) );
|
|
|
option.onClick( function() {
|
|
|
|
|
|
var points = [
|
|
@@ -227,7 +229,7 @@ Menubar.Add = function ( editor ) {
|
|
|
|
|
|
var option = new UI.Row();
|
|
|
option.setClass( 'option' );
|
|
|
- option.setTextContent( 'Sprite' );
|
|
|
+ option.setTextContent( strings.getKey( 'menubar/add/sprite' ) );
|
|
|
option.onClick( function () {
|
|
|
|
|
|
var sprite = new THREE.Sprite( new THREE.SpriteMaterial() );
|
|
@@ -246,7 +248,7 @@ Menubar.Add = function ( editor ) {
|
|
|
|
|
|
var option = new UI.Row();
|
|
|
option.setClass( 'option' );
|
|
|
- option.setTextContent( 'PointLight' );
|
|
|
+ option.setTextContent( strings.getKey( 'menubar/add/pointlight' ) );
|
|
|
option.onClick( function () {
|
|
|
|
|
|
var color = 0xffffff;
|
|
@@ -265,7 +267,7 @@ Menubar.Add = function ( editor ) {
|
|
|
|
|
|
var option = new UI.Row();
|
|
|
option.setClass( 'option' );
|
|
|
- option.setTextContent( 'SpotLight' );
|
|
|
+ option.setTextContent( strings.getKey( 'menubar/add/spotlight' ) );
|
|
|
option.onClick( function () {
|
|
|
|
|
|
var color = 0xffffff;
|
|
@@ -289,7 +291,7 @@ Menubar.Add = function ( editor ) {
|
|
|
|
|
|
var option = new UI.Row();
|
|
|
option.setClass( 'option' );
|
|
|
- option.setTextContent( 'DirectionalLight' );
|
|
|
+ option.setTextContent( strings.getKey( 'menubar/add/directionallight' ) );
|
|
|
option.onClick( function () {
|
|
|
|
|
|
var color = 0xffffff;
|
|
@@ -310,7 +312,7 @@ Menubar.Add = function ( editor ) {
|
|
|
|
|
|
var option = new UI.Row();
|
|
|
option.setClass( 'option' );
|
|
|
- option.setTextContent( 'HemisphereLight' );
|
|
|
+ option.setTextContent( strings.getKey( 'menubar/add/hemispherelight' ) );
|
|
|
option.onClick( function () {
|
|
|
|
|
|
var skyColor = 0x00aaff;
|
|
@@ -331,7 +333,7 @@ Menubar.Add = function ( editor ) {
|
|
|
|
|
|
var option = new UI.Row();
|
|
|
option.setClass( 'option' );
|
|
|
- option.setTextContent( 'AmbientLight' );
|
|
|
+ option.setTextContent( strings.getKey( 'menubar/add/ambientlight' ) );
|
|
|
option.onClick( function() {
|
|
|
|
|
|
var color = 0x222222;
|
|
@@ -352,7 +354,7 @@ Menubar.Add = function ( editor ) {
|
|
|
|
|
|
var option = new UI.Row();
|
|
|
option.setClass( 'option' );
|
|
|
- option.setTextContent( 'PerspectiveCamera' );
|
|
|
+ option.setTextContent( strings.getKey( 'menubar/add/perspectivecamera' ) );
|
|
|
option.onClick( function() {
|
|
|
|
|
|
var camera = new THREE.PerspectiveCamera( 50, 1, 1, 10000 );
|