From 71ff037887816004e8ca7b9251a8177f5938c7b2 Mon Sep 17 00:00:00 2001 From: miku-666 <74728189+NessieHax@users.noreply.github.com> Date: Sat, 18 May 2024 18:21:57 +0200 Subject: [PATCH] SkinRenderer - Add 'HighlightlingColor' property --- PCK-Studio/Forms/Editor/CustomSkinEditor.cs | 3 ++- PCK-Studio/Rendering/SkinRenderer.cs | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/PCK-Studio/Forms/Editor/CustomSkinEditor.cs b/PCK-Studio/Forms/Editor/CustomSkinEditor.cs index fc5c800d..361fd75b 100644 --- a/PCK-Studio/Forms/Editor/CustomSkinEditor.cs +++ b/PCK-Studio/Forms/Editor/CustomSkinEditor.cs @@ -255,6 +255,7 @@ namespace PckStudio.Forms.Editor } } + // TODO: fixed outline rendering private void skinPartListBox_SelectedIndexChanged(object sender, EventArgs e) { int scale = 4; @@ -269,7 +270,7 @@ namespace PckStudio.Forms.Editor GraphicsPath graphicsPath = box.GetUVGraphicsPath(new System.Numerics.Vector2(scaleSize.Width * renderer3D1.TillingFactor.X, scaleSize.Height * renderer3D1.TillingFactor.Y)); g.ApplyConfig(_graphicsConfig); g.DrawImage(_skin.Model.Texture, new Rectangle(Point.Empty, scaleSize), new Rectangle(Point.Empty, _skin.Model.Texture.Size), GraphicsUnit.Pixel); - g.DrawPath(new Pen(renderer3D1.GuideLineColor, lineWidth), graphicsPath); + g.DrawPath(new Pen(renderer3D1.HighlightlingColor, lineWidth), graphicsPath); } uvPictureBox.Invalidate(); } diff --git a/PCK-Studio/Rendering/SkinRenderer.cs b/PCK-Studio/Rendering/SkinRenderer.cs index cf4f0e31..c375a79a 100644 --- a/PCK-Studio/Rendering/SkinRenderer.cs +++ b/PCK-Studio/Rendering/SkinRenderer.cs @@ -82,6 +82,10 @@ namespace PckStudio.Rendering [Category("Appearance")] public Color GuideLineColor { get; set; } + [Description("The Color used for highlighting selected cube")] + [Category("Appearance")] + public Color HighlightlingColor { get; set; } = Color.Aqua; + public float MouseSensetivity { get; set; } = 0.01f; public int SelectedIndex { @@ -1181,7 +1185,7 @@ namespace PckStudio.Rendering Vector3 pivot = cubeMesh.Pivot + cubeMesh.Offset; transform = Pivot(translation, pivot, transform); GL.BlendFunc(BlendingFactor.DstAlpha, BlendingFactor.OneMinusSrcAlpha); - DrawBoundingBox(transform, cubeBoundingBox, GuideLineColor); + DrawBoundingBox(transform, cubeBoundingBox, HighlightlingColor); GL.BlendFunc(BlendingFactor.SrcAlpha, BlendingFactor.OneMinusSrcAlpha); } }