示例#1
0
        public override void OnMissionScreenTick(float dt)
        {
            base.OnMissionScreenTick(dt);

            if (_boundaryChanged)
            {
                _boundaryChanged = false;
                if (!MiniMap.Instance.IsValid)
                {
                    MiniMap.Instance.InitializeMapRange(Mission.Current, true);
                }
            }

            bool toggleMapKeyDown      = false;
            var  toggleMapLongPressKey = BattleMiniMapGameKeyCategory.GetKey(GameKeyEnum.ToggleMapLongPress);
            var  toggleMapKey          = BattleMiniMapGameKeyCategory.GetKey(GameKeyEnum.ToggleMap);

            if (BattleMiniMapConfig.Get().EnableToggleMapLongPressKey&& toggleMapLongPressKey.IsKeyDown(Input))
            {
                toggleMapKeyDown = true;
            }
            else if (toggleMapKey.IsKeyPressed(Input))
            {
                BattleMiniMapConfig.Get().ShowMap = !BattleMiniMapConfig.Get().ShowMap;
            }

            _dataSource.UpdateEnabled(dt, MiniMap.Instance.IsValid &&
                                      ((BattleMiniMapConfig.Get().ShowMap ^ toggleMapKeyDown) ||
                                       _isOrderViewOpened && BattleMiniMapConfig.Get().ShowMapWhenCommanding));

            _dataSource.UpdateCamera();

            if (_timer.Check(true))
            {
                _dataSource.UpdateData();
            }
        }