Exemple #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);
 }
Exemple #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);
 }
Exemple #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);
        }
Exemple #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;
            }
        }
Exemple #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;
            }
        }