fix token for character change, add online count to syncshells and groups
This commit is contained in:
@@ -91,8 +91,8 @@ public class CompactUi : WindowMediatorSubscriberBase
|
||||
|
||||
SizeConstraints = new WindowSizeConstraints()
|
||||
{
|
||||
MinimumSize = new Vector2(350, 400),
|
||||
MaximumSize = new Vector2(350, 2000),
|
||||
MinimumSize = new Vector2(375, 400),
|
||||
MaximumSize = new Vector2(375, 2000),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ public abstract class DrawFolderBase : IDrawFolder
|
||||
protected readonly string _id;
|
||||
protected readonly TagHandler _tagHandler;
|
||||
private float _menuWidth = -1;
|
||||
public int OnlinePairs => _drawPairs.Count(u => u.Pair.IsOnline);
|
||||
protected DrawFolderBase(string id, IEnumerable<DrawUserPair> drawPairs, TagHandler tagHandler)
|
||||
{
|
||||
_id = id;
|
||||
|
||||
@@ -39,16 +39,26 @@ public class DrawFolderGroup : DrawFolderBase
|
||||
protected override float DrawIcon(float textPosY, float originalY)
|
||||
{
|
||||
ImGui.SetCursorPosY(textPosY);
|
||||
|
||||
using (ImRaii.PushFont(UiBuilder.IconFont))
|
||||
ImGui.TextUnformatted(_groupFullInfoDto.GroupPermissions.IsDisableInvites() ? FontAwesomeIcon.Lock.ToIconString() : FontAwesomeIcon.Users.ToIconString());
|
||||
if (_groupFullInfoDto.GroupPermissions.IsDisableInvites())
|
||||
{
|
||||
UiSharedService.AttachToolTip("Syncshell " + _groupFullInfoDto.GroupAliasOrGID + " is closed for invites");
|
||||
}
|
||||
if (IsOwner)
|
||||
|
||||
using (ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, ImGui.GetStyle().ItemSpacing with { X = ImGui.GetStyle().ItemSpacing.X / 2f }))
|
||||
{
|
||||
ImGui.SameLine();
|
||||
ImGui.SetCursorPosY(textPosY);
|
||||
ImGui.TextUnformatted("[" + OnlinePairs.ToString() + "]");
|
||||
}
|
||||
UiSharedService.AttachToolTip(OnlinePairs + " online in this syncshell");
|
||||
|
||||
ImGui.SameLine();
|
||||
if (IsOwner)
|
||||
{
|
||||
ImGui.SameLine();
|
||||
using (ImRaii.PushFont(UiBuilder.IconFont))
|
||||
ImGui.TextUnformatted(FontAwesomeIcon.Crown.ToIconString());
|
||||
UiSharedService.AttachToolTip("You are the owner of " + _groupFullInfoDto.GroupAliasOrGID);
|
||||
@@ -136,7 +146,7 @@ public class DrawFolderGroup : DrawFolderBase
|
||||
ImGui.CloseCurrentPopup();
|
||||
}
|
||||
|
||||
if (UiSharedService.IconTextButton(disableVfx ? FontAwesomeIcon.Sun : FontAwesomeIcon.Circle, disableVfx ? "Enable VFX Sync" : "Disable VFX Sync",
|
||||
if (UiSharedService.IconTextButton(disableVfx ? FontAwesomeIcon.Sun : FontAwesomeIcon.Circle, disableVfx ? "Enable VFX Sync" : "Disable VFX Sync",
|
||||
menuWidth, true))
|
||||
{
|
||||
perm.SetDisableVFX(!disableVfx);
|
||||
|
||||
@@ -53,22 +53,42 @@ public class DrawFolderTag : DrawFolderBase
|
||||
_ => true,
|
||||
} && _drawPairs.Any();
|
||||
|
||||
private bool RenderCount => _id switch
|
||||
{
|
||||
TagHandler.CustomOfflineSyncshellTag => false,
|
||||
TagHandler.CustomOfflineTag => false,
|
||||
TagHandler.CustomUnpairedTag => false,
|
||||
_ => true
|
||||
};
|
||||
|
||||
protected override float DrawIcon(float textPosY, float originalY)
|
||||
{
|
||||
using var font = ImRaii.PushFont(UiBuilder.IconFont);
|
||||
var icon = _id switch
|
||||
using (ImRaii.PushFont(UiBuilder.IconFont))
|
||||
{
|
||||
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()
|
||||
};
|
||||
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()
|
||||
};
|
||||
|
||||
ImGui.SetCursorPosY(textPosY);
|
||||
ImGui.TextUnformatted(icon);
|
||||
ImGui.SetCursorPosY(textPosY);
|
||||
ImGui.TextUnformatted(icon);
|
||||
}
|
||||
if (RenderCount)
|
||||
{
|
||||
using (ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, ImGui.GetStyle().ItemSpacing with { X = ImGui.GetStyle().ItemSpacing.X / 2f }))
|
||||
{
|
||||
ImGui.SameLine();
|
||||
ImGui.SetCursorPosY(textPosY);
|
||||
ImGui.TextUnformatted("[" + OnlinePairs.ToString() + "]");
|
||||
}
|
||||
UiSharedService.AttachToolTip(OnlinePairs + " online in this group");
|
||||
}
|
||||
ImGui.SameLine();
|
||||
return ImGui.GetCursorPosX();
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ public class DrawGroupedGroupFolder : IDrawFolder
|
||||
{
|
||||
private readonly IEnumerable<IDrawFolder> _groups;
|
||||
private readonly TagHandler _tagHandler;
|
||||
public int OnlinePairs => _groups.Sum(g => g.OnlinePairs);
|
||||
|
||||
public DrawGroupedGroupFolder(IEnumerable<IDrawFolder> groups, TagHandler tagHandler)
|
||||
{
|
||||
@@ -33,6 +34,12 @@ public class DrawGroupedGroupFolder : IDrawFolder
|
||||
ImGui.SameLine();
|
||||
using (ImRaii.PushFont(UiBuilder.IconFont))
|
||||
ImGui.TextUnformatted(FontAwesomeIcon.UsersRectangle.ToIconString());
|
||||
using (ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, ImGui.GetStyle().ItemSpacing with { X = ImGui.GetStyle().ItemSpacing.X / 2f }))
|
||||
{
|
||||
ImGui.SameLine();
|
||||
ImGui.TextUnformatted("[" + OnlinePairs.ToString() + "]");
|
||||
}
|
||||
UiSharedService.AttachToolTip(OnlinePairs + " online all of your syncshells");
|
||||
ImGui.SameLine();
|
||||
ImGui.TextUnformatted("All Syncshells");
|
||||
ImGui.Separator();
|
||||
|
||||
@@ -2,5 +2,6 @@
|
||||
|
||||
public interface IDrawFolder
|
||||
{
|
||||
int OnlinePairs { get; }
|
||||
void Draw();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user