Exemplo n.º 1
0
 public async Task XpNotify(NotifyPlace place = NotifyPlace.Guild, XpNotificationLocation type = XpNotificationLocation.Channel)
 {
     if (place == NotifyPlace.Guild)
     {
         await _service.ChangeNotificationType(ctx.User.Id, ctx.Guild.Id, type).ConfigureAwait(false);
     }
     else
     {
         await _service.ChangeNotificationType(ctx.User, type).ConfigureAwait(false);
     }
     await ctx.Channel.SendConfirmAsync("👌").ConfigureAwait(false);
 }
Exemplo n.º 2
0
 public async Task XpNotify(NotifyPlace place = NotifyPlace.Guild, XpNotificationType type = XpNotificationType.Dm)
 {
     if (place == NotifyPlace.Guild)
     {
         await _service.ChangeNotificationType(Context.User.Id, Context.Guild.Id, type).ConfigureAwait(false);
     }
     else
     {
         await _service.ChangeNotificationType(Context.User, type).ConfigureAwait(false);
     }
     await Context.Channel.SendConfirmAsync("notify_type_changed").ConfigureAwait(false);
 }
Exemplo n.º 3
0
        public async Task XpNotify(NotifyPlace place, XpNotificationLocation type)
        {
            if (place == NotifyPlace.Guild)
            {
                await _service.ChangeNotificationType(ctx.User.Id, ctx.Guild.Id, type).ConfigureAwait(false);
            }
            else
            {
                await _service.ChangeNotificationType(ctx.User, type).ConfigureAwait(false);
            }

            await ctx.OkAsync().ConfigureAwait(false);
        }
Exemplo n.º 4
0
        private void doNotify(NotifyPlace place, string text, LogLevel level)
        {
            switch (place)
            {
            case NotifyPlace.Monitor:
                NotifyMonitor(text, level);
                break;

            case NotifyPlace.GameHUD:
                NotifyHUD(text);
                break;

            case NotifyPlace.MonitorAndGameHUD:
                NotifyHUD(text);
                NotifyMonitor(text, level);
                break;
            }
        }
Exemplo n.º 5
0
        public void Notify(string text, NotifyPlace place, NotifyMoment moment, LogLevel level = LogLevel.Info)
        {
            switch (moment)
            {
            case NotifyMoment.Immediate:
                doNotify(place, text, level);
                break;

            case NotifyMoment.GameLaunched:
                helper.Events.GameLoop.GameLaunched += new System.EventHandler <StardewModdingAPI.Events.GameLaunchedEventArgs>((sender, e) =>
                {
                    doNotify(place, text, level);
                });
                break;

            case NotifyMoment.SaveLoaded:
                helper.Events.GameLoop.SaveLoaded += new System.EventHandler <StardewModdingAPI.Events.SaveLoadedEventArgs>((sender, e) =>
                {
                    doNotify(place, text, level);
                });
                break;
            }
        }