add normalized icons
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using Dalamud.Interface;
|
||||
using Dalamud.Interface.Components;
|
||||
using Dalamud.Interface.Utility;
|
||||
using Dalamud.Interface.Utility.Raii;
|
||||
using ImGuiNET;
|
||||
using MareSynchronos.PlayerData.Pairs;
|
||||
@@ -41,7 +42,7 @@ public abstract class DrawFolderBase : IDrawFolder
|
||||
|
||||
ImGui.AlignTextToFramePadding();
|
||||
|
||||
UiSharedService.FontText(icon.ToIconString(), UiBuilder.IconFont);
|
||||
UiSharedService.NormalizedIcon(icon);
|
||||
if (ImGui.IsItemClicked())
|
||||
{
|
||||
_tagHandler.SetTagOpen(_id, !_tagHandler.IsTagOpen(_id));
|
||||
|
||||
@@ -42,8 +42,7 @@ public class DrawFolderGroup : DrawFolderBase
|
||||
{
|
||||
ImGui.AlignTextToFramePadding();
|
||||
|
||||
using (ImRaii.PushFont(UiBuilder.IconFont))
|
||||
ImGui.TextUnformatted(_groupFullInfoDto.GroupPermissions.IsDisableInvites() ? FontAwesomeIcon.Lock.ToIconString() : FontAwesomeIcon.Users.ToIconString());
|
||||
UiSharedService.NormalizedIcon(_groupFullInfoDto.GroupPermissions.IsDisableInvites() ? FontAwesomeIcon.Lock : FontAwesomeIcon.Users);
|
||||
if (_groupFullInfoDto.GroupPermissions.IsDisableInvites())
|
||||
{
|
||||
UiSharedService.AttachToolTip("Syncshell " + _groupFullInfoDto.GroupAliasOrGID + " is closed for invites");
|
||||
@@ -62,22 +61,19 @@ public class DrawFolderGroup : DrawFolderBase
|
||||
if (IsOwner)
|
||||
{
|
||||
ImGui.AlignTextToFramePadding();
|
||||
using (ImRaii.PushFont(UiBuilder.IconFont))
|
||||
ImGui.TextUnformatted(FontAwesomeIcon.Crown.ToIconString());
|
||||
UiSharedService.NormalizedIcon(FontAwesomeIcon.Crown);
|
||||
UiSharedService.AttachToolTip("You are the owner of " + _groupFullInfoDto.GroupAliasOrGID);
|
||||
}
|
||||
else if (IsModerator)
|
||||
{
|
||||
ImGui.AlignTextToFramePadding();
|
||||
using (ImRaii.PushFont(UiBuilder.IconFont))
|
||||
ImGui.TextUnformatted(FontAwesomeIcon.UserShield.ToIconString());
|
||||
UiSharedService.NormalizedIcon(FontAwesomeIcon.UserShield);
|
||||
UiSharedService.AttachToolTip("You are a moderator in " + _groupFullInfoDto.GroupAliasOrGID);
|
||||
}
|
||||
else if (IsPinned)
|
||||
{
|
||||
ImGui.AlignTextToFramePadding();
|
||||
using (ImRaii.PushFont(UiBuilder.IconFont))
|
||||
ImGui.TextUnformatted(FontAwesomeIcon.Thumbtack.ToIconString());
|
||||
UiSharedService.NormalizedIcon(FontAwesomeIcon.Thumbtack);
|
||||
UiSharedService.AttachToolTip("You are pinned in " + _groupFullInfoDto.GroupAliasOrGID);
|
||||
}
|
||||
ImGui.SameLine();
|
||||
@@ -179,8 +175,7 @@ public class DrawFolderGroup : DrawFolderBase
|
||||
FontAwesomeIcon pauseIcon = _groupFullInfoDto.GroupUserPermissions.IsPaused() ? FontAwesomeIcon.Play : FontAwesomeIcon.Pause;
|
||||
var pauseButtonSize = UiSharedService.GetIconButtonSize(pauseIcon);
|
||||
|
||||
var folderIcon = FontAwesomeIcon.UsersCog;
|
||||
var userCogButtonSize = UiSharedService.GetIconSize(folderIcon);
|
||||
var userCogButtonSize = UiSharedService.GetNormalizedIconSize(FontAwesomeIcon.UsersCog);
|
||||
|
||||
var individualSoundsDisabled = _groupFullInfoDto.GroupUserPermissions.IsDisableSounds();
|
||||
var individualAnimDisabled = _groupFullInfoDto.GroupUserPermissions.IsDisableAnimations();
|
||||
@@ -192,17 +187,15 @@ public class DrawFolderGroup : DrawFolderBase
|
||||
|
||||
ImGui.AlignTextToFramePadding();
|
||||
|
||||
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudYellow,
|
||||
_groupFullInfoDto.GroupPermissions.IsPreferDisableAnimations() != individualAnimDisabled
|
||||
UiSharedService.NormalizedIcon(FontAwesomeIcon.UsersCog, (_groupFullInfoDto.GroupPermissions.IsPreferDisableAnimations() != individualAnimDisabled
|
||||
|| _groupFullInfoDto.GroupPermissions.IsPreferDisableSounds() != individualSoundsDisabled
|
||||
|| _groupFullInfoDto.GroupPermissions.IsPreferDisableVFX() != individualVFXDisabled))
|
||||
UiSharedService.FontText(folderIcon.ToIconString(), UiBuilder.IconFont);
|
||||
|| _groupFullInfoDto.GroupPermissions.IsPreferDisableVFX() != individualVFXDisabled) ? ImGuiColors.DalamudYellow : null);
|
||||
if (ImGui.IsItemHovered())
|
||||
{
|
||||
ImGui.BeginTooltip();
|
||||
|
||||
ImGui.TextUnformatted("Syncshell Permissions");
|
||||
ImGui.Dummy(new(2f));
|
||||
ImGuiHelpers.ScaledDummy(2f);
|
||||
|
||||
UiSharedService.BooleanToColoredIcon(!individualSoundsDisabled, inline: false);
|
||||
ImGui.SameLine(40 * ImGuiHelpers.GlobalScale);
|
||||
@@ -218,9 +211,9 @@ public class DrawFolderGroup : DrawFolderBase
|
||||
|
||||
ImGui.Separator();
|
||||
|
||||
ImGui.Dummy(new(2f));
|
||||
ImGuiHelpers.ScaledDummy(2f);
|
||||
ImGui.TextUnformatted("Suggested Permissions");
|
||||
ImGui.Dummy(new(2f));
|
||||
ImGuiHelpers.ScaledDummy(2f);
|
||||
|
||||
UiSharedService.BooleanToColoredIcon(!_groupFullInfoDto.GroupPermissions.IsPreferDisableSounds(), inline: false);
|
||||
ImGui.SameLine(40 * ImGuiHelpers.GlobalScale);
|
||||
|
||||
@@ -69,22 +69,20 @@ public class DrawFolderTag : DrawFolderBase
|
||||
|
||||
protected override float DrawIcon()
|
||||
{
|
||||
using (ImRaii.PushFont(UiBuilder.IconFont))
|
||||
var icon = _id switch
|
||||
{
|
||||
var icon = _id switch
|
||||
{
|
||||
TagHandler.CustomUnpairedTag => FontAwesomeIcon.ArrowsLeftRight.ToIconString(),
|
||||
TagHandler.CustomOnlineTag => FontAwesomeIcon.Link.ToIconString(),
|
||||
TagHandler.CustomOfflineTag => FontAwesomeIcon.Unlink.ToIconString(),
|
||||
TagHandler.CustomOfflineSyncshellTag => FontAwesomeIcon.Unlink.ToIconString(),
|
||||
TagHandler.CustomVisibleTag => FontAwesomeIcon.Eye.ToIconString(),
|
||||
TagHandler.CustomAllTag => FontAwesomeIcon.User.ToIconString(),
|
||||
_ => FontAwesomeIcon.Folder.ToIconString()
|
||||
};
|
||||
TagHandler.CustomUnpairedTag => FontAwesomeIcon.ArrowsLeftRight,
|
||||
TagHandler.CustomOnlineTag => FontAwesomeIcon.Link,
|
||||
TagHandler.CustomOfflineTag => FontAwesomeIcon.Unlink,
|
||||
TagHandler.CustomOfflineSyncshellTag => FontAwesomeIcon.Unlink,
|
||||
TagHandler.CustomVisibleTag => FontAwesomeIcon.Eye,
|
||||
TagHandler.CustomAllTag => FontAwesomeIcon.User,
|
||||
_ => FontAwesomeIcon.Folder
|
||||
};
|
||||
|
||||
ImGui.AlignTextToFramePadding();
|
||||
UiSharedService.NormalizedIcon(icon);
|
||||
|
||||
ImGui.AlignTextToFramePadding();
|
||||
ImGui.TextUnformatted(icon);
|
||||
}
|
||||
if (RenderCount)
|
||||
{
|
||||
using (ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, ImGui.GetStyle().ItemSpacing with { X = ImGui.GetStyle().ItemSpacing.X / 2f }))
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
using Dalamud.Interface;
|
||||
using Dalamud.Interface.Utility;
|
||||
using Dalamud.Interface.Utility.Raii;
|
||||
using ImGuiNET;
|
||||
using MareSynchronos.UI.Handlers;
|
||||
using System.Collections.Immutable;
|
||||
using System.Numerics;
|
||||
|
||||
namespace MareSynchronos.UI.Components;
|
||||
|
||||
@@ -27,24 +29,28 @@ public class DrawGroupedGroupFolder : IDrawFolder
|
||||
string _id = "__folder_syncshells";
|
||||
using var id = ImRaii.PushId(_id);
|
||||
|
||||
ImGui.Dummy(new Vector2(0f, ImGui.GetFrameHeight()));
|
||||
ImGui.SameLine();
|
||||
|
||||
var icon = _tagHandler.IsTagOpen(_id) ? FontAwesomeIcon.CaretDown : FontAwesomeIcon.CaretRight;
|
||||
UiSharedService.FontText(icon.ToIconString(), UiBuilder.IconFont);
|
||||
UiSharedService.NormalizedIcon(icon);
|
||||
if (ImGui.IsItemClicked())
|
||||
{
|
||||
_tagHandler.SetTagOpen(_id, !_tagHandler.IsTagOpen(_id));
|
||||
}
|
||||
|
||||
ImGui.SameLine();
|
||||
using (ImRaii.PushFont(UiBuilder.IconFont))
|
||||
ImGui.TextUnformatted(FontAwesomeIcon.UsersRectangle.ToIconString());
|
||||
UiSharedService.NormalizedIcon(FontAwesomeIcon.UsersRectangle);
|
||||
using (ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, ImGui.GetStyle().ItemSpacing with { X = ImGui.GetStyle().ItemSpacing.X / 2f }))
|
||||
{
|
||||
ImGui.SameLine();
|
||||
ImGui.AlignTextToFramePadding();
|
||||
ImGui.TextUnformatted("[" + OnlinePairs.ToString() + "]");
|
||||
}
|
||||
UiSharedService.AttachToolTip(OnlinePairs + " online in all of your joined syncshells" + Environment.NewLine +
|
||||
TotalPairs + " pairs combined in all of your joined syncshells");
|
||||
ImGui.SameLine();
|
||||
ImGui.AlignTextToFramePadding();
|
||||
ImGui.TextUnformatted("All Syncshells");
|
||||
ImGui.Separator();
|
||||
|
||||
|
||||
@@ -189,30 +189,31 @@ public class DrawUserPair
|
||||
ImGui.AlignTextToFramePadding();
|
||||
|
||||
using var _ = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudYellow);
|
||||
using var font = ImRaii.PushFont(UiBuilder.IconFont);
|
||||
ImGui.TextUnformatted(FontAwesomeIcon.PauseCircle.ToIconString());
|
||||
//using var font = ImRaii.PushFont(UiBuilder.IconFont);
|
||||
UiSharedService.NormalizedIcon(FontAwesomeIcon.PauseCircle);
|
||||
userPairText = _pair.UserData.AliasOrUID + " is paused";
|
||||
ImGui.SameLine();
|
||||
}
|
||||
else if (!_pair.IsOnline)
|
||||
{
|
||||
ImGui.AlignTextToFramePadding();
|
||||
using var _ = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.DalamudRed);
|
||||
using var font = ImRaii.PushFont(UiBuilder.IconFont);
|
||||
ImGui.TextUnformatted(_pair.IndividualPairStatus == API.Data.Enum.IndividualPairStatus.OneSided
|
||||
? FontAwesomeIcon.ArrowsLeftRight.ToIconString()
|
||||
UiSharedService.NormalizedIcon(_pair.IndividualPairStatus == API.Data.Enum.IndividualPairStatus.OneSided
|
||||
? FontAwesomeIcon.ArrowsLeftRight
|
||||
: (_pair.IndividualPairStatus == API.Data.Enum.IndividualPairStatus.Bidirectional
|
||||
? FontAwesomeIcon.User.ToIconString() : FontAwesomeIcon.Users.ToIconString()));
|
||||
? FontAwesomeIcon.User : FontAwesomeIcon.Users));
|
||||
userPairText = _pair.UserData.AliasOrUID + " is offline";
|
||||
ImGui.SameLine();
|
||||
}
|
||||
else
|
||||
{
|
||||
ImGui.AlignTextToFramePadding();
|
||||
|
||||
using var font = ImRaii.PushFont(UiBuilder.IconFont);
|
||||
using var _ = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.HealerGreen);
|
||||
ImGui.TextUnformatted(_pair.IndividualPairStatus == API.Data.Enum.IndividualPairStatus.Bidirectional
|
||||
? FontAwesomeIcon.User.ToIconString() : FontAwesomeIcon.Users.ToIconString());
|
||||
UiSharedService.NormalizedIcon(_pair.IndividualPairStatus == API.Data.Enum.IndividualPairStatus.Bidirectional
|
||||
? FontAwesomeIcon.User : FontAwesomeIcon.Users);
|
||||
userPairText = _pair.UserData.AliasOrUID + " is online";
|
||||
ImGui.SameLine();
|
||||
}
|
||||
|
||||
if (_pair.IndividualPairStatus == API.Data.Enum.IndividualPairStatus.OneSided)
|
||||
@@ -241,31 +242,22 @@ public class DrawUserPair
|
||||
ImGui.AlignTextToFramePadding();
|
||||
if (string.Equals(_currentGroup.OwnerUID, _pair.UserData.UID, StringComparison.Ordinal))
|
||||
{
|
||||
using (ImRaii.PushFont(UiBuilder.IconFont))
|
||||
{
|
||||
ImGui.SameLine();
|
||||
ImGui.TextUnformatted(FontAwesomeIcon.Crown.ToIconString());
|
||||
}
|
||||
ImGui.SameLine();
|
||||
UiSharedService.NormalizedIcon(FontAwesomeIcon.Crown);
|
||||
UiSharedService.AttachToolTip("User is owner of this syncshell");
|
||||
}
|
||||
else if (_currentGroup.GroupPairUserInfos.TryGetValue(_pair.UserData.UID, out var userinfo))
|
||||
{
|
||||
if (userinfo.IsModerator())
|
||||
{
|
||||
using (ImRaii.PushFont(UiBuilder.IconFont))
|
||||
{
|
||||
ImGui.SameLine();
|
||||
ImGui.TextUnformatted(FontAwesomeIcon.UserShield.ToIconString());
|
||||
}
|
||||
ImGui.SameLine();
|
||||
UiSharedService.NormalizedIcon(FontAwesomeIcon.UserShield);
|
||||
UiSharedService.AttachToolTip("User is moderator in this syncshell");
|
||||
}
|
||||
else if (userinfo.IsPinned())
|
||||
{
|
||||
using (ImRaii.PushFont(UiBuilder.IconFont))
|
||||
{
|
||||
ImGui.SameLine();
|
||||
ImGui.TextUnformatted(FontAwesomeIcon.Thumbtack.ToIconString());
|
||||
}
|
||||
ImGui.SameLine();
|
||||
UiSharedService.NormalizedIcon(FontAwesomeIcon.Thumbtack);
|
||||
UiSharedService.AttachToolTip("User is pinned in this syncshell");
|
||||
}
|
||||
}
|
||||
@@ -273,32 +265,26 @@ public class DrawUserPair
|
||||
|
||||
if (_pair.UserPair.OwnPermissions.IsSticky())
|
||||
{
|
||||
ImGui.SameLine();
|
||||
ImGui.AlignTextToFramePadding();
|
||||
|
||||
using (ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, ImGui.GetStyle().ItemSpacing with { X = ImGui.GetStyle().ItemSpacing.X * 3 / 4f }))
|
||||
using (ImRaii.PushFont(UiBuilder.IconFont))
|
||||
{
|
||||
ImGui.SameLine();
|
||||
ImGui.TextUnformatted(FontAwesomeIcon.ArrowCircleUp.ToIconString());
|
||||
}
|
||||
UiSharedService.NormalizedIcon(FontAwesomeIcon.ArrowCircleUp);
|
||||
|
||||
UiSharedService.AttachToolTip(_pair.UserData.AliasOrUID + " has preferred permissions enabled");
|
||||
}
|
||||
|
||||
if (_pair.IsVisible)
|
||||
{
|
||||
ImGui.SameLine();
|
||||
ImGui.AlignTextToFramePadding();
|
||||
|
||||
using (ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, ImGui.GetStyle().ItemSpacing with { X = ImGui.GetStyle().ItemSpacing.X * 3 / 4f }))
|
||||
using (ImRaii.PushFont(UiBuilder.IconFont))
|
||||
{
|
||||
ImGui.SameLine();
|
||||
using var _ = ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.ParsedGreen);
|
||||
ImGui.TextUnformatted(FontAwesomeIcon.Eye.ToIconString());
|
||||
}
|
||||
UiSharedService.NormalizedIcon(FontAwesomeIcon.Eye, ImGuiColors.ParsedGreen);
|
||||
|
||||
UiSharedService.AttachToolTip("User is visible: " + _pair.PlayerName);
|
||||
}
|
||||
|
||||
ImGui.SameLine();
|
||||
}
|
||||
|
||||
private void DrawName(float leftSide, float rightSide)
|
||||
@@ -352,7 +338,7 @@ public class DrawUserPair
|
||||
{
|
||||
var infoIconPosDist = windowEndX - barButtonSize.X - spacingX - pauseIconSize.X - spacingX;
|
||||
var icon = FontAwesomeIcon.InfoCircle;
|
||||
var iconwidth = UiSharedService.GetIconSize(icon);
|
||||
var iconwidth = UiSharedService.GetNormalizedIconSize(icon);
|
||||
|
||||
infoIconDist = iconwidth.X;
|
||||
ImGui.SameLine(infoIconPosDist - iconwidth.X);
|
||||
|
||||
Reference in New Issue
Block a user