1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-07 07:27:25 +08:00
osu-lazer/osu.Game/Overlays/Options/Online/NotificationsOptions.cs

43 lines
2.1 KiB
C#
Raw Normal View History

2016-11-09 11:38:40 +08:00
using osu.Framework;
using osu.Framework.Graphics;
using osu.Framework.Graphics.UserInterface;
2016-11-09 11:38:40 +08:00
using osu.Game.Configuration;
namespace osu.Game.Overlays.Options.Online
{
public class NotificationsOptions : OptionsSubsection
{
protected override string Header => "Notifications";
2016-11-09 11:38:40 +08:00
private CheckBoxOption chatTicker, notifyMention, notifyChat, audibleNotification,
notificationsDuringGameplay, notifyFriendStatus;
public NotificationsOptions()
{
Children = new Drawable[]
{
2016-11-09 11:38:40 +08:00
chatTicker = new CheckBoxOption { LabelText = "Enable chat ticker" },
notifyMention = new CheckBoxOption { LabelText = "Show a notification popup when someone says your name" },
notifyChat = new CheckBoxOption { LabelText = "Show chat message notifications" },
audibleNotification = new CheckBoxOption { LabelText = "Play a sound when someone says your name" },
notificationsDuringGameplay = new CheckBoxOption { LabelText = "Show notification popups instantly during gameplay" },
notifyFriendStatus = new CheckBoxOption { LabelText = "Show notification popups when friends change status" },
};
}
2016-11-09 11:38:40 +08:00
protected override void Load(BaseGame game)
{
base.Load(game);
var osuGame = game as OsuGameBase;
if (osuGame != null)
{
chatTicker.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.Ticker);
notifyMention.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.ChatHighlightName);
notifyChat.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.ChatMessageNotification);
audibleNotification.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.ChatAudibleHighlight);
notificationsDuringGameplay.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.PopupDuringGameplay);
notifyFriendStatus.Bindable = osuGame.Config.GetBindable<bool>(OsuConfig.NotifyFriends);
}
}
}
}