Some checks failed
Tag and Release Lightless / tag-and-release (push) Failing after 32s
 Lightless 1.12.0 is HERE! In this major update, we are introducing something we've been working on and testing for the last couple of weeks. In this update we are introducing a new (**OPTIONAL**) feature called **LightFinder**! We took inspiration from FFXIV's very own Party Finder and decided to implement something that allows users to not only look for fellow Lightless users, but also put up their Syncshell for others looking to join a sync community! When you enable LightFinder, you will be visible to other LightFinder users for **3 hours** or when you want to disabled it. When the 3 hours are up, you can either leave it disabled or enable it again for another 3 hours. The tag shown above will show above your nameplate, and you will be able to receive pair requests in your UI from other users with LightFinder enabled without having to input their uid!  Are you at a Venue? In Limsa? Partying in the streets of Uldah? If you're looking for fellow Lightless users you can now enable LightFinder and you will be shown to others who also have LightFinder enabled! Looking for a Syncshell to join? Enable LightFinder to see what SyncShells are available to join! Want to advertise your Syncshell? Choose the syncshell you want to put up in LightFinder and enable LightFinder. **IMPORTANT: We want to stress the fact that, if you just want to sync with just your friends and no one else, this does not take that away. No one will know you use Lightless unless you choose to tell them, or use this **OPTIONAL** feature. Your privacy is still maintained if you don't want to use the feature.** # Major Changes ## LightFinder - **OPTIONAL FEATURE** - **DOES NOT AFFECT YOU IF YOU DON'T WANT TO USE IT**  * New **OPTIONAL** syncing feature where one can enable something like a Party Finder so that other Lightless users in the area can see you are looking for people to sync with. Enable it by clicking the compass button and then the `Enable LightFinder` button.  * [L] Send Pair Request has been added to player context menus. You should still be able to send a request without Lightfinder on BUT you will need to know the other player is using Lightless and have them send a pair request back.  * When in LightFinder mode, for X mins you will be visible to all Lightless Users WHO ALSO HAVE LIGHTFINDER ON and will receive notifications of people wanting to pair with you. If you are the person using LightFinder, you understand the risks of pairing with someone you don't know. If you are the person sending a request to someone with LightFinder on, you also understand the risks of pairing with someone you don't know. **AGAIN, THIS IS OPTIONAL.** * When in LightFinder mode, you can also put up a Syncshell you own on the Syncshell Finder so that others can easily find it and join. This has to be done prior to enabling LightFinder.  * Syncshell Finder allows you to join Syncshells that are indexed by LightFinder  # Minor Changes * Vanity addition to our supporters: On top of vanity ids you can find a fun addition under Your User Settings -> Edit Lightless Profile -> Vanity Settings to change the colour of your name in the lightless ui. This will be shown to all users.  * Pairing nameplate colour override can also now override FC tag (new option_ * Bunch of UI fixes, updates, and changes * kdb is now a whitelisted filetype that can upload Co-authored-by: CakeAndBanana <admin@cakeandbanana.nl> Co-authored-by: azyges <aaaaaa@aaa.aaa> Co-authored-by: choco <thijmenhogenkamp@gmail.com> Co-authored-by: choco <choco@noreply.git.lightless-sync.org> Co-authored-by: defnotken <itsdefnotken@gmail.com> Reviewed-on: #39
