public override void OnPush()
        {
            base.OnPush();

            // Reset counters
            hoursRemaining = 0;
            totalHours     = 0;
            waitTimer      = 0;
            enemyBrokeRest = false;

            // Get references
            playerEntity = GameManager.Instance.PlayerEntity;
            hud          = DaggerfallUI.Instance.DaggerfallHUD;
        }
Ejemplo n.º 2
0
        public override void OnPush()
        {
            base.OnPush();

            // Reset counters
            minutesOfHour          = 0;
            hoursRemaining         = 0;
            totalHours             = 0;
            waitTimer              = 0;
            enemyBrokeRest         = false;
            abortRestForEnemySpawn = false;

            // Get references
            playerEntity = GameManager.Instance.PlayerEntity;
            hud          = DaggerfallUI.Instance.DaggerfallHUD;

            GameManager.OnEncounter += GameManager_OnEncounter;
        }
        public override void OnPush()
        {
            base.OnPush();

            toggleClosedBinding = InputManager.Instance.GetBinding(InputManager.Actions.Rest);

            // Reset counters
            minutesOfHour          = 0;
            hoursRemaining         = 0;
            totalHours             = 0;
            waitTimer              = 0;
            enemyBrokeRest         = false;
            abortRestForEnemySpawn = false;

            // Get references
            playerEntity = GameManager.Instance.PlayerEntity;
            hud          = DaggerfallUI.Instance.DaggerfallHUD;

            GameManager.OnEncounter += GameManager_OnEncounter;

            // Raise player resting flag when UI opens
            // This is used for random enemy spawning and influences CastWhenHeld durability loss
            playerEntity.IsResting = true;
        }
Ejemplo n.º 4
0
        public override void OnPush()
        {
            base.OnPush();

            hud = DaggerfallUI.Instance.DaggerfallHUD;
        }
Ejemplo n.º 5
0
 void Start()
 {
     // HUD is first window on stack when enabled
     if (enableHUD && DaggerfallUnity.Instance.IsPathValidated)
     {
         dfHUD = new DaggerfallHUD(uiManager);
         uiManager.PushWindow(dfHUD);
         Debug.Log("HUD pushed to stack.");
     }
 }
        void Update()
        {
            // Progress fade
            if (fadeInProgress)
                TickFade();

            // HUD is always first window on stack when ready
            if (dfUnity.IsPathValidated && !hudSetup)
            {
                if (enableHUD)
                {
                    dfHUD = new DaggerfallHUD(uiManager);
                    uiManager.PushWindow(dfHUD);
                    Debug.Log("HUD pushed to stack.");
                }
                hudSetup = true;
            }

            // Route messages to top window or handle locally
            if (uiManager.MessageCount > 0)
            {
                // Top window has first chance at message
                if (uiManager.TopWindow != null)
                    uiManager.TopWindow.ProcessMessages();

                // Then process locally
                ProcessMessages();
            }

            // Update top window
            if (uiManager.TopWindow != null)
            {
                uiManager.TopWindow.Update();
            }

            // Clear key state every frame
            lastCharacterTyped = (char)0;
            lastKeyCode = KeyCode.None;
        }
        public override void OnPush()
        {
            base.OnPush();

            // Reset counters
            hoursRemaining = 0;
            totalHours = 0;
            waitTimer = 0;

            // Get references
            playerEntity = GameManager.Instance.PlayerEntity;
            hud = DaggerfallUI.Instance.DaggerfallHUD;
        }