Ejemplo n.º 1
0
        protected void EnhancedLevelsScreen_OnOptionCreated(Vector4 pos, bool selected, string optionDisplayText, uint index, int page, ButtonHolder holder)
        {
            if (holder == null)
            {
                return;
            }

            MissionType        mt;
            bool               enhancedOnly;
            List <Achievement> allAchievements;

            LevelInfo info = (LevelInfo)availableOptions.ToArray()[index];


            Level.PeekMissionDetails(info.Filename, out mt, out enhancedOnly, out allAchievements);
            enhancedMissionsMap[holder] = enhancedOnly;
            levelInfoMap[holder]        = info;

            CompletedLevelsInfo completedLevelsInfo = LoadGameUtil.Singleton.CompletedLevelsInfo;
            List <Achievement>  achievementsDone    = LoadGameUtil.Singleton.GetCompletedAchievementsForLevel(info);

            if (allAchievements != null)
            {
                LoadGameUtil.MergeAchievements(achievementsDone, allAchievements);
            }


            string filename = Level.GetMissionTypeTextureFile(mt);

            if (filename != null)
            {
                guiWindow.createStaticImage(new Vector4(Viewport.ActualWidth / 2 - GetTextVSpacing(), pos.y, GetTextVSpacing(), GetTextVSpacing()), filename, (ushort)(1000 + index));
            }

            if (enhancedOnly)
            {
                guiWindow.createStaticImage(new Vector4(Viewport.ActualWidth / 2 - 5.0f * GetTextVSpacing(), pos.y, GetTextVSpacing(), GetTextVSpacing()), "pin.png", (ushort)(1100 + index));
            }

            int i = 1;

            if (allAchievements == null)
            {
                return;
            }

            foreach (Achievement a in allAchievements)
            {
                i++;
                string image;
                image = a.IsFulfilled() ? a.GetFulfilledImageFilename() : a.GetUnFulfilledImageFilename();

                guiWindow.createStaticImage(new Vector4((Viewport.ActualWidth / 2) - i * GetTextVSpacing(), pos.y, GetTextVSpacing(), GetTextVSpacing()), image, (ushort)(2000 + index));
            }
        }
Ejemplo n.º 2
0
 protected override List <object> GetAvailableOptions()
 {
     if (GameConsts.Game.AllLevelsCheat)
     {
         return(LoadGameUtil.GetAllPossibleLevelsFull());
     }
     else
     {
         return(LoadGameUtil.GetCompletedLevelsFull());
     }
 }
Ejemplo n.º 3
0
 protected override List <object> GetAvailableOptions()
 {
     return(LoadGameUtil.GetEnhancedLevels());
 }