144 lines
5.4 KiB
C#
144 lines
5.4 KiB
C#
using Dalamud.Bindings.ImGui;
|
|
using Dalamud.Interface;
|
|
using Dalamud.Interface.Utility.Raii;
|
|
using LightlessSync.UI.Handlers;
|
|
using System.Collections.Immutable;
|
|
using System.Numerics;
|
|
|
|
namespace LightlessSync.UI.Components;
|
|
|
|
public class DrawGroupedGroupFolder : IDrawFolder
|
|
{
|
|
private readonly string _tag;
|
|
private readonly IEnumerable<IDrawFolder> _groups;
|
|
private readonly TagHandler _tagHandler;
|
|
private readonly UiSharedService _uiSharedService;
|
|
private readonly SelectSyncshellForTagUi _selectSyncshellForTagUi;
|
|
private readonly RenameSyncshellTagUi _renameSyncshellTagUi;
|
|
private bool _wasHovered = false;
|
|
private float _menuWidth;
|
|
|
|
public IImmutableList<DrawUserPair> DrawPairs => throw new NotSupportedException();
|
|
public int OnlinePairs => _groups.SelectMany(g => g.DrawPairs).Where(g => g.Pair.IsOnline).DistinctBy(g => g.Pair.UserData.UID).Count();
|
|
public int TotalPairs => _groups.Sum(g => g.TotalPairs);
|
|
|
|
public DrawGroupedGroupFolder(IEnumerable<IDrawFolder> groups, TagHandler tagHandler, UiSharedService uiSharedService, SelectSyncshellForTagUi selectSyncshellForTagUi, RenameSyncshellTagUi renameSyncshellTagUi, string tag)
|
|
{
|
|
_groups = groups;
|
|
_tagHandler = tagHandler;
|
|
_uiSharedService = uiSharedService;
|
|
_selectSyncshellForTagUi = selectSyncshellForTagUi;
|
|
_renameSyncshellTagUi = renameSyncshellTagUi;
|
|
_tag = tag;
|
|
}
|
|
|
|
public void Draw()
|
|
{
|
|
string _id = "__folder_syncshells";
|
|
if (_tag != "")
|
|
{
|
|
_id = $"__folder_{_tag}";
|
|
}
|
|
|
|
using var id = ImRaii.PushId(_id);
|
|
var color = ImRaii.PushColor(ImGuiCol.ChildBg, ImGui.GetColorU32(ImGuiCol.FrameBgHovered), _wasHovered);
|
|
using (ImRaii.Child("folder__" + _id, new System.Numerics.Vector2(UiSharedService.GetWindowContentRegionWidth() - ImGui.GetCursorPosX(), ImGui.GetFrameHeight())))
|
|
{
|
|
ImGui.Dummy(new Vector2(0f, ImGui.GetFrameHeight()));
|
|
using (ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, new Vector2(0f, 0f)))
|
|
ImGui.SameLine();
|
|
|
|
var icon = _tagHandler.IsTagOpen(_id) ? FontAwesomeIcon.CaretDown : FontAwesomeIcon.CaretRight;
|
|
ImGui.AlignTextToFramePadding();
|
|
|
|
_uiSharedService.IconText(icon);
|
|
if (ImGui.IsItemClicked())
|
|
{
|
|
_tagHandler.SetTagOpen(_id, !_tagHandler.IsTagOpen(_id));
|
|
}
|
|
|
|
ImGui.SameLine();
|
|
ImGui.AlignTextToFramePadding();
|
|
|
|
if (_tag != "")
|
|
{
|
|
_uiSharedService.IconText(FontAwesomeIcon.FolderPlus);
|
|
}
|
|
else
|
|
{
|
|
_uiSharedService.IconText(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();
|
|
if (_tag != "")
|
|
{
|
|
ImGui.TextUnformatted(_tag);
|
|
|
|
ImGui.SameLine();
|
|
DrawMenu();
|
|
} else
|
|
{
|
|
ImGui.TextUnformatted("All Syncshells");
|
|
}
|
|
}
|
|
color.Dispose();
|
|
_wasHovered = ImGui.IsItemHovered();
|
|
|
|
ImGui.Separator();
|
|
|
|
if (_tagHandler.IsTagOpen(_id))
|
|
{
|
|
using var indent = ImRaii.PushIndent(20f);
|
|
foreach (var entry in _groups)
|
|
{
|
|
entry.Draw();
|
|
}
|
|
}
|
|
}
|
|
|
|
protected void DrawMenu()
|
|
{
|
|
var barButtonSize = _uiSharedService.GetIconButtonSize(FontAwesomeIcon.EllipsisV);
|
|
var windowEndX = ImGui.GetWindowContentRegionMin().X + UiSharedService.GetWindowContentRegionWidth();
|
|
|
|
ImGui.SameLine(windowEndX - barButtonSize.X);
|
|
if (_uiSharedService.IconButton(FontAwesomeIcon.EllipsisV))
|
|
{
|
|
ImGui.OpenPopup("User Flyout Menu");
|
|
}
|
|
if (ImGui.BeginPopup("User Flyout Menu"))
|
|
{
|
|
using (ImRaii.PushId($"buttons-syncshell-{_tag}")) GroupMenu(_menuWidth);
|
|
_menuWidth = ImGui.GetWindowContentRegionMax().X - ImGui.GetWindowContentRegionMin().X;
|
|
ImGui.EndPopup();
|
|
}
|
|
}
|
|
|
|
protected void GroupMenu(float menuWidth)
|
|
{
|
|
ImGui.TextUnformatted("Syncshell Group Menu");
|
|
if (_uiSharedService.IconTextButton(FontAwesomeIcon.Users, "Select Syncshells", menuWidth, isInPopup: true))
|
|
{
|
|
_selectSyncshellForTagUi.Open(_tag);
|
|
}
|
|
if (_uiSharedService.IconTextButton(FontAwesomeIcon.Edit, "Rename Syncshell Group", menuWidth, isInPopup: true))
|
|
{
|
|
_renameSyncshellTagUi.Open(_tag);
|
|
}
|
|
if (_uiSharedService.IconTextButton(FontAwesomeIcon.Trash, "Delete Syncshell Group", menuWidth, isInPopup: true) && UiSharedService.CtrlPressed())
|
|
{
|
|
_tagHandler.RemoveSyncshellTag(_tag);
|
|
}
|
|
UiSharedService.AttachToolTip("Hold CTRL to remove this Group permanently.");
|
|
}
|
|
}
|