Exemple #1
0
    private void updateLevelInfo()
    {
        GridPanel panel = levellist.PrimaryGrid;

        panel.Rows.Clear();

        int i = 0;



        foreach (PVELevel level in PVEConfigs.instance.Levels)
        {
            object[]   vals = new object[9];
            PVEChapter pc   = PVEConfigs.instance.GetChapter(level.pveId);

            vals[0] = level.id;
            vals[1] = level.title;
            vals[2] = pc.title;
            vals[3] = level.subTitle;
            vals[4] = "res/png/map_route/" + level.mapId + ".png";
            vals[5] = false;
            vals[6] = "出战";
            vals[7] = level.id;

            GridRow gr = new GridRow(vals);
            gr.RowHeight = 150;

            panel.Rows.Add(gr);
            i++;
        }

        if (PVEConfigs.instance.EventLevels != null)
        {
            foreach (PVEEventLevel level in PVEConfigs.instance.EventLevels)
            {
                object[] vals = new object[9];


                vals[0] = level.id;
                vals[1] = level.title;
                vals[2] = tools.helper.getPVEEVENTAwardString(level);
                vals[3] = level.subTitle;
                vals[4] = "res/png/map_route/" + level.mapId + ".png";
                vals[5] = false;
                vals[6] = "出战";
                vals[7] = level.id;

                GridRow gr = new GridRow(vals);
                gr.RowHeight = 150;

                panel.Rows.Add(gr);
                i++;
            }
        }
    }
 public void CheckSelection(PVEChapter selectedChapter)
 {
     if (this.selectedStatus != null)
     {
         this.selectedStatus.SetActive(selectedChapter.id == this.chapterConfig.id);
     }
     if (this.isNew)
     {
         this.isNew = false;
         this.newIcon.SetActive(false);
     }
 }
 public void ShowChapterOf(PVEChapter chapterconfig)
 {
     if ((this.currentSelectedChapter != chapterconfig) && GlobalLock.instance.CanGo)
     {
         GlobalLock.instance.GoNow();
     }
     else
     {
         return;
     }
     this.targetLevel = 0;
     this.currentSelectedChapter = chapterconfig;
     this.UpdateChapterSelectStatus();
     this.UpdateLevels();
 }
 private void InitUIs()
 {
     this.RemoveAllChapterItems();
     if ((this.navigationTargetLevel == 0) && (CurrentWarParameters.selectedLevel != null))
     {
         this.navigationTargetLevel = CurrentWarParameters.selectedLevel.id;
     }
     if (this.navigationTargetLevel != 0)
     {
         PVELevel level = PVEConfigs.instance.GetLevel(this.navigationTargetLevel);
         if (level != null)
         {
             PVEChapter chapter = PVEConfigs.instance.GetChapter(level.pveId);
             if ((chapter != null) && (chapter.id <= GameData.instance.CurrentPVEChapterId))
             {
                 this.currentSelectedChapter = chapter;
                 if (this.navigationTargetLevel <= GameData.instance.CurrentPVE.pveLevelId)
                 {
                     this.targetLevel = this.navigationTargetLevel;
                 }
             }
         }
     }
     if (this.currentSelectedChapter == null)
     {
         this.currentSelectedChapter = PVEConfigs.instance.GetChapter(GameData.instance.CurrentPVE.pveId);
         this.targetLevel = GameData.instance.CurrentPVE.pveLevelId;
     }
     this.InitChapters();
     this.UpdateChapterSelectStatus();
     this.UpdateLevels();
 }
 public void UpdateChapter(PVEChapter config)
 {
     this.chapterConfig = config;
     this.passedChapterId = GameData.instance.CurrentPVEChapterId;
     this.UpdateUI();
 }