Ver Fonte

Skeleton of new controls panel

Tyler Lindberg há 7 anos atrás
pai
commit
d0063eea8d
4 ficheiros alterados com 40 adições e 2 exclusões
  1. 1 0
      editor/index.html
  2. 5 1
      editor/js/Config.js
  3. 32 0
      editor/js/Sidebar.Controls.js
  4. 2 1
      editor/js/Sidebar.js

+ 1 - 0
editor/index.html

@@ -127,6 +127,7 @@
 		<script src="js/Sidebar.Animation.js"></script>
 		<script src="js/Sidebar.Animation.js"></script>
 		<script src="js/Sidebar.Script.js"></script>
 		<script src="js/Sidebar.Script.js"></script>
 		<script src="js/Sidebar.History.js"></script>
 		<script src="js/Sidebar.History.js"></script>
+		<script src="js/Sidebar.Controls.js"></script>
 		<script src="js/Toolbar.js"></script>
 		<script src="js/Toolbar.js"></script>
 		<script src="js/Viewport.js"></script>
 		<script src="js/Viewport.js"></script>
 		<script src="js/Viewport.Info.js"></script>
 		<script src="js/Viewport.Info.js"></script>

+ 5 - 1
editor/js/Config.js

@@ -19,7 +19,11 @@ var Config = function ( name ) {
 
 
 		'project/vr': false,
 		'project/vr': false,
 
 
-		'settings/history': false
+		'settings/history': false,
+
+		'controls/translate': 'w',
+		'controls/rotate': 'r',
+		'controls/scale': 'w'
 	};
 	};
 
 
 	if ( window.localStorage[ name ] === undefined ) {
 	if ( window.localStorage[ name ] === undefined ) {

+ 32 - 0
editor/js/Sidebar.Controls.js

@@ -0,0 +1,32 @@
+/**
+ * @author TyLindberg / https://github.com/TyLindberg
+ */
+
+Sidebar.Controls = function ( editor ) {
+
+	var config = editor.config;
+	var signals = editor.signals;
+
+	var container = new UI.Panel();
+	container.setBorderTop( '0' );
+	container.setPaddingTop( '20px' );
+
+	container.add( new UI.Text( 'CONTROLS' ) );
+
+	var controlNames = [
+		'translate',
+		'rotate',
+		'scale'
+	];
+
+	// Create rows here
+
+	if ( config.getKey( 'controls/translate' ) !== undefined ) {
+
+
+
+	}
+
+	return container;
+
+};

+ 2 - 1
editor/js/Sidebar.js

@@ -41,7 +41,8 @@ var Sidebar = function ( editor ) {
 
 
 	var settings = new UI.Span().add(
 	var settings = new UI.Span().add(
 		new Sidebar.Settings( editor ),
 		new Sidebar.Settings( editor ),
-		new Sidebar.History( editor )
+		new Sidebar.History( editor ),
+		new Sidebar.Controls( editor )
 	);
 	);
 	container.add( settings );
 	container.add( settings );