internal static void LoadMainWindowStyleInState(EditorFullscreenState.WindowFullscreenState fullscreenState, bool makeResizable) { var windowHandle = GetProcessMainWindow(); if (fullscreenState != null && windowHandle != IntPtr.Zero) { var setStyle = makeResizable ? (uint)fullscreenState.OriginalStyle | WS_SIZEBOX : (uint)fullscreenState.OriginalStyle; SetWindowLongPtr(windowHandle, GWL_STYLE, (IntPtr)(setStyle)); //Always make resizable when reloading style. LogWin32Error("Error setting main window style"); SetWindowLongPtr(windowHandle, GWL_EXSTYLE, (IntPtr)fullscreenState.OriginalExStyle); LogWin32Error("Error setting main window ex style"); SetWindowPos(windowHandle, IntPtr.Zero, 0, 0, 0, 0, SWP.NOZORDER | SWP.FRAMECHANGED | SWP.NOACTIVATE | SWP.NOMOVE | SWP.NOSIZE); if (EWFDebugging.Enabled) { EWFDebugging.LogLine("Loaded Main Window Style: " + WindowStyleToString((IntPtr)fullscreenState.OriginalStyle)); EWFDebugging.LogLine("Loaded Main Window ExStyle: " + WindowExStyleToString((IntPtr)fullscreenState.OriginalExStyle)); } } }
internal static void SaveMainWindowStyleInState(EditorFullscreenState.WindowFullscreenState fullscreenState) { var windowHandle = GetProcessMainWindow(); if (fullscreenState != null && windowHandle != IntPtr.Zero) { var existingStyle = GetWindowLongPtr(windowHandle, GWL_STYLE); LogWin32Error("Error getting main window style"); var existingExStyle = GetWindowLongPtr(windowHandle, GWL_EXSTYLE); LogWin32Error("Error getting main window ex style"); fullscreenState.OriginalStyle = (int)existingStyle; fullscreenState.OriginalExStyle = (int)existingExStyle; if (EWFDebugging.Enabled) { EWFDebugging.LogLine("Saved Main Window Style: " + WindowStyleToString(existingStyle)); EWFDebugging.LogLine("Saved Main Window ExStyle: " + WindowExStyleToString(existingExStyle)); } } }
internal static void SaveMainWindowStyleInState(EditorFullscreenState.WindowFullscreenState fullscreenState) { WindowsDisplay.SaveMainWindowStyleInState(fullscreenState); }
internal static void LoadMainWindowStyleInState(EditorFullscreenState.WindowFullscreenState fullscreenState, bool makeResizable) { WindowsDisplay.LoadMainWindowStyleInState(fullscreenState, makeResizable); }
static void OnFullscreenEvent(object window, Type windowType, Vector2 atPosition, bool enteredFullscreen) { if (enteredFullscreen) { lastFullscreenedWindowType = windowType; } bool toggledTopToolbar = false; if (window != null || windowType == EditorFullscreenState.MainWindowType) { EditorFullscreenState.WindowFullscreenState state = null; if (windowType == EditorFullscreenState.MainWindowType) { state = EditorFullscreenState.FindWindowState(null, windowType); } else if (window != null) { state = EditorFullscreenState.FindWindowState((EditorWindow)window); } if (state != null) { var fullscreenOps = state.FullscreenOptions; toggledTopToolbar = fullscreenOps != null && state.ShowTopToolbar != fullscreenOps.showToolbarByDefault; } } var character = DemoCharacter.instance; bool completedRoom = false; int currentRoom = character.enteredRooms.Count; switch (currentRoom) { case 1: if (windowType == EditorFullscreenState.MainWindowType && enteredFullscreen) { completedRoom = true; } break; case 2: if (windowType == EditorFullscreenState.GameViewType && enteredFullscreen) { completedRoom = true; } break; case 3: if (DemoCharacter.hints[2].Contains("ANOTHER")) { //Must have game view fullscreen and open fullscreens scene view on another screen. bool gameViewIsFullscreen = EditorFullscreenController.WindowTypeIsFullscreen(EditorFullscreenState.GameViewType); bool sceneViewIsFullscreen = EditorFullscreenController.WindowTypeIsFullscreen(EditorFullscreenState.SceneViewType); if (enteredFullscreen && gameViewIsFullscreen && sceneViewIsFullscreen && (windowType == EditorFullscreenState.GameViewType || windowType == EditorFullscreenState.SceneViewType)) { completedRoom = true; } } else { //Only have to open the scene view. if (windowType == EditorFullscreenState.SceneViewType && enteredFullscreen) { completedRoom = true; } } break; case 4: if (windowType == EditorFullscreenState.GameViewType && toggledTopToolbar) { completedRoom = true; } if (completedRoom || DemoCharacter.completedRooms == 4) { if (CompletedHint5() == true) { character.CompleteRoom(5, true); } } break; case 5: if (CompletedHint5() == true) { completedRoom = true; //Must have closed the window covering the main window. } break; case 8: if (enteredFullscreen && windowType == null) //windowType is null when closing all fullscreen editor windows. In this case enteredFullscreen is true if at least one fullscreen window was closed. { completedRoom = true; } break; case 9: if (!enteredFullscreen && windowType == typeof(EditorFullscreenSettingsWindow)) { completedRoom = true; } break; } if (completedRoom) { character.CompleteRoom(currentRoom); } }