示例#1
0
 public LeaderboardsMenuLevel(MenuBase menuBase)
 {
   this.menuBase = menuBase;
 }
示例#2
0
 public ControlsMenuLevel(MenuBase menuBase)
 {
   this.InputManager = ServiceHelper.Get<IInputManager>();
   this.GameState = ServiceHelper.Get<IGameStateManager>();
   this.KeyboardManager = ServiceHelper.Get<IKeyboardStateManager>();
   this.MouseState = ServiceHelper.Get<IMouseStateManager>();
   this.menuBase = menuBase;
   this.IsDynamic = true;
   Dictionary<MappedAction, Keys> kmap = SettingsManager.Settings.KeyboardMapping;
   Dictionary<MappedAction, int> gmap = SettingsManager.Settings.GamepadMapping;
   for (int index = 0; index < 9; ++index)
     this.AddItem((string) null, MenuBase.SliderAction, -1).Selectable = false;
   this.otherGamepadsStart = this.Items.Count;
   MenuItem gjmi = this.AddItem("ControlsJump", -1);
   gjmi.Selected = (Action) (() => this.ChangeButton(gjmi));
   gjmi.SuffixText = (Func<string>) (() => " : " + this.Buttonize(gmap[MappedAction.Jump]));
   MenuItem gami = this.AddItem("ControlsAction", -1);
   gami.Selected = (Action) (() => this.ChangeButton(gami));
   gami.SuffixText = (Func<string>) (() => " : " + this.Buttonize(gmap[MappedAction.GrabThrow]));
   MenuItem gtmi = this.AddItem("ControlsTalk", -1);
   gtmi.Selected = (Action) (() => this.ChangeButton(gtmi));
   gtmi.SuffixText = (Func<string>) (() => " : " + this.Buttonize(gmap[MappedAction.CancelTalk]));
   MenuItem gmami = this.AddItem("Map_Title", -1);
   gmami.Selected = (Action) (() => this.ChangeButton(gmami));
   gmami.SuffixText = (Func<string>) (() => " : " + this.Buttonize(gmap[MappedAction.OpenMap]));
   MenuItem gimi = this.AddItem("ControlsInventory", -1);
   gimi.Selected = (Action) (() => this.ChangeButton(gimi));
   gimi.SuffixText = (Func<string>) (() => " : " + this.Buttonize(gmap[MappedAction.OpenInventory]));
   MenuItem gpmi = this.AddItem("ControlsPause", -1);
   gpmi.Selected = (Action) (() => this.ChangeButton(gpmi));
   gpmi.SuffixText = (Func<string>) (() => " : " + this.Buttonize(gmap[MappedAction.Pause]));
   MenuItem grlmi = this.AddItem("ControlsRotateLeft", -1);
   grlmi.Selected = (Action) (() => this.ChangeButton(grlmi));
   grlmi.SuffixText = (Func<string>) (() => " : " + this.Buttonize(gmap[MappedAction.RotateLeft]));
   MenuItem grrmi = this.AddItem("ControlsRotateRight", -1);
   grrmi.Selected = (Action) (() => this.ChangeButton(grrmi));
   grrmi.SuffixText = (Func<string>) (() => " : " + this.Buttonize(gmap[MappedAction.RotateRight]));
   MenuItem gclmi = this.AddItem("ControlsClampLook", -1);
   gclmi.Selected = (Action) (() => this.ChangeButton(gclmi));
   gclmi.SuffixText = (Func<string>) (() => " : " + this.Buttonize(gmap[MappedAction.ClampLook]));
   MenuItem gmzimi = this.AddItem("ControlsMapZoomIn", -1);
   gmzimi.Selected = (Action) (() => this.ChangeButton(gmzimi));
   gmzimi.SuffixText = (Func<string>) (() => " : " + this.Buttonize(gmap[MappedAction.MapZoomIn]));
   MenuItem gmzomi = this.AddItem("ControlsZoomOut", -1);
   gmzomi.Selected = (Action) (() => this.ChangeButton(gmzomi));
   gmzomi.SuffixText = (Func<string>) (() => " : " + this.Buttonize(gmap[MappedAction.MapZoomOut]));
   if (this.GameState.SaveData.HasFPView)
   {
     MenuItem gtfvmi = this.AddItem("ControlsToggleFpView", -1);
     gtfvmi.Selected = (Action) (() => this.ChangeButton(gtfvmi));
     gtfvmi.SuffixText = (Func<string>) (() => " : " + this.Buttonize(gmap[MappedAction.FpViewToggle]));
   }
   this.AddItem((string) null, MenuBase.SliderAction, -1).Selectable = false;
   this.AddItem("ResetToDefault", (Action) (() => this.ResetToDefault(false, true)), -1);
   this.keyboardStart = this.Items.Count;
   MenuItem jmi = this.AddItem("ControlsJump", -1);
   jmi.Selected = (Action) (() => this.ChangeKey(jmi));
   jmi.SuffixText = (Func<string>) (() => " : " + this.Localize((object) kmap[MappedAction.Jump]));
   MenuItem ami = this.AddItem("ControlsAction", -1);
   ami.Selected = (Action) (() => this.ChangeKey(ami));
   ami.SuffixText = (Func<string>) (() => " : " + this.Localize((object) kmap[MappedAction.GrabThrow]));
   MenuItem tmi = this.AddItem("ControlsTalk", -1);
   tmi.Selected = (Action) (() => this.ChangeKey(tmi));
   tmi.SuffixText = (Func<string>) (() => " : " + this.Localize((object) kmap[MappedAction.CancelTalk]));
   this.AddItem<ControlsMenuLevel.ArrowKeyMapping>("ControlsMove", MenuBase.SliderAction, false, (Func<ControlsMenuLevel.ArrowKeyMapping>) (() => this.UpToAKM(kmap[MappedAction.Up])), (Action<ControlsMenuLevel.ArrowKeyMapping, int>) ((lastValue, change) =>
   {
     ControlsMenuLevel.ArrowKeyMapping local_0_1 = this.UpToAKM(kmap[MappedAction.Up]) + change;
     if (local_0_1 == (ControlsMenuLevel.ArrowKeyMapping) 5)
       local_0_1 = ControlsMenuLevel.ArrowKeyMapping.WASD;
     if (local_0_1 < ControlsMenuLevel.ArrowKeyMapping.WASD)
       local_0_1 = ControlsMenuLevel.ArrowKeyMapping.Arrows;
     kmap[MappedAction.Up] = this.AKMToKey(local_0_1, 0);
     kmap[MappedAction.Left] = this.AKMToKey(local_0_1, 1);
     kmap[MappedAction.Down] = this.AKMToKey(local_0_1, 2);
     kmap[MappedAction.Right] = this.AKMToKey(local_0_1, 3);
     this.KeyboardManager.UpdateMapping();
   }), -1).SuffixText = (Func<string>) (() => " : " + this.Localize((object) this.UpToAKM(kmap[MappedAction.Up])));
   this.AddItem<ControlsMenuLevel.ArrowKeyMapping>("ControlsLook", MenuBase.SliderAction, false, (Func<ControlsMenuLevel.ArrowKeyMapping>) (() => this.UpToAKM(kmap[MappedAction.LookUp])), (Action<ControlsMenuLevel.ArrowKeyMapping, int>) ((lastValue, change) =>
   {
     ControlsMenuLevel.ArrowKeyMapping local_0_1 = this.UpToAKM(kmap[MappedAction.LookUp]) + change;
     if (local_0_1 == (ControlsMenuLevel.ArrowKeyMapping) 5)
       local_0_1 = ControlsMenuLevel.ArrowKeyMapping.WASD;
     if (local_0_1 < ControlsMenuLevel.ArrowKeyMapping.WASD)
       local_0_1 = ControlsMenuLevel.ArrowKeyMapping.Arrows;
     kmap[MappedAction.LookUp] = this.AKMToKey(local_0_1, 0);
     kmap[MappedAction.LookLeft] = this.AKMToKey(local_0_1, 1);
     kmap[MappedAction.LookDown] = this.AKMToKey(local_0_1, 2);
     kmap[MappedAction.LookRight] = this.AKMToKey(local_0_1, 3);
     this.KeyboardManager.UpdateMapping();
   }), -1).SuffixText = (Func<string>) (() => " : " + this.Localize((object) this.UpToAKM(kmap[MappedAction.LookUp])));
   MenuItem mami = this.AddItem("Map_Title", -1);
   mami.Selected = (Action) (() => this.ChangeKey(mami));
   mami.SuffixText = (Func<string>) (() => " : " + this.Localize((object) kmap[MappedAction.OpenMap]));
   MenuItem imi = this.AddItem("ControlsInventory", -1);
   imi.Selected = (Action) (() => this.ChangeKey(imi));
   imi.SuffixText = (Func<string>) (() => " : " + this.Localize((object) kmap[MappedAction.OpenInventory]));
   MenuItem pmi = this.AddItem("ControlsPause", -1);
   pmi.Selected = (Action) (() => this.ChangeKey(pmi));
   pmi.SuffixText = (Func<string>) (() => " : " + this.Localize((object) kmap[MappedAction.Pause]));
   MenuItem rlmi = this.AddItem("ControlsRotateLeft", -1);
   rlmi.Selected = (Action) (() => this.ChangeKey(rlmi));
   rlmi.SuffixText = (Func<string>) (() => " : " + this.Localize((object) kmap[MappedAction.RotateLeft]));
   MenuItem rrmi = this.AddItem("ControlsRotateRight", -1);
   rrmi.Selected = (Action) (() => this.ChangeKey(rrmi));
   rrmi.SuffixText = (Func<string>) (() => " : " + this.Localize((object) kmap[MappedAction.RotateRight]));
   MenuItem clmi = this.AddItem("ControlsClampLook", -1);
   clmi.Selected = (Action) (() => this.ChangeKey(clmi));
   clmi.SuffixText = (Func<string>) (() => " : " + this.Localize((object) kmap[MappedAction.ClampLook]));
   MenuItem mzimi = this.AddItem("ControlsMapZoomIn", -1);
   mzimi.Selected = (Action) (() => this.ChangeKey(mzimi));
   mzimi.SuffixText = (Func<string>) (() => " : " + this.Localize((object) kmap[MappedAction.MapZoomIn]));
   MenuItem mzomi = this.AddItem("ControlsZoomOut", -1);
   mzomi.Selected = (Action) (() => this.ChangeKey(mzomi));
   mzomi.SuffixText = (Func<string>) (() => " : " + this.Localize((object) kmap[MappedAction.MapZoomOut]));
   if (this.GameState.SaveData.HasFPView)
   {
     MenuItem tfvmi = this.AddItem("ControlsToggleFpView", -1);
     tfvmi.Selected = (Action) (() => this.ChangeKey(tfvmi));
     tfvmi.SuffixText = (Func<string>) (() => " : " + this.Localize((object) kmap[MappedAction.FpViewToggle]));
   }
   this.AddItem((string) null, MenuBase.SliderAction, -1).Selectable = false;
   this.AddItem("ResetToDefault", (Action) (() => this.ResetToDefault(true, false)), -1);
   this.selectorStart = this.Items.Count;
   this.AddItem("XboxGamepad", MenuBase.SliderAction, true, -1).UpperCase = true;
   this.AddItem("OtherGamepad", MenuBase.SliderAction, true, -1).UpperCase = true;
   this.AddItem("Keyboard", MenuBase.SliderAction, true, -1).UpperCase = true;
 }
示例#3
0
 public SaveManagementLevel(MenuBase menu)
 {
   this.Menu = menu;
 }