add normalized icons
This commit is contained in:
@@ -175,7 +175,7 @@ public class CompactUi : WindowMediatorSubscriberBase
|
||||
|
||||
private void DrawAddCharacter()
|
||||
{
|
||||
ImGui.Dummy(new(10));
|
||||
ImGuiHelpers.ScaledDummy(10f);
|
||||
var keys = _serverManager.CurrentServer!.SecretKeys;
|
||||
if (keys.Any())
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -68,23 +68,21 @@ public class DrawFolderTag : DrawFolderBase
|
||||
};
|
||||
|
||||
protected override float DrawIcon()
|
||||
{
|
||||
using (ImRaii.PushFont(UiBuilder.IconFont))
|
||||
{
|
||||
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();
|
||||
ImGui.TextUnformatted(icon);
|
||||
}
|
||||
UiSharedService.NormalizedIcon(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)
|
||||
@@ -240,65 +241,50 @@ 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());
|
||||
}
|
||||
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());
|
||||
}
|
||||
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());
|
||||
}
|
||||
UiSharedService.NormalizedIcon(FontAwesomeIcon.Thumbtack);
|
||||
UiSharedService.AttachToolTip("User is pinned in this syncshell");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (_pair.UserPair.OwnPermissions.IsSticky())
|
||||
{
|
||||
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());
|
||||
}
|
||||
ImGui.AlignTextToFramePadding();
|
||||
using (ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, ImGui.GetStyle().ItemSpacing with { X = ImGui.GetStyle().ItemSpacing.X * 3 / 4f }))
|
||||
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);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Dalamud.Interface;
|
||||
using Dalamud.Interface.Components;
|
||||
using Dalamud.Interface.Utility;
|
||||
using Dalamud.Interface.Utility.Raii;
|
||||
using ImGuiNET;
|
||||
using MareSynchronos.API.Data.Extensions;
|
||||
@@ -64,7 +65,7 @@ public class CreateSyncshellUI : WindowMediatorSubscriberBase
|
||||
"- You can own up to " + _apiController.ServerInfo.MaxGroupsCreatedByUser + " Syncshells on this server." + Environment.NewLine +
|
||||
"- You can join up to " + _apiController.ServerInfo.MaxGroupsJoinedByUser + " Syncshells on this server (including your own)" + Environment.NewLine +
|
||||
"- Syncshells on this server can have a maximum of " + _apiController.ServerInfo.MaxGroupUserCount + " users");
|
||||
ImGui.Dummy(new(2f));
|
||||
ImGuiHelpers.ScaledDummy(2f);
|
||||
ImGui.TextUnformatted("Your current Syncshell preferred permissions are:");
|
||||
ImGui.TextUnformatted("- Animations");
|
||||
UiSharedService.BooleanToColoredIcon(!_apiController.DefaultPermissions!.DisableGroupAnimations);
|
||||
@@ -88,7 +89,7 @@ public class CreateSyncshellUI : WindowMediatorSubscriberBase
|
||||
UiSharedService.TextWrapped("You can change the Syncshell password later at any time.");
|
||||
ImGui.Separator();
|
||||
UiSharedService.TextWrapped("These settings were set based on your preferred syncshell permissions:");
|
||||
ImGui.Dummy(new(2f));
|
||||
ImGuiHelpers.ScaledDummy(2f);
|
||||
UiSharedService.TextWrapped("Suggest Animation sync:");
|
||||
UiSharedService.BooleanToColoredIcon(!_lastCreatedGroup.GroupUserPreferredPermissions.IsDisableAnimations());
|
||||
UiSharedService.TextWrapped("Suggest Sounds sync:");
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Dalamud.Interface.Colors;
|
||||
using Dalamud.Interface.Utility;
|
||||
using Dalamud.Interface.Utility.Raii;
|
||||
using ImGuiNET;
|
||||
using MareSynchronos.API.Data.Enum;
|
||||
@@ -91,7 +92,7 @@ internal class JoinSyncshellUI : WindowMediatorSubscriberBase
|
||||
else
|
||||
{
|
||||
ImGui.TextUnformatted("You are about to join the Syncshell " + _groupJoinInfo.GroupAliasOrGID + " by " + _groupJoinInfo.OwnerAliasOrUID);
|
||||
ImGui.Dummy(new(2));
|
||||
ImGuiHelpers.ScaledDummy(2f);
|
||||
ImGui.TextUnformatted("This Syncshell staff has set the following suggested Syncshell permissions:");
|
||||
ImGui.TextUnformatted("- Sounds ");
|
||||
UiSharedService.BooleanToColoredIcon(!_groupJoinInfo.GroupPermissions.IsPreferDisableSounds());
|
||||
@@ -104,7 +105,7 @@ internal class JoinSyncshellUI : WindowMediatorSubscriberBase
|
||||
|| _groupJoinInfo.GroupPermissions.IsPreferDisableVFX() != _ownPermissions.DisableGroupVFX
|
||||
|| _groupJoinInfo.GroupPermissions.IsPreferDisableAnimations() != _ownPermissions.DisableGroupAnimations)
|
||||
{
|
||||
ImGui.Dummy(new(2));
|
||||
ImGuiHelpers.ScaledDummy(2f);
|
||||
UiSharedService.ColorText("Your current preferred default Syncshell permissions deviate from the suggested permissions:", ImGuiColors.DalamudYellow);
|
||||
if (_groupJoinInfo.GroupPermissions.IsPreferDisableSounds() != _ownPermissions.DisableGroupSounds)
|
||||
{
|
||||
@@ -157,7 +158,7 @@ internal class JoinSyncshellUI : WindowMediatorSubscriberBase
|
||||
{
|
||||
UiSharedService.TextWrapped("Your default syncshell permissions on joining are in line with the suggested Syncshell permissions through the owner.");
|
||||
}
|
||||
ImGui.Dummy(new(2));
|
||||
ImGuiHelpers.ScaledDummy(2f);
|
||||
if (UiSharedService.IconTextButton(Dalamud.Interface.FontAwesomeIcon.Plus, "Finalize and join " + _groupJoinInfo.GroupAliasOrGID))
|
||||
{
|
||||
GroupUserPreferredPermissions joinPermissions = GroupUserPreferredPermissions.NoneSet;
|
||||
|
||||
@@ -114,11 +114,11 @@ public class PopoutProfileUi : WindowMediatorSubscriberBase
|
||||
using (ImRaii.PushFont(_uiSharedService.UidFont, _uiSharedService.UidFontBuilt))
|
||||
UiSharedService.ColorText(_pair.UserData.AliasOrUID, ImGuiColors.HealerGreen);
|
||||
|
||||
ImGui.Dummy(new(spacing.Y, spacing.Y));
|
||||
ImGuiHelpers.ScaledDummy(spacing.Y, spacing.Y);
|
||||
var textPos = ImGui.GetCursorPosY();
|
||||
ImGui.Separator();
|
||||
var imagePos = ImGui.GetCursorPos();
|
||||
ImGui.Dummy(new(256, 256 * ImGuiHelpers.GlobalScale + spacing.Y));
|
||||
ImGuiHelpers.ScaledDummy(256, 256 * ImGuiHelpers.GlobalScale + spacing.Y);
|
||||
var note = _serverManager.GetNoteForUid(_pair.UserData.UID);
|
||||
if (!string.IsNullOrEmpty(note))
|
||||
{
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Dalamud.Interface;
|
||||
using Dalamud.Interface.Colors;
|
||||
using Dalamud.Interface.Utility;
|
||||
using Dalamud.Interface.Utility.Raii;
|
||||
using Dalamud.Utility;
|
||||
using ImGuiNET;
|
||||
@@ -476,7 +477,7 @@ public class SettingsUi : WindowMediatorSubscriberBase
|
||||
ImGui.TextUnformatted("The file compactor is only available on Windows.");
|
||||
}
|
||||
|
||||
ImGui.Dummy(new Vector2(10, 10));
|
||||
ImGuiHelpers.ScaledDummy(new Vector2(10, 10));
|
||||
ImGui.TextUnformatted("To clear the local storage accept the following disclaimer");
|
||||
ImGui.Indent();
|
||||
ImGui.Checkbox("##readClearCache", ref _readClearCache);
|
||||
@@ -865,7 +866,7 @@ public class SettingsUi : WindowMediatorSubscriberBase
|
||||
|
||||
var idx = _uiShared.DrawServiceSelection();
|
||||
|
||||
ImGui.Dummy(new Vector2(10, 10));
|
||||
ImGuiHelpers.ScaledDummy(new Vector2(10, 10));
|
||||
|
||||
var selectedServer = _serverConfigurationManager.GetServerByIndex(idx);
|
||||
if (selectedServer == _serverConfigurationManager.CurrentServer)
|
||||
@@ -1056,7 +1057,7 @@ public class SettingsUi : WindowMediatorSubscriberBase
|
||||
{
|
||||
UiSharedService.TextWrapped("Note: The default permissions settings here are not applied retroactively to existing pairs or joined Syncshells.");
|
||||
UiSharedService.TextWrapped("Note: The default permissions settings here are sent and stored on the connected service.");
|
||||
ImGui.Dummy(new(5f));
|
||||
ImGuiHelpers.ScaledDummy(5f);
|
||||
var perms = _apiController.DefaultPermissions!;
|
||||
bool individualIsSticky = perms.IndividualIsSticky;
|
||||
bool disableIndividualSounds = perms.DisableIndividualSounds;
|
||||
@@ -1075,7 +1076,7 @@ public class SettingsUi : WindowMediatorSubscriberBase
|
||||
" - All individually set permissions for any pair will also automatically become preferred permissions. This includes pairs in Syncshells." + Environment.NewLine + Environment.NewLine +
|
||||
"It is possible to remove or set the preferred permission state for any pair at any time." + Environment.NewLine + Environment.NewLine +
|
||||
"If unsure, leave this setting off.");
|
||||
ImGui.Dummy(new(3f));
|
||||
ImGuiHelpers.ScaledDummy(3f);
|
||||
|
||||
if (ImGui.Checkbox("Disable individual pair sounds", ref disableIndividualSounds))
|
||||
{
|
||||
@@ -1095,7 +1096,7 @@ public class SettingsUi : WindowMediatorSubscriberBase
|
||||
_ = _apiController.UserUpdateDefaultPermissions(perms);
|
||||
}
|
||||
UiSharedService.DrawHelpText("This setting will disable VFX sync for all new individual pairs.");
|
||||
ImGui.Dummy(new(5f));
|
||||
ImGuiHelpers.ScaledDummy(5f);
|
||||
bool disableGroundSounds = perms.DisableGroupSounds;
|
||||
bool disableGroupAnimations = perms.DisableGroupAnimations;
|
||||
bool disableGroupVFX = perms.DisableGroupVFX;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Dalamud.Interface;
|
||||
using Dalamud.Interface.Colors;
|
||||
using Dalamud.Interface.Utility;
|
||||
using Dalamud.Interface.Utility.Raii;
|
||||
using ImGuiNET;
|
||||
using MareSynchronos.API.Data.Extensions;
|
||||
@@ -77,7 +78,7 @@ public class SyncshellAdminUI : WindowMediatorSubscriberBase
|
||||
_ = _apiController.GroupChangeGroupPermissionState(new(GroupFullInfo.Group, perm));
|
||||
}
|
||||
|
||||
ImGui.Dummy(new(2f));
|
||||
ImGuiHelpers.ScaledDummy(2f);
|
||||
|
||||
UiSharedService.TextWrapped("One-time invites work as single-use passwords. Use those if you do not want to distribute your Syncshell password.");
|
||||
if (UiSharedService.IconTextButton(FontAwesomeIcon.Envelope, "Single one-time invite"))
|
||||
@@ -116,7 +117,7 @@ public class SyncshellAdminUI : WindowMediatorSubscriberBase
|
||||
}
|
||||
UiSharedService.AttachToolTip("This will remove all non-pinned, non-moderator users from the Syncshell");
|
||||
|
||||
ImGui.Dummy(new(2f));
|
||||
ImGuiHelpers.ScaledDummy(2f);
|
||||
|
||||
if (UiSharedService.IconTextButton(FontAwesomeIcon.Retweet, "Refresh Banlist from Server"))
|
||||
{
|
||||
|
||||
@@ -174,7 +174,6 @@ public class TopTabMenu
|
||||
|
||||
if (TabSelection != SelectedTab.None) ImGuiHelpers.ScaledDummy(3f);
|
||||
ImGui.Separator();
|
||||
ImGuiHelpers.ScaledDummy(1f);
|
||||
}
|
||||
|
||||
private void DrawAddPair(float availableXWidth, float spacingX)
|
||||
|
||||
@@ -310,13 +310,6 @@ public partial class UiSharedService : DisposableMediatorSubscriberBase
|
||||
return buttonSize;
|
||||
}
|
||||
|
||||
public static Vector2 GetIconSize(FontAwesomeIcon icon)
|
||||
{
|
||||
using var font = ImRaii.PushFont(UiBuilder.IconFont);
|
||||
var iconSize = ImGui.CalcTextSize(icon.ToIconString());
|
||||
return iconSize;
|
||||
}
|
||||
|
||||
public static string GetNotes(List<Pair> pairs)
|
||||
{
|
||||
StringBuilder sb = new();
|
||||
@@ -416,6 +409,77 @@ public partial class UiSharedService : DisposableMediatorSubscriberBase
|
||||
return wasClicked;
|
||||
}
|
||||
|
||||
public static Vector2 GetIconSize(FontAwesomeIcon icon)
|
||||
{
|
||||
if (_iconCacheDict.TryGetValue(ImGuiHelpers.GlobalScale, out var iconCache))
|
||||
{
|
||||
if (iconCache.TryGetValue(icon, out var size)) return size;
|
||||
iconCache[icon] = CalcIconSize(icon);
|
||||
return iconCache[icon];
|
||||
}
|
||||
|
||||
_iconCacheDict.Add(ImGuiHelpers.GlobalScale, new());
|
||||
return _iconCacheDict[ImGuiHelpers.GlobalScale][icon] = CalcIconSize(icon);
|
||||
}
|
||||
|
||||
private static Vector2 CalcIconSize(FontAwesomeIcon icon)
|
||||
{
|
||||
using var font = ImRaii.PushFont(UiBuilder.IconFont);
|
||||
var iconSize = ImGui.CalcTextSize(icon.ToIconString());
|
||||
return iconSize;
|
||||
}
|
||||
|
||||
public static (float xOffset, float scaling) GetIconScaling(FontAwesomeIcon icon)
|
||||
{
|
||||
var iconSize = GetIconSize(icon);
|
||||
return (iconSize.X < iconSize.Y ? (iconSize.Y - iconSize.X) / 2f : 0f, iconSize.X > iconSize.Y ? 1f / (iconSize.X / iconSize.Y) : 1f);
|
||||
}
|
||||
|
||||
private static Vector2 CalcIconScale(FontAwesomeIcon icon)
|
||||
{
|
||||
var iconSize = GetIconSize(icon);
|
||||
var (iconXoffset, iconScaling) = GetIconScaling(icon);
|
||||
return new((iconSize.X * iconScaling) + (iconXoffset * 2),
|
||||
(iconSize.X * iconScaling) + (iconXoffset * 2));
|
||||
}
|
||||
|
||||
public static Vector2 GetNormalizedIconSize(FontAwesomeIcon icon)
|
||||
{
|
||||
if (_iconCacheDict.TryGetValue(ImGuiHelpers.GlobalScale, out var iconCache))
|
||||
{
|
||||
if (iconCache.TryGetValue(icon, out var size)) return size;
|
||||
return iconCache[icon] = CalcIconScale(icon);
|
||||
}
|
||||
|
||||
_iconCacheDict.Add(ImGuiHelpers.GlobalScale, new());
|
||||
return _iconCacheDict[ImGuiHelpers.GlobalScale][icon] = CalcIconScale(icon);
|
||||
}
|
||||
|
||||
public static void NormalizedIcon(FontAwesomeIcon icon, Vector4? color = null)
|
||||
{
|
||||
var cursorPos = ImGui.GetCursorPos();
|
||||
var iconSize = GetIconSize(icon);
|
||||
var normalizedIconSize = GetNormalizedIconSize(icon);
|
||||
var drawList = ImGui.GetWindowDrawList();
|
||||
var windowPos = ImGui.GetWindowPos();
|
||||
var scrollPosX = ImGui.GetScrollX();
|
||||
var scrollPosY = ImGui.GetScrollY();
|
||||
var frameHeight = ImGui.GetFrameHeight();
|
||||
|
||||
var (iconXoffset, iconScaling) = GetIconScaling(icon);
|
||||
var frameOffsetY = ((frameHeight - iconSize.Y * iconScaling) / 2f);
|
||||
|
||||
drawList.AddText(UiBuilder.IconFont, ImGui.GetFontSize() * iconScaling,
|
||||
new(windowPos.X - scrollPosX + cursorPos.X + iconXoffset,
|
||||
windowPos.Y - scrollPosY + cursorPos.Y + frameOffsetY),
|
||||
color != null ? ImGui.GetColorU32(color.Value) : ImGui.GetColorU32(ImGuiCol.Text), icon.ToIconString());
|
||||
|
||||
ImGui.Dummy(new(normalizedIconSize.X, ImGui.GetFrameHeight()));
|
||||
}
|
||||
|
||||
private static Dictionary<float, Dictionary<FontAwesomeIcon, Vector2>> _normalizedIconScales = new();
|
||||
private static Dictionary<float, Dictionary<FontAwesomeIcon, Vector2>> _iconCacheDict = new();
|
||||
|
||||
public static bool IsDirectoryWritable(string dirPath, bool throwIfFails = false)
|
||||
{
|
||||
try
|
||||
|
||||
Reference in New Issue
Block a user