add visibility for loaded mods size for pair, use menu bar for settings, remove settings button

This commit is contained in:
rootdarkarchon
2023-11-16 15:57:23 +01:00
parent c196cdd344
commit 96cc64b35a
6 changed files with 21 additions and 18 deletions

View File

@@ -37,6 +37,7 @@ public sealed class PairHandler : DisposableMediatorSubscriberBase
private bool _isVisible;
private string _penumbraCollection;
private bool _redrawOnNextApplication = false;
public long LastAppliedDataSize { get; private set; }
public PairHandler(ILogger<PairHandler> logger, OnlineUserIdentDto onlineUser,
GameObjectHandlerFactory gameObjectHandlerFactory,
@@ -81,6 +82,8 @@ public sealed class PairHandler : DisposableMediatorSubscriberBase
_redrawOnNextApplication = true;
}
});
LastAppliedDataSize = -1;
}
public bool IsVisible
@@ -398,6 +401,12 @@ public sealed class PairHandler : DisposableMediatorSubscriberBase
if (updateModdedPaths)
{
await _ipcManager.PenumbraSetTemporaryModsAsync(Logger, _applicationId, _penumbraCollection, moddedPaths).ConfigureAwait(false);
LastAppliedDataSize = -1;
foreach (var path in moddedPaths.Select(v => new FileInfo(v.Value)).Where(p => p.Exists))
{
if (path.Exists)
LastAppliedDataSize += path.Length;
}
}
if (updateManip)

View File

@@ -44,6 +44,7 @@ public class Pair
public bool IsVisible => CachedPlayer?.IsVisible ?? false;
public CharacterData? LastReceivedCharacterData { get; set; }
public string? PlayerName => CachedPlayer?.PlayerName ?? string.Empty;
public long LastAppliedDataSize => CachedPlayer?.LastAppliedDataSize ?? -1;
public UserData UserData => UserPair.User;

View File

@@ -68,8 +68,7 @@ public class CompactUi : WindowMediatorSubscriberBase
_selectPairsForGroupUi = selectPairForTagUi;
_tabMenu = new TopTabMenu(Mediator, _apiController, _pairManager);
// todo: reenable when dalamud title bar buttons are out of staging
/*AllowPinning = false;
AllowPinning = false;
AllowClickthrough = false;
TitleBarButtons = new()
{
@@ -82,7 +81,7 @@ public class CompactUi : WindowMediatorSubscriberBase
},
IconOffset = new(2,1)
}
};*/
};
_drawFolders = GetDrawFolders().ToList();
@@ -371,17 +370,6 @@ public class CompactUi : WindowMediatorSubscriberBase
}
UiSharedService.AttachToolTip("Click to copy");
// todo: remove when dalamud title bar buttons are out of staging
ImGui.SetWindowFontScale(1.5f);
var buttonSize = UiSharedService.GetIconButtonSize(FontAwesomeIcon.Cog);
ImGui.SameLine();
ImGui.SetCursorPosX(ImGui.GetWindowContentRegionMax().X - buttonSize.X);
if (UiSharedService.NormalizedIconButton(FontAwesomeIcon.Cog))
{
Mediator.Publish(new UiToggleMessage(typeof(SettingsUi)));
}
ImGui.SetWindowFontScale(1.0f);
if (!string.Equals(_apiController.DisplayName, _apiController.UID, StringComparison.Ordinal))
{
var origTextSize = ImGui.CalcTextSize(_apiController.UID);

View File

@@ -227,6 +227,12 @@ public class DrawUserPair
userPairText += UiSharedService.TooltipSeparator + "You are directly Paired";
}
if (_pair.LastAppliedDataSize >= 0)
{
userPairText += UiSharedService.TooltipSeparator + (!_pair.IsVisible ? "(Last) " : string.Empty) +
"Loaded Mods Size: " + UiSharedService.ByteToString(_pair.LastAppliedDataSize, true);
}
if (_syncedGroups.Any())
{
userPairText += UiSharedService.TooltipSeparator + string.Join(Environment.NewLine,

View File

@@ -69,9 +69,8 @@ public class SettingsUi : WindowMediatorSubscriberBase
_apiController = apiController;
_fileCompactor = fileCompactor;
_uiShared = uiShared;
// todo: reenable when dalamud is out of staging
/*AllowClickthrough = false;
AllowPinning = false;*/
AllowClickthrough = false;
AllowPinning = false;
SizeConstraints = new WindowSizeConstraints()
{

View File

@@ -420,7 +420,7 @@ public partial class UiSharedService : DisposableMediatorSubscriberBase
var frameOffsetY = ((frameHeight - iconData.IconSize.Y * iconData.IconScaling) / 2f);
drawList.AddText(UiBuilder.IconFont, ImGui.GetFontSize() * iconData.IconScaling,
drawList.AddText(UiBuilder.IconFont, UiBuilder.IconFont.FontSize * iconData.IconScaling,
new(windowPos.X - scrollPosX + cursorPos.X + iconData.OffsetX,
windowPos.Y - scrollPosY + cursorPos.Y + frameOffsetY),
color, icon.ToIconString());