Beispiel #1
0
        private static async void StartupIgs(IGameSettings settings, IAppNotificationService notifications)
        {
            if (settings.Interface.IgsAutoLogin && settings.Interface.IgsRememberPassword)
            {
                if (await Connections.Igs.ConnectAsync())
                {
                    var success = await Connections.Igs.LoginAsync(settings.Interface.IgsName, settings.Interface.IgsPassword);

                    if (!success)
                    {
                        notifications.TriggerNotification(new BubbleNotification("IGS auto-login failed.", "Pandanet", NotificationType.Error));
                    }
                }
            }
        }
Beispiel #2
0
        /// <summary>
        /// Adds quest points with possible notification to the user
        /// </summary>
        /// <param name="addedPoints">Points to add to the user</param>
        public void AddPoints(int addedPoints)
        {
            var newValue = _gameSettings.Quests.Points + addedPoints;
            int oldvalue = _gameSettings.Quests.Points;

            if (newValue > oldvalue)
            {
                _appNotificationService.TriggerNotification(
                    new BubbleNotification(
                        string.Format(
                            _localizer.YouHaveGainedXPointsNowYouHaveY,
                            addedPoints,
                            newValue), null, NotificationType.Achievement));
                if (Ranks.AdvancedInRank(oldvalue, newValue))
                {
                    _appNotificationService.TriggerNotification(
                        new BubbleNotification(
                            string.Format(
                                _localizer.YouHaveAdvancedToNewRankX,
                                Ranks.GetRankName(_localizer, newValue)), null, NotificationType.Achievement));
                }
            }
            _gameSettings.Quests.Points = newValue;
        }