diff --git a/Assets/Scenes/Editor.unity b/Assets/Scenes/Editor.unity index 1cba2a066..de9394a6c 100644 --- a/Assets/Scenes/Editor.unity +++ b/Assets/Scenes/Editor.unity @@ -23600,7 +23600,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0.5} m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: -408.9795, y: -17} + m_AnchoredPosition: {x: -408.97943, y: -17} m_SizeDelta: {x: -817.96, y: -46.29} m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &1121370303 @@ -24767,7 +24767,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0.5} m_AnchorMax: {x: 1, y: 0.5} - m_AnchoredPosition: {x: 0, y: 105.87461} + m_AnchoredPosition: {x: 0, y: 103.926414} m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 1} --- !u!114 &1154875944 diff --git a/Assets/Scripts/AppInfo.cs b/Assets/Scripts/AppInfo.cs index f703a130b..9b8d250e7 100644 --- a/Assets/Scripts/AppInfo.cs +++ b/Assets/Scripts/AppInfo.cs @@ -1,8 +1,8 @@ using System; public static class AppInfo { - public const string Version = "0.0.1039"; - public static readonly DateTime Date = new DateTime(2023, 08, 11, 16, 44, 42, 336, DateTimeKind.Utc); + public const string Version = "0.0.1042"; + public static readonly DateTime Date = new DateTime(2023, 08, 14, 20, 40, 09, 178, DateTimeKind.Utc); } diff --git a/Assets/Scripts/WindowController.cs b/Assets/Scripts/WindowController.cs index f54792f86..f3b269d58 100644 --- a/Assets/Scripts/WindowController.cs +++ b/Assets/Scripts/WindowController.cs @@ -10,8 +10,11 @@ using Jukebox; using Jukebox.Legacy; using System; + using System.Runtime.InteropServices; + + namespace HeavenStudio { public class WindowController : MonoBehaviour @@ -47,11 +50,17 @@ namespace HeavenStudio here's a google doc with helpful sites(i think) for getting this working on mac https://docs.google.com/document/d/1mvHNNsXC6mo7PV6yZitpKam1fYnud7CXP73YLsebEo8/edit?usp=sharing good luck i cant figure this out + + update: just some default values for nscontroller or whatever it is: + + windowstyle is closable; resizable; tilted + nsbackthingy's default is buffer */ //Credit to Grizmu on the unity forums for this //DLL Stuff for windows #region WinDLLstuff + #if UNITY_STANDALONE_WIN const int SWP_HIDEWINDOW = 0x80; //idk why you would want this but here you go const int SWP_SHOWWINDOW = 0x40; //show window flag. const int SWP_NOMOVE = 0x0002; //don't move the window flag. idk why this either @@ -81,16 +90,28 @@ namespace HeavenStudio uint uFlags ); + System.IntPtr hWnd; + System.IntPtr HWND_TOP = new System.IntPtr(0); + System.IntPtr HWND_TOPMOST = new System.IntPtr(-1); + System.IntPtr HWND_NOTOPMOST = new System.IntPtr(-2); + + #endif + + public void SetPosition(System.IntPtr ptr, short x, short y, short resX, short resY) { if(!Application.isEditor && !Editor.Editor.instance.fullscreen && (pan != defaultPan | scale != defaultScale)) Reset(); if(Application.isEditor || !Editor.Editor.instance.fullscreen) return; + #if UNITY_STANDALONE_WIN SetWindowPos(ptr, HWND_NOTOPMOST, x, y, resX, resY, SWP_SHOWWINDOW); + #endif } - + private void Awake() { + #if UNITY_STANDALONE_WIN hWnd = GetActiveWindow(); + #endif AspectRatioWidth = Screen.mainWindowDisplayInfo.width; AspectRatioHeight = Screen.mainWindowDisplayInfo.height; defaultScale = new Vector3(Screen.width, Screen.height, 0); @@ -98,10 +119,7 @@ namespace HeavenStudio instance = this; } - System.IntPtr hWnd; - System.IntPtr HWND_TOP = new System.IntPtr(0); - System.IntPtr HWND_TOPMOST = new System.IntPtr(-1); - System.IntPtr HWND_NOTOPMOST = new System.IntPtr(-2); + #endregion @@ -145,9 +163,9 @@ namespace HeavenStudio UpdatePan(); //SetShakeIntensity(); - + #if UNITY_STANDALONE_WIN SetPosition(hWnd, Convert.ToInt16(pan.x), Convert.ToInt16(pan.y), Convert.ToInt16(scale.x), Convert.ToInt16(scale.y)); - //SetPosition(hWnd, Convert.ToInt16(pan.x + shakeResult.x), Convert.ToInt16(pan.y + shakeResult.y), Convert.ToInt16(scale.x), Convert.ToInt16(scale.y)); + #endif } private void UpdatePan() @@ -257,7 +275,9 @@ namespace HeavenStudio scale = defaultScale; shakeResult = defaultShake; if(Application.isEditor) return; + #if UNITY_STANDALONE_WIN SetWindowPos(hWnd, HWND_NOTOPMOST, Convert.ToInt16(pan.x), Convert.ToInt16(pan.y), Convert.ToInt16(scale.x), Convert.ToInt16(scale.y), SWP_SHOWWINDOW); + #endif } } } \ No newline at end of file diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index 7b6930eac..a762db3e9 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -134,7 +134,7 @@ PlayerSettings: 16:10: 1 16:9: 1 Others: 1 - bundleVersion: 0.0.1039 + bundleVersion: 0.0.1042 preloadedAssets: - {fileID: 102900000, guid: 5348c08b82446e0478cee8bda6c02cfc, type: 3} metroInputSource: 0 @@ -158,11 +158,11 @@ PlayerSettings: applicationIdentifier: Standalone: com.RHeavenStudio.Heaven-Studio buildNumber: - Standalone: 1039 + Standalone: 1042 iPhone: 0 tvOS: 0 overrideDefaultApplicationIdentifier: 0 - AndroidBundleVersionCode: 1039 + AndroidBundleVersionCode: 1042 AndroidMinSdkVersion: 22 AndroidTargetSdkVersion: 0 AndroidPreferredInstallLocation: 1