mirror of
https://github.com/Ottermandias/Glamourer.git
synced 2025-12-12 10:17:23 +01:00
Mark designs containing advanced dyes, mod associations or links in automation.
This commit is contained in:
parent
2026069ed3
commit
c9f00c6369
1 changed files with 45 additions and 6 deletions
|
|
@ -30,10 +30,10 @@ public class SetPanel(
|
||||||
Configuration _config,
|
Configuration _config,
|
||||||
RandomRestrictionDrawer _randomDrawer)
|
RandomRestrictionDrawer _randomDrawer)
|
||||||
{
|
{
|
||||||
private readonly JobGroupCombo _jobGroupCombo = new(_manager, _jobs, Glamourer.Log);
|
private readonly JobGroupCombo _jobGroupCombo = new(_manager, _jobs, Glamourer.Log);
|
||||||
private readonly HeaderDrawer.Button[] _rightButtons = [new HeaderDrawer.IncognitoButton(_config.Ephemeral)];
|
private readonly HeaderDrawer.Button[] _rightButtons = [new HeaderDrawer.IncognitoButton(_config.Ephemeral)];
|
||||||
private string? _tempName;
|
private string? _tempName;
|
||||||
private int _dragIndex = -1;
|
private int _dragIndex = -1;
|
||||||
|
|
||||||
private Action? _endAction;
|
private Action? _endAction;
|
||||||
|
|
||||||
|
|
@ -178,7 +178,8 @@ public class SetPanel(
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ImUtf8.TableSetupColumn("Design / Job Restrictions"u8, ImGuiTableColumnFlags.WidthFixed, 250 * ImGuiHelpers.GlobalScale);
|
ImUtf8.TableSetupColumn("Design / Job Restrictions"u8, ImGuiTableColumnFlags.WidthFixed,
|
||||||
|
250 * ImGuiHelpers.GlobalScale - (ImGui.GetScrollMaxY() > 0 ? ImGui.GetStyle().ScrollbarSize : 0));
|
||||||
if (_config.ShowAllAutomatedApplicationRules)
|
if (_config.ShowAllAutomatedApplicationRules)
|
||||||
ImUtf8.TableSetupColumn("Application"u8, ImGuiTableColumnFlags.WidthFixed,
|
ImUtf8.TableSetupColumn("Application"u8, ImGuiTableColumnFlags.WidthFixed,
|
||||||
3 * ImGui.GetFrameHeight() + 4 * ImGuiHelpers.GlobalScale);
|
3 * ImGui.GetFrameHeight() + 4 * ImGuiHelpers.GlobalScale);
|
||||||
|
|
@ -205,8 +206,8 @@ public class SetPanel(
|
||||||
if (ImGuiUtil.DrawDisabledButton(FontAwesomeIcon.Trash.ToIconString(), new Vector2(ImGui.GetFrameHeight()), tt, !keyValid, true))
|
if (ImGuiUtil.DrawDisabledButton(FontAwesomeIcon.Trash.ToIconString(), new Vector2(ImGui.GetFrameHeight()), tt, !keyValid, true))
|
||||||
_endAction = () => _manager.DeleteDesign(Selection, idx);
|
_endAction = () => _manager.DeleteDesign(Selection, idx);
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
ImUtf8.Selectable($"#{idx + 1:D2}");
|
DrawSelectable(idx, design.Design);
|
||||||
DrawDragDrop(Selection, idx);
|
|
||||||
ImGui.TableNextColumn();
|
ImGui.TableNextColumn();
|
||||||
DrawRandomEditing(Selection, design, idx);
|
DrawRandomEditing(Selection, design, idx);
|
||||||
_designCombo.Draw(Selection, design, idx);
|
_designCombo.Draw(Selection, design, idx);
|
||||||
|
|
@ -243,6 +244,44 @@ public class SetPanel(
|
||||||
_endAction = null;
|
_endAction = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void DrawSelectable(int idx, IDesignStandIn design)
|
||||||
|
{
|
||||||
|
var highlight = 0u;
|
||||||
|
var sb = new StringBuilder();
|
||||||
|
if (design is Design d)
|
||||||
|
{
|
||||||
|
var count = design.AllLinks(true).Count();
|
||||||
|
if (count > 1)
|
||||||
|
{
|
||||||
|
sb.AppendLine($"This design contains {count - 1} links to other designs.");
|
||||||
|
highlight = ColorId.HeaderButtons.Value();
|
||||||
|
}
|
||||||
|
|
||||||
|
count = d.AssociatedMods.Count;
|
||||||
|
if (count > 0)
|
||||||
|
{
|
||||||
|
sb.AppendLine($"This design contains {count} mod associations.");
|
||||||
|
highlight = ColorId.ModdedItemMarker.Value();
|
||||||
|
}
|
||||||
|
|
||||||
|
count = design.GetMaterialData().Count(p => p.Item2.Enabled);
|
||||||
|
if (count > 0)
|
||||||
|
{
|
||||||
|
sb.AppendLine($"This design contains {count} enabled advanced dyes.");
|
||||||
|
highlight = ColorId.AdvancedDyeActive.Value();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
using (ImRaii.PushColor(ImGuiCol.Text, highlight, highlight != 0))
|
||||||
|
{
|
||||||
|
ImUtf8.Selectable($"#{idx + 1:D2}");
|
||||||
|
}
|
||||||
|
|
||||||
|
ImUtf8.HoverTooltip($"{sb}");
|
||||||
|
|
||||||
|
DrawDragDrop(Selection, idx);
|
||||||
|
}
|
||||||
|
|
||||||
private int _tmpGearset = int.MaxValue;
|
private int _tmpGearset = int.MaxValue;
|
||||||
private int _whichIndex = -1;
|
private int _whichIndex = -1;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue