瀏覽代碼

Editor.Config: Renamed project/history/stored to settings/history. False by default.

Mr.doob 9 年之前
父節點
當前提交
3d22076493
共有 3 個文件被更改,包括 9 次插入7 次删除
  1. 2 1
      editor/js/Config.js
  2. 2 2
      editor/js/History.js
  3. 5 4
      editor/js/Sidebar.History.js

+ 2 - 1
editor/js/Config.js

@@ -10,12 +10,13 @@ var Config = function () {
 		'autosave': true,
 		'autosave': true,
 		'theme': 'css/light.css',
 		'theme': 'css/light.css',
 
 
-		'project/history/stored': true,
 		'project/renderer': 'WebGLRenderer',
 		'project/renderer': 'WebGLRenderer',
 		'project/renderer/antialias': true,
 		'project/renderer/antialias': true,
 		'project/renderer/shadows': true,
 		'project/renderer/shadows': true,
 		'project/vr': false,
 		'project/vr': false,
 
 
+		'settings/history': false,
+
 		'ui/sidebar/animation/collapsed': true,
 		'ui/sidebar/animation/collapsed': true,
 		'ui/sidebar/geometry/collapsed': true,
 		'ui/sidebar/geometry/collapsed': true,
 		'ui/sidebar/history/collapsed': true,
 		'ui/sidebar/history/collapsed': true,

+ 2 - 2
editor/js/History.js

@@ -75,7 +75,7 @@ History.prototype = {
 		cmd.execute();
 		cmd.execute();
 		cmd.inMemory = true;
 		cmd.inMemory = true;
 
 
-		if ( this.config.getKey( 'project/history/stored' ) ) {
+		if ( this.config.getKey( 'settings/history' ) ) {
 
 
 			cmd.json = cmd.toJSON();	// serialize the cmd immediately after execution and append the json to the cmd
 			cmd.json = cmd.toJSON();	// serialize the cmd immediately after execution and append the json to the cmd
 
 
@@ -165,7 +165,7 @@ History.prototype = {
 		history.undos = [];
 		history.undos = [];
 		history.redos = [];
 		history.redos = [];
 
 
-		if ( ! this.config.getKey( 'project/history/stored' ) ) {
+		if ( ! this.config.getKey( 'settings/history' ) ) {
 
 
 			return history;
 			return history;
 
 

+ 5 - 4
editor/js/Sidebar.History.js

@@ -24,12 +24,13 @@ Sidebar.History = function ( editor ) {
 	// Checkbox 'Save History'
 	// Checkbox 'Save History'
 
 
 	var saveHistorySpan = new UI.Span().setPosition( 'absolute' ).setRight( '8px' );
 	var saveHistorySpan = new UI.Span().setPosition( 'absolute' ).setRight( '8px' );
-	var saveHistoryCheckbox = new UI.Checkbox( config.getKey( 'project/history/stored' ) ).onChange( function () {
+	var saveHistoryCheckbox = new UI.Checkbox( config.getKey( 'settings/history' ) ).onChange( function () {
 
 
-		config.setKey( 'project/history/stored', this.getValue() );
-		var saveHistory = this.getValue();
+		var value = this.getValue();
 
 
-		if ( saveHistory ) {
+		config.setKey( 'settings/history', value );
+
+		if ( value ) {
 
 
 			alert( 'The history will be preserved across sessions.\nThis can have an impact on performance when working with textures.' );
 			alert( 'The history will be preserved across sessions.\nThis can have an impact on performance when working with textures.' );