From d84715ad27372aae31b50958d655800066d79888 Mon Sep 17 00:00:00 2001 From: Exter-N Date: Fri, 17 Nov 2023 23:51:42 +0100 Subject: [PATCH] =?UTF-8?q?Fix=20stain=20preview=20(=E2=88=9A=20+=20order)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Penumbra/Services/StainService.cs | 7 ++++--- .../AdvancedWindow/ModEditWindow.Materials.ColorTable.cs | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Penumbra/Services/StainService.cs b/Penumbra/Services/StainService.cs index 63f6d05e..a0bca570 100644 --- a/Penumbra/Services/StainService.cs +++ b/Penumbra/Services/StainService.cs @@ -6,6 +6,7 @@ using ImGuiNET; using OtterGui.Widgets; using Penumbra.GameData.Data; using Penumbra.GameData.Files; +using Penumbra.UI.AdvancedWindow; using Penumbra.Util; namespace Penumbra.Services; @@ -61,11 +62,11 @@ public class StainService : IDisposable ImGui.SameLine(); var frame = new Vector2(ImGui.GetTextLineHeight()); - ImGui.ColorButton("D", new Vector4(colors.Diffuse, 1), 0, frame); + ImGui.ColorButton("D", new Vector4(ModEditWindow.PseudoSqrtRgb(colors.Diffuse), 1), 0, frame); ImGui.SameLine(); - ImGui.ColorButton("E", new Vector4(colors.Emissive, 1), 0, frame); + ImGui.ColorButton("S", new Vector4(ModEditWindow.PseudoSqrtRgb(colors.Specular), 1), 0, frame); ImGui.SameLine(); - ImGui.ColorButton("S", new Vector4(colors.Specular, 1), 0, frame); + ImGui.ColorButton("E", new Vector4(ModEditWindow.PseudoSqrtRgb(colors.Emissive), 1), 0, frame); return ret; } } diff --git a/Penumbra/UI/AdvancedWindow/ModEditWindow.Materials.ColorTable.cs b/Penumbra/UI/AdvancedWindow/ModEditWindow.Materials.ColorTable.cs index d1cb4c94..a4e25f77 100644 --- a/Penumbra/UI/AdvancedWindow/ModEditWindow.Materials.ColorTable.cs +++ b/Penumbra/UI/AdvancedWindow/ModEditWindow.Materials.ColorTable.cs @@ -528,7 +528,7 @@ public partial class ModEditWindow private static float PseudoSqrtRgb(float x) => x < 0.0f ? -MathF.Sqrt(-x) : MathF.Sqrt(x); - private static Vector3 PseudoSqrtRgb(Vector3 vec) + internal static Vector3 PseudoSqrtRgb(Vector3 vec) => new(PseudoSqrtRgb(vec.X), PseudoSqrtRgb(vec.Y), PseudoSqrtRgb(vec.Z)); private static Vector4 PseudoSqrtRgb(Vector4 vec)