mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 07:06:35 +09:00
Resolve merge conflicts
This commit is contained in:
@ -7,6 +7,7 @@ using System.Linq;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using System.Collections.Generic;
|
||||
using osu.Framework.Logging;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Overlays.Notifications;
|
||||
|
||||
@ -20,14 +21,15 @@ namespace osu.Game.Graphics.Containers
|
||||
}
|
||||
|
||||
private OsuGame game;
|
||||
|
||||
private ChannelManager channelManager;
|
||||
private Action showNotImplementedError;
|
||||
|
||||
[BackgroundDependencyLoader(true)]
|
||||
private void load(OsuGame game, NotificationOverlay notifications)
|
||||
private void load(OsuGame game, NotificationOverlay notifications, ChannelManager channelManager)
|
||||
{
|
||||
// will be null in tests
|
||||
this.game = game;
|
||||
this.channelManager = channelManager;
|
||||
|
||||
showNotImplementedError = () => notifications?.Post(new SimpleNotification
|
||||
{
|
||||
@ -77,7 +79,15 @@ namespace osu.Game.Graphics.Containers
|
||||
game?.ShowBeatmapSet(setId);
|
||||
break;
|
||||
case LinkAction.OpenChannel:
|
||||
game?.OpenChannel(linkArgument);
|
||||
try
|
||||
{
|
||||
channelManager?.OpenChannel(linkArgument);
|
||||
}
|
||||
catch (ChannelNotFoundException e)
|
||||
{
|
||||
Logger.Log($"The requested channel \"{linkArgument}\" does not exist");
|
||||
}
|
||||
|
||||
break;
|
||||
case LinkAction.OpenEditorTimestamp:
|
||||
case LinkAction.JoinMultiplayerMatch:
|
||||
|
@ -2,9 +2,6 @@
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Reflection;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace osu.Game.Graphics.UserInterface
|
||||
{
|
||||
@ -15,18 +12,7 @@ namespace osu.Game.Graphics.UserInterface
|
||||
if (!typeof(T).IsEnum)
|
||||
throw new InvalidOperationException("OsuEnumDropdown only supports enums as the generic type argument");
|
||||
|
||||
List<KeyValuePair<string, T>> items = new List<KeyValuePair<string, T>>();
|
||||
foreach (var val in (T[])Enum.GetValues(typeof(T)))
|
||||
{
|
||||
var field = typeof(T).GetField(Enum.GetName(typeof(T), val));
|
||||
items.Add(
|
||||
new KeyValuePair<string, T>(
|
||||
field.GetCustomAttribute<DescriptionAttribute>()?.Description ?? Enum.GetName(typeof(T), val),
|
||||
val
|
||||
)
|
||||
);
|
||||
}
|
||||
Items = items;
|
||||
Items = (T[])Enum.GetValues(typeof(T));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user