Beispiel #1
0
        /// <summary>
        /// Xna PreUpdate event callback.
        /// </summary>
        /// <param name="e"></param>
        public static void OnXnaPreUpdate(XnaUpdateEventArgs e)
        {
            // Force the mouse to render..
            Terraria.MainGame.IsMouseVisible = true;

            // Clear current chat text..
            Terraria.SetMainField("chatText", string.Empty);

            // Update the input handler..
            InputHandler.Update();

            // Update the hotkey manager..
            HotkeyManager.ProcessHotkeys();

            // Update the UI manager..
            Detox.GuiManager.Update(e.GameTime);

            // Handle the enter key..
            if (InputHandler.CurrentKeyboard.IsKeyDown(Keys.Enter) && !InputHandler.PreviousKeyboard.IsKeyDown(Keys.Enter) &&
                !Terraria.GetMainField <bool>("editSign"))
            {
                if (Detox.DetoxConsole.Visible && !Detox.DetoxConsole.HasInputFocus)
                {
                    Detox.DetoxConsole.HasInputFocus = true;
                }
                else
                {
                    Detox.DetoxChatWindow.HasInputFocus = !Detox.DetoxChatWindow.HasInputFocus;
                }
            }
        }
Beispiel #2
0
            /// <summary>
            /// Invokes the Xna PostUpdate event.
            /// </summary>
            /// <param name="gameTime"></param>
            public static void InvokePostUpdate(GameTime gameTime)
            {
                var args = new XnaUpdateEventArgs
                {
                    GameTime = gameTime
                };

                PostUpdate.Invoke(args);
            }
Beispiel #3
0
        /// <summary>
        /// Xna PostUpdate event callback.
        /// </summary>
        /// <param name="e"></param>
        public static void OnXnaPostUpdate(XnaUpdateEventArgs e)
        {
            // Force the mouse to render..
            Terraria.MainGame.IsMouseVisible = true;

            // Clear the chat text and mode..
            Terraria.SetMainField("chatText", string.Empty);
            Terraria.SetMainField("chatMode", false);

            // Update the UI manager..
            Detox.GuiManager.PostUpdate(e.GameTime);
        }
Beispiel #4
0
        void OnPostUpdate(XnaUpdateEventArgs args)
        {
            var player = DetoxPlayers.LocalPlayer;

            if (godmode)
            {
                player["statLife"]    = player["statLifeMax"];
                player["statMana"]    = player["statManaMax"];
                player["breath"]      = player["breathMax"];
                player["dead"]        = false;
                player["pvpDeath"]    = false;
                player["noFallDmg"]   = true;
                player["noKnockback"] = true;
            }
        }
Beispiel #5
0
 /// <summary>
 /// Invokes the Xna PostUpdate event.
 /// </summary>
 /// <param name="gameTime"></param>
 public static void InvokePostUpdate(GameTime gameTime)
 {
     var args = new XnaUpdateEventArgs
         {
             GameTime = gameTime
         };
     PostUpdate.Invoke(args);
 }