mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 23:53:51 +09:00
Convert SkinEditorOverlay
to an OverlayContainer
to allow it to block input
This commit is contained in:
@ -1046,6 +1046,10 @@ namespace osu.Game
|
|||||||
|
|
||||||
switch (e.Action)
|
switch (e.Action)
|
||||||
{
|
{
|
||||||
|
case GlobalAction.ToggleSkinEditor:
|
||||||
|
skinEditor.ToggleVisibility();
|
||||||
|
return true;
|
||||||
|
|
||||||
case GlobalAction.ResetInputSettings:
|
case GlobalAction.ResetInputSettings:
|
||||||
Host.ResetInputHandlers();
|
Host.ResetInputHandlers();
|
||||||
frameworkConfig.GetBindable<ConfineMouseMode>(FrameworkSetting.ConfineMouseMode).SetDefault();
|
frameworkConfig.GetBindable<ConfineMouseMode>(FrameworkSetting.ConfineMouseMode).SetDefault();
|
||||||
|
@ -64,7 +64,7 @@ namespace osu.Game.Overlays.Settings.Sections
|
|||||||
new SettingsButton
|
new SettingsButton
|
||||||
{
|
{
|
||||||
Text = SkinSettingsStrings.SkinLayoutEditor,
|
Text = SkinSettingsStrings.SkinLayoutEditor,
|
||||||
Action = () => skinEditor?.Toggle(),
|
Action = () => skinEditor?.ToggleVisibility(),
|
||||||
},
|
},
|
||||||
new ExportSkinButton(),
|
new ExportSkinButton(),
|
||||||
};
|
};
|
||||||
|
@ -19,10 +19,12 @@ namespace osu.Game.Skinning.Editor
|
|||||||
/// A container which handles loading a skin editor on user request for a specified target.
|
/// A container which handles loading a skin editor on user request for a specified target.
|
||||||
/// This also handles the scaling / positioning adjustment of the target.
|
/// This also handles the scaling / positioning adjustment of the target.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class SkinEditorOverlay : CompositeDrawable, IKeyBindingHandler<GlobalAction>
|
public class SkinEditorOverlay : OverlayContainer, IKeyBindingHandler<GlobalAction>
|
||||||
{
|
{
|
||||||
private readonly ScalingContainer scalingContainer;
|
private readonly ScalingContainer scalingContainer;
|
||||||
|
|
||||||
|
protected override bool BlockNonPositionalInput => true;
|
||||||
|
|
||||||
[CanBeNull]
|
[CanBeNull]
|
||||||
private SkinEditor skinEditor;
|
private SkinEditor skinEditor;
|
||||||
|
|
||||||
@ -49,30 +51,12 @@ namespace osu.Game.Skinning.Editor
|
|||||||
|
|
||||||
Hide();
|
Hide();
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case GlobalAction.ToggleSkinEditor:
|
|
||||||
Toggle();
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Toggle()
|
protected override void PopIn()
|
||||||
{
|
|
||||||
if (skinEditor == null)
|
|
||||||
Show();
|
|
||||||
else
|
|
||||||
skinEditor.ToggleVisibility();
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Hide()
|
|
||||||
{
|
|
||||||
// base call intentionally omitted.
|
|
||||||
skinEditor?.Hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Show()
|
|
||||||
{
|
{
|
||||||
// base call intentionally omitted as we have custom behaviour.
|
// base call intentionally omitted as we have custom behaviour.
|
||||||
|
|
||||||
@ -106,6 +90,12 @@ namespace osu.Game.Skinning.Editor
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void PopOut()
|
||||||
|
{
|
||||||
|
// base call intentionally omitted.
|
||||||
|
skinEditor?.Hide();
|
||||||
|
}
|
||||||
|
|
||||||
private void updateComponentVisibility()
|
private void updateComponentVisibility()
|
||||||
{
|
{
|
||||||
Debug.Assert(skinEditor != null);
|
Debug.Assert(skinEditor != null);
|
||||||
|
Reference in New Issue
Block a user