예제 #1
0
        private static void DragAndDropHud(MouseState mouseState)
        {
            if (!TasSettings.InfoHud && !InputController.StudioTasFilePath.IsNotNullOrEmpty())
            {
                return;
            }

            Draw.SpriteBatch.Begin();

            InfoInspectEntity.HandleMouseData(mouseState, lastMouseState);

            Draw.Line(mouseState.X - 13f, mouseState.Y, mouseState.X + 12f, mouseState.Y, Color.Red, 5f);
            Draw.Line(mouseState.X, mouseState.Y - 13f, mouseState.X, mouseState.Y + 12f, Color.Red, 5f);

            if (lastMouseState.LeftButton == ButtonState.Released && mouseState.LeftButton == ButtonState.Pressed)
            {
                startDragPosition = new Vector2(mouseState.X, mouseState.Y);
            }

            if (startDragPosition != null && mouseState.LeftButton == ButtonState.Released)
            {
                if (Math.Abs((int)(mouseState.X - startDragPosition.Value.X)) > 0.1f ||
                    Math.Abs((int)(mouseState.Y - startDragPosition.Value.Y)) > 0.1f)
                {
                    CelesteTasModule.Instance.SaveSettings();
                }

                startDragPosition = null;
            }

            if (startDragPosition != null && mouseState.LeftButton == ButtonState.Pressed)
            {
                TasSettings.InfoPosition += new Vector2(mouseState.X - lastMouseState.X, mouseState.Y - lastMouseState.Y);
            }

            lastMouseState = mouseState;

            Draw.SpriteBatch.End();
        }
예제 #2
0
 public static void Unload()
 {
     On.Celeste.Level.Render  -= LevelOnRender;
     On.Celeste.Fonts.Prepare -= FontsOnPrepare;
     InfoInspectEntity.Unload();
 }
예제 #3
0
 public static void Load()
 {
     On.Celeste.Level.Render  += LevelOnRender;
     On.Celeste.Fonts.Prepare += FontsOnPrepare;
     InfoInspectEntity.Load();
 }