コード例 #1
0
        internal void Initialize()
        {
            if (IsInitialized)
            {
                throw new InvalidOperationException();
            }
            IsInitialized = true;

        #if PROFILING
            this._performance_timer.Start();
        #endif

            Values = new CameraValueMap(this);
            Stack  = new CameraStack(this);
            Cull   = new CameraCull(this);
            Hide   = new CameraHideHelper(this);

            BaseHead      = new CameraResult();
            BaseRoot      = new CameraResult();
            BaseResult    = new CameraResult();
            Offset1Result = new CameraResult();
            InputResult   = new CameraResult();
            Offset2Result = new CameraResult();
            FinalResult   = new CameraResult();
            TempResult    = new CameraResult();
        }
コード例 #2
0
        private bool CalculateEnabled(CameraUpdate update)
        {
            var tkeyCode = Settings.Instance.ToggleHotkey;

            if (tkeyCode > 0 && Input.IsPressed((VirtualKeys)tkeyCode))
            {
                if (!HadKey)
                {
                    HadKey = true;
                    SetWantState(IsEnabled ? WantStates.DisabledFromHotkey : WantStates.EnabledFromHotkey);
                }
            }
            else
            {
                HadKey = false;
            }

            var rkeyCode = Settings.Instance.ReloadHotkey;

            if (rkeyCode > 0 && Input.IsPressed((VirtualKeys)rkeyCode))
            {
                Settings.Instance.Load();
                Values = new CameraValueMap(this);
            }

            update.Values.WantEnabled.Update(Plugin.Time, IsEnabled);
            update.Values.WantDisabled.Update(Plugin.Time, IsEnabled);

            if (update.Values.WantDisabled.CurrentValue > 0.0 || update.Values.WantEnabled.CurrentValue <= 0.0)
            {
                return(false);
            }

            switch (update.GameCameraState.Id)
            {
            case TESCameraStates.Free:
            case TESCameraStates.FirstPerson:
            case TESCameraStates.TweenMenu:
            case TESCameraStates.AutoVanity:
                return(false);

            case TESCameraStates.VATS:
            {
                if (Settings.Instance.DisableDuringKillmove)
                {
                    return(false);
                }
            }
            break;
            }

            var menuManager = MenuManager.Instance;

            if (menuManager == null)
            {
                return(false);
            }

            return(!menuManager.IsMenuOpen("RaceSex Menu"));
        }
コード例 #3
0
 internal CameraUpdate(CameraMain main,
                       CameraResult result,
                       CameraTarget target,
                       PlayerCamera camera,
                       NiAVObject cameraNode,
                       TESCameraState state,
                       CameraValueMap values)
 {
     CameraMain      = main ?? throw new ArgumentNullException("main");
     Result          = result ?? throw new ArgumentNullException("result");
     Target          = target ?? throw new ArgumentNullException("target");
     GameCamera      = camera ?? throw new ArgumentNullException("camera");
     GameCameraNode  = cameraNode ?? throw new ArgumentNullException("cameraNode");
     GameCameraState = state ?? throw new ArgumentNullException("state");
     Values          = values ?? throw new ArgumentNullException("values");
     CachedMounted   = target.Actor != null && (target.Actor.IsOnMount || target.Actor.IsOnFlyingMount);
 }
コード例 #4
0
        internal CameraUpdate(CameraMain main, CameraResult result, CameraTarget target, PlayerCamera camera, NiAVObject cameraNode, TESCameraState state, CameraValueMap values)
        {
            if (main == null)
            {
                throw new ArgumentNullException("main");
            }

            if (result == null)
            {
                throw new ArgumentNullException("result");
            }

            if (target == null)
            {
                throw new ArgumentNullException("target");
            }

            if (camera == null)
            {
                throw new ArgumentNullException("camera");
            }

            if (cameraNode == null)
            {
                throw new ArgumentNullException("cameraNode");
            }

            if (state == null)
            {
                throw new ArgumentNullException("state");
            }

            if (values == null)
            {
                throw new ArgumentNullException("values");
            }

            this.CameraMain      = main;
            this.Result          = result;
            this.Target          = target;
            this.GameCamera      = camera;
            this.GameCameraNode  = cameraNode;
            this.GameCameraState = state;
            this.Values          = values;
            this.CachedMounted   = target.Actor != null && (target.Actor.IsOnMount || target.Actor.IsOnFlyingMount);
        }