Example #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;
            }
        }
Example #2
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;
     }
 }
Example #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);
            Terraria.SetMainField("chatRelease", false);

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