private string ChangeCallback(UIMenuDynamicListItem sender, UIMenuDynamicListItem.ChangeDirection direction) { int index = _selectedIndex; if (direction == UIMenuDynamicListItem.ChangeDirection.Right) { if (RemoteDeloreansHandler.TimeMachineCount > 0) { index++; if (index > RemoteDeloreansHandler.TimeMachineCount - 1) { index = 0; } } } else { if (RemoteDeloreansHandler.TimeMachineCount > 0) { index--; if (index < 0) { index = RemoteDeloreansHandler.TimeMachineCount - 1; } } } _selectedIndex = index; return(_selectedIndex.ToString()); }
private string ChangeCallback(UIMenuDynamicListItem sender, UIMenuDynamicListItem.ChangeDirection direction) { switch (direction) { case UIMenuDynamicListItem.ChangeDirection.Left: if (_speed > 0.1f) { _speed -= 0.1f; } break; case UIMenuDynamicListItem.ChangeDirection.Right: _speed += 0.1f; break; } _speed = Convert.ToSingle(Math.Round(_speed, 1)); MissionHandler.TrainMission.TimeMultiplier = _speed; return(_speed.ToString()); }
private string ChangeCallback(UIMenuDynamicListItem sender, UIMenuDynamicListItem.ChangeDirection direction) { int index = _selectedIndex; if (direction == UIMenuDynamicListItem.ChangeDirection.Right) { if (DeloreanHandler.TimeMachineCount > 0) { index++; if (index > DeloreanHandler.TimeMachineCount - 1) { index = 0; } } } else { if (DeloreanHandler.TimeMachineCount > 0) { index--; if (index < 0) { index = DeloreanHandler.TimeMachineCount - 1; } } } _selectedIndex = index; if (!TrySelectCar(_selectedIndex)) { GTA.UI.Notification.Show(Game.GetLocalizedString("BTTFV_OutOfRange")); } return(_selectedIndex.ToString()); }