Make preferred changed item star more noticeable, and make the color configurable.

This commit is contained in:
Ottermandias 2025-03-14 00:13:01 +01:00
parent 93b0996794
commit cda6a4c420
2 changed files with 6 additions and 1 deletions

View file

@ -34,6 +34,7 @@ public enum ColorId : short
PredefinedTagAdd, PredefinedTagAdd,
PredefinedTagRemove, PredefinedTagRemove,
TemporaryModSettingsTint, TemporaryModSettingsTint,
ChangedItemPreferenceStar,
NoTint, NoTint,
} }
@ -110,6 +111,7 @@ public static class Colors
ColorId.TemporaryModSettingsTint => ( 0x30FF0000, "Mod with Temporary Settings", "A mod that has temporary settings. This color is used as a tint for the regular state colors." ), ColorId.TemporaryModSettingsTint => ( 0x30FF0000, "Mod with Temporary Settings", "A mod that has temporary settings. This color is used as a tint for the regular state colors." ),
ColorId.NewModTint => ( 0x8000FF00, "New Mod Tint", "A mod that was newly imported or created during this session and has not been enabled yet. This color is used as a tint for the regular state colors."), ColorId.NewModTint => ( 0x8000FF00, "New Mod Tint", "A mod that was newly imported or created during this session and has not been enabled yet. This color is used as a tint for the regular state colors."),
ColorId.NoTint => ( 0x00000000, "No Tint", "The default tint for all mods."), ColorId.NoTint => ( 0x00000000, "No Tint", "The default tint for all mods."),
ColorId.ChangedItemPreferenceStar => ( 0x30FFFFFF, "Preferred Changed Item Star", "The color of the star button in the mod panel's changed items tab to prioritize specific items."),
_ => throw new ArgumentOutOfRangeException( nameof( color ), color, null ), _ => throw new ArgumentOutOfRangeException( nameof( color ), color, null ),
// @formatter:on // @formatter:on
}; };

View file

@ -12,6 +12,7 @@ using Penumbra.GameData.Structs;
using Penumbra.Mods; using Penumbra.Mods;
using Penumbra.Mods.Manager; using Penumbra.Mods.Manager;
using Penumbra.String; using Penumbra.String;
using Penumbra.UI.Classes;
namespace Penumbra.UI.ModsTab; namespace Penumbra.UI.ModsTab;
@ -213,6 +214,7 @@ public class ModPanelChangedItemsTab(
private ImGuiStoragePtr _stateStorage; private ImGuiStoragePtr _stateStorage;
private Vector2 _buttonSize; private Vector2 _buttonSize;
private uint _starColor;
public void DrawContent() public void DrawContent()
{ {
@ -236,6 +238,7 @@ public class ModPanelChangedItemsTab(
if (!table) if (!table)
return; return;
_starColor = ColorId.ChangedItemPreferenceStar.Value();
if (cache.AnyExpandable) if (cache.AnyExpandable)
{ {
ImUtf8.TableSetupColumn("##exp"u8, ImGuiTableColumnFlags.WidthFixed, _buttonSize.Y); ImUtf8.TableSetupColumn("##exp"u8, ImGuiTableColumnFlags.WidthFixed, _buttonSize.Y);
@ -286,7 +289,7 @@ public class ModPanelChangedItemsTab(
private void DrawPreferredButton(IdentifiedItem item, int idx) private void DrawPreferredButton(IdentifiedItem item, int idx)
{ {
if (ImUtf8.IconButton(FontAwesomeIcon.Star, "Prefer displaying this item instead of the current primary item.\n\nRight-click for more options."u8, _buttonSize, if (ImUtf8.IconButton(FontAwesomeIcon.Star, "Prefer displaying this item instead of the current primary item.\n\nRight-click for more options."u8, _buttonSize,
false, ImGui.GetColorU32(ImGuiCol.TextDisabled, 0.1f))) false, _starColor))
dataEditor.AddPreferredItem(selector.Selected!, item.Item.Id, false, true); dataEditor.AddPreferredItem(selector.Selected!, item.Item.Id, false, true);
using var context = ImUtf8.PopupContextItem("StarContext"u8, ImGuiPopupFlags.MouseButtonRight); using var context = ImUtf8.PopupContextItem("StarContext"u8, ImGuiPopupFlags.MouseButtonRight);
if (!context) if (!context)