protected override void OnFinalize()
 {
     base.OnFinalize();
     // TODO: There was a report that the encyclopedia UI is bugged
     //_spriteCategoryEncyclopedia.Unload();
     RemoveLayer(_gauntletLayer);
     _gauntletLayer.ReleaseMovie(_gauntletMovie);
     _gauntletLayer = null !;
     _gauntletMovie = null !;
     _dataSource.ExecuteSelect(null);
     _dataSource = null !;
 }
        protected override void OnInitialize()
        {
            base.OnInitialize();
            var spriteData      = UIResourceManager.SpriteData;
            var resourceContext = UIResourceManager.ResourceContext;
            var uiresourceDepot = UIResourceManager.UIResourceDepot;

            _spriteCategoryEncyclopedia = spriteData.SpriteCategories["ui_encyclopedia"];
            _spriteCategoryEncyclopedia.Load(resourceContext, uiresourceDepot);
            _dataSource    = new ModOptionsVM();
            _gauntletLayer = new GauntletLayer(4000, "GauntletLayer");
            _gauntletMovie = _gauntletLayer.LoadMovie("ModOptionsView", _dataSource);
            _gauntletLayer.Input.RegisterHotKeyCategory(HotKeyManager.GetCategory("GenericPanelGameKeyCategory"));
            _gauntletLayer.InputRestrictions.SetInputRestrictions(true, InputUsageMask.All);
            _gauntletLayer.IsFocusLayer = true;
            AddLayer(_gauntletLayer);
            ScreenManager.TrySetFocus(_gauntletLayer);
        }