mirror of
https://github.com/osukey/osukey.git
synced 2025-05-30 09:57:21 +09:00
Merge branch 'master' into fps-counter-cleanup
This commit is contained in:
commit
be0d73f951
@ -34,6 +34,16 @@ namespace osu.Game.Localisation
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static LocalisableString RestartTrack => new TranslatableString(getKey(@"restart_track"), @"Restart track");
|
public static LocalisableString RestartTrack => new TranslatableString(getKey(@"restart_track"), @"Restart track");
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// "Beatmap saved"
|
||||||
|
/// </summary>
|
||||||
|
public static LocalisableString BeatmapSaved => new TranslatableString(getKey(@"beatmap_saved"), @"Beatmap saved");
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// "Skin saved"
|
||||||
|
/// </summary>
|
||||||
|
public static LocalisableString SkinSaved => new TranslatableString(getKey(@"skin_saved"), @"Skin saved");
|
||||||
|
|
||||||
private static string getKey(string key) => $@"{prefix}:{key}";
|
private static string getKey(string key) => $@"{prefix}:{key}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -118,7 +118,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
|||||||
RelativeSizeAxes = Axes.Y,
|
RelativeSizeAxes = Axes.Y,
|
||||||
Height = 0.5f,
|
Height = 0.5f,
|
||||||
Icon = FontAwesome.Solid.SearchPlus,
|
Icon = FontAwesome.Solid.SearchPlus,
|
||||||
Action = () => changeZoom(1)
|
Action = () => Timeline.AdjustZoomRelatively(1)
|
||||||
},
|
},
|
||||||
new TimelineButton
|
new TimelineButton
|
||||||
{
|
{
|
||||||
@ -127,7 +127,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
|||||||
RelativeSizeAxes = Axes.Y,
|
RelativeSizeAxes = Axes.Y,
|
||||||
Height = 0.5f,
|
Height = 0.5f,
|
||||||
Icon = FontAwesome.Solid.SearchMinus,
|
Icon = FontAwesome.Solid.SearchMinus,
|
||||||
Action = () => changeZoom(-1)
|
Action = () => Timeline.AdjustZoomRelatively(-1)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -153,7 +153,5 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
|||||||
Timeline.ControlPointsVisible.BindTo(controlPointsCheckbox.Current);
|
Timeline.ControlPointsVisible.BindTo(controlPointsCheckbox.Current);
|
||||||
Timeline.TicksVisible.BindTo(ticksCheckbox.Current);
|
Timeline.TicksVisible.BindTo(ticksCheckbox.Current);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void changeZoom(float change) => Timeline.Zoom += change;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -127,7 +127,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
|||||||
if (e.AltPressed)
|
if (e.AltPressed)
|
||||||
{
|
{
|
||||||
// zoom when holding alt.
|
// zoom when holding alt.
|
||||||
setZoomTarget(zoomTarget + e.ScrollDelta.Y, zoomedContent.ToLocalSpace(e.ScreenSpaceMousePosition).X);
|
AdjustZoomRelatively(e.ScrollDelta.Y, zoomedContent.ToLocalSpace(e.ScreenSpaceMousePosition).X);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -145,12 +145,19 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
|||||||
zoomedContentWidthCache.Validate();
|
zoomedContentWidthCache.Validate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void AdjustZoomRelatively(float change, float? focusPoint = null)
|
||||||
|
{
|
||||||
|
const float zoom_change_sensitivity = 0.02f;
|
||||||
|
|
||||||
|
setZoomTarget(zoomTarget + change * (MaxZoom - minZoom) * zoom_change_sensitivity, focusPoint);
|
||||||
|
}
|
||||||
|
|
||||||
private float zoomTarget = 1;
|
private float zoomTarget = 1;
|
||||||
|
|
||||||
private void setZoomTarget(float newZoom, float focusPoint)
|
private void setZoomTarget(float newZoom, float? focusPoint = null)
|
||||||
{
|
{
|
||||||
zoomTarget = Math.Clamp(newZoom, MinZoom, MaxZoom);
|
zoomTarget = Math.Clamp(newZoom, MinZoom, MaxZoom);
|
||||||
transformZoomTo(zoomTarget, focusPoint, ZoomDuration, ZoomEasing);
|
transformZoomTo(zoomTarget, focusPoint ?? DrawWidth / 2, ZoomDuration, ZoomEasing);
|
||||||
|
|
||||||
OnZoomChanged();
|
OnZoomChanged();
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,7 @@ using osu.Framework.Graphics.UserInterface;
|
|||||||
using osu.Framework.Input;
|
using osu.Framework.Input;
|
||||||
using osu.Framework.Input.Bindings;
|
using osu.Framework.Input.Bindings;
|
||||||
using osu.Framework.Input.Events;
|
using osu.Framework.Input.Events;
|
||||||
|
using osu.Framework.Localisation;
|
||||||
using osu.Framework.Logging;
|
using osu.Framework.Logging;
|
||||||
using osu.Framework.Platform;
|
using osu.Framework.Platform;
|
||||||
using osu.Framework.Screens;
|
using osu.Framework.Screens;
|
||||||
@ -31,10 +32,11 @@ using osu.Game.Database;
|
|||||||
using osu.Game.Graphics.Cursor;
|
using osu.Game.Graphics.Cursor;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
using osu.Game.Input.Bindings;
|
using osu.Game.Input.Bindings;
|
||||||
|
using osu.Game.Localisation;
|
||||||
using osu.Game.Online.API;
|
using osu.Game.Online.API;
|
||||||
using osu.Game.Overlays;
|
using osu.Game.Overlays;
|
||||||
using osu.Game.Overlays.Notifications;
|
using osu.Game.Overlays.Notifications;
|
||||||
using osu.Game.Resources.Localisation.Web;
|
using osu.Game.Overlays.OSD;
|
||||||
using osu.Game.Rulesets;
|
using osu.Game.Rulesets;
|
||||||
using osu.Game.Rulesets.Edit;
|
using osu.Game.Rulesets.Edit;
|
||||||
using osu.Game.Rulesets.Objects;
|
using osu.Game.Rulesets.Objects;
|
||||||
@ -50,6 +52,7 @@ using osu.Game.Screens.Play;
|
|||||||
using osu.Game.Users;
|
using osu.Game.Users;
|
||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
using osuTK.Input;
|
using osuTK.Input;
|
||||||
|
using CommonStrings = osu.Game.Resources.Localisation.Web.CommonStrings;
|
||||||
|
|
||||||
namespace osu.Game.Screens.Edit
|
namespace osu.Game.Screens.Edit
|
||||||
{
|
{
|
||||||
@ -169,6 +172,9 @@ namespace osu.Game.Screens.Edit
|
|||||||
[Cached]
|
[Cached]
|
||||||
private readonly OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Aquamarine);
|
private readonly OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Aquamarine);
|
||||||
|
|
||||||
|
[Resolved(canBeNull: true)]
|
||||||
|
private OnScreenDisplay onScreenDisplay { get; set; }
|
||||||
|
|
||||||
public Editor(EditorLoader loader = null)
|
public Editor(EditorLoader loader = null)
|
||||||
{
|
{
|
||||||
this.loader = loader;
|
this.loader = loader;
|
||||||
@ -405,6 +411,7 @@ namespace osu.Game.Screens.Edit
|
|||||||
// no longer new after first user-triggered save.
|
// no longer new after first user-triggered save.
|
||||||
isNewBeatmap = false;
|
isNewBeatmap = false;
|
||||||
updateLastSavedHash();
|
updateLastSavedHash();
|
||||||
|
onScreenDisplay?.Display(new BeatmapEditorToast(ToastStrings.BeatmapSaved, editorBeatmap.BeatmapInfo.GetDisplayTitle()));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -934,5 +941,13 @@ namespace osu.Game.Screens.Edit
|
|||||||
ControlPointInfo IBeatSyncProvider.ControlPoints => editorBeatmap.ControlPointInfo;
|
ControlPointInfo IBeatSyncProvider.ControlPoints => editorBeatmap.ControlPointInfo;
|
||||||
IClock IBeatSyncProvider.Clock => clock;
|
IClock IBeatSyncProvider.Clock => clock;
|
||||||
ChannelAmplitudes? IBeatSyncProvider.Amplitudes => Beatmap.Value.TrackLoaded ? Beatmap.Value.Track.CurrentAmplitudes : null;
|
ChannelAmplitudes? IBeatSyncProvider.Amplitudes => Beatmap.Value.TrackLoaded ? Beatmap.Value.Track.CurrentAmplitudes : null;
|
||||||
|
|
||||||
|
private class BeatmapEditorToast : Toast
|
||||||
|
{
|
||||||
|
public BeatmapEditorToast(LocalisableString value, string beatmapDisplayName)
|
||||||
|
: base(InputSettingsStrings.EditorSection, value, beatmapDisplayName)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,21 +13,26 @@ using osu.Framework.Bindables;
|
|||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.UserInterface;
|
using osu.Framework.Graphics.UserInterface;
|
||||||
|
using osu.Framework.Input;
|
||||||
|
using osu.Framework.Input.Bindings;
|
||||||
using osu.Framework.Input.Events;
|
using osu.Framework.Input.Events;
|
||||||
|
using osu.Framework.Localisation;
|
||||||
using osu.Framework.Testing;
|
using osu.Framework.Testing;
|
||||||
using osu.Game.Database;
|
using osu.Game.Database;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
using osu.Game.Graphics.Cursor;
|
using osu.Game.Graphics.Cursor;
|
||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
|
using osu.Game.Localisation;
|
||||||
using osu.Game.Overlays;
|
using osu.Game.Overlays;
|
||||||
|
using osu.Game.Overlays.OSD;
|
||||||
using osu.Game.Screens.Edit.Components;
|
using osu.Game.Screens.Edit.Components;
|
||||||
using osu.Game.Screens.Edit.Components.Menus;
|
using osu.Game.Screens.Edit.Components.Menus;
|
||||||
|
|
||||||
namespace osu.Game.Skinning.Editor
|
namespace osu.Game.Skinning.Editor
|
||||||
{
|
{
|
||||||
[Cached(typeof(SkinEditor))]
|
[Cached(typeof(SkinEditor))]
|
||||||
public class SkinEditor : VisibilityContainer, ICanAcceptFiles
|
public class SkinEditor : VisibilityContainer, ICanAcceptFiles, IKeyBindingHandler<PlatformAction>
|
||||||
{
|
{
|
||||||
public const double TRANSITION_DURATION = 500;
|
public const double TRANSITION_DURATION = 500;
|
||||||
|
|
||||||
@ -68,6 +73,9 @@ namespace osu.Game.Skinning.Editor
|
|||||||
private EditorSidebar componentsSidebar;
|
private EditorSidebar componentsSidebar;
|
||||||
private EditorSidebar settingsSidebar;
|
private EditorSidebar settingsSidebar;
|
||||||
|
|
||||||
|
[Resolved(canBeNull: true)]
|
||||||
|
private OnScreenDisplay onScreenDisplay { get; set; }
|
||||||
|
|
||||||
public SkinEditor()
|
public SkinEditor()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -199,6 +207,25 @@ namespace osu.Game.Skinning.Editor
|
|||||||
SelectedComponents.BindCollectionChanged((_, _) => Scheduler.AddOnce(populateSettings), true);
|
SelectedComponents.BindCollectionChanged((_, _) => Scheduler.AddOnce(populateSettings), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool OnPressed(KeyBindingPressEvent<PlatformAction> e)
|
||||||
|
{
|
||||||
|
switch (e.Action)
|
||||||
|
{
|
||||||
|
case PlatformAction.Save:
|
||||||
|
if (e.Repeat)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
Save();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void OnReleased(KeyBindingReleaseEvent<PlatformAction> e)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
public void UpdateTargetScreen(Drawable targetScreen)
|
public void UpdateTargetScreen(Drawable targetScreen)
|
||||||
{
|
{
|
||||||
this.targetScreen = targetScreen;
|
this.targetScreen = targetScreen;
|
||||||
@ -316,6 +343,7 @@ namespace osu.Game.Skinning.Editor
|
|||||||
currentSkin.Value.UpdateDrawableTarget(t);
|
currentSkin.Value.UpdateDrawableTarget(t);
|
||||||
|
|
||||||
skins.Save(skins.CurrentSkin.Value);
|
skins.Save(skins.CurrentSkin.Value);
|
||||||
|
onScreenDisplay?.Display(new SkinEditorToast(ToastStrings.SkinSaved, currentSkin.Value.SkinInfo.ToString()));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool OnHover(HoverEvent e) => true;
|
protected override bool OnHover(HoverEvent e) => true;
|
||||||
@ -395,5 +423,13 @@ namespace osu.Game.Skinning.Editor
|
|||||||
|
|
||||||
game?.UnregisterImportHandler(this);
|
game?.UnregisterImportHandler(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private class SkinEditorToast : Toast
|
||||||
|
{
|
||||||
|
public SkinEditorToast(LocalisableString value, string skinDisplayName)
|
||||||
|
: base(SkinSettingsStrings.SkinLayoutEditor, value, skinDisplayName)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user