示例#1
0
    public virtual void RunningUpdate()
    {
        if (_waitingForMainGameWindow)
        {
            if (ExternalWindowTracker.WindowIsPresent(_srcGame.windowTitle))
            {
                Debug.Log("Main Game Window Appeared");
                _waitingForMainGameWindow = false;
                _srcGame.launchSettings.mouseStartupOptions?.Perform();
            }
        }

        if (!_waitingForMainGameWindow)
        {
            float prevTime = _timeSinceWindowAppeared;
            _timeSinceWindowAppeared += Time.deltaTime;

            if (_srcGame.launchSettings.joyToKeyDelayed)
            {
                bool joyToKeyDelayReached = prevTime < _srcGame.launchSettings.joyToKeyConfigDelay && _timeSinceWindowAppeared >= _srcGame.launchSettings.joyToKeyConfigDelay;
                if (joyToKeyDelayReached)
                {
                    Debug.Log("Joy to key delay reached!");
                    ProcessRunner.instance.setJoyToKeyConfig(_srcGame.joyToKeyConfig);
                }
            }
        }
    }
示例#2
0
    public override void RunningUpdate()
    {
        base.RunningUpdate();
        if (hasResolutionSetupScreen)
        {
            if (_resDiaSkipState == DialogSkipState.WaitingForDialogToAppear)
            {
                if (ExternalWindowTracker.WindowIsPresent(this.ResulotionDialogWindowTitle))
                {
                    _resDiaSkipState = DialogSkipState.DialogHasAppeared;
                }
            }
            else if (_resDiaSkipState == DialogSkipState.DialogHasAppeared)
            {
                _lastResDialogKeySendTimer += Time.deltaTime;
                if (!ExternalWindowTracker.WindowIsPresent(this.ResulotionDialogWindowTitle))
                {
                    _resDiaSkipState = DialogSkipState.DialogHasClosed;
                }
                else if (_lastResDialogKeySendTimer > .5f)
                {
                    Debug.Log("Sending");
                    SendKeyToResDialog();
                }
            }
            //else
            //{
            //    if (ProcessRunner.WindowIsPresent(this.ResulotionDialogWindowTitle) && _dialogWaitTimer.expired)
            //    {
            //        _dialogWaitTimer.Restart();
            //        needToSendKeys = true;
            //    }

            //}
        }
    }
示例#3
0
    public bool IsGameRunning()
    {
        bool processJustStarted        = _runningGame != null && currentProcessStartTimer < 5;
        bool windowBasedGameIsRunning  = _runningGame != null && !string.IsNullOrEmpty(_runningGame.windowTitle) && ExternalWindowTracker.WindowIsPresent(_runningGame.windowTitle);
        bool processBasedGameIsRunning = _runningGame != null && (currentGameRunner.process != null && !currentGameRunner.process.HasExited);

        return(processJustStarted || windowBasedGameIsRunning || processBasedGameIsRunning);
    }