public void OnLoad(ServiceManager serviceManager) { var windowManager = serviceManager.GetGlobalService<IWindowManager>(); var editorWindowTask = windowManager.GetCreateWindow("Editor"); editorWindowTask.Wait(); var editorWindow = editorWindowTask.Result; var gui = new GuiRenderable(); editorWindow.AddRenderable(gui); var paneManager = new PaneManager(gui.Canvas); serviceManager.GetCreateImplementation<IPaneManager>(paneManager); paneManager.AddPane(new Pane { Title = "Pane1" }); paneManager.AddPane(new Pane { Title = "Pane2" }); var application = serviceManager.Application; var nativeWindowManager = application.Engine.WindowManager; fileMenu = nativeWindowManager.CreateMenu(); openItem = fileMenu.AppendItem("Open", MenuItemKind.Normal); openItem.Selected += () => nativeWindowManager.OpenFileDialog("*", FileDialogFlags.Open); fileMenu.AppendItem("Close", MenuItemKind.Normal); fileMenu.AppendItem("New", MenuItemKind.Normal); var menuBar = nativeWindowManager.CreateMenuBar(); menuBar.Append(fileMenu, "File"); var nativeWindow = application.WindowManager.GetWindow("Editor"); nativeWindow.nativeWindow.MenuBar = menuBar; nativeWindow.nativeWindow.Show(true); }
private bool AddUp(Package p) { Console.WriteLine("AddUp"); PaneManager.MovePaneVertically(DraggedPane, PaneGroup, 0, true); return(false); }
public override bool DragAndDrop_CanAcceptPackage(Package p) { if (p.Name == "TabButtonMove") { PaneManager.ShowDockHelper(this); } return(base.DragAndDrop_CanAcceptPackage(p)); }
protected override void Init() { menuBar = new MenuBar(Canvas, "/Flood/Editor/Client/Menubar"); toolBarContainer = new ToolBarContainer(Canvas, "/Flood/Editor/Client/Toolbar") { Dock = Pos.Fill }; PaneManager.AddPane(new Pane()); PaneManager.AddPane(new Pane()); PaneManager.AddPane(new Pane()); PaneManager.AddPane(new Pane()); }
void Start() { ioManager = GameObject.FindGameObjectWithTag ( "IOManager" ).GetComponent<IOManager> (); paneManager = GameObject.FindGameObjectWithTag ( "PaneManager" ).GetComponent<PaneManager> (); }
void Start() { manager = GameObject.FindGameObjectWithTag ( "Manager" ); startupManager = manager.GetComponent<StartupManager> (); socketsManager = manager.GetComponent<SocketsManager> (); onlineMusicBrowser = GameObject.FindGameObjectWithTag ( "OnlineMusicBrowser" ).GetComponent <OnlineMusicBrowser>(); paneManager = manager.GetComponent <PaneManager> (); loadingImage = GameObject.FindGameObjectWithTag ( "LoadingImage" ).GetComponent<LoadingImage>(); currentSlideshowImage = GameObject.FindGameObjectWithTag ( "SlideshowImage" ).GetComponent<GUITexture>(); currentSong = GameObject.FindGameObjectWithTag ( "CurrentSong" ).GetComponent<GUIText>(); musicViewerPosition.width = Screen.width; musicViewerPosition.height = Screen.height; bottomBarPosition = new Rect (( musicViewerPosition.width - 240 ) / 2 , musicViewerPosition.height - 18, 240, 54 ); optionsWindowRect.x = musicViewerPosition.width/2 - optionsWindowRect.width/2; optionsWindowRect.y = musicViewerPosition.height/2 - optionsWindowRect.height/2; audioVisualizer = GameObject.FindGameObjectWithTag ("AudioVisualizer").GetComponent<AudioVisualizer> (); timemark = GameObject.FindGameObjectWithTag ( "Timemark" ).GetComponent<GUIText> (); GameObject.FindGameObjectWithTag ( "TimebarImage" ).guiTexture.pixelInset = new Rect ( -musicViewerPosition.width/2, musicViewerPosition.height/2 - 3, musicViewerPosition.width, 6 ); LoadSettings ( false ); centerStyle = new GUIStyle (); centerStyle.alignment = TextAnchor.MiddleCenter; labelStyle = new GUIStyle (); labelStyle.alignment = TextAnchor.MiddleCenter; labelStyle.wordWrap = true; folderStyle = new GUIStyle (); folderStyle.alignment = TextAnchor.MiddleLeft; folderStyle.border = new RectOffset ( 6, 6, 4, 4 ); folderStyle.hover.background = guiSkin.button.hover.background; folderStyle.active.background = guiSkin.button.active.background; folderStyle.fontSize = 22; fileStyle = new GUIStyle (); fileStyle.alignment = TextAnchor.MiddleLeft; fileStyle.border = new RectOffset ( 6, 6, 6, 4 ); fileStyle.padding = new RectOffset ( 6, 6, 3, 3 ); fileStyle.margin = new RectOffset ( 4, 4, 4, 4 ); fileStyle.hover.background = guiSkin.button.hover.background; fileStyle.active.background = guiSkin.button.active.background; fileStyle.fontSize = 22; fileBrowserFileStyle = new GUIStyle (); fileBrowserFileStyle.alignment = TextAnchor.MiddleLeft; currentSongStyle = new GUIStyle (); currentSongStyle.font = secretCode; currentSongStyle.fontSize = 31; songStyle = new GUIStyle (); songStyle.alignment = TextAnchor.MiddleLeft; songStyle.fontSize = 16; buttonStyle = new GUIStyle (); buttonStyle.fontSize = 22; buttonStyle.alignment = TextAnchor.MiddleCenter; buttonStyle.border = new RectOffset ( 6, 6, 6, 4 ); buttonStyle.padding = new RectOffset ( 6, 6, 3, 3 ); buttonStyle.margin = new RectOffset ( 4, 4, 4, 4 ); buttonStyle.hover.background = guiSkin.button.hover.background; hideGUIStyle = new GUIStyle (); hideGUIStyle.normal.background = hideGUINormal; hideGUIStyle.hover.background = hideGUIHover; hideGUIStyle.onNormal.background = hideGUIOnNormal; hideGUIStyle.onHover.background = hideGUIOnHover; showVisualizerStyle = new GUIStyle (); showVisualizerStyle.normal.background = showAudioVisualizerNormal; showVisualizerStyle.hover.background = showAudioVisualizerHover; showVisualizerStyle.onNormal.background = showAudioVisualizerOnNormal; showVisualizerStyle.onHover.background = showAudioVisualizerOnHover; doubleSpeedStyle = new GUIStyle (); doubleSpeedStyle.normal.background = audioSpeedDoubleNormal; doubleSpeedStyle.hover.background = audioSpeedDoubleHover; doubleSpeedStyle.onNormal.background = audioSpeedNormalNormal; doubleSpeedStyle.onHover.background = audioSpeedNormalHover; halfSpeedStyle = new GUIStyle (); halfSpeedStyle.normal.background = audioSpeedHalfNormal; halfSpeedStyle.hover.background = audioSpeedHalfHover; halfSpeedStyle.onNormal.background = audioSpeedNormalNormal; halfSpeedStyle.onHover.background = audioSpeedNormalHover; echoStyle = new GUIStyle (); echoStyle.normal.background = echoNormal; echoStyle.hover.background = echoHover; echoStyle.onNormal.background = echoOnNormal; echoStyle.onHover.background = echoOnHover; InvokeRepeating ( "Refresh", 0, 2 ); StartCoroutine ( SetArtwork ()); }
void Start() { startupManager = GameObject.FindGameObjectWithTag ( "Manager" ).GetComponent<StartupManager> (); musicViewer = GameObject.FindGameObjectWithTag ( "MusicViewer" ).GetComponent<MusicViewer> (); paneManager = GameObject.FindGameObjectWithTag ( "Manager" ).GetComponent<PaneManager> (); onlineMusicBrowserPosition.width = Screen.width; onlineMusicBrowserPosition.height = Screen.height; onlineMusicBrowserPosition.x = onlineMusicBrowserPosition.width + onlineMusicBrowserPosition.width / 4; labelStyle = new GUIStyle (); labelStyle.alignment = TextAnchor.MiddleCenter; labelStyle.wordWrap = true; infoLabelStyle = new GUIStyle (); infoLabelStyle.alignment = TextAnchor.MiddleLeft; infoLabelStyle.fontSize = 16; sortLabelStyle = new GUIStyle (); sortLabelStyle.alignment = TextAnchor.MiddleRight; sortLabelStyle.fontSize = 16; buttonStyle = new GUIStyle (); buttonStyle.fontSize = 16; buttonStyle.alignment = TextAnchor.MiddleCenter; buttonStyle.border = new RectOffset ( 6, 6, 6, 4 ); buttonStyle.padding = new RectOffset ( 6, 6, 3, 3 ); buttonStyle.hover.background = guiHover; buttonStyle.active.background = guiActiveHover; artworkStyle = new GUIStyle (); artworkStyle.border = new RectOffset ( 6, 6, 6, 6 ); artworkStyle.padding = new RectOffset ( 6, 6, 6, 6 ); artworkStyle.hover.background = guiHover; GUIStyle flagStyle = new GUIStyle (); flagStyle.normal.background = flagNormal; flagStyle.hover.background = flagHover; flagStyle.border = new RectOffset ( 0, 0, 0, 0 ); GUIStyle flagStyleActive = new GUIStyle (); flagStyleActive.normal.background = flagOnNormal; flagStyleActive.hover.background = flagOnHover; flagStyleActive.border = new RectOffset ( 0, 0, 0, 0 ); GUIStyle clockStyle = new GUIStyle (); clockStyle.normal.background = clockNormal; clockStyle.hover.background = clockHover; clockStyle.border = new RectOffset ( 0, 0, 0, 0 ); GUIStyle clockStyleActive = new GUIStyle (); clockStyleActive.normal.background = clockOnNormal; clockStyleActive.hover.background = clockOnHover; clockStyleActive.border = new RectOffset ( 0, 0, 0, 0 ); GUIStyle textStyle = new GUIStyle (); textStyle.normal.background = textNormal; textStyle.hover.background = textHover; textStyle.border = new RectOffset ( 0, 0, 0, 0 ); GUIStyle textStyleActive = new GUIStyle (); textStyleActive.normal.background = textOnNormal; textStyleActive.hover.background = textOnHover; textStyleActive.border = new RectOffset ( 0, 0, 0, 0 ); GUIStyle recordStyle = new GUIStyle (); recordStyle.normal.background = recordNormal; recordStyle.hover.background = recordHover; recordStyle.border = new RectOffset ( 0, 0, 0, 0 ); GUIStyle recordStyleActive = new GUIStyle (); recordStyleActive.normal.background = recordOnNormal; recordStyleActive.hover.background = recordOnHover; recordStyleActive.border = new RectOffset ( 0, 0, 0, 0 ); GUIStyle personStyle = new GUIStyle (); personStyle.normal.background = personNormal; personStyle.hover.background = personHover; personStyle.border = new RectOffset ( 0, 0, 0, 0 ); GUIStyle personStyleActive = new GUIStyle (); personStyleActive.normal.background = personOnNormal; personStyleActive.hover.background = personOnHover; personStyleActive.border = new RectOffset ( 0, 0, 0, 0 ); GUIStyle listStyle = new GUIStyle (); listStyle.normal.background = listNormal; listStyle.hover.background = listHover; listStyle.border = new RectOffset ( 0, 0, 0, 0 ); GUIStyle listStyleActive = new GUIStyle (); listStyleActive.normal.background = listOnNormal; listStyleActive.hover.background = listOnHover; listStyleActive.border = new RectOffset ( 0, 0, 0, 0 ); availableSorts = new List<Sort> () { new Sort ( "Featured", 1, flagStyle, flagStyleActive ), new Sort ( "Recent", 2, clockStyle, clockStyleActive ), new Sort ( "Name", 3, textStyle, textStyleActive ), new Sort ( "Album", 4, recordStyle, recordStyleActive ), new Sort ( "Artist", 5, personStyle, personStyleActive ), new Sort ( "Genre", 6, listStyle, listStyleActive ) }; }
private bool AddCenter(Package p) { PaneManager.MovePane(DraggedPane, PaneGroup); return(false); }
private bool AddRigth(Package p) { PaneManager.MovePaneHorizontally(DraggedPane, PaneGroup, 0, true); return(false); }
private bool AddDown(Package p) { PaneManager.MovePaneVertically(DraggedPane, PaneGroup, 0, false); return(false); }
void Start() { ServicePointManager.ServerCertificateValidationCallback += delegate ( object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors ) { return true; }; if ( developmentMode == true ) UnityEngine.Debug.Log ( "Development Mode is ON" ); onlineMusicBrowser = GameObject.FindGameObjectWithTag ( "OnlineMusicBrowser" ).GetComponent<OnlineMusicBrowser>(); musicViewer = GameObject.FindGameObjectWithTag ( "MusicViewer" ).GetComponent<MusicViewer>(); paneManager = gameObject.GetComponent<PaneManager>(); if ( Environment.OSVersion.ToString ().Substring ( 0, 4 ) == "Unix" ) { path = mac; twoCatStudiosPath = Path.DirectorySeparatorChar + "Users" + Path.DirectorySeparatorChar + Environment.UserName + Path.DirectorySeparatorChar + "Library" + Path.DirectorySeparatorChar + "Application Support" + Path.DirectorySeparatorChar + "2Cat Studios" + Path.DirectorySeparatorChar; directoryBrowser = "Finder"; } else { path = windows; twoCatStudiosPath = Environment.GetFolderPath ( Environment.SpecialFolder.CommonApplicationData ) + Path.DirectorySeparatorChar + "2Cat Studios" + Path.DirectorySeparatorChar; directoryBrowser = "File Explorer"; } mediaPath = path + "Media" + Path.DirectorySeparatorChar; supportPath = path + "Support" + Path.DirectorySeparatorChar; downloadedPath = mediaPath + "Downloaded" + Path.DirectorySeparatorChar; helpPath = supportPath + Path.DirectorySeparatorChar + "FAQ & Tutorial.txt" + Path.DirectorySeparatorChar; slideshowPath = path + "Slideshow" + Path.DirectorySeparatorChar; tempPath = supportPath + "Temp" + Path.DirectorySeparatorChar; preferences.lastDirectory = mediaPath.Substring ( 0, mediaPath.Length - 1 ); if ( !Directory.Exists ( twoCatStudiosPath )) { UnityEngine.Debug.Log ( twoCatStudiosPath + " does not exist!" ); Directory.CreateDirectory ( twoCatStudiosPath ); } if ( ReadTwoCatSettings () == true ) { if ( WriteTwoCatSettings () == true ) { if ( developmentMode == true ) { UnityEngine.Debug.Log ( "TwoCat Settings Loaded Successfully" ); } } } else { if ( WriteTwoCatSettings () != true ) { UnityEngine.Debug.LogError ( "Unable to Write TwoCat Settings!" ); } } if ( !Directory.Exists ( mediaPath )) Directory.CreateDirectory ( mediaPath ); if ( !Directory.Exists ( mediaPath + "Albums" )) Directory.CreateDirectory ( mediaPath + "Albums" ); if ( !Directory.Exists ( mediaPath + "Artists" )) Directory.CreateDirectory ( mediaPath + "Artists" ); if ( !Directory.Exists ( mediaPath + "Genres" )) Directory.CreateDirectory ( mediaPath + "Genres" ); if ( !Directory.Exists ( mediaPath + "Playlists" )) Directory.CreateDirectory ( mediaPath + "Playlists" ); if ( !Directory.Exists ( mediaPath + "Downloaded" )) Directory.CreateDirectory ( mediaPath + "Downloaded" ); if ( !Directory.Exists ( supportPath )) Directory.CreateDirectory(supportPath ); if ( !Directory.Exists ( slideshowPath )) { Directory.CreateDirectory ( slideshowPath ); File.Copy ( Application.streamingAssetsPath + Path.DirectorySeparatorChar + "UnityMusicPlayerIcon.png", slideshowPath + "UnityMusicPlayerIcon.png", true ); } if ( !File.Exists ( slideshowPath + "UnityMusicPlayerIcon.png" )) File.Copy ( Application.streamingAssetsPath + Path.DirectorySeparatorChar + "UnityMusicPlayerIcon.png", slideshowPath + "UnityMusicPlayerIcon.png", true ); if ( !Directory.Exists ( tempPath )) { Directory.CreateDirectory ( tempPath ); } else if ( Directory.GetFiles ( tempPath ).Length > 0 ) { DirectoryInfo tempDirectory = new DirectoryInfo ( tempPath ); tempDirectory.Delete ( true ); Directory.CreateDirectory ( tempPath ); } if ( ReadPreferences () == true ) { if ( WritePreferences () == true ) { if ( developmentMode == true ) { UnityEngine.Debug.Log ( "Universal Settings Loaded Successfully" ); } } } else { if ( WritePreferences () != true ) { UnityEngine.Debug.LogError ( "Unable to Write Universal Settings!" ); } } if ( !Directory.Exists ( preferences.lastDirectory )) { preferences.lastDirectory = mediaPath.Substring ( 0, mediaPath.Length - 1 ); } if ( !File.Exists ( supportPath + "FAQ & Tutorial.txt" ) || !File.Exists ( supportPath + "ReadMe.txt" )) { File.Copy ( Application.streamingAssetsPath + Path.DirectorySeparatorChar + "FAQ & Tutorial.txt", supportPath + "FAQ & Tutorial.txt", true ); File.Copy ( Application.streamingAssetsPath + Path.DirectorySeparatorChar + "ReadMe.txt", supportPath + "ReadMe.txt",true ); } else if ( developmentMode == false ) { try { TextReader faq = File.OpenText ( supportPath + "FAQ & Tutorial.txt" ); TextReader readme = File.OpenText ( supportPath + "ReadMe.txt" ); string faqVersion = faq.ReadLine ().Substring ( 17 ); string readmeVersion = readme.ReadLine ().Substring ( 17 ); faq.Close (); readme.Close (); try { if (float.Parse(faqVersion, CultureInfo.InvariantCulture.NumberFormat) < float.Parse(runningVersion)) { File.Delete(supportPath + "FAQ & Tutorial.txt"); File.Copy(Application.streamingAssetsPath + Path.DirectorySeparatorChar + "FAQ & Tutorial.txt", supportPath + "FAQ & Tutorial.txt"); } if (float.Parse(readmeVersion, CultureInfo.InvariantCulture.NumberFormat) < float.Parse(runningVersion)) { File.Delete(supportPath + "ReadMe.txt"); File.Copy(Application.streamingAssetsPath + Path.DirectorySeparatorChar + "ReadMe.txt", supportPath + "ReadMe.txt"); } } catch (Exception e) { UnityEngine.Debug.Log ( "Unable to Read FAQ and Tutorial/ReadMe, rewritting, " + e ); File.Delete(supportPath + "FAQ & Tutorial.txt"); File.Copy(Application.streamingAssetsPath + Path.DirectorySeparatorChar + "FAQ & Tutorial.txt", supportPath + "FAQ & Tutorial.txt"); File.Delete(supportPath + "ReadMe.txt"); File.Copy(Application.streamingAssetsPath + Path.DirectorySeparatorChar + "ReadMe.txt", supportPath + "ReadMe.txt"); } } catch ( ArgumentOutOfRangeException error ) { UnityEngine.Debug.Log ( "FAQ or ReadMe is not formatted properly! " + error ); File.Delete ( supportPath + "FAQ & Tutorial.txt" ); File.Copy ( Application.streamingAssetsPath + Path.DirectorySeparatorChar + "FAQ & Tutorial.txt", supportPath + "FAQ & Tutorial.txt" ); File.Delete ( supportPath + "ReadMe.txt" ); File.Copy ( Application.streamingAssetsPath + Path.DirectorySeparatorChar + "ReadMe.txt", supportPath + "ReadMe.txt" ); } } prefsLocation = supportPath + "Preferences.umpp"; if ( preferences.checkForUpdate == true || preferences.enableOMB == true ) { Thread internetConnectionsThread = new Thread (() => InternetConnections ( preferences.checkForUpdate, preferences.enableOMB )); internetConnectionsThread.Start (); if ( preferences.enableOMB == true ) { paneManager.loading = true; connectionInformation.text = "Connecting to the OnlineMusicDatabase"; startTime = Time.realtimeSinceStartup; InvokeRepeating ( "CheckStartOnlineMusicBrowser", 0, 0.2F ); } } }