internal ModOptionsWindowBuilder(GameObject owner, Mod ownerMod)
        {
            GameUIRoot.Instance.SetEscMenuDisabled(true);
            RegisterShouldCursorBeEnabledDelegate.Register(shouldCurorBeEnabled);
            GameUIRoot.Instance.RefreshCursorEnabled();

            owner.SetActive(false);
            _owner       = owner;
            _ownerMod    = ownerMod;
            _spawnedBase = InternalAssetBundleReferences.ModsWindow.InstantiateObject("ModOptionsCanvas");
            _spawnedBase.AddComponent <CloseModOptionsWindowOnEscapeKey>().Init(this); // used to make sure we can close the window with escape
            ModdedObject modObject = _spawnedBase.GetComponent <ModdedObject>();

            _content           = modObject.GetObject <GameObject>(0);
            _xButton           = modObject.GetObject <Button>(1);
            _pageButtonsHolder = modObject.GetObject <GameObject>(2);
            _xButton.onClick.AddListener(CloseWindow);

            DelegateScheduler.Instance.Schedule(delegate
            {
                PopulatePages();
                if (_pages.Count >= 1)
                {
                    SetPage(_pages[0]);
                }
            }, -1f); // We do -1f here because the game might be paused and cause this to be triggered right after it is unpaused
        }
        /// <summary>
        /// Closes the options window, does NOT open the parent window
        /// </summary>
        public void ForceCloseWindow()
        {
            RegisterShouldCursorBeEnabledDelegate.UnRegister(shouldCurorBeEnabled);

            GameObject.Destroy(_spawnedBase);
            GameUIRoot.Instance.SetEscMenuDisabled(false);

            GameUIRoot.Instance.RefreshCursorEnabled();
        }