Pārlūkot izejas kodu

Squashed 'src/ted2go/' changes from c86245062..55e2f9cd4

55e2f9cd4 More SiblyMode tweaks.
d5b45b53f Added Prefs.SiblyMode!

git-subtree-dir: src/ted2go
git-subtree-split: 55e2f9cd4345e4752ca6200307ae9559b5e0b009
Mark Sibly 8 gadi atpakaļ
vecāks
revīzija
138d19a5f0

+ 4 - 0
MainWindow.monkey2

@@ -625,6 +625,8 @@ Class MainWindowInstance Extends Window
 	End
 	
 	Method StoreConsoleVisibility()
+	
+		If Prefs.SiblyMode return
 		
 		_storedConsoleVisible=_consolesTabView.Visible
 		_consoleVisibleCounter=0
@@ -632,6 +634,8 @@ Class MainWindowInstance Extends Window
 	
 	Method RestoreConsoleVisibility()
 	
+		If Prefs.SiblyMode Return
+	
 		If _consoleVisibleCounter > 0 Return
 		_consolesTabView.Visible=_storedConsoleVisible
 		RequestRender()

+ 10 - 4
Prefs.monkey2

@@ -41,6 +41,8 @@ Class PrefsInstance
 	'
 	Field MonkeyRootPath:String
 	Field IdeHomeDir:String
+	'	
+	Field SiblyMode:Bool
 	
 	Property FindFilesFilter:String()
 		Return _findFilter
@@ -108,6 +110,12 @@ Class PrefsInstance
 			SourceShowInherited=j2["showInherited"].ToBool()
 			
 		Endif
+		
+		If json.Contains( "siblyMode" )
+		
+			SiblyMode=json["siblyMode"].ToBool()
+		End
+	
 	End
 	
 	Method SaveState( json:JsonObject )
@@ -154,6 +162,8 @@ Class PrefsInstance
 		j["sortByType"]=New JsonBool( SourceSortByType )
 		j["showInherited"]=New JsonBool( SourceShowInherited )
 		
+		If SiblyMode json["siblyMode"]=JsonBool.TrueValue
+		
 	End
 	
 	Method LoadLocalState()
@@ -199,12 +209,8 @@ Class PrefsInstance
 		Return Max( EditorFontSize,6 ) '6 is a minimum
 	End
 	
-	
 	Private 
 	
 	Field _findFilter:String
 	
 End
-
-
-

+ 2 - 2
action/BuildActions.monkey2

@@ -100,7 +100,7 @@ Class BuildActions Implements IModuleBuilder
 		semant.Triggered=OnSemant
 		
 		
-		buildSettings=New Action( "Target settings..." )
+		buildSettings=New Action( "Product settings..." )
 		buildSettings.Triggered=OnBuildFileSettings
 		
 		nextError=New Action( "Next build error" )
@@ -150,7 +150,7 @@ Class BuildActions Implements IModuleBuilder
 		_iosTarget=New CheckButton( "iOS",,group )
 		_iosTarget.Layout="fill-x"
 		
-		targetMenu=New MenuExt( "Build variants" )
+		targetMenu=New MenuExt( "Build target" )
 		targetMenu.AddView( _debugConfig )
 		targetMenu.AddView( _releaseConfig )
 		targetMenu.AddSeparator()

+ 5 - 2
dialog/FindDialog.monkey2

@@ -17,7 +17,9 @@ Class FindDialog Extends DialogExt
 			
 			Local t:=_findField.Text
 			If t.Length > 1
-				actions.FindByTextChanged( EntireProject )
+				If Not Prefs.SiblyMode			
+					actions.FindByTextChanged( EntireProject )
+				Endif
 			Endif
 		End
 
@@ -91,8 +93,9 @@ Class FindDialog Extends DialogExt
 	End
 	
 	Method SetInitialText( find:String )
-		
+If Not Prefs.SiblyMode
 		_findField.Text=find
+Endif
 		_findField.SelectAll()
 	End
 	

+ 1 - 1
document/SceneDocument.monkey2

@@ -81,7 +81,7 @@ Class SceneDocumentView Extends View
 				_doc.Camera.Position=New Vec3f(0,0,-2.5)
 				_doc.Model.Rotation=New Vec3f(0,0,0)
 			Case Key.S
-				_doc.Light.ShadowsEnabled=Not _doc.Light.ShadowsEnabled
+				_doc.Light.CastsShadow=Not _doc.Light.CastsShadow
 			Case Key.A
 				
 			End

+ 20 - 6
view/MenuExt.monkey2

@@ -1,7 +1,6 @@
 
 Namespace ted2go
 
-
 Class MenuExt Extends DockingView
 
 	#rem monkeydoc Creates a new menu.
@@ -79,7 +78,9 @@ Class MenuExt Extends DockingView
 		
 		button.Clicked=Lambda()
 			If menu.Visible
-				menu.Close()
+				If Not Prefs.SiblyMode
+					menu.Close()
+				Endif
 			Else
 				Local location:=New Vec2i( button.Bounds.Right,button.Bounds.Top )
 				menu.Open( location,button,Self )
@@ -180,15 +181,28 @@ Class MenuExt Extends DockingView
 					'
 					If view=_hovered Return
 					_hovered=view
-					Local sub:=menu._subs[view]
 					If _timer Then _timer.Cancel()
-					If _sub And menu<>_sub
-						_sub.Close()
-						_sub=Null
+					
+					Local sub:=menu._subs[view]
+					
+					If Not Prefs.SiblyMode
+						If _sub And menu<>_sub
+							_sub.Close()
+							_sub=Null
+						Endif
 					Endif
+					
 					If sub
 						_timer=New Timer( 1.8,Lambda()
 							Local location:=New Vec2i( view.Bounds.Right,view.Bounds.Top )
+							
+							If Prefs.SiblyMode
+								If _sub And menu<>_sub
+									_sub.Close()
+									_sub=Null
+								Endif
+							Endif
+							
 							If sub.Visible Then sub.Close()
 							sub.Open( location,view,menu )
 							_sub=sub

+ 13 - 3
view/ProjectView.monkey2

@@ -54,11 +54,21 @@ Class ProjectView Extends ScrollView
 			
 		End
 		
-		browser.FileDoubleClicked+=Lambda( path:String )
+		If Prefs.SiblyMode
 		
-			OnOpenDocument( path )
+			browser.FileClicked+=Lambda( path:String )
+			
+				OnOpenDocument( path )
+			End
 		
-		End
+		Else 
+		
+			browser.FileDoubleClicked+=Lambda( path:String )
+			
+				OnOpenDocument( path )
+			End
+		
+		Endif
 		
 		browser.FileRightClicked+=Lambda( path:String )