Improve Color Table highlighting UX

This commit is contained in:
Exter-N 2025-12-12 21:21:12 +01:00 committed by Ottermandias
parent 92e9b472ed
commit 5a9ff39782
3 changed files with 15 additions and 6 deletions

View file

@ -115,7 +115,10 @@ public class Configuration : IPluginConfiguration, ISavable, IService
public bool AlwaysOpenDefaultImport { get; set; } = false;
public bool KeepDefaultMetaChanges { get; set; } = false;
public string DefaultModAuthor { get; set; } = DefaultTexToolsData.Author;
public bool EditRawTileTransforms { get; set; } = false;
public bool EditRawTileTransforms { get; set; } = false;
public bool WholePairSelectorAlwaysHighlights { get; set; } = false;
public bool HdrRenderTargets { get; set; } = true;
public Dictionary<ColorId, uint> Colors { get; set; }

View file

@ -273,11 +273,13 @@ public partial class MtrlTab
private void ColorTablePairHighlightButton(int pairIdx, bool disabled)
{
var wholePairSelectorHighlight = (_config.WholePairSelectorAlwaysHighlights || Im.Io.KeyControl) && Im.Item.Hovered();
ImEx.Icon.Button(LunaStyle.OnHoverIcon,
"Highlight this pair of rows on your character, if possible.\n\nHighlight colors can be configured in Penumbra's settings."u8,
disabled || _colorTablePreviewers.Count is 0);
if (Im.Item.Hovered())
if (wholePairSelectorHighlight || Im.Item.Hovered())
HighlightColorTablePair(pairIdx);
else if (_highlightedColorTablePair == pairIdx)
CancelColorTableHighlight();
@ -308,14 +310,14 @@ public partial class MtrlTab
else
{
drawList.RectangleFilled(
rcMin, rcMax with { Y = float.Lerp(rcMin.Y, rcMax.Y, 1.0f / 3) },
rcMin, rcMax with { Y = MathF.Floor(float.Lerp(rcMin.Y, rcMax.Y, 1.0f / 3)) },
topColor, frameRounding, ImDrawFlagsRectangle.RoundCornersTop);
drawList.RectangleMulticolor(
rcMin with { Y = float.Lerp(rcMin.Y, rcMax.Y, 1.0f / 3) },
rcMax with { Y = float.Lerp(rcMin.Y, rcMax.Y, 2.0f / 3) },
rcMin with { Y = MathF.Floor(float.Lerp(rcMin.Y, rcMax.Y, 1.0f / 3)) },
rcMax with { Y = MathF.Ceiling(float.Lerp(rcMin.Y, rcMax.Y, 2.0f / 3)) },
topColor, topColor, bottomColor, bottomColor);
drawList.RectangleFilled(
rcMin with { Y = float.Lerp(rcMin.Y, rcMax.Y, 2.0f / 3) }, rcMax,
rcMin with { Y = MathF.Ceiling(float.Lerp(rcMin.Y, rcMax.Y, 2.0f / 3)) }, rcMax,
bottomColor, frameRounding, ImDrawFlagsRectangle.RoundCornersTop);
}

View file

@ -801,6 +801,10 @@ public sealed class SettingsTab : ITab<TabType>
Checkbox("Advanced Editing: Edit Raw Tile UV Transforms",
"Edit the raw matrix components of tile UV transforms, instead of having them decomposed into scale, rotation and shear.",
_config.EditRawTileTransforms, v => _config.EditRawTileTransforms = v);
Checkbox("Advanced Editing: Always Highlight Color Row Pair when Hovering Selection Button",
"Make the whole color row pair selection button highlight the pair in game, instead of just the crosshair, even without holding Ctrl.",
_config.WholePairSelectorAlwaysHighlights, v => _config.WholePairSelectorAlwaysHighlights = v);
}
#endregion