예제 #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;
                }
            }
        }
예제 #2
0
파일: Events.cs 프로젝트: atom0s/Detox
            /// <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);
            }
예제 #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);
        }
예제 #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;
            }
        }
예제 #5
0
파일: Events.cs 프로젝트: 999eagle/Detox
 /// <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);
 }