diff --git a/Content/Editor/IconsAtlas.flax b/Content/Editor/IconsAtlas.flax
index 3318b811b..ae46fcf06 100644
--- a/Content/Editor/IconsAtlas.flax
+++ b/Content/Editor/IconsAtlas.flax
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:d867a994701f09964335ddf51cd4060a54728b9de4420ad3f0bfbd8847bc7602
-size 5611659
+oid sha256:745ce418c493445abde98aea91a34592b00c5c46b68cd7e61604a05b3043c76c
+size 5608587
diff --git a/Source/Editor/EditorIcons.cs b/Source/Editor/EditorIcons.cs
index 127ba3f6f..fb3c46a41 100644
--- a/Source/Editor/EditorIcons.cs
+++ b/Source/Editor/EditorIcons.cs
@@ -96,6 +96,7 @@ namespace FlaxEditor
public SpriteHandle Link64;
public SpriteHandle Build64;
public SpriteHandle Add64;
+ public SpriteHandle ShipIt64;
// 96px
public SpriteHandle Toolbox96;
diff --git a/Source/Editor/GUI/ContextMenu/ContextMenuSingleSelectGroup.cs b/Source/Editor/GUI/ContextMenu/ContextMenuSingleSelectGroup.cs
index 9b58c09a8..5abb52b4a 100644
--- a/Source/Editor/GUI/ContextMenu/ContextMenuSingleSelectGroup.cs
+++ b/Source/Editor/GUI/ContextMenu/ContextMenuSingleSelectGroup.cs
@@ -2,106 +2,92 @@
using System;
using System.Collections.Generic;
-using System.Linq;
using FlaxEngine;
-using FlaxEngine.GUI;
namespace FlaxEditor.GUI.ContextMenu
{
///
- /// Context menu single select group.
+ /// Context menu for a single selectable option from range of values (eg. enum).
///
[HideInEditor]
class ContextMenuSingleSelectGroup
{
- public struct SingleSelectGroupItem
+ private struct SingleSelectGroupItem
{
- public string text;
- public U value;
- public Action onSelected;
- public List buttons;
+ public string Text;
+ public string Tooltip;
+ public T Value;
+ public Action Selected;
+ public List Buttons;
}
private List _menus = new List();
- private List> _items = new List>();
- public Action OnSelectionChanged;
+ private List _items = new List();
+ private SingleSelectGroupItem _selectedItem;
- public SingleSelectGroupItem activeItem;
-
- public ContextMenuSingleSelectGroup AddItem(string text, T value, Action onSelected = null)
+ public T Selected
{
- var item = new SingleSelectGroupItem
+ get => _selectedItem.Value;
+ set
{
- text = text,
- value = value,
- onSelected = onSelected,
- buttons = new List()
+ var index = _items.FindIndex(x => x.Value.Equals(value));
+ if (index != -1 && !_selectedItem.Value.Equals(value))
+ {
+ SetSelected(_items[index]);
+ }
+ }
+ }
+
+ public Action SelectedChanged;
+
+ public ContextMenuSingleSelectGroup AddItem(string text, T value, Action selected = null, string tooltip = null)
+ {
+ var item = new SingleSelectGroupItem
+ {
+ Text = text,
+ Tooltip = tooltip,
+ Value = value,
+ Selected = selected,
+ Buttons = new List()
};
_items.Add(item);
-
foreach (var contextMenu in _menus)
AddItemToContextMenu(contextMenu, item);
-
return this;
}
public ContextMenuSingleSelectGroup AddItemsToContextMenu(ContextMenu contextMenu)
{
_menus.Add(contextMenu);
-
for (int i = 0; i < _items.Count; i++)
- {
AddItemToContextMenu(contextMenu, _items[i]);
- }
-
return this;
}
- private void AddItemToContextMenu(ContextMenu contextMenu, SingleSelectGroupItem item)
+ private void AddItemToContextMenu(ContextMenu contextMenu, SingleSelectGroupItem item)
{
- var btn = contextMenu.AddButton(item.text, () =>
- {
- SetItemAsActive(item);
- });
-
- item.buttons.Add(btn);
-
- if (item.Equals(activeItem))
- {
+ var btn = contextMenu.AddButton(item.Text, () => { SetSelected(item); });
+ if (item.Tooltip != null)
+ btn.TooltipText = item.Tooltip;
+ item.Buttons.Add(btn);
+ if (item.Equals(_selectedItem))
btn.Checked = true;
- }
}
- private void DeselectAll()
+ private void SetSelected(SingleSelectGroupItem item)
{
- foreach (var item in _items)
+ foreach (var e in _items)
{
- foreach (var btn in item.buttons) btn.Checked = false;
+ foreach (var btn in e.Buttons)
+ btn.Checked = false;
}
- }
+ _selectedItem = item;
- public void SetItemAsActive(T value)
- {
- var index = _items.FindIndex(x => x.value.Equals(value));
+ SelectedChanged?.Invoke(item.Value);
+ item.Selected?.Invoke();
- if (index == -1) return;
-
- SetItemAsActive(_items[index]);
- }
-
- private void SetItemAsActive(SingleSelectGroupItem item)
- {
- DeselectAll();
- activeItem = item;
-
- var index = _items.IndexOf(item);
- OnSelectionChanged?.Invoke(item.value);
- item.onSelected?.Invoke();
-
- foreach (var btn in item.buttons)
- {
+ foreach (var btn in item.Buttons)
btn.Checked = true;
- }
}
}
}
diff --git a/Source/Editor/GUI/ToolStrip.cs b/Source/Editor/GUI/ToolStrip.cs
index 858e21b51..0dac241ed 100644
--- a/Source/Editor/GUI/ToolStrip.cs
+++ b/Source/Editor/GUI/ToolStrip.cs
@@ -25,12 +25,12 @@ namespace FlaxEditor.GUI
///
/// Event fired when button gets clicked with the primary mouse button.
///
- public Action ButtonPrimaryClicked;
+ public Action ButtonClicked;
///
/// Event fired when button gets clicked with the secondary mouse button.
///
- public Action ButtonSecondaryClicked;
+ public Action SecondaryButtonClicked;
///
/// Tries to get the last button.
@@ -96,7 +96,7 @@ namespace FlaxEditor.GUI
Parent = this,
};
if (onClick != null)
- button.PrimaryClicked += onClick;
+ button.Clicked += onClick;
return button;
}
@@ -115,7 +115,7 @@ namespace FlaxEditor.GUI
Parent = this,
};
if (onClick != null)
- button.PrimaryClicked += onClick;
+ button.Clicked += onClick;
return button;
}
@@ -133,7 +133,7 @@ namespace FlaxEditor.GUI
Parent = this,
};
if (onClick != null)
- button.PrimaryClicked += onClick;
+ button.Clicked += onClick;
return button;
}
@@ -146,14 +146,14 @@ namespace FlaxEditor.GUI
return AddChild(new ToolStripSeparator(ItemsHeight));
}
- internal void OnButtonPrimaryClicked(ToolStripButton button)
+ internal void OnButtonClicked(ToolStripButton button)
{
- ButtonPrimaryClicked?.Invoke(button);
+ ButtonClicked?.Invoke(button);
}
- internal void OnButtonSecondaryClicked(ToolStripButton button)
+ internal void OnSecondaryButtonClicked(ToolStripButton button)
{
- ButtonSecondaryClicked?.Invoke(button);
+ SecondaryButtonClicked?.Invoke(button);
}
///
diff --git a/Source/Editor/GUI/ToolStripButton.cs b/Source/Editor/GUI/ToolStripButton.cs
index f8d032696..e839a7356 100644
--- a/Source/Editor/GUI/ToolStripButton.cs
+++ b/Source/Editor/GUI/ToolStripButton.cs
@@ -11,12 +11,8 @@ namespace FlaxEditor.GUI
///
///
[HideInEditor]
- public partial class ToolStripButton : Control
+ public class ToolStripButton : Control
{
- // TODO: abstracted for potential future in-editor input configuration (ex. for left handed mouse users)
- private const MouseButton PRIMARY_MOUSE_BUTTON = MouseButton.Left;
- private const MouseButton SECONDARY_MOUSE_BUTTON = MouseButton.Right;
-
///
/// The default margin for button parts (icon, text, etc.).
///
@@ -30,7 +26,7 @@ namespace FlaxEditor.GUI
///
/// Event fired when user clicks the button.
///
- public Action PrimaryClicked;
+ public Action Clicked;
///
/// Event fired when user clicks the button.
@@ -140,13 +136,7 @@ namespace FlaxEditor.GUI
if (!string.IsNullOrEmpty(_text))
{
textRect.Size.X = Width - DefaultMargin - textRect.Left;
- Render2D.DrawText(
- style.FontMedium,
- _text,
- textRect,
- enabled ? style.Foreground : style.ForegroundDisabled,
- TextAlignment.Near,
- TextAlignment.Center);
+ Render2D.DrawText(style.FontMedium, _text, textRect, enabled ? style.Foreground : style.ForegroundDisabled, TextAlignment.Near, TextAlignment.Center);
}
}
@@ -169,19 +159,15 @@ namespace FlaxEditor.GUI
///
public override bool OnMouseDown(Float2 location, MouseButton button)
{
- if (button == PRIMARY_MOUSE_BUTTON)
+ if (button == MouseButton.Left)
{
- // Set flag
_primaryMouseDown = true;
-
Focus();
return true;
}
- else if (button == SECONDARY_MOUSE_BUTTON)
+ if (button == MouseButton.Right)
{
- // Set flag
_secondaryMouseDown = true;
-
Focus();
return true;
}
@@ -192,29 +178,22 @@ namespace FlaxEditor.GUI
///
public override bool OnMouseUp(Float2 location, MouseButton button)
{
- if (button == PRIMARY_MOUSE_BUTTON && _primaryMouseDown)
+ if (button == MouseButton.Left && _primaryMouseDown)
{
- // Clear flag
_primaryMouseDown = false;
-
- // Fire events
if (AutoCheck)
Checked = !Checked;
- PrimaryClicked?.Invoke();
- (Parent as ToolStrip)?.OnButtonPrimaryClicked(this);
+ Clicked?.Invoke();
+ (Parent as ToolStrip)?.OnButtonClicked(this);
return true;
}
- else if (button == SECONDARY_MOUSE_BUTTON && _secondaryMouseDown)
+ if (button == MouseButton.Right && _secondaryMouseDown)
{
- // Clear flag
_secondaryMouseDown = false;
-
SecondaryClicked?.Invoke();
- (Parent as ToolStrip)?.OnButtonSecondaryClicked(this);
-
+ (Parent as ToolStrip)?.OnSecondaryButtonClicked(this);
ContextMenu?.Show(this, new Float2(0, Height));
-
return true;
}
@@ -224,7 +203,6 @@ namespace FlaxEditor.GUI
///
public override void OnMouseLeave()
{
- // Clear flag
_primaryMouseDown = false;
_secondaryMouseDown = false;
@@ -234,7 +212,6 @@ namespace FlaxEditor.GUI
///
public override void OnLostFocus()
{
- // Clear flag
_primaryMouseDown = false;
_secondaryMouseDown = false;
diff --git a/Source/Editor/Modules/UIModule.cs b/Source/Editor/Modules/UIModule.cs
index 5e0af20fe..38c61942a 100644
--- a/Source/Editor/Modules/UIModule.cs
+++ b/Source/Editor/Modules/UIModule.cs
@@ -21,7 +21,7 @@ using FlaxEngine.Json;
using DockHintWindow = FlaxEditor.GUI.Docking.DockHintWindow;
using MasterDockPanel = FlaxEditor.GUI.Docking.MasterDockPanel;
using FlaxEditor.Content.Settings;
-using static FlaxEditor.Options.InterfaceOptions;
+using FlaxEditor.Options;
namespace FlaxEditor.Modules
{
@@ -203,6 +203,7 @@ namespace FlaxEditor.Modules
_toolStripScale.Checked = gizmoMode == TransformGizmoBase.Mode.Scale;
//
_toolStripBuildScenes.Enabled = (canEditScene && !isPlayMode) || Editor.StateMachine.BuildingScenesState.IsActive;
+ _toolStripCook.Enabled = Editor.Windows.GameCookerWin.CanBuild(Platform.PlatformType) && !GameCooker.IsRunning;
//
var play = _toolStripPlay;
var pause = _toolStripPause;
@@ -418,6 +419,7 @@ namespace FlaxEditor.Modules
Editor.Undo.UndoDone += OnUndoEvent;
Editor.Undo.RedoDone += OnUndoEvent;
Editor.Undo.ActionDone += OnUndoEvent;
+ GameCooker.Event += OnGameCookerEvent;
UpdateToolstrip();
}
@@ -433,6 +435,11 @@ namespace FlaxEditor.Modules
UpdateStatusBar();
}
+ private void OnGameCookerEvent(GameCooker.EventType type)
+ {
+ UpdateToolstrip();
+ }
+
///
public override void OnExit()
{
@@ -477,23 +484,18 @@ namespace FlaxEditor.Modules
private void InitSharedMenus()
{
- for (int i = 1; i <= 4; i++) _numberOfClientsGroup.AddItem(i.ToString(), i);
+ for (int i = 1; i <= 4; i++)
+ _numberOfClientsGroup.AddItem(i.ToString(), i);
- _numberOfClientsGroup.SetItemAsActive(Editor.Options.Options.Interface.NumberOfGameClientsToLaunch);
- _numberOfClientsGroup.OnSelectionChanged = (value) =>
+ _numberOfClientsGroup.Selected = Editor.Options.Options.Interface.NumberOfGameClientsToLaunch;
+ _numberOfClientsGroup.SelectedChanged = value =>
{
var options = Editor.Options.Options;
options.Interface.NumberOfGameClientsToLaunch = value;
Editor.Options.Apply(options);
};
- Editor.Options.OptionsChanged += (options) =>
- {
- if (options.Interface.NumberOfGameClientsToLaunch != _numberOfClientsGroup.activeItem.value)
- {
- _numberOfClientsGroup.SetItemAsActive(options.Interface.NumberOfGameClientsToLaunch);
- }
- };
+ Editor.Options.OptionsChanged += options => { _numberOfClientsGroup.Selected = options.Interface.NumberOfGameClientsToLaunch; };
}
private void InitMainMenu(RootControl mainWindow)
@@ -665,43 +667,33 @@ namespace FlaxEditor.Modules
_toolStripRotate = (ToolStripButton)ToolStrip.AddButton(Editor.Icons.Rotate32, () => Editor.MainTransformGizmo.ActiveMode = TransformGizmoBase.Mode.Rotate).LinkTooltip("Change Gizmo tool mode to Rotate (2)");
_toolStripScale = (ToolStripButton)ToolStrip.AddButton(Editor.Icons.Scale32, () => Editor.MainTransformGizmo.ActiveMode = TransformGizmoBase.Mode.Scale).LinkTooltip("Change Gizmo tool mode to Scale (3)");
ToolStrip.AddSeparator();
- _toolStripBuildScenes = (ToolStripButton)ToolStrip.AddButton(Editor.Icons.Build64, Editor.BuildScenesOrCancel).LinkTooltip("Build scenes data - CSG, navmesh, static lighting, env probes - configurable via Build Actions in editor options (Ctrl+F10)");
- ToolStrip.AddSeparator();
- // build
- _toolStripCook = (ToolStripButton)ToolStrip.AddButton(Editor.Icons.BuildSettings128, CookAndRun).LinkTooltip("Cook and run");
+ // Cook scenes
+ _toolStripBuildScenes = (ToolStripButton)ToolStrip.AddButton(Editor.Icons.Build64, Editor.BuildScenesOrCancel).LinkTooltip("Build scenes data - CSG, navmesh, static lighting, env probes - configurable via Build Actions in editor options (Ctrl+F10)");
+
+ // Cook and run
+ _toolStripCook = (ToolStripButton)ToolStrip.AddButton(Editor.Icons.ShipIt64, CookAndRun).LinkTooltip("Cook & Run - build game for the current platform and run it locally");
_toolStripCook.ContextMenu = new ContextMenu();
_toolStripCook.ContextMenu.AddButton("Run cooked game", RunCookedGame);
_toolStripCook.ContextMenu.AddSeparator();
var numberOfClientsMenu = _toolStripCook.ContextMenu.AddChildMenu("Number of game clients");
_numberOfClientsGroup.AddItemsToContextMenu(numberOfClientsMenu.ContextMenu);
- // play
+ ToolStrip.AddSeparator();
+
+ // Play
_toolStripPlay = (ToolStripButton)ToolStrip.AddButton(Editor.Icons.Play64, OnPlayPressed).LinkTooltip("Play Game");
_toolStripPlay.ContextMenu = new ContextMenu();
- ContextMenuChildMenu playSubMenu;
-
- // play - button action
- playSubMenu = _toolStripPlay.ContextMenu.AddChildMenu("Play button action");
- var playActionGroup = new ContextMenuSingleSelectGroup();
- playActionGroup.AddItem("Play Game", PlayAction.PlayGame);
- playActionGroup.AddItem("Play Scenes", PlayAction.PlayScenes);
+ var playSubMenu = _toolStripPlay.ContextMenu.AddChildMenu("Play button action");
+ var playActionGroup = new ContextMenuSingleSelectGroup();
+ playActionGroup.AddItem("Play Game", InterfaceOptions.PlayAction.PlayGame, null, "Launches the game from the First Scene defined in the project settings.");
+ playActionGroup.AddItem("Play Scenes", InterfaceOptions.PlayAction.PlayScenes, null, "Launches the game using the scenes currently loaded in the editor.");
playActionGroup.AddItemsToContextMenu(playSubMenu.ContextMenu);
- playActionGroup.SetItemAsActive(Editor.Options.Options.Interface.PlayButtonAction);
- // important to add the handler after setting the initial item as active above or the editor will crash
- playActionGroup.OnSelectionChanged = SetPlayAction;
- // TODO: there is a hole in the syncing of these values:
- // - when changing in the editor, the options will be updated, but the options UI in-editor will not
+ playActionGroup.Selected = Editor.Options.Options.Interface.PlayButtonAction;
+ playActionGroup.SelectedChanged = SetPlayAction;
+ Editor.Options.OptionsChanged += options => { playActionGroup.Selected = options.Interface.PlayButtonAction; };
- Editor.Options.OptionsChanged += (options) =>
- {
- if (options.Interface.PlayButtonAction != playActionGroup.activeItem.value)
- {
- playActionGroup.SetItemAsActive(options.Interface.PlayButtonAction);
- }
- };
-
- _toolStripPause = (ToolStripButton)ToolStrip.AddButton(Editor.Icons.Pause64, Editor.Simulation.RequestResumeOrPause).LinkTooltip($"Pause/Resume game({inputOptions.Pause.ToString()})");
+ _toolStripPause = (ToolStripButton)ToolStrip.AddButton(Editor.Icons.Pause64, Editor.Simulation.RequestResumeOrPause).LinkTooltip($"Pause/Resume game({inputOptions.Pause})");
_toolStripStep = (ToolStripButton)ToolStrip.AddButton(Editor.Icons.Skip64, Editor.Simulation.RequestPlayOneFrame).LinkTooltip("Step one frame in game");
UpdateToolstrip();
@@ -736,10 +728,7 @@ namespace FlaxEditor.Modules
var defaultTextColor = StatusBar.TextColor;
_outputLogButton.HoverBegin += () => StatusBar.TextColor = Style.Current.BackgroundSelected;
_outputLogButton.HoverEnd += () => StatusBar.TextColor = defaultTextColor;
- _outputLogButton.Clicked += () =>
- {
- Editor.Windows.OutputLogWin.FocusOrShow();
- };
+ _outputLogButton.Clicked += () => { Editor.Windows.OutputLogWin.FocusOrShow(); };
// Progress bar with label
const float progressBarWidth = 120.0f;
@@ -1043,7 +1032,7 @@ namespace FlaxEditor.Modules
projectInfo.Save();
}
- private void SetPlayAction(PlayAction newPlayAction)
+ private void SetPlayAction(InterfaceOptions.PlayAction newPlayAction)
{
var options = Editor.Options.Options;
options.Interface.PlayButtonAction = newPlayAction;
@@ -1054,23 +1043,25 @@ namespace FlaxEditor.Modules
{
switch (Editor.Options.Options.Interface.PlayButtonAction)
{
- case PlayAction.PlayGame:
- if (Editor.IsPlayMode)
- Editor.Simulation.RequestStopPlay();
- else
- PlayGame();
- return;
- case PlayAction.PlayScenes: PlayScenes(); return;
+ case InterfaceOptions.PlayAction.PlayGame:
+ if (Editor.IsPlayMode)
+ Editor.Simulation.RequestStopPlay();
+ else
+ PlayGame();
+ return;
+ case InterfaceOptions.PlayAction.PlayScenes:
+ PlayScenes();
+ return;
}
}
private void PlayGame()
{
var firstScene = GameSettings.Load().FirstScene;
-
if (firstScene == Guid.Empty)
{
- if (Level.IsAnySceneLoaded) Editor.Simulation.RequestStartPlay();
+ if (Level.IsAnySceneLoaded)
+ Editor.Simulation.RequestStartPlay();
return;
}
diff --git a/Source/Editor/Options/InterfaceOptions.cs b/Source/Editor/Options/InterfaceOptions.cs
index 7d97fecd6..5fd8c31c7 100644
--- a/Source/Editor/Options/InterfaceOptions.cs
+++ b/Source/Editor/Options/InterfaceOptions.cs
@@ -83,10 +83,11 @@ namespace FlaxEditor.Options
/// Launches the game from the First Scene defined in the project settings.
///
PlayGame,
+
///
/// Launches the game using the scenes currently loaded in the editor.
///
- PlayScenes
+ PlayScenes,
}
///
@@ -97,14 +98,12 @@ namespace FlaxEditor.Options
public float InterfaceScale { get; set; } = 1.0f;
#if PLATFORM_WINDOWS
-
///
/// Gets or sets a value indicating whether use native window title bar. Editor restart required.
///
[DefaultValue(false)]
[EditorDisplay("Interface"), EditorOrder(70), Tooltip("Determines whether use native window title bar. Editor restart required.")]
public bool UseNativeWindowSystem { get; set; } = false;
-
#endif
///
@@ -215,15 +214,14 @@ namespace FlaxEditor.Options
/// Gets or sets a value indicating what action should be taken upon pressing the play button.
///
[DefaultValue(PlayAction.PlayScenes)]
- [EditorDisplay("Play In-Editor", "Play Button Action"), EditorOrder(410), Tooltip("Determines the action taken when the play button is pressed.")]
+ [EditorDisplay("Play In-Editor", "Play Button Action"), EditorOrder(410)]
public PlayAction PlayButtonAction { get; set; } = PlayAction.PlayScenes;
///
/// Gets or sets a value indicating the number of game clients to launch when building and/or running cooked game.
///
- [DefaultValue(1)]
- [EditorDisplay("Cook & Run", "Number Of GameClients To Launch"), EditorOrder(500), Tooltip("Determines the number of game clients to launch when building and/or running cooked game.")]
- [Range(1, 4)]
+ [DefaultValue(1), Range(1, 4)]
+ [EditorDisplay("Cook & Run"), EditorOrder(500)]
public int NumberOfGameClientsToLaunch = 1;
private static FontAsset DefaultFont => FlaxEngine.Content.LoadAsyncInternal(EditorAssets.PrimaryFont);
diff --git a/Source/Editor/Windows/GameCookerWindow.cs b/Source/Editor/Windows/GameCookerWindow.cs
index f88fa36f5..5ece067a0 100644
--- a/Source/Editor/Windows/GameCookerWindow.cs
+++ b/Source/Editor/Windows/GameCookerWindow.cs
@@ -110,14 +110,14 @@ namespace FlaxEditor.Windows
#if PLATFORM_WINDOWS
switch (BuildPlatform)
{
- case BuildPlatform.MacOSx64:
- case BuildPlatform.MacOSARM64:
- case BuildPlatform.iOSARM64:
- IsSupported = false;
- break;
- default:
- IsSupported = true;
- break;
+ case BuildPlatform.MacOSx64:
+ case BuildPlatform.MacOSARM64:
+ case BuildPlatform.iOSARM64:
+ IsSupported = false;
+ break;
+ default:
+ IsSupported = true;
+ break;
}
#elif PLATFORM_LINUX
switch (BuildPlatform)
@@ -160,17 +160,17 @@ namespace FlaxEditor.Windows
{
switch (BuildPlatform)
{
- case BuildPlatform.Windows32:
- case BuildPlatform.Windows64:
- case BuildPlatform.UWPx86:
- case BuildPlatform.UWPx64:
- case BuildPlatform.LinuxX64:
- case BuildPlatform.AndroidARM64:
- layout.Label("Use Flax Launcher and download the required package.", TextAlignment.Center);
- break;
- default:
- layout.Label("Engine source is required to target this platform.", TextAlignment.Center);
- break;
+ case BuildPlatform.Windows32:
+ case BuildPlatform.Windows64:
+ case BuildPlatform.UWPx86:
+ case BuildPlatform.UWPx64:
+ case BuildPlatform.LinuxX64:
+ case BuildPlatform.AndroidARM64:
+ layout.Label("Use Flax Launcher and download the required package.", TextAlignment.Center);
+ break;
+ default:
+ layout.Label("Engine source is required to target this platform.", TextAlignment.Center);
+ break;
}
}
else
@@ -238,6 +238,7 @@ namespace FlaxEditor.Windows
{
[EditorDisplay(null, "arm64")]
ARM64,
+
[EditorDisplay(null, "x64")]
x64,
}
@@ -272,43 +273,43 @@ namespace FlaxEditor.Windows
string name;
switch (_platform)
{
- case PlatformType.Windows:
- name = "Windows";
- break;
- case PlatformType.XboxOne:
- name = "Xbox One";
- break;
- case PlatformType.UWP:
- name = "Windows Store";
- layout.Label("UWP (Windows Store) platform has been deprecated and is no longer supported", TextAlignment.Center).Label.TextColor = Color.Red;
- break;
- case PlatformType.Linux:
- name = "Linux";
- break;
- case PlatformType.PS4:
- name = "PlayStation 4";
- break;
- case PlatformType.XboxScarlett:
- name = "Xbox Scarlett";
- break;
- case PlatformType.Android:
- name = "Android";
- break;
- case PlatformType.Switch:
- name = "Switch";
- break;
- case PlatformType.PS5:
- name = "PlayStation 5";
- break;
- case PlatformType.Mac:
- name = "Mac";
- break;
- case PlatformType.iOS:
- name = "iOS";
- break;
- default:
- name = Utilities.Utils.GetPropertyNameUI(_platform.ToString());
- break;
+ case PlatformType.Windows:
+ name = "Windows";
+ break;
+ case PlatformType.XboxOne:
+ name = "Xbox One";
+ break;
+ case PlatformType.UWP:
+ name = "Windows Store";
+ layout.Label("UWP (Windows Store) platform has been deprecated and is no longer supported", TextAlignment.Center).Label.TextColor = Color.Red;
+ break;
+ case PlatformType.Linux:
+ name = "Linux";
+ break;
+ case PlatformType.PS4:
+ name = "PlayStation 4";
+ break;
+ case PlatformType.XboxScarlett:
+ name = "Xbox Scarlett";
+ break;
+ case PlatformType.Android:
+ name = "Android";
+ break;
+ case PlatformType.Switch:
+ name = "Switch";
+ break;
+ case PlatformType.PS5:
+ name = "PlayStation 5";
+ break;
+ case PlatformType.Mac:
+ name = "Mac";
+ break;
+ case PlatformType.iOS:
+ name = "iOS";
+ break;
+ default:
+ name = Utilities.Utils.GetPropertyNameUI(_platform.ToString());
+ break;
}
var group = layout.Group(name);
@@ -614,6 +615,18 @@ namespace FlaxEditor.Windows
_exitOnBuildEnd = true;
}
+ ///
+ /// Returns true if can build for the given platform (both supported and available).
+ ///
+ /// The platform.
+ /// True if can build, otherwise false.
+ public bool CanBuild(PlatformType platformType)
+ {
+ if (_buildTabProxy.PerPlatformOptions.TryGetValue(platformType, out var platform))
+ return platform.IsAvailable && platform.IsSupported;
+ return false;
+ }
+
///
/// Builds all the targets from the given preset.
///
@@ -660,11 +673,11 @@ namespace FlaxEditor.Windows
Editor.Log("Building and running");
GameCooker.GetCurrentPlatform(out var platform, out var buildPlatform, out var buildConfiguration);
var numberOfClients = Editor.Options.Options.Interface.NumberOfGameClientsToLaunch;
-
for (int i = 0; i < numberOfClients; i++)
{
var buildOptions = BuildOptions.AutoRun;
- if (i > 0) buildOptions |= BuildOptions.NoCook;
+ if (i > 0)
+ buildOptions |= BuildOptions.NoCook;
_buildingQueue.Enqueue(new QueueItem
{
@@ -687,7 +700,6 @@ namespace FlaxEditor.Windows
Editor.Log("Running cooked build");
GameCooker.GetCurrentPlatform(out var platform, out var buildPlatform, out var buildConfiguration);
var numberOfClients = Editor.Options.Options.Interface.NumberOfGameClientsToLaunch;
-
for (int i = 0; i < numberOfClients; i++)
{
_buildingQueue.Enqueue(new QueueItem
diff --git a/Source/Editor/Windows/Profiler/ProfilerWindow.cs b/Source/Editor/Windows/Profiler/ProfilerWindow.cs
index b35641bf6..f5a5c6f86 100644
--- a/Source/Editor/Windows/Profiler/ProfilerWindow.cs
+++ b/Source/Editor/Windows/Profiler/ProfilerWindow.cs
@@ -93,7 +93,7 @@ namespace FlaxEditor.Windows.Profiler
_liveRecordingButton = toolstrip.AddButton(editor.Icons.Play64);
_liveRecordingButton.LinkTooltip("Live profiling events recording");
_liveRecordingButton.AutoCheck = true;
- _liveRecordingButton.PrimaryClicked += () => _liveRecordingButton.Icon = LiveRecording ? editor.Icons.Stop64 : editor.Icons.Play64;
+ _liveRecordingButton.Clicked += () => _liveRecordingButton.Icon = LiveRecording ? editor.Icons.Stop64 : editor.Icons.Play64;
_clearButton = toolstrip.AddButton(editor.Icons.Rotate32, Clear);
_clearButton.LinkTooltip("Clear data");
toolstrip.AddSeparator();