mirror of
https://github.com/ppy/osu.git
synced 2025-01-31 19:32:58 +08:00
Simplify caching
This commit is contained in:
parent
b91461e661
commit
c574551ee0
@ -51,7 +51,7 @@ namespace osu.Game.Tests.Visual.Editing
|
|||||||
|
|
||||||
Composer.Alpha = 0;
|
Composer.Alpha = 0;
|
||||||
|
|
||||||
var contextMenuContainer = new OsuContextMenuContainer
|
Add(new OsuContextMenuContainer
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
@ -75,11 +75,7 @@ namespace osu.Game.Tests.Visual.Editing
|
|||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
|
|
||||||
Dependencies.Cache(contextMenuContainer);
|
|
||||||
|
|
||||||
Add(contextMenuContainer);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[SetUpSteps]
|
[SetUpSteps]
|
||||||
|
@ -8,6 +8,7 @@ using osu.Game.Graphics.UserInterface;
|
|||||||
|
|
||||||
namespace osu.Game.Graphics.Cursor
|
namespace osu.Game.Graphics.Cursor
|
||||||
{
|
{
|
||||||
|
[Cached(typeof(OsuContextMenuContainer))]
|
||||||
public partial class OsuContextMenuContainer : ContextMenuContainer
|
public partial class OsuContextMenuContainer : ContextMenuContainer
|
||||||
{
|
{
|
||||||
[Cached]
|
[Cached]
|
||||||
|
@ -101,12 +101,6 @@ namespace osu.Game.Overlays.SkinEditor
|
|||||||
[Resolved]
|
[Resolved]
|
||||||
private IDialogOverlay? dialogOverlay { get; set; }
|
private IDialogOverlay? dialogOverlay { get; set; }
|
||||||
|
|
||||||
[Cached]
|
|
||||||
public OsuContextMenuContainer ContextMenuContainer { get; private set; } = new OsuContextMenuContainer
|
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.Both,
|
|
||||||
};
|
|
||||||
|
|
||||||
public SkinEditor()
|
public SkinEditor()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -121,110 +115,112 @@ namespace osu.Game.Overlays.SkinEditor
|
|||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both;
|
RelativeSizeAxes = Axes.Both;
|
||||||
|
|
||||||
ContextMenuContainer.Child = new GridContainer
|
AddInternal(new OsuContextMenuContainer
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
RowDimensions = new[]
|
Child = new GridContainer
|
||||||
{
|
{
|
||||||
new Dimension(GridSizeMode.AutoSize),
|
RelativeSizeAxes = Axes.Both,
|
||||||
new Dimension(GridSizeMode.AutoSize),
|
RowDimensions = new[]
|
||||||
new Dimension(),
|
|
||||||
},
|
|
||||||
Content = new[]
|
|
||||||
{
|
|
||||||
new Drawable[]
|
|
||||||
{
|
{
|
||||||
new Container
|
new Dimension(GridSizeMode.AutoSize),
|
||||||
{
|
new Dimension(GridSizeMode.AutoSize),
|
||||||
Name = @"Menu container",
|
new Dimension(),
|
||||||
RelativeSizeAxes = Axes.X,
|
|
||||||
Depth = float.MinValue,
|
|
||||||
Height = MENU_HEIGHT,
|
|
||||||
Children = new Drawable[]
|
|
||||||
{
|
|
||||||
new EditorMenuBar
|
|
||||||
{
|
|
||||||
Anchor = Anchor.CentreLeft,
|
|
||||||
Origin = Anchor.CentreLeft,
|
|
||||||
RelativeSizeAxes = Axes.Both,
|
|
||||||
Items = new[]
|
|
||||||
{
|
|
||||||
new MenuItem(CommonStrings.MenuBarFile)
|
|
||||||
{
|
|
||||||
Items = new OsuMenuItem[]
|
|
||||||
{
|
|
||||||
new EditorMenuItem(Web.CommonStrings.ButtonsSave, MenuItemType.Standard, () => Save()),
|
|
||||||
new EditorMenuItem(CommonStrings.Export, MenuItemType.Standard, () => skins.ExportCurrentSkin()) { Action = { Disabled = !RuntimeInfo.IsDesktop } },
|
|
||||||
new OsuMenuItemSpacer(),
|
|
||||||
new EditorMenuItem(CommonStrings.RevertToDefault, MenuItemType.Destructive, () => dialogOverlay?.Push(new RevertConfirmDialog(revert))),
|
|
||||||
new OsuMenuItemSpacer(),
|
|
||||||
new EditorMenuItem(CommonStrings.Exit, MenuItemType.Standard, () => skinEditorOverlay?.Hide()),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
new MenuItem(CommonStrings.MenuBarEdit)
|
|
||||||
{
|
|
||||||
Items = new OsuMenuItem[]
|
|
||||||
{
|
|
||||||
undoMenuItem = new EditorMenuItem(CommonStrings.Undo, MenuItemType.Standard, Undo),
|
|
||||||
redoMenuItem = new EditorMenuItem(CommonStrings.Redo, MenuItemType.Standard, Redo),
|
|
||||||
new OsuMenuItemSpacer(),
|
|
||||||
cutMenuItem = new EditorMenuItem(CommonStrings.Cut, MenuItemType.Standard, Cut),
|
|
||||||
copyMenuItem = new EditorMenuItem(CommonStrings.Copy, MenuItemType.Standard, Copy),
|
|
||||||
pasteMenuItem = new EditorMenuItem(CommonStrings.Paste, MenuItemType.Standard, Paste),
|
|
||||||
cloneMenuItem = new EditorMenuItem(CommonStrings.Clone, MenuItemType.Standard, Clone),
|
|
||||||
}
|
|
||||||
},
|
|
||||||
}
|
|
||||||
},
|
|
||||||
headerText = new OsuTextFlowContainer
|
|
||||||
{
|
|
||||||
TextAnchor = Anchor.TopRight,
|
|
||||||
Padding = new MarginPadding(5),
|
|
||||||
Anchor = Anchor.TopRight,
|
|
||||||
Origin = Anchor.TopRight,
|
|
||||||
AutoSizeAxes = Axes.X,
|
|
||||||
RelativeSizeAxes = Axes.Y,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
new Drawable[]
|
Content = new[]
|
||||||
{
|
{
|
||||||
new SkinEditorSceneLibrary
|
new Drawable[]
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X,
|
new Container
|
||||||
},
|
|
||||||
},
|
|
||||||
new Drawable[]
|
|
||||||
{
|
|
||||||
new GridContainer
|
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.Both,
|
|
||||||
ColumnDimensions = new[]
|
|
||||||
{
|
{
|
||||||
new Dimension(GridSizeMode.AutoSize),
|
Name = @"Menu container",
|
||||||
new Dimension(),
|
RelativeSizeAxes = Axes.X,
|
||||||
new Dimension(GridSizeMode.AutoSize),
|
Depth = float.MinValue,
|
||||||
},
|
Height = MENU_HEIGHT,
|
||||||
Content = new[]
|
Children = new Drawable[]
|
||||||
{
|
|
||||||
new Drawable[]
|
|
||||||
{
|
{
|
||||||
componentsSidebar = new EditorSidebar(),
|
new EditorMenuBar
|
||||||
content = new Container
|
|
||||||
{
|
{
|
||||||
Depth = float.MaxValue,
|
Anchor = Anchor.CentreLeft,
|
||||||
|
Origin = Anchor.CentreLeft,
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Items = new[]
|
||||||
|
{
|
||||||
|
new MenuItem(CommonStrings.MenuBarFile)
|
||||||
|
{
|
||||||
|
Items = new OsuMenuItem[]
|
||||||
|
{
|
||||||
|
new EditorMenuItem(Web.CommonStrings.ButtonsSave, MenuItemType.Standard, () => Save()),
|
||||||
|
new EditorMenuItem(CommonStrings.Export, MenuItemType.Standard, () => skins.ExportCurrentSkin()) { Action = { Disabled = !RuntimeInfo.IsDesktop } },
|
||||||
|
new OsuMenuItemSpacer(),
|
||||||
|
new EditorMenuItem(CommonStrings.RevertToDefault, MenuItemType.Destructive, () => dialogOverlay?.Push(new RevertConfirmDialog(revert))),
|
||||||
|
new OsuMenuItemSpacer(),
|
||||||
|
new EditorMenuItem(CommonStrings.Exit, MenuItemType.Standard, () => skinEditorOverlay?.Hide()),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
new MenuItem(CommonStrings.MenuBarEdit)
|
||||||
|
{
|
||||||
|
Items = new OsuMenuItem[]
|
||||||
|
{
|
||||||
|
undoMenuItem = new EditorMenuItem(CommonStrings.Undo, MenuItemType.Standard, Undo),
|
||||||
|
redoMenuItem = new EditorMenuItem(CommonStrings.Redo, MenuItemType.Standard, Redo),
|
||||||
|
new OsuMenuItemSpacer(),
|
||||||
|
cutMenuItem = new EditorMenuItem(CommonStrings.Cut, MenuItemType.Standard, Cut),
|
||||||
|
copyMenuItem = new EditorMenuItem(CommonStrings.Copy, MenuItemType.Standard, Copy),
|
||||||
|
pasteMenuItem = new EditorMenuItem(CommonStrings.Paste, MenuItemType.Standard, Paste),
|
||||||
|
cloneMenuItem = new EditorMenuItem(CommonStrings.Clone, MenuItemType.Standard, Clone),
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
},
|
},
|
||||||
settingsSidebar = new EditorSidebar(),
|
headerText = new OsuTextFlowContainer
|
||||||
|
{
|
||||||
|
TextAnchor = Anchor.TopRight,
|
||||||
|
Padding = new MarginPadding(5),
|
||||||
|
Anchor = Anchor.TopRight,
|
||||||
|
Origin = Anchor.TopRight,
|
||||||
|
AutoSizeAxes = Axes.X,
|
||||||
|
RelativeSizeAxes = Axes.Y,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
new Drawable[]
|
||||||
|
{
|
||||||
|
new SkinEditorSceneLibrary
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.X,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
new Drawable[]
|
||||||
|
{
|
||||||
|
new GridContainer
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
ColumnDimensions = new[]
|
||||||
|
{
|
||||||
|
new Dimension(GridSizeMode.AutoSize),
|
||||||
|
new Dimension(),
|
||||||
|
new Dimension(GridSizeMode.AutoSize),
|
||||||
|
},
|
||||||
|
Content = new[]
|
||||||
|
{
|
||||||
|
new Drawable[]
|
||||||
|
{
|
||||||
|
componentsSidebar = new EditorSidebar(),
|
||||||
|
content = new Container
|
||||||
|
{
|
||||||
|
Depth = float.MaxValue,
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
},
|
||||||
|
settingsSidebar = new EditorSidebar(),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
},
|
}
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
|
|
||||||
AddInternal(ContextMenuContainer);
|
|
||||||
|
|
||||||
clipboardContent = clipboard.Content.GetBoundCopy();
|
clipboardContent = clipboard.Content.GetBoundCopy();
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using osu.Framework;
|
using osu.Framework;
|
||||||
@ -76,12 +77,6 @@ namespace osu.Game.Screens.Edit
|
|||||||
/// </remarks>
|
/// </remarks>
|
||||||
public const float WAVEFORM_VISUAL_OFFSET = 20;
|
public const float WAVEFORM_VISUAL_OFFSET = 20;
|
||||||
|
|
||||||
[Cached]
|
|
||||||
public OsuContextMenuContainer ContextMenuContainer { get; private set; } = new OsuContextMenuContainer
|
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.Both
|
|
||||||
};
|
|
||||||
|
|
||||||
public override float BackgroundParallaxAmount => 0.1f;
|
public override float BackgroundParallaxAmount => 0.1f;
|
||||||
|
|
||||||
public override bool AllowBackButton => false;
|
public override bool AllowBackButton => false;
|
||||||
@ -165,7 +160,7 @@ namespace osu.Game.Screens.Edit
|
|||||||
|
|
||||||
private string lastSavedHash;
|
private string lastSavedHash;
|
||||||
|
|
||||||
private Container<EditorScreen> screenContainer;
|
private ScreenContainer screenContainer;
|
||||||
|
|
||||||
[CanBeNull]
|
[CanBeNull]
|
||||||
private readonly EditorLoader loader;
|
private readonly EditorLoader loader;
|
||||||
@ -325,108 +320,110 @@ namespace osu.Game.Screens.Edit
|
|||||||
editorTimelineShowTimingChanges = config.GetBindable<bool>(OsuSetting.EditorTimelineShowTimingChanges);
|
editorTimelineShowTimingChanges = config.GetBindable<bool>(OsuSetting.EditorTimelineShowTimingChanges);
|
||||||
editorTimelineShowTicks = config.GetBindable<bool>(OsuSetting.EditorTimelineShowTicks);
|
editorTimelineShowTicks = config.GetBindable<bool>(OsuSetting.EditorTimelineShowTicks);
|
||||||
|
|
||||||
ContextMenuContainer.AddRange(new Drawable[]
|
AddInternal(new OsuContextMenuContainer
|
||||||
{
|
{
|
||||||
new Container
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
Name = "Screen container",
|
new Container
|
||||||
RelativeSizeAxes = Axes.Both,
|
|
||||||
Padding = new MarginPadding { Top = 40, Bottom = 50 },
|
|
||||||
Child = screenContainer = new Container<EditorScreen>
|
|
||||||
{
|
{
|
||||||
|
Name = "Screen container",
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
}
|
Padding = new MarginPadding { Top = 40, Bottom = 50 },
|
||||||
},
|
Child = screenContainer = new ScreenContainer
|
||||||
new Container
|
|
||||||
{
|
|
||||||
Name = "Top bar",
|
|
||||||
RelativeSizeAxes = Axes.X,
|
|
||||||
Height = 40,
|
|
||||||
Children = new Drawable[]
|
|
||||||
{
|
|
||||||
new EditorMenuBar
|
|
||||||
{
|
{
|
||||||
Anchor = Anchor.CentreLeft,
|
|
||||||
Origin = Anchor.CentreLeft,
|
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
MaxHeight = 600,
|
}
|
||||||
Items = new[]
|
},
|
||||||
|
new Container
|
||||||
|
{
|
||||||
|
Name = "Top bar",
|
||||||
|
RelativeSizeAxes = Axes.X,
|
||||||
|
Height = 40,
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
new EditorMenuBar
|
||||||
{
|
{
|
||||||
new MenuItem(CommonStrings.MenuBarFile)
|
Anchor = Anchor.CentreLeft,
|
||||||
|
Origin = Anchor.CentreLeft,
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
MaxHeight = 600,
|
||||||
|
Items = new[]
|
||||||
{
|
{
|
||||||
Items = createFileMenuItems().ToList()
|
new MenuItem(CommonStrings.MenuBarFile)
|
||||||
},
|
|
||||||
new MenuItem(CommonStrings.MenuBarEdit)
|
|
||||||
{
|
|
||||||
Items = new[]
|
|
||||||
{
|
{
|
||||||
undoMenuItem = new EditorMenuItem(CommonStrings.Undo, MenuItemType.Standard, Undo),
|
Items = createFileMenuItems().ToList()
|
||||||
redoMenuItem = new EditorMenuItem(CommonStrings.Redo, MenuItemType.Standard, Redo),
|
},
|
||||||
new OsuMenuItemSpacer(),
|
new MenuItem(CommonStrings.MenuBarEdit)
|
||||||
cutMenuItem = new EditorMenuItem(CommonStrings.Cut, MenuItemType.Standard, Cut),
|
|
||||||
copyMenuItem = new EditorMenuItem(CommonStrings.Copy, MenuItemType.Standard, Copy),
|
|
||||||
pasteMenuItem = new EditorMenuItem(CommonStrings.Paste, MenuItemType.Standard, Paste),
|
|
||||||
cloneMenuItem = new EditorMenuItem(CommonStrings.Clone, MenuItemType.Standard, Clone),
|
|
||||||
}
|
|
||||||
},
|
|
||||||
new MenuItem(CommonStrings.MenuBarView)
|
|
||||||
{
|
|
||||||
Items = new[]
|
|
||||||
{
|
{
|
||||||
new MenuItem(EditorStrings.Timeline)
|
Items = new[]
|
||||||
{
|
{
|
||||||
Items =
|
undoMenuItem = new EditorMenuItem(CommonStrings.Undo, MenuItemType.Standard, Undo),
|
||||||
[
|
redoMenuItem = new EditorMenuItem(CommonStrings.Redo, MenuItemType.Standard, Redo),
|
||||||
new WaveformOpacityMenuItem(config.GetBindable<float>(OsuSetting.EditorWaveformOpacity)),
|
new OsuMenuItemSpacer(),
|
||||||
new ToggleMenuItem(EditorStrings.TimelineShowTimingChanges)
|
cutMenuItem = new EditorMenuItem(CommonStrings.Cut, MenuItemType.Standard, Cut),
|
||||||
{
|
copyMenuItem = new EditorMenuItem(CommonStrings.Copy, MenuItemType.Standard, Copy),
|
||||||
State = { BindTarget = editorTimelineShowTimingChanges }
|
pasteMenuItem = new EditorMenuItem(CommonStrings.Paste, MenuItemType.Standard, Paste),
|
||||||
},
|
cloneMenuItem = new EditorMenuItem(CommonStrings.Clone, MenuItemType.Standard, Clone),
|
||||||
new ToggleMenuItem(EditorStrings.TimelineShowTicks)
|
}
|
||||||
{
|
},
|
||||||
State = { BindTarget = editorTimelineShowTicks }
|
new MenuItem(CommonStrings.MenuBarView)
|
||||||
},
|
{
|
||||||
]
|
Items = new[]
|
||||||
},
|
|
||||||
new BackgroundDimMenuItem(editorBackgroundDim),
|
|
||||||
new ToggleMenuItem(EditorStrings.ShowHitMarkers)
|
|
||||||
{
|
{
|
||||||
State = { BindTarget = editorHitMarkers },
|
new MenuItem(EditorStrings.Timeline)
|
||||||
},
|
{
|
||||||
new ToggleMenuItem(EditorStrings.AutoSeekOnPlacement)
|
Items =
|
||||||
|
[
|
||||||
|
new WaveformOpacityMenuItem(config.GetBindable<float>(OsuSetting.EditorWaveformOpacity)),
|
||||||
|
new ToggleMenuItem(EditorStrings.TimelineShowTimingChanges)
|
||||||
|
{
|
||||||
|
State = { BindTarget = editorTimelineShowTimingChanges }
|
||||||
|
},
|
||||||
|
new ToggleMenuItem(EditorStrings.TimelineShowTicks)
|
||||||
|
{
|
||||||
|
State = { BindTarget = editorTimelineShowTicks }
|
||||||
|
},
|
||||||
|
]
|
||||||
|
},
|
||||||
|
new BackgroundDimMenuItem(editorBackgroundDim),
|
||||||
|
new ToggleMenuItem(EditorStrings.ShowHitMarkers)
|
||||||
|
{
|
||||||
|
State = { BindTarget = editorHitMarkers },
|
||||||
|
},
|
||||||
|
new ToggleMenuItem(EditorStrings.AutoSeekOnPlacement)
|
||||||
|
{
|
||||||
|
State = { BindTarget = editorAutoSeekOnPlacement },
|
||||||
|
},
|
||||||
|
new ToggleMenuItem(EditorStrings.LimitedDistanceSnap)
|
||||||
|
{
|
||||||
|
State = { BindTarget = editorLimitedDistanceSnap },
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
new MenuItem(EditorStrings.Timing)
|
||||||
|
{
|
||||||
|
Items = new MenuItem[]
|
||||||
{
|
{
|
||||||
State = { BindTarget = editorAutoSeekOnPlacement },
|
new EditorMenuItem(EditorStrings.SetPreviewPointToCurrent, MenuItemType.Standard, SetPreviewPointToCurrentTime)
|
||||||
},
|
|
||||||
new ToggleMenuItem(EditorStrings.LimitedDistanceSnap)
|
|
||||||
{
|
|
||||||
State = { BindTarget = editorLimitedDistanceSnap },
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
|
||||||
new MenuItem(EditorStrings.Timing)
|
|
||||||
{
|
|
||||||
Items = new MenuItem[]
|
|
||||||
{
|
|
||||||
new EditorMenuItem(EditorStrings.SetPreviewPointToCurrent, MenuItemType.Standard, SetPreviewPointToCurrentTime)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
},
|
screenSwitcher = new EditorScreenSwitcherControl
|
||||||
screenSwitcher = new EditorScreenSwitcherControl
|
{
|
||||||
{
|
Anchor = Anchor.BottomRight,
|
||||||
Anchor = Anchor.BottomRight,
|
Origin = Anchor.BottomRight,
|
||||||
Origin = Anchor.BottomRight,
|
X = -10,
|
||||||
X = -10,
|
Current = Mode,
|
||||||
Current = Mode,
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
bottomBar = new BottomBar(),
|
||||||
bottomBar = new BottomBar(),
|
MutationTracker,
|
||||||
MutationTracker,
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
AddInternal(ContextMenuContainer);
|
|
||||||
|
|
||||||
changeHandler?.CanUndo.BindValueChanged(v => undoMenuItem.Action.Disabled = !v.NewValue, true);
|
changeHandler?.CanUndo.BindValueChanged(v => undoMenuItem.Action.Disabled = !v.NewValue, true);
|
||||||
changeHandler?.CanRedo.BindValueChanged(v => redoMenuItem.Action.Disabled = !v.NewValue, true);
|
changeHandler?.CanRedo.BindValueChanged(v => redoMenuItem.Action.Disabled = !v.NewValue, true);
|
||||||
|
|
||||||
@ -1012,7 +1009,7 @@ namespace osu.Game.Screens.Edit
|
|||||||
throw new InvalidOperationException("Editor menu bar switched to an unsupported mode");
|
throw new InvalidOperationException("Editor menu bar switched to an unsupported mode");
|
||||||
}
|
}
|
||||||
|
|
||||||
LoadComponentAsync(currentScreen, newScreen =>
|
screenContainer.LoadComponentAsync(currentScreen, newScreen =>
|
||||||
{
|
{
|
||||||
if (newScreen == currentScreen)
|
if (newScreen == currentScreen)
|
||||||
{
|
{
|
||||||
@ -1390,5 +1387,12 @@ namespace osu.Game.Screens.Edit
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private partial class ScreenContainer : Container<EditorScreen>
|
||||||
|
{
|
||||||
|
public new Task LoadComponentAsync<TLoadable>([NotNull] TLoadable component, Action<TLoadable> onLoaded = null, CancellationToken cancellation = default, Scheduler scheduler = null)
|
||||||
|
where TLoadable : Drawable
|
||||||
|
=> base.LoadComponentAsync(component, onLoaded, cancellation, scheduler);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user