Merge tag '0.9.21' into mare-classic

* tag '0.9.21':
  fix combat situations not redrawing every time after combat ends
  add more resilience to MCDF export and loading
  disable data application and scanner in combat
  fix bug
  add lock around adding to cached handled paths
  disable target in pvp
  add click to target in ui
  change tooltip for penumbra version to 0.8.2.1
  add file storage validation
  add experimental resolving of data through penumbra
  adjust initial dialog to opt in/out into census with buttons
This commit is contained in:
Loporrit
2023-12-09 12:06:10 +00:00
23 changed files with 352 additions and 129 deletions

View File

@@ -66,13 +66,18 @@ public class DrawUserPair : DrawPairBase
ImGui.SetCursorPosY(textPosY);
ImGui.PushFont(UiBuilder.IconFont);
UiSharedService.ColorText(FontAwesomeIcon.Eye.ToIconString(), ImGuiColors.ParsedGreen);
if (ImGui.IsItemClicked())
{
_mediator.Publish(new TargetPairMessage(_pair));
}
ImGui.PopFont();
var visibleTooltip = _pair.UserData.AliasOrUID + " is visible: " + _pair.PlayerName!;
var visibleTooltip = _pair.UserData.AliasOrUID + " is visible: " + _pair.PlayerName! + Environment.NewLine + "Click to target this player";
if (_pair.LastAppliedDataSize >= 0)
{
visibleTooltip += UiSharedService.TooltipSeparator +
"Loaded Mods Size: " + UiSharedService.ByteToString(_pair.LastAppliedDataSize, true);
}
UiSharedService.AttachToolTip(visibleTooltip);
}
}

View File

@@ -22,6 +22,8 @@ public class BanUserPopupHandler : IPopupHandler
public Vector2 PopupSize => new(500, 250);
public bool ShowClose => true;
public void DrawContent()
{
UiSharedService.TextWrapped("User " + (_reportedPair.UserData.AliasOrUID) + " will be banned and removed from this Syncshell.");
@@ -37,10 +39,6 @@ public class BanUserPopupHandler : IPopupHandler
UiSharedService.TextWrapped("The reason will be displayed in the banlist. The current server-side alias if present (Vanity ID) will automatically be attached to the reason.");
}
public void OnClose()
{
}
public void Open(OpenBanUserPopupMessage message)
{
_reportedPair = message.PairToBan;

View File

@@ -5,8 +5,7 @@ namespace MareSynchronos.UI.Components.Popup;
public interface IPopupHandler
{
Vector2 PopupSize { get; }
bool ShowClose { get; }
void DrawContent();
void OnClose();
}

View File

@@ -62,17 +62,13 @@ public class PopupHandler : WindowMediatorSubscriberBase
using var popup = ImRaii.Popup(WindowName, ImGuiWindowFlags.Modal);
if (!popup) return;
_currentHandler.DrawContent();
ImGui.Separator();
if (UiSharedService.NormalizedIconTextButton(FontAwesomeIcon.Times, "Close"))
if (_currentHandler.ShowClose)
{
ImGui.CloseCurrentPopup();
_currentHandler.OnClose();
ImGui.Separator();
if (UiSharedService.NormalizedIconTextButton(FontAwesomeIcon.Times, "Close"))
{
ImGui.CloseCurrentPopup();
}
}
}
public override void OnClose()
{
base.OnClose();
_currentHandler?.OnClose();
}
}

View File

@@ -24,6 +24,8 @@ internal class ReportPopupHandler : IPopupHandler
public Vector2 PopupSize => new(500, 500);
public bool ShowClose => true;
public void DrawContent()
{
using (ImRaii.PushFont(_uiSharedService.UidFont))
@@ -49,10 +51,6 @@ internal class ReportPopupHandler : IPopupHandler
}
}
public void OnClose()
{
}
public void Open(OpenReportPopupMessage msg)
{
_reportedPair = msg.PairToReport;