コード例 #1
0
        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());
        }
コード例 #2
0
        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());
        }
コード例 #3
0
ファイル: RCMenu.cs プロジェクト: hugoraider/BackToTheFutureV
        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());
        }