Пример #1
0
        private static void ViewAllUnviewed(ConCommandArgs args)
        {
            UserProfile userProfile   = args.GetSenderLocalUser().userProfile;
            var         viewableNames = (from node in ViewablesCatalog.rootNode.Descendants()
                                         where node.shouldShowUnviewed(userProfile)
                                         select node.fullName);
            var amountScanned = 0;

            foreach (var viewableName in viewableNames.ToList())
            {
                if (string.IsNullOrEmpty(viewableName))
                {
                    continue;
                }
                amountScanned++;
                if (cfgPrintProgressToConsole.Value)
                {
                    Debug.Log(viewableName);
                }
                if (cfgViewForAllLocalUsers.Value)
                {
                    foreach (LocalUser localUser in LocalUserManager.readOnlyLocalUsersList)
                    {
                        localUser.userProfile.MarkViewableAsViewed(viewableName);
                    }
                }
                else
                {
                    LocalUserManager.readOnlyLocalUsersList[0].userProfile.MarkViewableAsViewed(viewableName);
                }
            }
            if (amountScanned != 0)
            {
                Debug.Log($"Viewed {amountScanned} unviewed content!");
            }
            else
            {
                Debug.Log("Nothing left to view!");
            }
        }