Exemple #1
0
 public override void OnLostFocus()
 {
     base.OnLostFocus();
     list.Clear();
     if (boundLevel != null)
     {
         boundLevel.ReleaseThumbnailReference();
         boundLevel = null;
     }
     InDLCMenu = false;
 }
        public void RebindLevel()
        {
            if (level != null)
            {
                level.ReleaseThumbnailReference();
            }
            switch (NetGame.instance.currentLevelType)
            {
            case WorkshopItemSource.BuiltIn:
                WorkshopRepository.instance.LoadBuiltinLevels();
                break;

            case WorkshopItemSource.BuiltInLobbies:
                WorkshopRepository.instance.LoadBuiltinLevels(requestLobbies: true);
                break;

            case WorkshopItemSource.EditorPick:
                WorkshopRepository.instance.LoadEditorPickLevels();
                break;
            }
            WorkshopRepository.instance.levelRepo.GetLevel(NetGame.instance.currentLevel, NetGame.instance.currentLevelType, delegate(WorkshopLevelMetadata l)
            {
                level     = l;
                bool flag = false;
                if (level != null)
                {
                    if (NetGame.isServer && DLC.instance.SupportsDLC() && level.workshopId < 16 && !DLC.instance.LevelIsAvailable((int)level.workshopId))
                    {
                        flag = true;
                    }
                    if (!flag)
                    {
                        BindImage(level.thumbnailTexture);
                        levelName.text = level.title;
                    }
                }
                else
                {
                    flag = true;
                }
                if (flag)
                {
                    BindImage(null);
                    levelName.text = "MISSING";
                    NetGame.instance.currentLevel = 0uL;
                    if (NetGame.isServer)
                    {
                        App.instance.ChangeLobbyLevel(0uL, WorkshopItemSource.BuiltIn);
                    }
                    RebindLevel();
                }
            });
        }
    public override void OnLostFocus()
    {
        base.OnLostFocus();
        MenuSystem menuSystem = MenuSystem.instance;

        menuSystem.InputDeviceChange = (Action <MenuSystem.eInputDeviceType>)Delegate.Remove(menuSystem.InputDeviceChange, new Action <MenuSystem.eInputDeviceType>(OnInputDeviceChange));
        ButtonLegendBar.instance.ToogleCarouselLegend(state: false);
        NetGame.instance.transport.RegisterForGameOverlayActivation(null);
        InLevelSelectMenu = false;
        list.Clear();
        if (boundLevel != null)
        {
            boundLevel.ReleaseThumbnailReference();
            boundLevel = null;
        }
    }
Exemple #4
0
 public override void Bind(int index, object data)
 {
     base.Bind(index, data);
     level = (WorkshopLevelMetadata)data;
     if (level == null)
     {
         base.gameObject.SetActive(value: false);
     }
     else
     {
         base.gameObject.SetActive(value: true);
         if (label != null)
         {
             Type type = label.GetType();
             if (labelIsUIText)
             {
                 if (labelComponent != null)
                 {
                     ((Text)labelComponent).text = level.title;
                 }
             }
             else if (labelComponent != null)
             {
                 ((TextMeshProUGUI)labelComponent).text = level.title;
             }
             if (image != null && level != null)
             {
                 image.texture = level.thumbnailTexture;
             }
         }
         if (newLevelStar != null)
         {
             bool active = false;
             if (!GameSave.HasSeenLatestLevel() && level.levelType == WorkshopItemSource.EditorPick && level.workshopId == 2)
             {
                 active = true;
             }
             newLevelStar.SetActive(active);
         }
     }
     if (boundData != null)
     {
         boundData.ReleaseThumbnailReference();
     }
     boundData = level;
 }