From 21083f89057b4d14e6358ce5048d271417366acc Mon Sep 17 00:00:00 2001 From: xxSeys1 Date: Thu, 17 Oct 2024 19:24:38 +0200 Subject: [PATCH 01/10] expand play mode game panel focus options --- Source/Editor/Modules/SimulationModule.cs | 39 ++++++++-- Source/Editor/Options/InterfaceOptions.cs | 29 ++++++- Source/Editor/Windows/GameWindow.cs | 93 +++++++++++++++++++++-- 3 files changed, 143 insertions(+), 18 deletions(-) diff --git a/Source/Editor/Modules/SimulationModule.cs b/Source/Editor/Modules/SimulationModule.cs index 6f54ab10d..dd83d7553 100644 --- a/Source/Editor/Modules/SimulationModule.cs +++ b/Source/Editor/Modules/SimulationModule.cs @@ -2,6 +2,7 @@ using System; using System.Threading; +using FlaxEditor.GUI.Docking; using FlaxEditor.States; using FlaxEditor.Windows; using FlaxEngine; @@ -20,6 +21,7 @@ namespace FlaxEditor.Modules private bool _updateOrFixedUpdateWasCalled; private long _breakpointHangFlag; private EditorWindow _enterPlayFocusedWindow; + private DockWindow _previousWindow; private Guid[] _scenesToReload; internal SimulationModule(Editor editor) @@ -272,23 +274,46 @@ namespace FlaxEditor.Modules // Show Game widow if hidden if (gameWin != null) { - if (gameWin.FocusOnPlay) - gameWin.FocusGameViewport(); + switch (gameWin.FocusOnPlayOption) + { + case Options.InterfaceOptions.PlayModeFocus.None: + break; + + case Options.InterfaceOptions.PlayModeFocus.GamePanel: + gameWin.FocusGameViewport(); + break; + + case Options.InterfaceOptions.PlayModeFocus.GamePanelThenBack: + _previousWindow = gameWin.ParentDockPanel.SelectedTab; + gameWin.FocusGameViewport(); + break; + } + gameWin.SetWindowMode(Editor.Options.Options.Interface.DefaultGameWindowMode); } - Editor.Log("[PlayMode] Enter"); } /// public override void OnPlayEnd() { - // Restore focused window before play mode - if (_enterPlayFocusedWindow != null) + var gameWin = Editor.Windows.GameWin; + + switch (gameWin.FocusOnPlayOption) { - _enterPlayFocusedWindow.FocusOrShow(); - _enterPlayFocusedWindow = null; + case Options.InterfaceOptions.PlayModeFocus.None: + break; + + case Options.InterfaceOptions.PlayModeFocus.GamePanel: + break; + + case Options.InterfaceOptions.PlayModeFocus.GamePanelThenBack: + if (!Editor.Windows.GameWin.ParentDockPanel.ContainsTab(_previousWindow)) + break; + + _previousWindow.Focus(); + break; } Editor.UI.UncheckPauseButton(); diff --git a/Source/Editor/Options/InterfaceOptions.cs b/Source/Editor/Options/InterfaceOptions.cs index d8493a70a..315853041 100644 --- a/Source/Editor/Options/InterfaceOptions.cs +++ b/Source/Editor/Options/InterfaceOptions.cs @@ -138,6 +138,27 @@ namespace FlaxEditor.Options AutoUnit, } + /// + /// Options for on play mode start panel focus. + /// + public enum PlayModeFocus + { + /// + /// Don't change any focus. + /// + None, + + /// + /// Focus the Game panel. + /// + GamePanel, + + /// + /// Focus the Game panel. On play mode end focus the previous panel again. + /// + GamePanelThenBack, + } + /// /// Gets or sets the Editor User Interface scale. Applied to all UI elements, windows and text. Can be used to scale the interface up on a bigger display. Editor restart required. /// @@ -341,11 +362,11 @@ namespace FlaxEditor.Options public bool OutputLogScrollToBottom { get; set; } = true; /// - /// Gets or sets a value indicating whether auto-focus game window on play mode start. + /// Gets or sets a value indicating what panel should be focused when play mode start. /// - [DefaultValue(true)] - [EditorDisplay("Play In-Editor", "Focus Game Window On Play"), EditorOrder(500), Tooltip("Determines whether auto-focus game window on play mode start.")] - public bool FocusGameWinOnPlay { get; set; } = true; + [DefaultValue(PlayModeFocus.GamePanel)] + [EditorDisplay("Play In-Editor", "Focus On Play"), EditorOrder(500), Tooltip("Set what panel to focus on play mode start.")] + public PlayModeFocus FocusOnPlayMode { get; set; } = PlayModeFocus.GamePanel; /// /// Gets or sets a value indicating what action should be taken upon pressing the play button. diff --git a/Source/Editor/Windows/GameWindow.cs b/Source/Editor/Windows/GameWindow.cs index 56e4c4380..a2e831576 100644 --- a/Source/Editor/Windows/GameWindow.cs +++ b/Source/Editor/Windows/GameWindow.cs @@ -39,6 +39,28 @@ namespace FlaxEditor.Windows private bool _useAspect = false; private bool _freeAspect = true; + private List _focusOptions = new List() + { + new PlayModeFocusOptions + { + Name = "None", + Tooltip = "Don't change focus.", + FocusOption = InterfaceOptions.PlayModeFocus.None, + }, + new PlayModeFocusOptions + { + Name = "Game Panel", + Tooltip = "Focus the Game panel.", + FocusOption = InterfaceOptions.PlayModeFocus.GamePanel, + }, + new PlayModeFocusOptions + { + Name = "Game Panel Then Back", + Tooltip = "Focus the Game panel. On play mode end focus the previous panel again.", + FocusOption = InterfaceOptions.PlayModeFocus.GamePanelThenBack, + }, + }; + /// /// Gets the viewport. /// @@ -162,9 +184,9 @@ namespace FlaxEditor.Windows public bool CenterMouseOnFocus { get; set; } /// - /// Gets or sets a value indicating whether auto-focus game window on play mode start. + /// Gets or sets a value indicating what panel should be focused when play mode start. /// - public bool FocusOnPlay { get; set; } + public InterfaceOptions.PlayModeFocus FocusOnPlayOption { get; set; } private enum ViewportScaleType { @@ -195,6 +217,29 @@ namespace FlaxEditor.Windows public bool Active; } + private class PlayModeFocusOptions + { + /// + /// The name. + /// + public string Name; + + /// + /// The tooltip. + /// + public string Tooltip; + + /// + /// The type of focus. + /// + public InterfaceOptions.PlayModeFocus FocusOption; + + /// + /// If the option is active. + /// + public bool Active; + } + /// /// Root control for game UI preview in Editor. Supports basic UI editing via . /// @@ -430,7 +475,7 @@ namespace FlaxEditor.Windows private void OnOptionsChanged(EditorOptions options) { CenterMouseOnFocus = options.Interface.CenterMouseOnGameWinFocus; - FocusOnPlay = options.Interface.FocusGameWinOnPlay; + FocusOnPlayOption = options.Interface.FocusOnPlayMode; } private void PlayingStateOnSceneDuplicating() @@ -488,6 +533,41 @@ namespace FlaxEditor.Windows } } + // TODO: Move this to other generate method + private void GenerateFocusOptionsContextMenu(ContextMenu pfMenu) + { + foreach (PlayModeFocusOptions f in _focusOptions) + { + f.Active = f.FocusOption == FocusOnPlayOption; + + var button = pfMenu.AddButton(f.Name); + button.CloseMenuOnClick = false; + button.Tag = f; + button.TooltipText = f.Tooltip; + button.Icon = f.Active ? Style.Current.CheckBoxTick : SpriteHandle.Invalid; + button.Clicked += () => + { + foreach (var child in pfMenu.Items) + { + if (child is ContextMenuButton cmb && cmb.Tag is PlayModeFocusOptions p) + { + if (cmb == button) + { + p.Active = true; + button.Icon = Style.Current.CheckBoxTick; + FocusOnPlayOption = p.FocusOption; + } + else if (p.Active) + { + cmb.Icon = SpriteHandle.Invalid; + p.Active = false; + } + } + } + }; + } + } + /// public override void OnShowContextMenu(ContextMenu menu) { @@ -495,10 +575,9 @@ namespace FlaxEditor.Windows // Focus on play { - var focus = menu.AddButton("Start Focused"); - focus.CloseMenuOnClick = false; - var checkbox = new CheckBox(140, 2, FocusOnPlay) { Parent = focus }; - checkbox.StateChanged += state => FocusOnPlay = state.Checked; + var pfMenu = menu.AddChildMenu("Play Mode Focus Override").ContextMenu; + + GenerateFocusOptionsContextMenu(pfMenu); } menu.AddSeparator(); From a810288e2e0cfe206e362b5649daeb8befe0ddcc Mon Sep 17 00:00:00 2001 From: xxSeys1 Date: Thu, 17 Oct 2024 22:04:53 +0200 Subject: [PATCH 02/10] do todo --- Source/Editor/Windows/GameWindow.cs | 69 ++++++++++++++--------------- 1 file changed, 34 insertions(+), 35 deletions(-) diff --git a/Source/Editor/Windows/GameWindow.cs b/Source/Editor/Windows/GameWindow.cs index a2e831576..b6b95867e 100644 --- a/Source/Editor/Windows/GameWindow.cs +++ b/Source/Editor/Windows/GameWindow.cs @@ -533,41 +533,6 @@ namespace FlaxEditor.Windows } } - // TODO: Move this to other generate method - private void GenerateFocusOptionsContextMenu(ContextMenu pfMenu) - { - foreach (PlayModeFocusOptions f in _focusOptions) - { - f.Active = f.FocusOption == FocusOnPlayOption; - - var button = pfMenu.AddButton(f.Name); - button.CloseMenuOnClick = false; - button.Tag = f; - button.TooltipText = f.Tooltip; - button.Icon = f.Active ? Style.Current.CheckBoxTick : SpriteHandle.Invalid; - button.Clicked += () => - { - foreach (var child in pfMenu.Items) - { - if (child is ContextMenuButton cmb && cmb.Tag is PlayModeFocusOptions p) - { - if (cmb == button) - { - p.Active = true; - button.Icon = Style.Current.CheckBoxTick; - FocusOnPlayOption = p.FocusOption; - } - else if (p.Active) - { - cmb.Icon = SpriteHandle.Invalid; - p.Active = false; - } - } - } - }; - } - } - /// public override void OnShowContextMenu(ContextMenu menu) { @@ -679,6 +644,40 @@ namespace FlaxEditor.Windows menu.AddSeparator(); } + private void GenerateFocusOptionsContextMenu(ContextMenu pfMenu) + { + foreach (PlayModeFocusOptions f in _focusOptions) + { + f.Active = f.FocusOption == FocusOnPlayOption; + + var button = pfMenu.AddButton(f.Name); + button.CloseMenuOnClick = false; + button.Tag = f; + button.TooltipText = f.Tooltip; + button.Icon = f.Active ? Style.Current.CheckBoxTick : SpriteHandle.Invalid; + button.Clicked += () => + { + foreach (var child in pfMenu.Items) + { + if (child is ContextMenuButton cmb && cmb.Tag is PlayModeFocusOptions p) + { + if (cmb == button) + { + p.Active = true; + button.Icon = Style.Current.CheckBoxTick; + FocusOnPlayOption = p.FocusOption; + } + else if (p.Active) + { + cmb.Icon = SpriteHandle.Invalid; + p.Active = false; + } + } + } + }; + } + } + private void CreateViewportSizingContextMenu(ContextMenu vsMenu) { // Add default viewport sizing options From af79a3284748529eb82af1ca2b4599773e6f09d5 Mon Sep 17 00:00:00 2001 From: xxSeys1 Date: Thu, 17 Oct 2024 22:06:07 +0200 Subject: [PATCH 03/10] make naming more consistent --- Source/Editor/Windows/GameWindow.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Editor/Windows/GameWindow.cs b/Source/Editor/Windows/GameWindow.cs index b6b95867e..886b11d11 100644 --- a/Source/Editor/Windows/GameWindow.cs +++ b/Source/Editor/Windows/GameWindow.cs @@ -540,7 +540,7 @@ namespace FlaxEditor.Windows // Focus on play { - var pfMenu = menu.AddChildMenu("Play Mode Focus Override").ContextMenu; + var pfMenu = menu.AddChildMenu("Focus On Play Override").ContextMenu; GenerateFocusOptionsContextMenu(pfMenu); } From dddd5b83d07bf812dab0ddb27041ae1e7e4d1f49 Mon Sep 17 00:00:00 2001 From: xxSeys1 Date: Fri, 18 Oct 2024 16:58:49 +0200 Subject: [PATCH 04/10] add button to remove override --- Source/Editor/Windows/GameWindow.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Source/Editor/Windows/GameWindow.cs b/Source/Editor/Windows/GameWindow.cs index 886b11d11..c10c27913 100644 --- a/Source/Editor/Windows/GameWindow.cs +++ b/Source/Editor/Windows/GameWindow.cs @@ -543,6 +543,12 @@ namespace FlaxEditor.Windows var pfMenu = menu.AddChildMenu("Focus On Play Override").ContextMenu; GenerateFocusOptionsContextMenu(pfMenu); + + pfMenu.AddSeparator(); + + var button = pfMenu.AddButton("Remove override"); + button.TooltipText = "Reset the override to the value set in the editor options."; + button.Clicked += () => FocusOnPlayOption = Editor.Instance.Options.Options.Interface.FocusOnPlayMode; } menu.AddSeparator(); From 145933dd1118c2e895b502c0f11c7933a6db95cb Mon Sep 17 00:00:00 2001 From: xxSeys1 Date: Fri, 25 Oct 2024 19:29:48 +0200 Subject: [PATCH 05/10] Remove unnecessary using --- Source/Editor/Options/InterfaceOptions.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Source/Editor/Options/InterfaceOptions.cs b/Source/Editor/Options/InterfaceOptions.cs index 315853041..75ce94ea3 100644 --- a/Source/Editor/Options/InterfaceOptions.cs +++ b/Source/Editor/Options/InterfaceOptions.cs @@ -2,7 +2,6 @@ using System.ComponentModel; using FlaxEditor.GUI.Docking; -using FlaxEditor.Utilities; using FlaxEngine; namespace FlaxEditor.Options From 2721364df6be1c5d38ebcf1055ebbc2beda5863e Mon Sep 17 00:00:00 2001 From: xxSeys1 Date: Fri, 25 Oct 2024 19:30:53 +0200 Subject: [PATCH 06/10] improve naming --- Source/Editor/Modules/SimulationModule.cs | 8 ++++---- Source/Editor/Options/InterfaceOptions.cs | 17 +++++++++-------- Source/Editor/Windows/GameWindow.cs | 12 ++++++------ 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/Source/Editor/Modules/SimulationModule.cs b/Source/Editor/Modules/SimulationModule.cs index dd83d7553..155372a7a 100644 --- a/Source/Editor/Modules/SimulationModule.cs +++ b/Source/Editor/Modules/SimulationModule.cs @@ -279,11 +279,11 @@ namespace FlaxEditor.Modules case Options.InterfaceOptions.PlayModeFocus.None: break; - case Options.InterfaceOptions.PlayModeFocus.GamePanel: + case Options.InterfaceOptions.PlayModeFocus.GameWindow: gameWin.FocusGameViewport(); break; - case Options.InterfaceOptions.PlayModeFocus.GamePanelThenBack: + case Options.InterfaceOptions.PlayModeFocus.GameWindowThenRestore: _previousWindow = gameWin.ParentDockPanel.SelectedTab; gameWin.FocusGameViewport(); break; @@ -305,10 +305,10 @@ namespace FlaxEditor.Modules case Options.InterfaceOptions.PlayModeFocus.None: break; - case Options.InterfaceOptions.PlayModeFocus.GamePanel: + case Options.InterfaceOptions.PlayModeFocus.GameWindow: break; - case Options.InterfaceOptions.PlayModeFocus.GamePanelThenBack: + case Options.InterfaceOptions.PlayModeFocus.GameWindowThenRestore: if (!Editor.Windows.GameWin.ParentDockPanel.ContainsTab(_previousWindow)) break; diff --git a/Source/Editor/Options/InterfaceOptions.cs b/Source/Editor/Options/InterfaceOptions.cs index 75ce94ea3..5b01b88ba 100644 --- a/Source/Editor/Options/InterfaceOptions.cs +++ b/Source/Editor/Options/InterfaceOptions.cs @@ -1,5 +1,6 @@ // Copyright (c) 2012-2024 Wojciech Figat. All rights reserved. +using System; using System.ComponentModel; using FlaxEditor.GUI.Docking; using FlaxEngine; @@ -138,24 +139,24 @@ namespace FlaxEditor.Options } /// - /// Options for on play mode start panel focus. + /// Options focus Game Window behaviour when play mode is entered. /// public enum PlayModeFocus { /// - /// Don't change any focus. + /// Don't change focus. /// None, /// - /// Focus the Game panel. + /// Focus the Game Window. /// - GamePanel, + GameWindow, /// - /// Focus the Game panel. On play mode end focus the previous panel again. + /// Focus the Game Window. On play mode end restore focus to the previous window. /// - GamePanelThenBack, + GameWindowThenRestore, } /// @@ -363,9 +364,9 @@ namespace FlaxEditor.Options /// /// Gets or sets a value indicating what panel should be focused when play mode start. /// - [DefaultValue(PlayModeFocus.GamePanel)] + [DefaultValue(PlayModeFocus.GameWindow)] [EditorDisplay("Play In-Editor", "Focus On Play"), EditorOrder(500), Tooltip("Set what panel to focus on play mode start.")] - public PlayModeFocus FocusOnPlayMode { get; set; } = PlayModeFocus.GamePanel; + public PlayModeFocus FocusOnPlayMode { get; set; } = PlayModeFocus.GameWindow; /// /// Gets or sets a value indicating what action should be taken upon pressing the play button. diff --git a/Source/Editor/Windows/GameWindow.cs b/Source/Editor/Windows/GameWindow.cs index c10c27913..d73facfd2 100644 --- a/Source/Editor/Windows/GameWindow.cs +++ b/Source/Editor/Windows/GameWindow.cs @@ -49,15 +49,15 @@ namespace FlaxEditor.Windows }, new PlayModeFocusOptions { - Name = "Game Panel", - Tooltip = "Focus the Game panel.", - FocusOption = InterfaceOptions.PlayModeFocus.GamePanel, + Name = "Game Window", + Tooltip = "Focus the Game Window.", + FocusOption = InterfaceOptions.PlayModeFocus.GameWindow, }, new PlayModeFocusOptions { - Name = "Game Panel Then Back", - Tooltip = "Focus the Game panel. On play mode end focus the previous panel again.", - FocusOption = InterfaceOptions.PlayModeFocus.GamePanelThenBack, + Name = "Game Window Then Back", + Tooltip = "Focus the Game Window. On play mode end restore focus to the previous window.", + FocusOption = InterfaceOptions.PlayModeFocus.GameWindowThenRestore, }, }; From 88215ca3f0e3e54ce8a29db1b5bfdde2c476f494 Mon Sep 17 00:00:00 2001 From: xxSeys1 Date: Fri, 25 Oct 2024 19:31:55 +0200 Subject: [PATCH 07/10] add auto-upgrader for old focus option --- Source/Editor/Options/InterfaceOptions.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Source/Editor/Options/InterfaceOptions.cs b/Source/Editor/Options/InterfaceOptions.cs index 5b01b88ba..70ebe139f 100644 --- a/Source/Editor/Options/InterfaceOptions.cs +++ b/Source/Editor/Options/InterfaceOptions.cs @@ -340,6 +340,18 @@ namespace FlaxEditor.Options [EditorDisplay("Output Log", "Text Shadow Offset"), EditorOrder(445), Tooltip("The output log text shadow offset. Set to 0 to disable this feature.")] public Float2 OutputLogTextShadowOffset { get; set; } = new Float2(1); + // [Deprecated in v1.10] + [Serialize, Obsolete, NoUndo] + private bool FocusGameWinOnPlay + { + get => throw new Exception(); + set + { + // Upgrade value + FocusOnPlayMode = value ? PlayModeFocus.GameWindow : PlayModeFocus.None; + } + } + /// /// Gets or sets a value indicating whether auto-focus output log window on code compilation error. /// From 6c6a557ffb65ae28cff307c519c12e96bcabbb6e Mon Sep 17 00:00:00 2001 From: xxSeys1 Date: Fri, 25 Oct 2024 23:00:05 +0200 Subject: [PATCH 08/10] make naming more consistent --- Source/Editor/Windows/GameWindow.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Editor/Windows/GameWindow.cs b/Source/Editor/Windows/GameWindow.cs index d73facfd2..0366cef8f 100644 --- a/Source/Editor/Windows/GameWindow.cs +++ b/Source/Editor/Windows/GameWindow.cs @@ -55,7 +55,7 @@ namespace FlaxEditor.Windows }, new PlayModeFocusOptions { - Name = "Game Window Then Back", + Name = "Game Window Then Restore", Tooltip = "Focus the Game Window. On play mode end restore focus to the previous window.", FocusOption = InterfaceOptions.PlayModeFocus.GameWindowThenRestore, }, From 576639148f564a1a3453f45135c2e4e8e6607ee3 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Tue, 5 Nov 2024 11:32:40 +0100 Subject: [PATCH 09/10] Format code and fix error if `_previousWindow` has been closed #2994 --- Source/Editor/Modules/SimulationModule.cs | 33 +++++++++++------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/Source/Editor/Modules/SimulationModule.cs b/Source/Editor/Modules/SimulationModule.cs index 155372a7a..bb9df0950 100644 --- a/Source/Editor/Modules/SimulationModule.cs +++ b/Source/Editor/Modules/SimulationModule.cs @@ -276,17 +276,16 @@ namespace FlaxEditor.Modules { switch (gameWin.FocusOnPlayOption) { - case Options.InterfaceOptions.PlayModeFocus.None: - break; + case Options.InterfaceOptions.PlayModeFocus.None: break; - case Options.InterfaceOptions.PlayModeFocus.GameWindow: - gameWin.FocusGameViewport(); - break; + case Options.InterfaceOptions.PlayModeFocus.GameWindow: + gameWin.FocusGameViewport(); + break; - case Options.InterfaceOptions.PlayModeFocus.GameWindowThenRestore: - _previousWindow = gameWin.ParentDockPanel.SelectedTab; - gameWin.FocusGameViewport(); - break; + case Options.InterfaceOptions.PlayModeFocus.GameWindowThenRestore: + _previousWindow = gameWin.ParentDockPanel.SelectedTab; + gameWin.FocusGameViewport(); + break; } gameWin.SetWindowMode(Editor.Options.Options.Interface.DefaultGameWindowMode); @@ -302,18 +301,16 @@ namespace FlaxEditor.Modules switch (gameWin.FocusOnPlayOption) { - case Options.InterfaceOptions.PlayModeFocus.None: - break; - - case Options.InterfaceOptions.PlayModeFocus.GameWindow: - break; - - case Options.InterfaceOptions.PlayModeFocus.GameWindowThenRestore: + case Options.InterfaceOptions.PlayModeFocus.None: break; + case Options.InterfaceOptions.PlayModeFocus.GameWindow: break; + case Options.InterfaceOptions.PlayModeFocus.GameWindowThenRestore: + if (_previousWindow != null && !_previousWindow.IsDisposing) + { if (!Editor.Windows.GameWin.ParentDockPanel.ContainsTab(_previousWindow)) break; - _previousWindow.Focus(); - break; + } + break; } Editor.UI.UncheckPauseButton(); From 935e25ab7d70d8b0fc5c5729b1f172b2e2832746 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Tue, 5 Nov 2024 11:32:49 +0100 Subject: [PATCH 10/10] Fix compile warnings --- Source/Engine/Content/Assets/Animation.cpp | 2 +- Source/Engine/Core/LogContext.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Engine/Content/Assets/Animation.cpp b/Source/Engine/Content/Assets/Animation.cpp index 261394441..6f8b23ec7 100644 --- a/Source/Engine/Content/Assets/Animation.cpp +++ b/Source/Engine/Content/Assets/Animation.cpp @@ -504,7 +504,7 @@ void Animation::GetReferences(Array& assets, Array& files) const writer.StartObject(); k.Value.Instance->Serialize(writer, nullptr); writer.EndObject(); - JsonAssetBase::GetReferences(StringAnsiView((char*)buffer.GetString(), buffer.GetSize()), assets); + JsonAssetBase::GetReferences(StringAnsiView((const char*)buffer.GetString(), (int32)buffer.GetSize()), assets); } } } diff --git a/Source/Engine/Core/LogContext.cpp b/Source/Engine/Core/LogContext.cpp index 6916fd7de..c7ed7ea2e 100644 --- a/Source/Engine/Core/LogContext.cpp +++ b/Source/Engine/Core/LogContext.cpp @@ -57,7 +57,7 @@ void LogContext::Print(LogType verbosity) LogContextData& context = stack.Ptr[index]; // Skip duplicates - if (index < stack.Count - 1 && stack.Ptr[stack.Count - 1] == context) + if (index < (int32)stack.Count - 1 && stack.Ptr[stack.Count - 1] == context) continue; // Build call hierarchy via indentation