public IndexToItem ( int index ) : dynamic | ||
index | int | Item's index. |
Résultat | dynamic |
public void OnListChange(UIMenu sender, UIMenuListItem list, int index) { if (sender != mainMenu || list != dishesListItem) return; // We only want to detect changes from our menu. string dish = list.IndexToItem(index).ToString(); UI.Notify("Preparing ~b~" + dish +"~w~..."); }
//when user change mission list private void OnListChange(UIMenu sender, UIMenuListItem listitem, int index) { if (sender == mi_menu) { mission = listitem.IndexToItem(index); } }
private void CreateMenu() { _mainMenu = new UIMenu("Tobii Eye Tracking", "~b~SETTINGS"); _mainMenu.SetMenuWidthOffset(50); //_mainMenu.ControlDisablingEnabled = false; _menuPool.Add(_mainMenu); var values0To1 = new List<dynamic>(); for (var i = 0; i <= 10; i++) { values0To1.Add(i * 0.1); } var valuesMinus1To1 = new List<dynamic>(); for (var i = -10; i <= 10; i++) { valuesMinus1To1.Add(i * 0.1); } var values0To70 = new List<dynamic>(); for (var i = 0; i <= 70; i++) { values0To70.Add((double)i); } var valuesMinus70To0 = new List<dynamic>(); for (var i = -70; i <= 0; i++) { valuesMinus70To0.Add((double)i); } var freelookDevices = new List<dynamic> { "Gamepad", "Mouse" }; _freelookDevice = new UIMenuListItem("Freelook device", freelookDevices, (int)_settings.FreelookDevice, "Device to use for freelook"); _freelookDevice.OnListChanged += (sender, args) => { _settings.FreelookDevice = (FeeelookDevice)_freelookDevice.Index; }; _mainMenu.AddItem(_freelookDevice); var thirdPersonFreelook = new UIMenuCheckboxItem("TPS Freelook", _settings.ThirdPersonFreelookEnabled, "Control camera with gaze"); thirdPersonFreelook.CheckboxEvent += (sender, args) => { _settings.ThirdPersonFreelookEnabled = thirdPersonFreelook.Checked; }; _mainMenu.AddItem(thirdPersonFreelook); var thirdPersonSensitivitySlider = new UIMenuListItem("TPS Freelook Sensitivity", values0To1, (int)Math.Round(_settings.ThirdPersonSensitivity / 0.1), "Freelook sensitivity"); thirdPersonSensitivitySlider.OnListChanged += (sender, args) => { _settings.ThirdPersonSensitivity = thirdPersonSensitivitySlider.IndexToItem(thirdPersonSensitivitySlider.Index); }; _mainMenu.AddItem(thirdPersonSensitivitySlider); { var thirdPersonYOffsetSlider = new UIMenuListItem("TPS Freelook Vertical Offset", valuesMinus1To1, (int)Math.Round((_settings.ThirdPersonYOffset + 1) / 0.1), "Freelook vertical offset"); thirdPersonYOffsetSlider.OnListChanged += (sender, args) => { _settings.ThirdPersonYOffset = thirdPersonYOffsetSlider.IndexToItem(thirdPersonYOffsetSlider.Index); }; _mainMenu.AddItem(thirdPersonYOffsetSlider); var thirdPersonDeadZoneWidthSlider = new UIMenuListItem("TPS Freelook Deadzone Width", values0To1, (int)Math.Round(_settings.ThirdPersonDeadZoneWidth / 0.1), "Freelook deadzone"); thirdPersonDeadZoneWidthSlider.OnListChanged += (sender, args) => { _settings.ThirdPersonDeadZoneWidth = thirdPersonDeadZoneWidthSlider.IndexToItem(thirdPersonDeadZoneWidthSlider.Index); }; _mainMenu.AddItem(thirdPersonDeadZoneWidthSlider); var thirdPersonDeadZoneHeightSlider = new UIMenuListItem("TPS Freelook Deadzone Height", values0To1, (int)Math.Round(_settings.ThirdPersonDeadZoneHeight / 0.1), "Freelook deadzone"); thirdPersonDeadZoneHeightSlider.OnListChanged += (sender, args) => { _settings.ThirdPersonDeadZoneHeight = thirdPersonDeadZoneHeightSlider.IndexToItem(thirdPersonDeadZoneHeightSlider.Index); }; _mainMenu.AddItem(thirdPersonDeadZoneHeightSlider); var thirdPersonMinPitchSlider = new UIMenuListItem("TPS Min Pitch", valuesMinus70To0, (int)Math.Round((_settings.ThirdPersonMinPitchDeg + 70) / 1), "Freelook min pitch angle"); thirdPersonMinPitchSlider.OnListChanged += (sender, args) => { _settings.ThirdPersonMinPitchDeg = thirdPersonMinPitchSlider.IndexToItem(thirdPersonMinPitchSlider.Index); }; _mainMenu.AddItem(thirdPersonMinPitchSlider); var thirdPersonMaxPitchSlider = new UIMenuListItem("TPS Max Pitch", values0To70, (int)Math.Round((_settings.ThirdPersonMaxPitchDeg) / 1), "Freelook max pitch angle"); thirdPersonMaxPitchSlider.OnListChanged += (sender, args) => { _settings.ThirdPersonMaxPitchDeg = thirdPersonMaxPitchSlider.IndexToItem(thirdPersonMaxPitchSlider.Index); }; _mainMenu.AddItem(thirdPersonMaxPitchSlider); } { var thirdPersonYOffsetDrivingSlider = new UIMenuListItem("TPS Freelook Vertical Offset Driving", valuesMinus1To1, (int)Math.Round((_settings.ThirdPersonYOffsetDriving + 1) / 0.1), "Freelook vertical offset"); thirdPersonYOffsetDrivingSlider.OnListChanged += (sender, args) => { _settings.ThirdPersonYOffsetDriving = thirdPersonYOffsetDrivingSlider.IndexToItem(thirdPersonYOffsetDrivingSlider.Index); }; _mainMenu.AddItem(thirdPersonYOffsetDrivingSlider); var thirdPersonDeadZoneWidthDrivingSlider = new UIMenuListItem("TPS Freelook Deadzone Width Driving", values0To1, (int)Math.Round(_settings.ThirdPersonDeadZoneWidthDriving / 0.1), "Freelook deadzone"); thirdPersonDeadZoneWidthDrivingSlider.OnListChanged += (sender, args) => { _settings.ThirdPersonDeadZoneWidthDriving = thirdPersonDeadZoneWidthDrivingSlider.IndexToItem(thirdPersonDeadZoneWidthDrivingSlider.Index); }; _mainMenu.AddItem(thirdPersonDeadZoneWidthDrivingSlider); var thirdPersonDeadZoneHeightDrivingSlider = new UIMenuListItem("TPS Freelook Deadzone Height Driving", values0To1, (int)Math.Round(_settings.ThirdPersonDeadZoneHeightDriving / 0.1), "Freelook deadzone"); thirdPersonDeadZoneHeightDrivingSlider.OnListChanged += (sender, args) => { _settings.ThirdPersonDeadZoneHeightDriving = thirdPersonDeadZoneHeightDrivingSlider.IndexToItem(thirdPersonDeadZoneHeightDrivingSlider.Index); }; _mainMenu.AddItem(thirdPersonDeadZoneHeightDrivingSlider); var thirdPersonMinPitchDrivingSlider = new UIMenuListItem("TPS Min Pitch Driving", valuesMinus70To0, (int)Math.Round((_settings.ThirdPersonMinPitchDrivingDeg + 70) / 1), "Freelook min pitch angle"); thirdPersonMinPitchDrivingSlider.OnListChanged += (sender, args) => { _settings.ThirdPersonMinPitchDrivingDeg = thirdPersonMinPitchDrivingSlider.IndexToItem(thirdPersonMinPitchDrivingSlider.Index); }; _mainMenu.AddItem(thirdPersonMinPitchDrivingSlider); var thirdPersonMaxPitchDrivingSlider = new UIMenuListItem("TPS Max Pitch Driving", values0To70, (int)Math.Round((_settings.ThirdPersonMaxPitchDeg) / 1), "Freelook max pitch angle"); thirdPersonMaxPitchDrivingSlider.OnListChanged += (sender, args) => { _settings.ThirdPersonMaxPitchDrivingDeg = thirdPersonMaxPitchDrivingSlider.IndexToItem(thirdPersonMaxPitchDrivingSlider.Index); }; _mainMenu.AddItem(thirdPersonMaxPitchDrivingSlider); } { var thirdPersonYOffsetPlaneSlider = new UIMenuListItem("TPS Freelook Vertical Offset Plane", valuesMinus1To1, (int)Math.Round((_settings.ThirdPersonYOffsetPlane + 1) / 0.1), "Freelook vertical offset"); thirdPersonYOffsetPlaneSlider.OnListChanged += (sender, args) => { _settings.ThirdPersonYOffsetPlane = thirdPersonYOffsetPlaneSlider.IndexToItem(thirdPersonYOffsetPlaneSlider.Index); }; _mainMenu.AddItem(thirdPersonYOffsetPlaneSlider); var thirdPersonDeadZoneWidthPlaneSlider = new UIMenuListItem("TPS Freelook Deadzone Width Plane", values0To1, (int)Math.Round(_settings.ThirdPersonDeadZoneWidthPlane / 0.1), "Freelook deadzone"); thirdPersonDeadZoneWidthPlaneSlider.OnListChanged += (sender, args) => { _settings.ThirdPersonDeadZoneWidthPlane = thirdPersonDeadZoneWidthPlaneSlider.IndexToItem(thirdPersonDeadZoneWidthPlaneSlider.Index); }; _mainMenu.AddItem(thirdPersonDeadZoneWidthPlaneSlider); var thirdPersonDeadZoneHeightPlaneSlider = new UIMenuListItem("TPS Freelook Deadzone Height Plane", values0To1, (int)Math.Round(_settings.ThirdPersonDeadZoneHeightPlane / 0.1), "Freelook deadzone"); thirdPersonDeadZoneHeightPlaneSlider.OnListChanged += (sender, args) => { _settings.ThirdPersonDeadZoneHeightPlane = thirdPersonDeadZoneHeightPlaneSlider.IndexToItem(thirdPersonDeadZoneHeightPlaneSlider.Index); }; _mainMenu.AddItem(thirdPersonDeadZoneHeightPlaneSlider); var thirdPersonMinPitchPlaneSlider = new UIMenuListItem("TPS Min Pitch Plane", valuesMinus70To0, (int)Math.Round((_settings.ThirdPersonMinPitchPlaneDeg + 70) / 1), "Freelook min pitch angle"); thirdPersonMinPitchPlaneSlider.OnListChanged += (sender, args) => { _settings.ThirdPersonMinPitchPlaneDeg = thirdPersonMinPitchPlaneSlider.IndexToItem(thirdPersonMinPitchPlaneSlider.Index); }; _mainMenu.AddItem(thirdPersonMinPitchPlaneSlider); var thirdPersonMaxPitchPlaneSlider = new UIMenuListItem("TPS Max Pitch Plane", values0To70, (int)Math.Round((_settings.ThirdPersonMaxPitchPlaneDeg) / 1), "Freelook max pitch angle"); thirdPersonMaxPitchPlaneSlider.OnListChanged += (sender, args) => { _settings.ThirdPersonMaxPitchPlaneDeg = thirdPersonMaxPitchPlaneSlider.IndexToItem(thirdPersonMaxPitchPlaneSlider.Index); }; _mainMenu.AddItem(thirdPersonMaxPitchPlaneSlider); } { var thirdPersonYOffsetHeliSlider = new UIMenuListItem("TPS Freelook Vertical Offset Heli", valuesMinus1To1, (int)Math.Round((_settings.ThirdPersonYOffsetHeli + 1) / 0.1), "Freelook vertical offset"); thirdPersonYOffsetHeliSlider.OnListChanged += (sender, args) => { _settings.ThirdPersonYOffsetHeli = thirdPersonYOffsetHeliSlider.IndexToItem(thirdPersonYOffsetHeliSlider.Index); }; _mainMenu.AddItem(thirdPersonYOffsetHeliSlider); var thirdPersonDeadZoneWidthHeliSlider = new UIMenuListItem("TPS Freelook Deadzone Width Heli", values0To1, (int)Math.Round(_settings.ThirdPersonDeadZoneWidthHeli / 0.1), "Freelook deadzone"); thirdPersonDeadZoneWidthHeliSlider.OnListChanged += (sender, args) => { _settings.ThirdPersonDeadZoneWidthHeli = thirdPersonDeadZoneWidthHeliSlider.IndexToItem(thirdPersonDeadZoneWidthHeliSlider.Index); }; _mainMenu.AddItem(thirdPersonDeadZoneWidthHeliSlider); var thirdPersonDeadZoneHeightHeliSlider = new UIMenuListItem("TPS Freelook Deadzone Height Heli", values0To1, (int)Math.Round(_settings.ThirdPersonDeadZoneHeightHeli / 0.1), "Freelook deadzone"); thirdPersonDeadZoneHeightHeliSlider.OnListChanged += (sender, args) => { _settings.ThirdPersonDeadZoneHeightHeli = thirdPersonDeadZoneHeightHeliSlider.IndexToItem(thirdPersonDeadZoneHeightHeliSlider.Index); }; _mainMenu.AddItem(thirdPersonDeadZoneHeightHeliSlider); var thirdPersonMinPitchHeliSlider = new UIMenuListItem("TPS Min Pitch Heli", valuesMinus70To0, (int)Math.Round((_settings.ThirdPersonMinPitchHeliDeg + 70) / 1), "Freelook min pitch angle"); thirdPersonMinPitchHeliSlider.OnListChanged += (sender, args) => { _settings.ThirdPersonMinPitchHeliDeg = thirdPersonMinPitchHeliSlider.IndexToItem(thirdPersonMinPitchHeliSlider.Index); }; _mainMenu.AddItem(thirdPersonMinPitchHeliSlider); var thirdPersonMaxPitchHeliSlider = new UIMenuListItem("TPS Max Pitch Heli", values0To70, (int)Math.Round((_settings.ThirdPersonMaxPitchDeg) / 1), "Freelook max pitch angle"); thirdPersonMaxPitchHeliSlider.OnListChanged += (sender, args) => { _settings.ThirdPersonMaxPitchHeliDeg = thirdPersonMaxPitchHeliSlider.IndexToItem(thirdPersonMaxPitchHeliSlider.Index); }; _mainMenu.AddItem(thirdPersonMaxPitchHeliSlider); } var firstPersonFreelook = new UIMenuCheckboxItem("FPS Freelook", _settings.FirstPersonFreelookEnabled, "Control camera with gaze"); firstPersonFreelook.CheckboxEvent += (sender, args) => { _settings.FirstPersonFreelookEnabled = firstPersonFreelook.Checked; }; _mainMenu.AddItem(firstPersonFreelook); var firstPersonSensitivitySlider = new UIMenuListItem("FPS Freelook Sensitivity", values0To1, (int)Math.Round(_settings.FirstPersonSensitivity / 0.1), "Freelook sensitivity"); firstPersonSensitivitySlider.OnListChanged += (sender, args) => { _settings.FirstPersonSensitivity = firstPersonSensitivitySlider.IndexToItem(firstPersonSensitivitySlider.Index); }; _mainMenu.AddItem(firstPersonSensitivitySlider); { var firstPersonDeadZoneWidthSlider = new UIMenuListItem("FPS Freelook Deadzone Width", values0To1, (int)Math.Round(_settings.FirstPersonDeadZoneWidth / 0.1), "Freelook deadzone"); firstPersonDeadZoneWidthSlider.OnListChanged += (sender, args) => { _settings.FirstPersonDeadZoneWidth = firstPersonDeadZoneWidthSlider.IndexToItem(firstPersonDeadZoneWidthSlider.Index); }; _mainMenu.AddItem(firstPersonDeadZoneWidthSlider); var firstPersonDeadZoneHeightSlider = new UIMenuListItem("FPS Freelook Deadzone Height", values0To1, (int)Math.Round(_settings.FirstPersonDeadZoneHeight / 0.1), "Freelook deadzone"); firstPersonDeadZoneHeightSlider.OnListChanged += (sender, args) => { _settings.FirstPersonDeadZoneHeight = firstPersonDeadZoneHeightSlider.IndexToItem(firstPersonDeadZoneHeightSlider.Index); }; _mainMenu.AddItem(firstPersonDeadZoneHeightSlider); var firstPersonMinPitchSlider = new UIMenuListItem("FPS Min Pitch", valuesMinus70To0, (int)Math.Round((_settings.FirstPersonMinPitchDeg + 70) / 1), "Freelook min pitch angle"); firstPersonMinPitchSlider.OnListChanged += (sender, args) => { _settings.FirstPersonMinPitchDeg = firstPersonMinPitchSlider.IndexToItem(firstPersonMinPitchSlider.Index); }; _mainMenu.AddItem(firstPersonMinPitchSlider); var firstPersonMaxPitchSlider = new UIMenuListItem("FPS Max Pitch", values0To70, (int)Math.Round((_settings.FirstPersonMaxPitchDeg) / 1), "Freelook max pitch angle"); firstPersonMaxPitchSlider.OnListChanged += (sender, args) => { _settings.FirstPersonMaxPitchDeg = firstPersonMaxPitchSlider.IndexToItem(firstPersonMaxPitchSlider.Index); }; _mainMenu.AddItem(firstPersonMaxPitchSlider); } var aimingSensitivitySlider = new UIMenuListItem("Aiming Sensitivity", values0To1, (int)Math.Round(_settings.AimingSensitivity / 0.1), "Freelok sensitivity while aiming"); aimingSensitivitySlider.OnListChanged += (sender, args) => { _settings.AimingSensitivity = aimingSensitivitySlider.IndexToItem(aimingSensitivitySlider.Index); }; _mainMenu.AddItem(aimingSensitivitySlider); var aimWithGaze = new UIMenuCheckboxItem("Aim With Gaze", _settings.AimWithGazeEnabled, "Aim with gaze"); aimWithGaze.CheckboxEvent += (sender, args) => { _settings.AimWithGazeEnabled = aimWithGaze.Checked; }; _mainMenu.AddItem(aimWithGaze); var snapAtPedestrians = new UIMenuCheckboxItem("Snap At Pedestrians", _settings.SnapAtPedestriansEnabled, "Snap aim at pedestrians"); snapAtPedestrians.CheckboxEvent += (sender, args) => { _settings.SnapAtPedestriansEnabled = snapAtPedestrians.Checked; }; _mainMenu.AddItem(snapAtPedestrians); var gazeFilteringSlider = new UIMenuListItem("Gaze Filter", values0To1, (int)Math.Round(_settings.GazeFiltering / 0.1), "Filter gaze data"); gazeFilteringSlider.OnListChanged += (sender, args) => { _settings.GazeFiltering = gazeFilteringSlider.IndexToItem(gazeFilteringSlider.Index); }; _mainMenu.AddItem(gazeFilteringSlider); var incinerateAtGaze = new UIMenuCheckboxItem("Incinerate At Gaze", _settings.IncinerateAtGazeEnabled, "Incinerate at gaze"); incinerateAtGaze.CheckboxEvent += (sender, args) => { _settings.IncinerateAtGazeEnabled = incinerateAtGaze.Checked; }; _mainMenu.AddItem(incinerateAtGaze); var taseAtGaze = new UIMenuCheckboxItem("Tase At Gaze", _settings.TaseAtGazeEnabled, "Tase at gaze"); taseAtGaze.CheckboxEvent += (sender, args) => { _settings.TaseAtGazeEnabled = taseAtGaze.Checked; }; _mainMenu.AddItem(taseAtGaze); var missilesAtGaze = new UIMenuCheckboxItem("Launch Missiles At Gaze", _settings.MissilesAtGazeEnabled, "Launch missiles at gaze"); missilesAtGaze.CheckboxEvent += (sender, args) => { _settings.MissilesAtGazeEnabled = missilesAtGaze.Checked; }; _mainMenu.AddItem(missilesAtGaze); var pedestrianIntreraction = new UIMenuCheckboxItem("Pedestrian Interaction", _settings.PedestrianInteractionEnabled, "Pedestrians talk to you"); pedestrianIntreraction.CheckboxEvent += (sender, args) => { _settings.PedestrianInteractionEnabled = pedestrianIntreraction.Checked; }; _mainMenu.AddItem(pedestrianIntreraction); var dontFallFromBikes = new UIMenuCheckboxItem("Don't Fall From Bikes", _settings.DontFallFromBikesEnabled, "Never fall from bikes"); dontFallFromBikes.CheckboxEvent += (sender, args) => { _settings.DontFallFromBikesEnabled = dontFallFromBikes.Checked; }; _mainMenu.AddItem(dontFallFromBikes); var dedzns = new UIMenuItem("Deadzones"); _mainMenu.AddItem(dedzns); _mainMenu.RefreshIndex(); { DeadzoneMenu = new UIMenu("Tobii Eye Tracking", "~b~DEADZONES"); DeadzoneMenu.SetMenuWidthOffset(50); _mainMenu.BindMenuToItem(DeadzoneMenu, dedzns); DeadzoneMenu.AddItem(new UIMenuItem("Add Deadzone", "Deadzones prevent camera movement when you are looking inside the zone, for example, the minimap.")); DeadzoneMenu.RefreshIndex(); _menuPool.Add(DeadzoneMenu); } }
private void CreateMenu() { _mainMenu = new UIMenu("Tobii Eye Tracking", "~b~SETTINGS"); _mainMenu.SetMenuWidthOffset(50); //_mainMenu.ControlDisablingEnabled = false; _menuPool.Add(_mainMenu); InitLists(); CreateThirdPersonFreelookMenu(); CreateFirstPersonFreelookMenu(); CreateDeadzoneMenu(); _freelookDevice = new UIMenuListItem("Freelook Device", _freelookDevices, (int)_settings.FreelookDevice, "Device to use for freelook"); _freelookDevice.OnListChanged += (sender, args) => { _settings.FreelookDevice = (FeeelookDevice)_freelookDevice.Index; }; _mainMenu.AddItem(_freelookDevice); var firstPersonFreelookSettings = new UIMenuItem("First Person Freelook Settings", "Look around with gaze in first person"); _mainMenu.AddItem(firstPersonFreelookSettings); _mainMenu.BindMenuToItem(FirstPersonFreelookMenu, firstPersonFreelookSettings); var thirdPersonFreelookSettings = new UIMenuItem("Third Person Freelook Settings", "Look around with gaze in third person"); _mainMenu.AddItem(thirdPersonFreelookSettings); _mainMenu.BindMenuToItem(ThirdPersonFreelookMenu, thirdPersonFreelookSettings); var deadzoneSettings = new UIMenuItem("Freelook Deadzones", "Deadzones prevent camera movement when you are looking inside the zone, for example, the minimap"); _mainMenu.AddItem(deadzoneSettings); _mainMenu.BindMenuToItem(DeadzoneMenu, deadzoneSettings); var aimingSensitivitySlider = new UIMenuListItem("Aiming Sensitivity", _values0To1, (int)Math.Round(_settings.AimingSensitivity / 0.1), "Freelok sensitivity while aiming"); aimingSensitivitySlider.OnListChanged += (sender, args) => { _settings.AimingSensitivity = aimingSensitivitySlider.IndexToItem(aimingSensitivitySlider.Index); }; _mainMenu.AddItem(aimingSensitivitySlider); var aimWithGaze = new UIMenuCheckboxItem("Aim With Gaze", _settings.AimWithGazeEnabled, "Aim with gaze"); aimWithGaze.CheckboxEvent += (sender, args) => { _settings.AimWithGazeEnabled = aimWithGaze.Checked; }; _mainMenu.AddItem(aimWithGaze); var snapAtPedestrians = new UIMenuCheckboxItem("Snap At Pedestrians", _settings.SnapAtPedestriansEnabled, "Snap aim at pedestrians"); snapAtPedestrians.CheckboxEvent += (sender, args) => { _settings.SnapAtPedestriansEnabled = snapAtPedestrians.Checked; }; _mainMenu.AddItem(snapAtPedestrians); var gazeFilteringSlider = new UIMenuListItem("Gaze Filter", _values0To1, (int)Math.Round(_settings.GazeFiltering / 0.1), "Filter gaze data"); gazeFilteringSlider.OnListChanged += (sender, args) => { _settings.GazeFiltering = gazeFilteringSlider.IndexToItem(gazeFilteringSlider.Index); }; _mainMenu.AddItem(gazeFilteringSlider); var incinerateAtGaze = new UIMenuCheckboxItem("Incinerate At Gaze", _settings.IncinerateAtGazeEnabled, "Incinerate at gaze"); incinerateAtGaze.CheckboxEvent += (sender, args) => { _settings.IncinerateAtGazeEnabled = incinerateAtGaze.Checked; }; _mainMenu.AddItem(incinerateAtGaze); var taseAtGaze = new UIMenuCheckboxItem("Tase At Gaze", _settings.TaseAtGazeEnabled, "Tase at gaze"); taseAtGaze.CheckboxEvent += (sender, args) => { _settings.TaseAtGazeEnabled = taseAtGaze.Checked; }; _mainMenu.AddItem(taseAtGaze); var missilesAtGaze = new UIMenuCheckboxItem("Launch Missiles At Gaze", _settings.MissilesAtGazeEnabled, "Launch missiles at gaze"); missilesAtGaze.CheckboxEvent += (sender, args) => { _settings.MissilesAtGazeEnabled = missilesAtGaze.Checked; }; _mainMenu.AddItem(missilesAtGaze); var pedestrianIntreraction = new UIMenuCheckboxItem("Pedestrian Interaction", _settings.PedestrianInteractionEnabled, "Pedestrians talk to you"); pedestrianIntreraction.CheckboxEvent += (sender, args) => { _settings.PedestrianInteractionEnabled = pedestrianIntreraction.Checked; }; _mainMenu.AddItem(pedestrianIntreraction); var dontFallFromBikes = new UIMenuCheckboxItem("Don't Fall From Bikes", _settings.DontFallFromBikesEnabled, "Never fall from bikes"); dontFallFromBikes.CheckboxEvent += (sender, args) => { _settings.DontFallFromBikesEnabled = dontFallFromBikes.Checked; }; _mainMenu.AddItem(dontFallFromBikes); var shutDown = new UIMenuItem("Shut Down", "Unload the mod"); shutDown.Activated += (sender, item) => { ShutDownRequested(this, new EventArgs()); }; _mainMenu.AddItem(shutDown); _mainMenu.RefreshIndex(); }
private void CreateThirdPersonFreelookMenu() { ThirdPersonFreelookMenu = new UIMenu("Tobii Eye Tracking", "~b~THIRD PERSON FREELOOK SETTINGS"); ThirdPersonFreelookMenu.SetMenuWidthOffset(50); { var thirdPersonFreelook = new UIMenuCheckboxItem("TPS Freelook", _settings.ThirdPersonFreelookEnabled, "Control camera with gaze"); thirdPersonFreelook.CheckboxEvent += (sender, args) => { _settings.ThirdPersonFreelookEnabled = thirdPersonFreelook.Checked; }; ThirdPersonFreelookMenu.AddItem(thirdPersonFreelook); var thirdPersonSensitivitySlider = new UIMenuListItem("TPS Freelook Sensitivity", _values0To1, (int) Math.Round(_settings.ThirdPersonSensitivity/0.1), "Freelook sensitivity"); thirdPersonSensitivitySlider.OnListChanged += (sender, args) => { _settings.ThirdPersonSensitivity = thirdPersonSensitivitySlider.IndexToItem(thirdPersonSensitivitySlider.Index); }; ThirdPersonFreelookMenu.AddItem(thirdPersonSensitivitySlider); var thirdPersonYOffsetSlider = new UIMenuListItem("TPS Freelook Vertical Offset", _valuesMinus1To1, (int) Math.Round((_settings.ThirdPersonYOffset + 1)/0.1), "Freelook vertical offset"); thirdPersonYOffsetSlider.OnListChanged += (sender, args) => { _settings.ThirdPersonYOffset = thirdPersonYOffsetSlider.IndexToItem(thirdPersonYOffsetSlider.Index); }; ThirdPersonFreelookMenu.AddItem(thirdPersonYOffsetSlider); var thirdPersonDeadZoneWidthSlider = new UIMenuListItem("TPS Freelook Deadzone Width", _values0To1, (int) Math.Round(_settings.ThirdPersonDeadZoneWidth/0.1), "Freelook deadzone"); thirdPersonDeadZoneWidthSlider.OnListChanged += (sender, args) => { _settings.ThirdPersonDeadZoneWidth = thirdPersonDeadZoneWidthSlider.IndexToItem(thirdPersonDeadZoneWidthSlider.Index); }; ThirdPersonFreelookMenu.AddItem(thirdPersonDeadZoneWidthSlider); var thirdPersonDeadZoneHeightSlider = new UIMenuListItem("TPS Freelook Deadzone Height", _values0To1, (int) Math.Round(_settings.ThirdPersonDeadZoneHeight/0.1), "Freelook deadzone"); thirdPersonDeadZoneHeightSlider.OnListChanged += (sender, args) => { _settings.ThirdPersonDeadZoneHeight = thirdPersonDeadZoneHeightSlider.IndexToItem(thirdPersonDeadZoneHeightSlider.Index); }; ThirdPersonFreelookMenu.AddItem(thirdPersonDeadZoneHeightSlider); var thirdPersonMinPitchSlider = new UIMenuListItem("TPS Min Pitch", _valuesMinus70To0, (int) Math.Round((_settings.ThirdPersonMinPitchDeg + 70)/1), "Freelook min pitch angle"); thirdPersonMinPitchSlider.OnListChanged += (sender, args) => { _settings.ThirdPersonMinPitchDeg = thirdPersonMinPitchSlider.IndexToItem(thirdPersonMinPitchSlider.Index); }; ThirdPersonFreelookMenu.AddItem(thirdPersonMinPitchSlider); var thirdPersonMaxPitchSlider = new UIMenuListItem("TPS Max Pitch", _values0To70, (int) Math.Round((_settings.ThirdPersonMaxPitchDeg)/1), "Freelook max pitch angle"); thirdPersonMaxPitchSlider.OnListChanged += (sender, args) => { _settings.ThirdPersonMaxPitchDeg = thirdPersonMaxPitchSlider.IndexToItem(thirdPersonMaxPitchSlider.Index); }; ThirdPersonFreelookMenu.AddItem(thirdPersonMaxPitchSlider); } { var thirdPersonYOffsetDrivingSlider = new UIMenuListItem("TPS Freelook Vertical Offset Driving", _valuesMinus1To1, (int) Math.Round((_settings.ThirdPersonYOffsetDriving + 1)/0.1), "Freelook vertical offset"); thirdPersonYOffsetDrivingSlider.OnListChanged += (sender, args) => { _settings.ThirdPersonYOffsetDriving = thirdPersonYOffsetDrivingSlider.IndexToItem(thirdPersonYOffsetDrivingSlider.Index); }; ThirdPersonFreelookMenu.AddItem(thirdPersonYOffsetDrivingSlider); var thirdPersonDeadZoneWidthDrivingSlider = new UIMenuListItem("TPS Freelook Deadzone Width Driving", _values0To1, (int) Math.Round(_settings.ThirdPersonDeadZoneWidthDriving/0.1), "Freelook deadzone"); thirdPersonDeadZoneWidthDrivingSlider.OnListChanged += (sender, args) => { _settings.ThirdPersonDeadZoneWidthDriving = thirdPersonDeadZoneWidthDrivingSlider.IndexToItem(thirdPersonDeadZoneWidthDrivingSlider.Index); }; ThirdPersonFreelookMenu.AddItem(thirdPersonDeadZoneWidthDrivingSlider); var thirdPersonDeadZoneHeightDrivingSlider = new UIMenuListItem("TPS Freelook Deadzone Height Driving", _values0To1, (int) Math.Round(_settings.ThirdPersonDeadZoneHeightDriving/0.1), "Freelook deadzone"); thirdPersonDeadZoneHeightDrivingSlider.OnListChanged += (sender, args) => { _settings.ThirdPersonDeadZoneHeightDriving = thirdPersonDeadZoneHeightDrivingSlider.IndexToItem(thirdPersonDeadZoneHeightDrivingSlider.Index); }; ThirdPersonFreelookMenu.AddItem(thirdPersonDeadZoneHeightDrivingSlider); var thirdPersonMinPitchDrivingSlider = new UIMenuListItem("TPS Min Pitch Driving", _valuesMinus70To0, (int) Math.Round((_settings.ThirdPersonMinPitchDrivingDeg + 70)/1), "Freelook min pitch angle"); thirdPersonMinPitchDrivingSlider.OnListChanged += (sender, args) => { _settings.ThirdPersonMinPitchDrivingDeg = thirdPersonMinPitchDrivingSlider.IndexToItem(thirdPersonMinPitchDrivingSlider.Index); }; ThirdPersonFreelookMenu.AddItem(thirdPersonMinPitchDrivingSlider); var thirdPersonMaxPitchDrivingSlider = new UIMenuListItem("TPS Max Pitch Driving", _values0To70, (int) Math.Round((_settings.ThirdPersonMaxPitchDeg)/1), "Freelook max pitch angle"); thirdPersonMaxPitchDrivingSlider.OnListChanged += (sender, args) => { _settings.ThirdPersonMaxPitchDrivingDeg = thirdPersonMaxPitchDrivingSlider.IndexToItem(thirdPersonMaxPitchDrivingSlider.Index); }; ThirdPersonFreelookMenu.AddItem(thirdPersonMaxPitchDrivingSlider); } { var thirdPersonYOffsetPlaneSlider = new UIMenuListItem("TPS Freelook Vertical Offset Plane", _valuesMinus1To1, (int) Math.Round((_settings.ThirdPersonYOffsetPlane + 1)/0.1), "Freelook vertical offset"); thirdPersonYOffsetPlaneSlider.OnListChanged += (sender, args) => { _settings.ThirdPersonYOffsetPlane = thirdPersonYOffsetPlaneSlider.IndexToItem(thirdPersonYOffsetPlaneSlider.Index); }; ThirdPersonFreelookMenu.AddItem(thirdPersonYOffsetPlaneSlider); var thirdPersonDeadZoneWidthPlaneSlider = new UIMenuListItem("TPS Freelook Deadzone Width Plane", _values0To1, (int) Math.Round(_settings.ThirdPersonDeadZoneWidthPlane/0.1), "Freelook deadzone"); thirdPersonDeadZoneWidthPlaneSlider.OnListChanged += (sender, args) => { _settings.ThirdPersonDeadZoneWidthPlane = thirdPersonDeadZoneWidthPlaneSlider.IndexToItem(thirdPersonDeadZoneWidthPlaneSlider.Index); }; ThirdPersonFreelookMenu.AddItem(thirdPersonDeadZoneWidthPlaneSlider); var thirdPersonDeadZoneHeightPlaneSlider = new UIMenuListItem("TPS Freelook Deadzone Height Plane", _values0To1, (int) Math.Round(_settings.ThirdPersonDeadZoneHeightPlane/0.1), "Freelook deadzone"); thirdPersonDeadZoneHeightPlaneSlider.OnListChanged += (sender, args) => { _settings.ThirdPersonDeadZoneHeightPlane = thirdPersonDeadZoneHeightPlaneSlider.IndexToItem(thirdPersonDeadZoneHeightPlaneSlider.Index); }; ThirdPersonFreelookMenu.AddItem(thirdPersonDeadZoneHeightPlaneSlider); var thirdPersonMinPitchPlaneSlider = new UIMenuListItem("TPS Min Pitch Plane", _valuesMinus70To0, (int) Math.Round((_settings.ThirdPersonMinPitchPlaneDeg + 70)/1), "Freelook min pitch angle"); thirdPersonMinPitchPlaneSlider.OnListChanged += (sender, args) => { _settings.ThirdPersonMinPitchPlaneDeg = thirdPersonMinPitchPlaneSlider.IndexToItem(thirdPersonMinPitchPlaneSlider.Index); }; ThirdPersonFreelookMenu.AddItem(thirdPersonMinPitchPlaneSlider); var thirdPersonMaxPitchPlaneSlider = new UIMenuListItem("TPS Max Pitch Plane", _values0To70, (int) Math.Round((_settings.ThirdPersonMaxPitchPlaneDeg)/1), "Freelook max pitch angle"); thirdPersonMaxPitchPlaneSlider.OnListChanged += (sender, args) => { _settings.ThirdPersonMaxPitchPlaneDeg = thirdPersonMaxPitchPlaneSlider.IndexToItem(thirdPersonMaxPitchPlaneSlider.Index); }; ThirdPersonFreelookMenu.AddItem(thirdPersonMaxPitchPlaneSlider); } { var thirdPersonYOffsetHeliSlider = new UIMenuListItem("TPS Freelook Vertical Offset Heli", _valuesMinus1To1, (int) Math.Round((_settings.ThirdPersonYOffsetHeli + 1)/0.1), "Freelook vertical offset"); thirdPersonYOffsetHeliSlider.OnListChanged += (sender, args) => { _settings.ThirdPersonYOffsetHeli = thirdPersonYOffsetHeliSlider.IndexToItem(thirdPersonYOffsetHeliSlider.Index); }; ThirdPersonFreelookMenu.AddItem(thirdPersonYOffsetHeliSlider); var thirdPersonDeadZoneWidthHeliSlider = new UIMenuListItem("TPS Freelook Deadzone Width Heli", _values0To1, (int) Math.Round(_settings.ThirdPersonDeadZoneWidthHeli/0.1), "Freelook deadzone"); thirdPersonDeadZoneWidthHeliSlider.OnListChanged += (sender, args) => { _settings.ThirdPersonDeadZoneWidthHeli = thirdPersonDeadZoneWidthHeliSlider.IndexToItem(thirdPersonDeadZoneWidthHeliSlider.Index); }; ThirdPersonFreelookMenu.AddItem(thirdPersonDeadZoneWidthHeliSlider); var thirdPersonDeadZoneHeightHeliSlider = new UIMenuListItem("TPS Freelook Deadzone Height Heli", _values0To1, (int) Math.Round(_settings.ThirdPersonDeadZoneHeightHeli/0.1), "Freelook deadzone"); thirdPersonDeadZoneHeightHeliSlider.OnListChanged += (sender, args) => { _settings.ThirdPersonDeadZoneHeightHeli = thirdPersonDeadZoneHeightHeliSlider.IndexToItem(thirdPersonDeadZoneHeightHeliSlider.Index); }; ThirdPersonFreelookMenu.AddItem(thirdPersonDeadZoneHeightHeliSlider); var thirdPersonMinPitchHeliSlider = new UIMenuListItem("TPS Min Pitch Heli", _valuesMinus70To0, (int) Math.Round((_settings.ThirdPersonMinPitchHeliDeg + 70)/1), "Freelook min pitch angle"); thirdPersonMinPitchHeliSlider.OnListChanged += (sender, args) => { _settings.ThirdPersonMinPitchHeliDeg = thirdPersonMinPitchHeliSlider.IndexToItem(thirdPersonMinPitchHeliSlider.Index); }; ThirdPersonFreelookMenu.AddItem(thirdPersonMinPitchHeliSlider); var thirdPersonMaxPitchHeliSlider = new UIMenuListItem("TPS Max Pitch Heli", _values0To70, (int) Math.Round((_settings.ThirdPersonMaxPitchDeg)/1), "Freelook max pitch angle"); thirdPersonMaxPitchHeliSlider.OnListChanged += (sender, args) => { _settings.ThirdPersonMaxPitchHeliDeg = thirdPersonMaxPitchHeliSlider.IndexToItem(thirdPersonMaxPitchHeliSlider.Index); }; ThirdPersonFreelookMenu.AddItem(thirdPersonMaxPitchHeliSlider); } ThirdPersonFreelookMenu.RefreshIndex(); _menuPool.Add(ThirdPersonFreelookMenu); }
private void CreateFirstPersonFreelookMenu() { FirstPersonFreelookMenu = new UIMenu("Tobii Eye Tracking", "~b~FIRST PERSON FREELOOK SETTINGS"); FirstPersonFreelookMenu.SetMenuWidthOffset(50); { var firstPersonFreelook = new UIMenuCheckboxItem("FPS Freelook", _settings.FirstPersonFreelookEnabled, "Control camera with gaze"); firstPersonFreelook.CheckboxEvent += (sender, args) => { _settings.FirstPersonFreelookEnabled = firstPersonFreelook.Checked; }; FirstPersonFreelookMenu.AddItem(firstPersonFreelook); var firstPersonSensitivitySlider = new UIMenuListItem("FPS Freelook Sensitivity", _values0To1, (int) Math.Round(_settings.FirstPersonSensitivity/0.1), "Freelook sensitivity"); firstPersonSensitivitySlider.OnListChanged += (sender, args) => { _settings.FirstPersonSensitivity = firstPersonSensitivitySlider.IndexToItem(firstPersonSensitivitySlider.Index); }; FirstPersonFreelookMenu.AddItem(firstPersonSensitivitySlider); var firstPersonDeadZoneWidthSlider = new UIMenuListItem("FPS Freelook Deadzone Width", _values0To1, (int) Math.Round(_settings.FirstPersonDeadZoneWidth/0.1), "Freelook deadzone"); firstPersonDeadZoneWidthSlider.OnListChanged += (sender, args) => { _settings.FirstPersonDeadZoneWidth = firstPersonDeadZoneWidthSlider.IndexToItem(firstPersonDeadZoneWidthSlider.Index); }; FirstPersonFreelookMenu.AddItem(firstPersonDeadZoneWidthSlider); var firstPersonDeadZoneHeightSlider = new UIMenuListItem("FPS Freelook Deadzone Height", _values0To1, (int) Math.Round(_settings.FirstPersonDeadZoneHeight/0.1), "Freelook deadzone"); firstPersonDeadZoneHeightSlider.OnListChanged += (sender, args) => { _settings.FirstPersonDeadZoneHeight = firstPersonDeadZoneHeightSlider.IndexToItem(firstPersonDeadZoneHeightSlider.Index); }; FirstPersonFreelookMenu.AddItem(firstPersonDeadZoneHeightSlider); var firstPersonMinPitchSlider = new UIMenuListItem("FPS Min Pitch", _valuesMinus70To0, (int) Math.Round((_settings.FirstPersonMinPitchDeg + 70)/1), "Freelook min pitch angle"); firstPersonMinPitchSlider.OnListChanged += (sender, args) => { _settings.FirstPersonMinPitchDeg = firstPersonMinPitchSlider.IndexToItem(firstPersonMinPitchSlider.Index); }; FirstPersonFreelookMenu.AddItem(firstPersonMinPitchSlider); var firstPersonMaxPitchSlider = new UIMenuListItem("FPS Max Pitch", _values0To70, (int) Math.Round((_settings.FirstPersonMaxPitchDeg)/1), "Freelook max pitch angle"); firstPersonMaxPitchSlider.OnListChanged += (sender, args) => { _settings.FirstPersonMaxPitchDeg = firstPersonMaxPitchSlider.IndexToItem(firstPersonMaxPitchSlider.Index); }; FirstPersonFreelookMenu.AddItem(firstPersonMaxPitchSlider); } { var firstPersonFreelookDriving = new UIMenuCheckboxItem("FPS Freelook Driving", _settings.FirstPersonFreelookDrivingEnabled, "Control camera with gaze"); firstPersonFreelookDriving.CheckboxEvent += (sender, args) => { _settings.FirstPersonFreelookDrivingEnabled = firstPersonFreelookDriving.Checked; }; FirstPersonFreelookMenu.AddItem(firstPersonFreelookDriving); var firstPersonSensitivityDrivingSlider = new UIMenuListItem("FPS Freelook Sensitivity Driving", _values0To1, (int) Math.Round(_settings.FirstPersonSensitivityDriving/0.1), "Freelook sensitivity"); firstPersonSensitivityDrivingSlider.OnListChanged += (sender, args) => { _settings.FirstPersonSensitivityDriving = firstPersonSensitivityDrivingSlider.IndexToItem(firstPersonSensitivityDrivingSlider.Index); }; FirstPersonFreelookMenu.AddItem(firstPersonSensitivityDrivingSlider); var firstPersonDeadZoneWidthDrivingSlider = new UIMenuListItem("FPS Freelook Deadzone Width Driving", _values0To1, (int) Math.Round(_settings.FirstPersonDeadZoneWidthDriving/0.1), "Freelook deadzone"); firstPersonDeadZoneWidthDrivingSlider.OnListChanged += (sender, args) => { _settings.FirstPersonDeadZoneWidthDriving = firstPersonDeadZoneWidthDrivingSlider.IndexToItem(firstPersonDeadZoneWidthDrivingSlider.Index); }; FirstPersonFreelookMenu.AddItem(firstPersonDeadZoneWidthDrivingSlider); var firstPersonDeadZoneHeightDrivingSlider = new UIMenuListItem("FPS Freelook Deadzone Height Driving", _values0To1, (int) Math.Round(_settings.FirstPersonDeadZoneHeightDriving/0.1), "Freelook deadzone"); firstPersonDeadZoneHeightDrivingSlider.OnListChanged += (sender, args) => { _settings.FirstPersonDeadZoneHeightDriving = firstPersonDeadZoneHeightDrivingSlider.IndexToItem(firstPersonDeadZoneHeightDrivingSlider.Index); }; FirstPersonFreelookMenu.AddItem(firstPersonDeadZoneHeightDrivingSlider); var firstPersonMinPitchDrivingSlider = new UIMenuListItem("FPS Min Pitch Driving", _valuesMinus70To0, (int) Math.Round((_settings.FirstPersonMinPitchDegDriving + 70)/1), "Freelook min pitch angle"); firstPersonMinPitchDrivingSlider.OnListChanged += (sender, args) => { _settings.FirstPersonMinPitchDegDriving = firstPersonMinPitchDrivingSlider.IndexToItem(firstPersonMinPitchDrivingSlider.Index); }; FirstPersonFreelookMenu.AddItem(firstPersonMinPitchDrivingSlider); var firstPersonMaxPitchDrivingSlider = new UIMenuListItem("FPS Max Pitch Driving", _values0To70, (int) Math.Round((_settings.FirstPersonMaxPitchDegDriving)/1), "Freelook max pitch angle"); firstPersonMaxPitchDrivingSlider.OnListChanged += (sender, args) => { _settings.FirstPersonMaxPitchDegDriving = firstPersonMaxPitchDrivingSlider.IndexToItem(firstPersonMaxPitchDrivingSlider.Index); }; FirstPersonFreelookMenu.AddItem(firstPersonMaxPitchDrivingSlider); } FirstPersonFreelookMenu.RefreshIndex(); _menuPool.Add(FirstPersonFreelookMenu); }
private void CreateMenu() { _mainMenu = new UIMenu("Tobii Eye Tracking", "~b~SETTINGS"); _mainMenu.SetMenuWidthOffset(50); //_mainMenu.ControlDisablingEnabled = false; _menuPool.Add(_mainMenu); InitLists(); var firstPersonFreelook = new UIMenuCheckboxItem("Extended View", _settings.ExtendedViewEnabled, "Extend your view by looking at the edges of the screen"); firstPersonFreelook.CheckboxEvent += (sender, args) => { _settings.ExtendedViewEnabled = firstPersonFreelook.Checked; }; _mainMenu.AddItem(firstPersonFreelook); var extendedViewSensitivitySlider = new UIMenuListItem("Extended View Sensitivity", _values0To1, (int)Math.Round(_settings.ExtendedViewSensitivity / 0.1), "Extended View sensitivity"); extendedViewSensitivitySlider.OnListChanged += (sender, args) => { _settings.ExtendedViewSensitivity = (float)extendedViewSensitivitySlider.IndexToItem(extendedViewSensitivitySlider.Index); }; _mainMenu.AddItem(extendedViewSensitivitySlider); var fireAtGaze = new UIMenuCheckboxItem("Shoot At Gaze", _settings.FireAtGazeEnabled, "Your gun will shoot where you look. Move the RIGHT JOYSTICK while HOLDING LEFT THUMB to fine adjust the crosshair around your gaze point while shooting."); fireAtGaze.CheckboxEvent += (sender, args) => { _settings.FireAtGazeEnabled = fireAtGaze.Checked; }; _mainMenu.AddItem(fireAtGaze); var aimAtGaze = new UIMenuCheckboxItem("Aim At Gaze", _settings.AimAtGazeEnabled, "You camera will turn towards the target when you press aim button."); aimAtGaze.CheckboxEvent += (sender, args) => { _settings.AimAtGazeEnabled = aimAtGaze.Checked; }; _mainMenu.AddItem(aimAtGaze); var snapAtTargets = new UIMenuCheckboxItem("Snap At Targets", _settings.SnapAtTargetsEnabled, "Snap crosshair at targets. Makes it less challenging to use Aim At Gaze and Shoot At Gaze features."); snapAtTargets.CheckboxEvent += (sender, args) => { _settings.SnapAtTargetsEnabled = snapAtTargets.Checked; }; _mainMenu.AddItem(snapAtTargets); var gazeFilteringSlider = new UIMenuListItem("Gaze Filter", _values0To1, (int)Math.Round(_settings.GazeFiltering / 0.1), "Filter gaze data. Higher values will make crosshair movements smoother, but will increase the latency."); gazeFilteringSlider.OnListChanged += (sender, args) => { _settings.GazeFiltering = (float)gazeFilteringSlider.IndexToItem(gazeFilteringSlider.Index); }; _mainMenu.AddItem(gazeFilteringSlider); var incinerateAtGaze = new UIMenuCheckboxItem("Incinerate At Gaze", _settings.IncinerateAtGazeEnabled, "Push A button to burn things where you look. This feature replaces the default command for A button."); incinerateAtGaze.CheckboxEvent += (sender, args) => { _settings.IncinerateAtGazeEnabled = incinerateAtGaze.Checked; }; _mainMenu.AddItem(incinerateAtGaze); var taseAtGaze = new UIMenuCheckboxItem("Tase At Gaze", _settings.TaseAtGazeEnabled, "Push RB to tase people remotely with your eyes. Doesn't work in aircrafts. This feature replaces the default command for RB."); taseAtGaze.CheckboxEvent += (sender, args) => { _settings.TaseAtGazeEnabled = taseAtGaze.Checked; }; _mainMenu.AddItem(taseAtGaze); var missilesAtGaze = new UIMenuCheckboxItem("Launch Missiles At Gaze", _settings.MissilesAtGazeEnabled, "Push B button to launch missiles at gaze. This feature replaces the default command for B button."); missilesAtGaze.CheckboxEvent += (sender, args) => { _settings.MissilesAtGazeEnabled = missilesAtGaze.Checked; }; _mainMenu.AddItem(missilesAtGaze); var alwaysShowCrosshair = new UIMenuCheckboxItem("Always Show Crosshair", _settings.AlwaysShowCrosshairEnabled, "Show crosshair even when you are not aiming or shooting"); alwaysShowCrosshair.CheckboxEvent += (sender, args) => { _settings.AlwaysShowCrosshairEnabled = alwaysShowCrosshair.Checked; }; _mainMenu.AddItem(alwaysShowCrosshair); var dontFallFromBikes = new UIMenuCheckboxItem("Don't Fall From Bikes", _settings.DontFallFromBikesEnabled, "You won't fall from a bike when you crash into something"); dontFallFromBikes.CheckboxEvent += (sender, args) => { _settings.DontFallFromBikesEnabled = dontFallFromBikes.Checked; }; _mainMenu.AddItem(dontFallFromBikes); const string privacyPolicyText = "By selecting to send usage statistics you agree that your usage statistics, such as a game session time, " + "mod settings and mod features you use will be collected by the developer. The data will be collected " + "anonymously, processed on Google Analytics and used solely to enhance user experience."; _sendUsageStatistics = new UIMenuCheckboxItem("Send Usage Statistics", _settings.SendUsageStatistics, privacyPolicyText); _sendUsageStatistics.CheckboxEvent += (sender, args) => { _settings.SendUsageStatistics = _sendUsageStatistics.Checked; }; _mainMenu.AddItem(_sendUsageStatistics); _mainMenu.RefreshIndex(); }