diff --git a/Penumbra/UI/AdvancedWindow/ModEditWindow.Materials.MtrlTab.cs b/Penumbra/UI/AdvancedWindow/ModEditWindow.Materials.MtrlTab.cs index d230950a..f4ce3329 100644 --- a/Penumbra/UI/AdvancedWindow/ModEditWindow.Materials.MtrlTab.cs +++ b/Penumbra/UI/AdvancedWindow/ModEditWindow.Materials.MtrlTab.cs @@ -19,6 +19,7 @@ using Penumbra.GameData.Structs; using Penumbra.Interop.MaterialPreview; using Penumbra.String; using Penumbra.String.Classes; +using Penumbra.UI.Classes; using static Penumbra.GameData.Files.ShpkFile; namespace Penumbra.UI.AdvancedWindow; @@ -668,12 +669,13 @@ public partial class ModEditWindow private static void ApplyHighlight(ref MtrlFile.ColorSet.Row row, float time) { - var level = Math.Sin(time * 2.0 * Math.PI) * 0.25 + 0.5; - var levelSq = (float)(level * level); + var level = (MathF.Sin(time * 2.0f * MathF.PI) + 2.0f) / 3.0f / 255.0f; + var baseColor = ColorId.InGameHighlight.Value(); + var color = level * new Vector3(baseColor & 0xFF, (baseColor >> 8) & 0xFF, (baseColor >> 16) & 0xFF); row.Diffuse = Vector3.Zero; row.Specular = Vector3.Zero; - row.Emissive = new Vector3(levelSq); + row.Emissive = color * color; } public void Update() diff --git a/Penumbra/UI/Classes/Colors.cs b/Penumbra/UI/Classes/Colors.cs index 450f3787..e2acc1a3 100644 --- a/Penumbra/UI/Classes/Colors.cs +++ b/Penumbra/UI/Classes/Colors.cs @@ -24,7 +24,8 @@ public enum ColorId RedundantAssignment, NoModsAssignment, NoAssignment, - SelectorPriority, + SelectorPriority, + InGameHighlight, } public static class Colors @@ -64,6 +65,7 @@ public static class Colors ColorId.NoModsAssignment => ( 0x50000080, "'Use No Mods' Collection Assignment", "A collection assignment set to not use any mods at all."), ColorId.NoAssignment => ( 0x00000000, "Unassigned Collection Assignment", "A collection assignment that is not configured to any collection and thus just has no specific treatment."), ColorId.SelectorPriority => ( 0xFF808080, "Mod Selector Priority", "The priority displayed for non-zero priority mods in the mod selector."), + ColorId.InGameHighlight => ( 0xFFEBCF89, "In-Game Highlight", "An in-game element that has been highlighted for ease of editing."), _ => throw new ArgumentOutOfRangeException( nameof( color ), color, null ), // @formatter:on };