Beispiel #1
0
        private void AddTopElements()
        {
            MenuLevel menuLevel1 = this.MenuRoot;
            int       num1       = 0;
            string    text1      = "ContinueGame";
            Action    onSelect1  = new Action(((MenuBase)this).ContinueGame);
            int       at1        = num1;
            MenuItem  menuItem   = menuLevel1.AddItem(text1, onSelect1, at1);

            menuItem.Disabled   = this.GameState.SaveData.IsNew || this.GameState.SaveData.Level == null || this.GameState.SaveData.CanNewGamePlus;
            menuItem.Selectable = !menuItem.Disabled;
            if (this.GameState.IsTrialMode || this.GameState.SaveData.IsNew)
            {
                MenuLevel menuLevel2 = this.MenuRoot;
                int       num2       = 1;
                string    text2      = "StartNewGame";
                Action    onSelect2  = new Action(((MenuBase)this).StartNewGame);
                int       num3       = menuItem.Disabled ? 1 : 0;
                int       at2        = num2;
                menuLevel2.AddItem(text2, onSelect2, num3 != 0, at2);
            }
            else
            {
                MenuLevel menuLevel2 = this.MenuRoot;
                int       num2       = 1;
                string    text2      = "StartNewGame";
                Action    onSelect2  = (Action)(() => this.ChangeMenuLevel(this.StartNewGameMenu, false));
                int       num3       = menuItem.Disabled ? 1 : 0;
                int       at2        = num2;
                menuLevel2.AddItem(text2, onSelect2, num3 != 0, at2);
            }
            if (this.GameState.SaveData.CanNewGamePlus)
            {
                MenuLevel menuLevel2 = this.MenuRoot;
                int       num2       = 2;
                string    text2      = "StartNewGamePlus";
                Action    onSelect2  = new Action(this.NewGamePlus);
                int       at2        = num2;
                menuLevel2.AddItem(text2, onSelect2, at2);
            }
            this.MenuRoot.SelectedIndex = this.GameState.SaveData.CanNewGamePlus ? 2 : (this.MenuRoot.Items[0].Selectable ? 0 : 1);
        }
Beispiel #2
0
        protected override void PostInitialize()
        {
            if (PauseMenu.Starfield == null)
            {
                ServiceHelper.AddComponent((IGameComponent)(PauseMenu.Starfield = new StarField(this.Game)));
            }
            MenuLevel menuLevel1 = this.MenuRoot;
            int       num1       = 0;
            string    text1      = "ResumeGame";
            Action    onSelect1  = new Action(((MenuBase)this).ResumeGame);
            int       at1        = num1;

            menuLevel1.AddItem(text1, onSelect1, at1);
            MenuLevel menuLevel2 = this.MenuRoot;
            int       num2       = 1;
            string    text2      = "StartNewGame";
            Action    onSelect2  = (Action)(() => this.ChangeMenuLevel(this.StartNewGameMenu, false));
            int       at2        = num2;

            menuLevel2.AddItem(text2, onSelect2, at2);
            this.wasStrict = this.InputManager.StrictRotation;
            this.InputManager.StrictRotation = false;
            this.GameState.SaveToCloud(false);
        }
Beispiel #3
0
 private void RefreshSlotsFor(MenuLevel level, SaveManagementLevel.SMOperation operation, Func<SaveSlotInfo, bool> condition)
 {
   level.Items.Clear();
   foreach (SaveSlotInfo saveSlotInfo in this.Slots)
   {
     SaveSlotInfo s = saveSlotInfo;
     MenuItem menuItem;
     if (saveSlotInfo.Empty)
       (menuItem = level.AddItem((string) null, (Action) (() => this.ChooseSaveSlot(s, operation)), -1)).SuffixText = (Func<string>) (() => StaticText.GetString("NewSlot"));
     else
       (menuItem = level.AddItem("SaveSlotPrefix", (Action) (() => this.ChooseSaveSlot(s, operation)), -1)).SuffixText = (Func<string>) (() => string.Format((IFormatProvider) CultureInfo.InvariantCulture, " {0} ({1:P1} - {2:dd\\.hh\\:mm})", (object) (s.Index + 1), (object) s.Percentage, (object) s.PlayTime));
     menuItem.Disabled = !condition(saveSlotInfo);
     menuItem.Selectable = condition(saveSlotInfo);
   }
   for (int index = 0; index < this.Items.Count; ++index)
   {
     if (level.Items[index].Selectable)
     {
       level.SelectedIndex = index;
       break;
     }
   }
 }