[Draft] Update 0.8 (#46)
* move stuff out into file transfer manager * obnoxious unsupported version text, adjustments to filetransfermanager * add back file upload transfer progress * restructure code * cleanup some more stuff I guess * downloadids by playername * individual anim/sound bs * fix migration stuff, finalize impl of individual sound/anim pause * fixes with logging stuff * move download manager to transient * rework dl ui first iteration * some refactoring and cleanup * more code cleanup * refactoring * switch to hostbuilder * some more rework I guess * more refactoring * clean up mediator calls and disposal * fun code cleanup * push error message when log level is set to anything but information in non-debug builds * remove notificationservice * move message to after login * add download bars to gameworld * fixes download progress bar * set gpose ui min and max size * remove unnecessary usings * adjustments to reconnection logic * add options to set visible/offline groups visibility * add impl of uploading display, transfer list in settings ui * attempt to fix issues with server selection * add back download status to compact ui * make dl bar fixed size based * some fixes for upload/download handling * adjust text from Syncing back to Uploading --------- Co-authored-by: rootdarkarchon <root.darkarchon@outlook.com> Co-authored-by: Stanley Dimant <stanley.dimant@varian.com>
This commit is contained in:
@@ -1,38 +1,31 @@
|
||||
using System.Numerics;
|
||||
using Dalamud.Interface;
|
||||
using ImGuiNET;
|
||||
using MareSynchronos.Models;
|
||||
using MareSynchronos.PlayerData.Pairs;
|
||||
using MareSynchronos.UI.Handlers;
|
||||
|
||||
namespace MareSynchronos.UI.Components;
|
||||
|
||||
public class SelectPairForGroupUi
|
||||
{
|
||||
private bool _show = false;
|
||||
private bool _opened = false;
|
||||
private HashSet<string> _peopleInGroup = new(StringComparer.Ordinal);
|
||||
private string _tag = string.Empty;
|
||||
private readonly TagHandler _tagHandler;
|
||||
private string _filter = string.Empty;
|
||||
private bool _opened = false;
|
||||
private HashSet<string> _peopleInGroup = new(StringComparer.Ordinal);
|
||||
private bool _show = false;
|
||||
private string _tag = string.Empty;
|
||||
|
||||
public SelectPairForGroupUi(TagHandler tagHandler)
|
||||
{
|
||||
_tagHandler = tagHandler;
|
||||
}
|
||||
|
||||
public void Open(string tag)
|
||||
{
|
||||
_peopleInGroup = _tagHandler.GetOtherUidsForTag(tag);
|
||||
_tag = tag;
|
||||
_show = true;
|
||||
}
|
||||
|
||||
public void Draw(List<Pair> pairs, Dictionary<string, bool> showUidForEntry)
|
||||
{
|
||||
var workHeight = ImGui.GetMainViewport().WorkSize.Y / ImGuiHelpers.GlobalScale;
|
||||
var minSize = new Vector2(300, workHeight < 400 ? workHeight : 400) * ImGuiHelpers.GlobalScale;
|
||||
var maxSize = new Vector2(300, 1000) * ImGuiHelpers.GlobalScale;
|
||||
|
||||
|
||||
var popupName = $"Choose Users for Group {_tag}";
|
||||
|
||||
if (!_show)
|
||||
@@ -43,7 +36,7 @@ public class SelectPairForGroupUi
|
||||
if (_show && !_opened)
|
||||
{
|
||||
ImGui.SetNextWindowSize(minSize);
|
||||
UiShared.CenterNextWindow(minSize.X, minSize.Y, ImGuiCond.Always);
|
||||
UiSharedService.CenterNextWindow(minSize.X, minSize.Y, ImGuiCond.Always);
|
||||
ImGui.OpenPopup(popupName);
|
||||
_opened = true;
|
||||
}
|
||||
@@ -51,10 +44,12 @@ public class SelectPairForGroupUi
|
||||
ImGui.SetNextWindowSizeConstraints(minSize, maxSize);
|
||||
if (ImGui.BeginPopupModal(popupName, ref _show, ImGuiWindowFlags.Popup | ImGuiWindowFlags.Modal))
|
||||
{
|
||||
UiShared.FontText($"Select users for group {_tag}", UiBuilder.DefaultFont);
|
||||
UiSharedService.FontText($"Select users for group {_tag}", UiBuilder.DefaultFont);
|
||||
ImGui.InputTextWithHint("##filter", "Filter", ref _filter, 255, ImGuiInputTextFlags.None);
|
||||
foreach (var item in pairs.OrderBy(p => PairName(showUidForEntry, p), StringComparer.OrdinalIgnoreCase)
|
||||
.Where(p => string.IsNullOrEmpty(_filter) || PairName(showUidForEntry, p).Contains(_filter, StringComparison.OrdinalIgnoreCase)).ToList())
|
||||
foreach (var item in pairs
|
||||
.Where(p => string.IsNullOrEmpty(_filter) || PairName(showUidForEntry, p).Contains(_filter, StringComparison.OrdinalIgnoreCase))
|
||||
.OrderBy(p => PairName(showUidForEntry, p), StringComparer.OrdinalIgnoreCase)
|
||||
.ToList())
|
||||
{
|
||||
var isInGroup = _peopleInGroup.Contains(item.UserData.UID);
|
||||
if (ImGui.Checkbox(PairName(showUidForEntry, item), ref isInGroup))
|
||||
@@ -80,7 +75,14 @@ public class SelectPairForGroupUi
|
||||
}
|
||||
}
|
||||
|
||||
private string PairName(Dictionary<string, bool> showUidForEntry, Pair pair)
|
||||
public void Open(string tag)
|
||||
{
|
||||
_peopleInGroup = _tagHandler.GetOtherUidsForTag(tag);
|
||||
_tag = tag;
|
||||
_show = true;
|
||||
}
|
||||
|
||||
private static string PairName(Dictionary<string, bool> showUidForEntry, Pair pair)
|
||||
{
|
||||
showUidForEntry.TryGetValue(pair.UserData.UID, out var showUidInsteadOfName);
|
||||
var playerText = pair.GetNote();
|
||||
@@ -90,4 +92,4 @@ public class SelectPairForGroupUi
|
||||
}
|
||||
return playerText;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user