Example #1
0
 public BombBinderCommander(BombBinder bombBinder)
 {
     BombBinder        = bombBinder;
     Selectable        = BombBinder.GetComponent <Selectable>();
     FloatingHoldable  = BombBinder.GetComponent <FloatingHoldable>();
     SelectableManager = KTInputManager.Instance.SelectableManager;
 }
Example #2
0
        internal void ShowStamp()
        {
            BombBinder bombBinder = SceneManager.Instance.PostGameState.Room.BombBinder;

            ShowStamp(bombBinder.ResultDefusedPage);
            ShowStamp(bombBinder.ResultExplodedPage);
            ShowStamp(bombBinder.ResultFreeplayDefusedPage);
            ShowStamp(bombBinder.ResultFreeplayExplodedPage);
            ShowStamp(bombBinder.ResultTournamentPage);
        }
Example #3
0
        private IEnumerator ConvertCoroutine()
        {
            yield return(null);

            yield return(null);

            BombBinder bombBinder = SceneManager.Instance.PostGameState.Room.BombBinder;

            ConvertResultsPage(bombBinder.ResultDefusedPage);
            ConvertResultsPage(bombBinder.ResultExplodedPage);
            ConvertResultsPage(bombBinder.ResultFreeplayDefusedPage);
            ConvertResultsPage(bombBinder.ResultFreeplayExplodedPage);
            ConvertResultsPage(bombBinder.ResultTournamentPage);
        }
Example #4
0
    public static IEnumerator Search(FloatingHoldable holdable, [Group(1)] string query)
    {
        BombBinder binder      = SceneManager.Instance.SetupState.Room.GetComponent <SetupRoom>().BombBinder;
        var        pageManager = binder.MissionTableOfContentsPageManager;

        var possibleMissions = ModManager.Instance.ModMissions
                               .Concat(MissionManager.Instance.MissionDB.Missions)
                               .Where(mission => Localization.GetLocalizedString(mission.DisplayNameTerm)?.ContainsIgnoreCase(query) == true);

        switch (possibleMissions.Count())
        {
        case 0:
            IRCConnection.SendMessage($"There are no missions that match \"{query}\".");
            break;

        case 1:
            var missionID = possibleMissions.First().ID;
            binder.ShowMissionDetail(missionID, binder.MissionTableOfContentsPageManager.GetMissionEntry(missionID).Selectable);
            pageManager.FindMissionInBinder(missionID, out int tocIndex, out int pageIndex, out _);
            pageManager.SetValue("currentToCIndex", tocIndex);
            pageManager.SetValue("currentPageIndex", pageIndex);
            yield return(null);

            break;

        default:
            IRCConnection.SendMessage($"{possibleMissions.Count()} missions match \"{query}\", displaying matching missions in the binder.");

            var tableOfContentsList = pageManager.GetValue <List <MissionTableOfContents> >("tableOfContentsList");

            var previousResults = pageManager.GetToC("toc_tp_search");
            if (previousResults != null)
            {
                previousResults.ClearPages();
                tableOfContentsList.Remove(previousResults);
            }

            var missionIDs = possibleMissions.Select(mission => mission.ID);
            var metaData   = new TableOfContentsMetaData
            {
                ID       = "toc_tp_search",
                Sections = tableOfContentsList
                           .SelectMany(toc => toc.GetValue <TableOfContentsMetaData>("tocData").Sections)
                           .Where(section => missionIDs.Any(section.MissionIDs.Contains))
                           .Select(section => new SectionMetaData
                {
                    SectionNum = section.SectionNum,
                    TitleTerm  = section.TitleTerm,
                    MissionIDs = missionIDs.Where(section.MissionIDs.Contains).ToList(),
                    IsUnlocked = section.IsUnlocked
                })
                           .ToList()
            };

            MissionTableOfContents missionTableOfContents = new MissionTableOfContents();
            missionTableOfContents.Init(pageManager, metaData, binder.Selectable, true);
            tableOfContentsList.Add(missionTableOfContents);

            pageManager.ShowToC("toc_tp_search");

            yield return(null);

            break;
        }

        InitializePage(holdable);
    }