1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 19:42:55 +08:00

Skin Editor

This commit is contained in:
LukynkaCZE 2022-07-19 22:18:19 +02:00
parent a00da279b7
commit 51a0b5afdc
2 changed files with 27 additions and 0 deletions

View File

@ -44,6 +44,17 @@ namespace osu.Game.Localisation
/// </summary>
public static LocalisableString EditorSaveBeatmap => new TranslatableString(getKey(@"beatmap_editor_save"), @"Beatmap Saved");
/// <summary>
/// "Skin Editor"
/// </summary>
public static LocalisableString SkinEditor => new TranslatableString(getKey(@"skin_editor"), @"Skin Editor");
/// <summary>
/// "Skin Saved"
/// </summary>
public static LocalisableString EditorSaveSkin => new TranslatableString(getKey(@"skin_editor_save"), @"Skin Saved");
private static string getKey(string key) => $@"{prefix}:{key}";
}

View File

@ -14,13 +14,16 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.UserInterface;
using osu.Framework.Input.Events;
using osu.Framework.Localisation;
using osu.Framework.Testing;
using osu.Game.Database;
using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
using osu.Game.Graphics.Cursor;
using osu.Game.Graphics.UserInterface;
using osu.Game.Localisation;
using osu.Game.Overlays;
using osu.Game.Overlays.OSD;
using osu.Game.Screens.Edit.Components;
using osu.Game.Screens.Edit.Components.Menus;
@ -68,6 +71,9 @@ namespace osu.Game.Skinning.Editor
private EditorSidebar componentsSidebar;
private EditorSidebar settingsSidebar;
[Resolved(canBeNull: true)]
private OnScreenDisplay onScreenDisplay { get; set; }
public SkinEditor()
{
}
@ -316,6 +322,7 @@ namespace osu.Game.Skinning.Editor
currentSkin.Value.UpdateDrawableTarget(t);
skins.Save(skins.CurrentSkin.Value);
onScreenDisplay?.Display(new SkinEditorToast(ToastStrings.EditorSaveSkin, currentSkin.Value.SkinInfo.ToString()));
}
protected override bool OnHover(HoverEvent e) => true;
@ -395,5 +402,14 @@ namespace osu.Game.Skinning.Editor
game?.UnregisterImportHandler(this);
}
private class SkinEditorToast : Toast
{
public SkinEditorToast(LocalisableString value, string skinDisplayName)
: base(ToastStrings.SkinEditor, value, skinDisplayName) { }
}
}
}