Compare commits
10 Commits
fc5b55055c
...
eccfc5b3f0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eccfc5b3f0 | ||
|
|
0c834f5edd | ||
|
|
b15f6f2c2a | ||
|
|
108bbe2a02 | ||
|
|
f94af2cc9e | ||
|
|
11535caf7e | ||
|
|
95969eeb7c | ||
|
|
c0870e85df | ||
|
|
85058379e7 | ||
|
|
a3e62f5529 |
@@ -19,7 +19,7 @@ public unsafe class VfxSpawnManager : DisposableMediatorSubscriberBase
|
|||||||
[Signature("E8 ?? ?? ?? ?? F3 0F 10 35 ?? ?? ?? ?? 48 89 43 08")]
|
[Signature("E8 ?? ?? ?? ?? F3 0F 10 35 ?? ?? ?? ?? 48 89 43 08")]
|
||||||
private readonly delegate* unmanaged<byte*, byte*, VfxStruct*> _staticVfxCreate;
|
private readonly delegate* unmanaged<byte*, byte*, VfxStruct*> _staticVfxCreate;
|
||||||
|
|
||||||
[Signature("E8 ?? ?? ?? ?? 8B 4B 7C 85 C9")]
|
[Signature("E8 ?? ?? ?? ?? ?? ?? ?? 8B 4A ?? 85 C9")]
|
||||||
private readonly delegate* unmanaged<VfxStruct*, float, int, ulong> _staticVfxRun;
|
private readonly delegate* unmanaged<VfxStruct*, float, int, ulong> _staticVfxRun;
|
||||||
|
|
||||||
[Signature("40 53 48 83 EC 20 48 8B D9 48 8B 89 ?? ?? ?? ?? 48 85 C9 74 28 33 D2 E8 ?? ?? ?? ?? 48 8B 8B ?? ?? ?? ?? 48 85 C9")]
|
[Signature("40 53 48 83 EC 20 48 8B D9 48 8B 89 ?? ?? ?? ?? 48 85 C9 74 28 33 D2 E8 ?? ?? ?? ?? 48 8B 8B ?? ?? ?? ?? 48 85 C9")]
|
||||||
|
|||||||
@@ -59,4 +59,5 @@ public class MareConfig : IMareConfiguration
|
|||||||
public bool AutoPopulateEmptyNotesFromCharaName { get; set; } = false;
|
public bool AutoPopulateEmptyNotesFromCharaName { get; set; } = false;
|
||||||
public int Version { get; set; } = 1;
|
public int Version { get; set; } = 1;
|
||||||
public NotificationLocation WarningNotification { get; set; } = NotificationLocation.Both;
|
public NotificationLocation WarningNotification { get; set; } = NotificationLocation.Both;
|
||||||
|
public bool UseFocusTarget { get; set; } = false;
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project Sdk="Dalamud.NET.Sdk/12.0.2">
|
<Project Sdk="Dalamud.NET.Sdk/13.0.0">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Authors></Authors>
|
<Authors></Authors>
|
||||||
<Company></Company>
|
<Company></Company>
|
||||||
|
|||||||
@@ -195,7 +195,7 @@ public sealed class CacheCreationService : DisposableMediatorSubscriberBase
|
|||||||
_creationCts.Cancel();
|
_creationCts.Cancel();
|
||||||
_creationCts.Dispose();
|
_creationCts.Dispose();
|
||||||
_creationCts = new();
|
_creationCts = new();
|
||||||
_cacheCreateLock.Wait();
|
_cacheCreateLock.Wait(_creationCts.Token);
|
||||||
var objectKindsToCreate = _cachesToCreate.ToList();
|
var objectKindsToCreate = _cachesToCreate.ToList();
|
||||||
foreach (var creationObj in objectKindsToCreate)
|
foreach (var creationObj in objectKindsToCreate)
|
||||||
{
|
{
|
||||||
@@ -208,12 +208,14 @@ public sealed class CacheCreationService : DisposableMediatorSubscriberBase
|
|||||||
{
|
{
|
||||||
using var linkedCts = CancellationTokenSource.CreateLinkedTokenSource(_creationCts.Token, _runtimeCts.Token);
|
using var linkedCts = CancellationTokenSource.CreateLinkedTokenSource(_creationCts.Token, _runtimeCts.Token);
|
||||||
|
|
||||||
|
await Task.Delay(TimeSpan.FromSeconds(1), linkedCts.Token).ConfigureAwait(false);
|
||||||
|
|
||||||
Logger.LogDebug("Creating Caches for {objectKinds}", string.Join(", ", objectKindsToCreate));
|
Logger.LogDebug("Creating Caches for {objectKinds}", string.Join(", ", objectKindsToCreate));
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Dictionary<ObjectKind, CharacterDataFragment?> createdData = [];
|
Dictionary<ObjectKind, CharacterDataFragment?> createdData = [];
|
||||||
foreach (var objectKind in objectKindsToCreate)
|
foreach (var objectKind in _currentlyCreating)
|
||||||
{
|
{
|
||||||
createdData[objectKind] = await _characterDataFactory.BuildCharacterData(_playerRelatedObjects[objectKind], linkedCts.Token).ConfigureAwait(false);
|
createdData[objectKind] = await _characterDataFactory.BuildCharacterData(_playerRelatedObjects[objectKind], linkedCts.Token).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -133,8 +133,9 @@ public sealed class Plugin : IDalamudPlugin
|
|||||||
collection.AddSingleton((s) => new EventAggregator(pluginInterface.ConfigDirectory.FullName,
|
collection.AddSingleton((s) => new EventAggregator(pluginInterface.ConfigDirectory.FullName,
|
||||||
s.GetRequiredService<ILogger<EventAggregator>>(), s.GetRequiredService<MareMediator>()));
|
s.GetRequiredService<ILogger<EventAggregator>>(), s.GetRequiredService<MareMediator>()));
|
||||||
collection.AddSingleton((s) => new DalamudUtilService(s.GetRequiredService<ILogger<DalamudUtilService>>(),
|
collection.AddSingleton((s) => new DalamudUtilService(s.GetRequiredService<ILogger<DalamudUtilService>>(),
|
||||||
clientState, objectTable, framework, gameGui, condition, gameData, targetManager, gameConfig, sigScanner,
|
clientState, objectTable, framework, gameGui, condition, gameData, targetManager, gameConfig,
|
||||||
s.GetRequiredService<BlockedCharacterHandler>(), s.GetRequiredService<MareMediator>(), s.GetRequiredService<PerformanceCollectorService>()));
|
s.GetRequiredService<BlockedCharacterHandler>(), s.GetRequiredService<MareMediator>(), s.GetRequiredService<PerformanceCollectorService>(),
|
||||||
|
s.GetRequiredService<MareConfigService>()));
|
||||||
collection.AddSingleton((s) => new DtrEntry(s.GetRequiredService<ILogger<DtrEntry>>(), dtrBar, s.GetRequiredService<MareConfigService>(),
|
collection.AddSingleton((s) => new DtrEntry(s.GetRequiredService<ILogger<DtrEntry>>(), dtrBar, s.GetRequiredService<MareConfigService>(),
|
||||||
s.GetRequiredService<MareMediator>(), s.GetRequiredService<PairManager>(), s.GetRequiredService<ApiController>()));
|
s.GetRequiredService<MareMediator>(), s.GetRequiredService<PairManager>(), s.GetRequiredService<ApiController>()));
|
||||||
collection.AddSingleton(s => new PairManager(s.GetRequiredService<ILogger<PairManager>>(), s.GetRequiredService<PairFactory>(),
|
collection.AddSingleton(s => new PairManager(s.GetRequiredService<ILogger<PairManager>>(), s.GetRequiredService<PairFactory>(),
|
||||||
|
|||||||
@@ -147,17 +147,18 @@ public sealed partial class CharaDataManager : DisposableMediatorSubscriberBase
|
|||||||
{
|
{
|
||||||
return UiBlockingComputation = DataApplicationTask = Task.Run(async () =>
|
return UiBlockingComputation = DataApplicationTask = Task.Run(async () =>
|
||||||
{
|
{
|
||||||
var charaName = await _dalamudUtilService.RunOnFrameworkThread(() => _dalamudUtilService.GposeTargetGameObject?.Name.TextValue).ConfigureAwait(false)
|
var obj = await _dalamudUtilService.GetGposeTargetGameObjectAsync().ConfigureAwait(false);
|
||||||
?? string.Empty;
|
var charaName = obj?.Name.TextValue ?? string.Empty;
|
||||||
if (string.IsNullOrEmpty(charaName)) return;
|
if (string.IsNullOrEmpty(charaName)) return;
|
||||||
|
|
||||||
await ApplyCharaData(dataMetaInfoDto, charaName).ConfigureAwait(false);
|
await ApplyCharaData(dataMetaInfoDto, charaName).ConfigureAwait(false);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ApplyOwnDataToGposeTarget(CharaDataFullExtendedDto dataDto)
|
public async Task ApplyOwnDataToGposeTarget(CharaDataFullExtendedDto dataDto)
|
||||||
{
|
{
|
||||||
var charaName = _dalamudUtilService.GposeTargetGameObject?.Name.TextValue ?? string.Empty;
|
var chara = await _dalamudUtilService.GetGposeTargetGameObjectAsync().ConfigureAwait(false);
|
||||||
|
var charaName = chara?.Name.TextValue ?? string.Empty;
|
||||||
CharaDataDownloadDto downloadDto = new(dataDto.Id, dataDto.Uploader)
|
CharaDataDownloadDto downloadDto = new(dataDto.Id, dataDto.Uploader)
|
||||||
{
|
{
|
||||||
CustomizeData = dataDto.CustomizeData,
|
CustomizeData = dataDto.CustomizeData,
|
||||||
@@ -184,7 +185,7 @@ public sealed partial class CharaDataManager : DisposableMediatorSubscriberBase
|
|||||||
{
|
{
|
||||||
return UiBlockingComputation = Task.Run(async () =>
|
return UiBlockingComputation = Task.Run(async () =>
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(pose.PoseData) || !CanApplyInGpose(out _)) return;
|
if (string.IsNullOrEmpty(pose.PoseData) || !(await CanApplyInGpose().ConfigureAwait(false)).CanApply) return;
|
||||||
var gposeChara = await _dalamudUtilService.GetGposeCharacterFromObjectTableByNameAsync(targetName, true).ConfigureAwait(false);
|
var gposeChara = await _dalamudUtilService.GetGposeCharacterFromObjectTableByNameAsync(targetName, true).ConfigureAwait(false);
|
||||||
if (gposeChara == null) return;
|
if (gposeChara == null) return;
|
||||||
|
|
||||||
@@ -199,9 +200,11 @@ public sealed partial class CharaDataManager : DisposableMediatorSubscriberBase
|
|||||||
{
|
{
|
||||||
return UiBlockingComputation = Task.Run(async () =>
|
return UiBlockingComputation = Task.Run(async () =>
|
||||||
{
|
{
|
||||||
if (CanApplyInGpose(out var chara))
|
var apply = await CanApplyInGpose().ConfigureAwait(false);
|
||||||
|
|
||||||
|
if (apply.CanApply)
|
||||||
{
|
{
|
||||||
await ApplyPoseData(pose, chara).ConfigureAwait(false);
|
await ApplyPoseData(pose, apply.TargetName).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -210,7 +213,8 @@ public sealed partial class CharaDataManager : DisposableMediatorSubscriberBase
|
|||||||
{
|
{
|
||||||
return UiBlockingComputation = Task.Run(async () =>
|
return UiBlockingComputation = Task.Run(async () =>
|
||||||
{
|
{
|
||||||
if (pose.WorldData == default || !CanApplyInGpose(out _)) return;
|
var apply = await CanApplyInGpose().ConfigureAwait(false);
|
||||||
|
if (pose.WorldData == default || !(await CanApplyInGpose().ConfigureAwait(false)).CanApply) return;
|
||||||
var gposeChara = await _dalamudUtilService.GetGposeCharacterFromObjectTableByNameAsync(targetName, true).ConfigureAwait(false);
|
var gposeChara = await _dalamudUtilService.GetGposeCharacterFromObjectTableByNameAsync(targetName, true).ConfigureAwait(false);
|
||||||
if (gposeChara == null) return;
|
if (gposeChara == null) return;
|
||||||
|
|
||||||
@@ -226,9 +230,10 @@ public sealed partial class CharaDataManager : DisposableMediatorSubscriberBase
|
|||||||
{
|
{
|
||||||
return UiBlockingComputation = Task.Run(async () =>
|
return UiBlockingComputation = Task.Run(async () =>
|
||||||
{
|
{
|
||||||
if (CanApplyInGpose(out var chara))
|
var apply = await CanApplyInGpose().ConfigureAwait(false);
|
||||||
|
if (apply.CanApply)
|
||||||
{
|
{
|
||||||
await ApplyPoseData(pose, chara).ConfigureAwait(false);
|
await ApplyPoseData(pose, apply.TargetName).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -259,19 +264,21 @@ public sealed partial class CharaDataManager : DisposableMediatorSubscriberBase
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool CanApplyInGpose(out string targetName)
|
public async Task<(bool CanApply, string TargetName)> CanApplyInGpose()
|
||||||
{
|
{
|
||||||
bool canApply = _dalamudUtilService.IsInGpose && _dalamudUtilService.GposeTargetGameObject != null
|
var obj = await _dalamudUtilService.GetGposeTargetGameObjectAsync().ConfigureAwait(false);
|
||||||
&& _dalamudUtilService.GposeTargetGameObject.ObjectKind == Dalamud.Game.ClientState.Objects.Enums.ObjectKind.Player;
|
string targetName = string.Empty;
|
||||||
|
bool canApply = _dalamudUtilService.IsInGpose && obj != null
|
||||||
|
&& obj.ObjectKind == Dalamud.Game.ClientState.Objects.Enums.ObjectKind.Player;
|
||||||
if (canApply)
|
if (canApply)
|
||||||
{
|
{
|
||||||
targetName = _dalamudUtilService.GposeTargetGameObject!.Name.TextValue;
|
targetName = obj!.Name.TextValue;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
targetName = "Invalid Target";
|
targetName = "Invalid Target";
|
||||||
}
|
}
|
||||||
return canApply;
|
return (canApply, targetName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void CancelDataApplication()
|
public void CancelDataApplication()
|
||||||
@@ -503,11 +510,12 @@ public sealed partial class CharaDataManager : DisposableMediatorSubscriberBase
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void McdfApplyToGposeTarget()
|
public async Task McdfApplyToGposeTarget()
|
||||||
{
|
{
|
||||||
if (CanApplyInGpose(out string target))
|
var apply = await CanApplyInGpose().ConfigureAwait(false);
|
||||||
|
if (apply.CanApply)
|
||||||
{
|
{
|
||||||
McdfApplyToTarget(target);
|
McdfApplyToTarget(apply.TargetName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -733,7 +741,7 @@ public sealed partial class CharaDataManager : DisposableMediatorSubscriberBase
|
|||||||
_dalamudUtilService.GposeTarget = (FFXIVClientStructs.FFXIV.Client.Game.Object.GameObject*)newActor.Address;
|
_dalamudUtilService.GposeTarget = (FFXIVClientStructs.FFXIV.Client.Game.Object.GameObject*)newActor.Address;
|
||||||
}
|
}
|
||||||
|
|
||||||
McdfApplyToGposeTarget();
|
await McdfApplyToGposeTarget().ConfigureAwait(false);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -750,10 +758,11 @@ public sealed partial class CharaDataManager : DisposableMediatorSubscriberBase
|
|||||||
{
|
{
|
||||||
UiBlockingComputation = Task.Run(async () =>
|
UiBlockingComputation = Task.Run(async () =>
|
||||||
{
|
{
|
||||||
if (CanApplyInGpose(out var gposeTarget))
|
var apply = await CanApplyInGpose().ConfigureAwait(false);
|
||||||
|
if (apply.CanApply)
|
||||||
{
|
{
|
||||||
await ApplyPoseData(value, gposeTarget).ConfigureAwait(false);
|
await ApplyPoseData(value, apply.TargetName).ConfigureAwait(false);
|
||||||
await ApplyWorldDataToTarget(value, gposeTarget).ConfigureAwait(false);
|
await ApplyWorldDataToTarget(value, apply.TargetName).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ using FFXIVClientStructs.FFXIV.Client.UI.Agent;
|
|||||||
using Lumina.Excel.Sheets;
|
using Lumina.Excel.Sheets;
|
||||||
using MareSynchronos.API.Dto.CharaData;
|
using MareSynchronos.API.Dto.CharaData;
|
||||||
using MareSynchronos.Interop;
|
using MareSynchronos.Interop;
|
||||||
|
using MareSynchronos.MareConfiguration;
|
||||||
using MareSynchronos.PlayerData.Handlers;
|
using MareSynchronos.PlayerData.Handlers;
|
||||||
using MareSynchronos.Services.Mediator;
|
using MareSynchronos.Services.Mediator;
|
||||||
using MareSynchronos.Utils;
|
using MareSynchronos.Utils;
|
||||||
@@ -38,6 +39,7 @@ public class DalamudUtilService : IHostedService, IMediatorSubscriber
|
|||||||
private readonly ILogger<DalamudUtilService> _logger;
|
private readonly ILogger<DalamudUtilService> _logger;
|
||||||
private readonly IObjectTable _objectTable;
|
private readonly IObjectTable _objectTable;
|
||||||
private readonly PerformanceCollectorService _performanceCollector;
|
private readonly PerformanceCollectorService _performanceCollector;
|
||||||
|
private readonly MareConfigService _configService;
|
||||||
private uint? _classJobId = 0;
|
private uint? _classJobId = 0;
|
||||||
private DateTime _delayedFrameworkUpdateCheck = DateTime.UtcNow;
|
private DateTime _delayedFrameworkUpdateCheck = DateTime.UtcNow;
|
||||||
private string _lastGlobalBlockPlayer = string.Empty;
|
private string _lastGlobalBlockPlayer = string.Empty;
|
||||||
@@ -46,13 +48,12 @@ public class DalamudUtilService : IHostedService, IMediatorSubscriber
|
|||||||
private readonly Dictionary<string, (string Name, nint Address)> _playerCharas = new(StringComparer.Ordinal);
|
private readonly Dictionary<string, (string Name, nint Address)> _playerCharas = new(StringComparer.Ordinal);
|
||||||
private readonly List<string> _notUpdatedCharas = [];
|
private readonly List<string> _notUpdatedCharas = [];
|
||||||
private bool _sentBetweenAreas = false;
|
private bool _sentBetweenAreas = false;
|
||||||
private readonly Dictionary<ulong, string> _aidCache = [];
|
private Lazy<ulong> _cid;
|
||||||
private readonly Lazy<uint> _aid;
|
|
||||||
private int _aidCounter = 0;
|
|
||||||
|
|
||||||
public DalamudUtilService(ILogger<DalamudUtilService> logger, IClientState clientState, IObjectTable objectTable, IFramework framework,
|
public DalamudUtilService(ILogger<DalamudUtilService> logger, IClientState clientState, IObjectTable objectTable, IFramework framework,
|
||||||
IGameGui gameGui, ICondition condition, IDataManager gameData, ITargetManager targetManager, IGameConfig gameConfig, ISigScanner sigScanner,
|
IGameGui gameGui, ICondition condition, IDataManager gameData, ITargetManager targetManager, IGameConfig gameConfig,
|
||||||
BlockedCharacterHandler blockedCharacterHandler, MareMediator mediator, PerformanceCollectorService performanceCollector)
|
BlockedCharacterHandler blockedCharacterHandler, MareMediator mediator, PerformanceCollectorService performanceCollector,
|
||||||
|
MareConfigService configService)
|
||||||
{
|
{
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
_clientState = clientState;
|
_clientState = clientState;
|
||||||
@@ -65,6 +66,7 @@ public class DalamudUtilService : IHostedService, IMediatorSubscriber
|
|||||||
_blockedCharacterHandler = blockedCharacterHandler;
|
_blockedCharacterHandler = blockedCharacterHandler;
|
||||||
Mediator = mediator;
|
Mediator = mediator;
|
||||||
_performanceCollector = performanceCollector;
|
_performanceCollector = performanceCollector;
|
||||||
|
_configService = configService;
|
||||||
WorldData = new(() =>
|
WorldData = new(() =>
|
||||||
{
|
{
|
||||||
return gameData.GetExcelSheet<Lumina.Excel.Sheets.World>(Dalamud.Game.ClientLanguage.English)!
|
return gameData.GetExcelSheet<Lumina.Excel.Sheets.World>(Dalamud.Game.ClientLanguage.English)!
|
||||||
@@ -120,22 +122,20 @@ public class DalamudUtilService : IHostedService, IMediatorSubscriber
|
|||||||
if (string.IsNullOrEmpty(name)) return;
|
if (string.IsNullOrEmpty(name)) return;
|
||||||
var addr = _playerCharas.FirstOrDefault(f => string.Equals(f.Value.Name, name, StringComparison.Ordinal)).Value.Address;
|
var addr = _playerCharas.FirstOrDefault(f => string.Equals(f.Value.Name, name, StringComparison.Ordinal)).Value.Address;
|
||||||
if (addr == nint.Zero) return;
|
if (addr == nint.Zero) return;
|
||||||
|
var useFocusTarget = _configService.Current.UseFocusTarget;
|
||||||
_ = RunOnFrameworkThread(() =>
|
_ = RunOnFrameworkThread(() =>
|
||||||
{
|
{
|
||||||
|
if (useFocusTarget)
|
||||||
|
targetManager.FocusTarget = CreateGameObject(addr);
|
||||||
|
else
|
||||||
targetManager.Target = CreateGameObject(addr);
|
targetManager.Target = CreateGameObject(addr);
|
||||||
}).ConfigureAwait(false);
|
}).ConfigureAwait(false);
|
||||||
});
|
});
|
||||||
IsWine = Util.IsWine();
|
IsWine = Util.IsWine();
|
||||||
|
_cid = RebuildCID();
|
||||||
|
}
|
||||||
|
|
||||||
_aid = new(() =>
|
private Lazy<ulong> RebuildCID() => new(GetCID);
|
||||||
{
|
|
||||||
unsafe
|
|
||||||
{
|
|
||||||
var address = sigScanner.GetStaticAddressFromSig("48 8B 0D ?? ?? ?? ?? 4C 8B CA");
|
|
||||||
return (uint)(address != nint.Zero ? (*(ulong**)address)[1] : 0u);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool IsWine { get; init; }
|
public bool IsWine { get; init; }
|
||||||
|
|
||||||
@@ -144,7 +144,17 @@ public class DalamudUtilService : IHostedService, IMediatorSubscriber
|
|||||||
get => TargetSystem.Instance()->GPoseTarget;
|
get => TargetSystem.Instance()->GPoseTarget;
|
||||||
set => TargetSystem.Instance()->GPoseTarget = value;
|
set => TargetSystem.Instance()->GPoseTarget = value;
|
||||||
}
|
}
|
||||||
public unsafe IGameObject? GposeTargetGameObject => GposeTarget == null ? null : _objectTable[GposeTarget->ObjectIndex];
|
|
||||||
|
private unsafe bool HasGposeTarget => GposeTarget != null;
|
||||||
|
private unsafe int GPoseTargetIdx => !HasGposeTarget ? -1 : GposeTarget->ObjectIndex;
|
||||||
|
|
||||||
|
public async Task<IGameObject?> GetGposeTargetGameObjectAsync()
|
||||||
|
{
|
||||||
|
if (!HasGposeTarget)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
return await _framework.RunOnFrameworkThread(() => _objectTable[GPoseTargetIdx]).ConfigureAwait(true);
|
||||||
|
}
|
||||||
public bool IsAnythingDrawing { get; private set; } = false;
|
public bool IsAnythingDrawing { get; private set; } = false;
|
||||||
public bool IsInCutscene { get; private set; } = false;
|
public bool IsInCutscene { get; private set; } = false;
|
||||||
public bool IsInGpose { get; private set; } = false;
|
public bool IsInGpose { get; private set; } = false;
|
||||||
@@ -159,7 +169,6 @@ public class DalamudUtilService : IHostedService, IMediatorSubscriber
|
|||||||
public Lazy<Dictionary<uint, string>> TerritoryData { get; private set; }
|
public Lazy<Dictionary<uint, string>> TerritoryData { get; private set; }
|
||||||
public Lazy<Dictionary<uint, (Map Map, string MapName)>> MapData { get; private set; }
|
public Lazy<Dictionary<uint, (Map Map, string MapName)>> MapData { get; private set; }
|
||||||
public bool IsLodEnabled { get; private set; }
|
public bool IsLodEnabled { get; private set; }
|
||||||
|
|
||||||
public MareMediator Mediator { get; }
|
public MareMediator Mediator { get; }
|
||||||
|
|
||||||
public IGameObject? CreateGameObject(IntPtr reference)
|
public IGameObject? CreateGameObject(IntPtr reference)
|
||||||
@@ -298,20 +307,12 @@ public class DalamudUtilService : IHostedService, IMediatorSubscriber
|
|||||||
|
|
||||||
public async Task<string> GetPlayerNameHashedAsync()
|
public async Task<string> GetPlayerNameHashedAsync()
|
||||||
{
|
{
|
||||||
return await RunOnFrameworkThread(() => _aid.Value.ToString().GetHash256()).ConfigureAwait(false);
|
return await RunOnFrameworkThread(() => _cid.Value.ToString().GetHash256()).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private unsafe string GetHashedAccIdFromPlayerPointer(nint ptr)
|
private unsafe static string GetHashedCIDFromPlayerPointer(nint ptr)
|
||||||
{
|
{
|
||||||
if (ptr == nint.Zero) return "UNK" + _aidCounter++;
|
return ((BattleChara*)ptr)->Character.ContentId.ToString().GetHash256();
|
||||||
var aid = ((BattleChara*)ptr)->Character.AccountId;
|
|
||||||
if (!_aidCache.TryGetValue(aid, out string? hash))
|
|
||||||
{
|
|
||||||
var player = GetPlayerCharacter();
|
|
||||||
if (player == null) return "UNK" + _aidCounter++;
|
|
||||||
_aidCache[aid] = hash = unchecked((uint)(((((BattleChara*)player.Address)->Character.AccountId ^ aid) >> 31) ^ _aid.Value)).ToString().GetHash256();
|
|
||||||
}
|
|
||||||
return hash;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public IntPtr GetPlayerPtr()
|
public IntPtr GetPlayerPtr()
|
||||||
@@ -604,7 +605,7 @@ public class DalamudUtilService : IHostedService, IMediatorSubscriber
|
|||||||
|
|
||||||
private unsafe void FrameworkOnUpdateInternal()
|
private unsafe void FrameworkOnUpdateInternal()
|
||||||
{
|
{
|
||||||
if (_clientState.LocalPlayer?.IsDead ?? false)
|
if ((_clientState.LocalPlayer?.IsDead ?? false) && _condition[ConditionFlag.BoundByDuty])
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -632,7 +633,7 @@ public class DalamudUtilService : IHostedService, IMediatorSubscriber
|
|||||||
}
|
}
|
||||||
|
|
||||||
var charaName = ((GameObject*)chara.Address)->NameString;
|
var charaName = ((GameObject*)chara.Address)->NameString;
|
||||||
var hash = GetHashedAccIdFromPlayerPointer(chara.Address);
|
var hash = GetHashedCIDFromPlayerPointer(chara.Address);
|
||||||
if (!IsAnythingDrawing)
|
if (!IsAnythingDrawing)
|
||||||
CheckCharacterForDrawing(chara.Address, charaName);
|
CheckCharacterForDrawing(chara.Address, charaName);
|
||||||
_notUpdatedCharas.Remove(hash);
|
_notUpdatedCharas.Remove(hash);
|
||||||
@@ -748,6 +749,7 @@ public class DalamudUtilService : IHostedService, IMediatorSubscriber
|
|||||||
_logger.LogDebug("Logged in");
|
_logger.LogDebug("Logged in");
|
||||||
IsLoggedIn = true;
|
IsLoggedIn = true;
|
||||||
_lastZone = _clientState.TerritoryType;
|
_lastZone = _clientState.TerritoryType;
|
||||||
|
_cid = RebuildCID();
|
||||||
Mediator.Publish(new DalamudLoginMessage());
|
Mediator.Publish(new DalamudLoginMessage());
|
||||||
}
|
}
|
||||||
else if (localPlayer == null && IsLoggedIn)
|
else if (localPlayer == null && IsLoggedIn)
|
||||||
|
|||||||
@@ -43,8 +43,8 @@ public sealed class XivDataAnalyzer
|
|||||||
if ((nint)handle == nint.Zero) continue;
|
if ((nint)handle == nint.Zero) continue;
|
||||||
var curBones = handle->BoneCount;
|
var curBones = handle->BoneCount;
|
||||||
// this is unrealistic, the filename shouldn't ever be that long
|
// this is unrealistic, the filename shouldn't ever be that long
|
||||||
if (handle->ResourceHandle.FileName.Length > 1024) continue;
|
if (handle->FileName.Length > 1024) continue;
|
||||||
var skeletonName = handle->ResourceHandle.FileName.ToString();
|
var skeletonName = handle->FileName.ToString();
|
||||||
if (string.IsNullOrEmpty(skeletonName)) continue;
|
if (string.IsNullOrEmpty(skeletonName)) continue;
|
||||||
outputIndices[skeletonName] = new();
|
outputIndices[skeletonName] = new();
|
||||||
for (ushort boneIdx = 0; boneIdx < curBones; boneIdx++)
|
for (ushort boneIdx = 0; boneIdx < curBones; boneIdx++)
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
using Dalamud.Interface;
|
using Dalamud.Bindings.ImGui;
|
||||||
|
using Dalamud.Interface;
|
||||||
using Dalamud.Interface.Colors;
|
using Dalamud.Interface.Colors;
|
||||||
using Dalamud.Interface.Utility;
|
using Dalamud.Interface.Utility;
|
||||||
using Dalamud.Interface.Utility.Raii;
|
using Dalamud.Interface.Utility.Raii;
|
||||||
using ImGuiNET;
|
|
||||||
using MareSynchronos.Services.CharaData.Models;
|
using MareSynchronos.Services.CharaData.Models;
|
||||||
|
|
||||||
namespace MareSynchronos.UI;
|
namespace MareSynchronos.UI;
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
using Dalamud.Interface.Colors;
|
using Dalamud.Bindings.ImGui;
|
||||||
|
using Dalamud.Interface.Colors;
|
||||||
using Dalamud.Interface.Utility.Raii;
|
using Dalamud.Interface.Utility.Raii;
|
||||||
using Dalamud.Interface.Utility;
|
using Dalamud.Interface.Utility;
|
||||||
using Dalamud.Interface;
|
using Dalamud.Interface;
|
||||||
using ImGuiNET;
|
|
||||||
using MareSynchronos.API.Dto.CharaData;
|
using MareSynchronos.API.Dto.CharaData;
|
||||||
using MareSynchronos.Services.CharaData.Models;
|
using MareSynchronos.Services.CharaData.Models;
|
||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
using Dalamud.Interface.Colors;
|
using Dalamud.Bindings.ImGui;
|
||||||
|
using Dalamud.Interface.Colors;
|
||||||
using Dalamud.Interface.Utility.Raii;
|
using Dalamud.Interface.Utility.Raii;
|
||||||
using Dalamud.Interface.Utility;
|
using Dalamud.Interface.Utility;
|
||||||
using Dalamud.Interface;
|
using Dalamud.Interface;
|
||||||
using ImGuiNET;
|
|
||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
|
|
||||||
namespace MareSynchronos.UI;
|
namespace MareSynchronos.UI;
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
using Dalamud.Interface;
|
using Dalamud.Bindings.ImGui;
|
||||||
|
using Dalamud.Interface;
|
||||||
using Dalamud.Interface.Colors;
|
using Dalamud.Interface.Colors;
|
||||||
using Dalamud.Interface.ImGuiFileDialog;
|
using Dalamud.Interface.ImGuiFileDialog;
|
||||||
using Dalamud.Interface.Utility;
|
using Dalamud.Interface.Utility;
|
||||||
using Dalamud.Interface.Utility.Raii;
|
using Dalamud.Interface.Utility.Raii;
|
||||||
using ImGuiNET;
|
|
||||||
using MareSynchronos.API.Dto.CharaData;
|
using MareSynchronos.API.Dto.CharaData;
|
||||||
using MareSynchronos.MareConfiguration;
|
using MareSynchronos.MareConfiguration;
|
||||||
using MareSynchronos.MareConfiguration.Models;
|
using MareSynchronos.MareConfiguration.Models;
|
||||||
@@ -165,7 +165,7 @@ internal sealed partial class CharaDataHubUi : WindowMediatorSubscriberBase
|
|||||||
UpdateFilteredFavorites();
|
UpdateFilteredFavorites();
|
||||||
}
|
}
|
||||||
|
|
||||||
_hasValidGposeTarget = _charaDataManager.CanApplyInGpose(out _gposeTarget);
|
(_hasValidGposeTarget, _gposeTarget) = _charaDataManager.CanApplyInGpose().GetAwaiter().GetResult();
|
||||||
|
|
||||||
if (!_charaDataManager.BrioAvailable)
|
if (!_charaDataManager.BrioAvailable)
|
||||||
{
|
{
|
||||||
@@ -383,7 +383,7 @@ internal sealed partial class CharaDataHubUi : WindowMediatorSubscriberBase
|
|||||||
UiSharedService.AttachToolTip($"Target the GPose Character {CharaName(actor.Name.TextValue)}");
|
UiSharedService.AttachToolTip($"Target the GPose Character {CharaName(actor.Name.TextValue)}");
|
||||||
ImGui.AlignTextToFramePadding();
|
ImGui.AlignTextToFramePadding();
|
||||||
var pos = ImGui.GetCursorPosX();
|
var pos = ImGui.GetCursorPosX();
|
||||||
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.HealerGreen, actor.Address == (_dalamudUtilService.GposeTargetGameObject?.Address ?? nint.Zero)))
|
using (ImRaii.PushColor(ImGuiCol.Text, ImGuiColors.HealerGreen, actor.Address == (_dalamudUtilService.GetGposeTargetGameObjectAsync().GetAwaiter().GetResult()?.Address ?? nint.Zero)))
|
||||||
{
|
{
|
||||||
ImGui.TextUnformatted(CharaName(actor.Name.TextValue));
|
ImGui.TextUnformatted(CharaName(actor.Name.TextValue));
|
||||||
}
|
}
|
||||||
@@ -832,7 +832,7 @@ internal sealed partial class CharaDataHubUi : WindowMediatorSubscriberBase
|
|||||||
{
|
{
|
||||||
if (_uiSharedService.IconTextButton(FontAwesomeIcon.ArrowRight, "Apply"))
|
if (_uiSharedService.IconTextButton(FontAwesomeIcon.ArrowRight, "Apply"))
|
||||||
{
|
{
|
||||||
_charaDataManager.McdfApplyToGposeTarget();
|
_ = _charaDataManager.McdfApplyToGposeTarget();
|
||||||
}
|
}
|
||||||
UiSharedService.AttachToolTip($"Apply to {_gposeTarget}");
|
UiSharedService.AttachToolTip($"Apply to {_gposeTarget}");
|
||||||
ImGui.SameLine();
|
ImGui.SameLine();
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
using Dalamud.Interface;
|
using Dalamud.Bindings.ImGui;
|
||||||
|
using Dalamud.Interface;
|
||||||
using Dalamud.Interface.Colors;
|
using Dalamud.Interface.Colors;
|
||||||
using Dalamud.Interface.Utility;
|
using Dalamud.Interface.Utility;
|
||||||
using Dalamud.Interface.Utility.Raii;
|
using Dalamud.Interface.Utility.Raii;
|
||||||
using Dalamud.Utility;
|
using Dalamud.Utility;
|
||||||
using ImGuiNET;
|
|
||||||
using MareSynchronos.API.Data.Extensions;
|
using MareSynchronos.API.Data.Extensions;
|
||||||
using MareSynchronos.API.Dto.Group;
|
using MareSynchronos.API.Dto.Group;
|
||||||
using MareSynchronos.Interop.Ipc;
|
using MareSynchronos.Interop.Ipc;
|
||||||
@@ -242,35 +242,6 @@ public class CompactUi : WindowMediatorSubscriberBase
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawAddCharacter()
|
|
||||||
{
|
|
||||||
ImGuiHelpers.ScaledDummy(10f);
|
|
||||||
var keys = _serverManager.CurrentServer!.SecretKeys;
|
|
||||||
if (keys.Any())
|
|
||||||
{
|
|
||||||
if (_secretKeyIdx == -1) _secretKeyIdx = keys.First().Key;
|
|
||||||
if (_uiSharedService.IconTextButton(FontAwesomeIcon.Plus, "Add current character with secret key"))
|
|
||||||
{
|
|
||||||
_serverManager.CurrentServer!.Authentications.Add(new MareConfiguration.Models.Authentication()
|
|
||||||
{
|
|
||||||
CharacterName = _uiSharedService.PlayerName,
|
|
||||||
WorldId = _uiSharedService.WorldId,
|
|
||||||
SecretKeyIdx = _secretKeyIdx
|
|
||||||
});
|
|
||||||
|
|
||||||
_serverManager.Save();
|
|
||||||
|
|
||||||
_ = _apiController.CreateConnectionsAsync();
|
|
||||||
}
|
|
||||||
|
|
||||||
_uiSharedService.DrawCombo("Secret Key##addCharacterSecretKey", keys, (f) => f.Value.FriendlyName, (f) => _secretKeyIdx = f.Key);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
UiSharedService.ColorTextWrapped("No secret keys are configured for the current server.", ImGuiColors.DalamudYellow);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void DrawPairs()
|
private void DrawPairs()
|
||||||
{
|
{
|
||||||
var ySize = _transferPartHeight == 0
|
var ySize = _transferPartHeight == 0
|
||||||
@@ -452,21 +423,7 @@ public class CompactUi : WindowMediatorSubscriberBase
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
UiSharedService.ColorTextWrapped(GetServerError(), GetUidColor());
|
UiSharedService.ColorTextWrapped(GetServerError(), GetUidColor());
|
||||||
if (_apiController.ServerState is ServerState.NoSecretKey)
|
|
||||||
{
|
|
||||||
DrawAddCharacter();
|
|
||||||
}
|
}
|
||||||
if (_apiController.ServerState is ServerState.OAuthLoginTokenStale)
|
|
||||||
{
|
|
||||||
DrawRenewOAuth2();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void DrawRenewOAuth2()
|
|
||||||
{
|
|
||||||
ImGuiHelpers.ScaledDummy(10f);
|
|
||||||
// add some text and a button to restart discord authentication
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private IEnumerable<IDrawFolder> GetDrawFolders()
|
private IEnumerable<IDrawFolder> GetDrawFolders()
|
||||||
@@ -617,7 +574,7 @@ public class CompactUi : WindowMediatorSubscriberBase
|
|||||||
"Your plugin or the server you are connecting to is out of date. Please update your plugin now. If you already did so, contact the server provider to update their server to the latest version.",
|
"Your plugin or the server you are connecting to is out of date. Please update your plugin now. If you already did so, contact the server provider to update their server to the latest version.",
|
||||||
ServerState.RateLimited => "You are rate limited for (re)connecting too often. Disconnect, wait 10 minutes and try again.",
|
ServerState.RateLimited => "You are rate limited for (re)connecting too often. Disconnect, wait 10 minutes and try again.",
|
||||||
ServerState.Connected => string.Empty,
|
ServerState.Connected => string.Empty,
|
||||||
ServerState.NoSecretKey => "You have no secret key set for this current character. Use the button below or open the settings and set a secret key for the current character. You can reuse the same secret key for multiple characters.",
|
ServerState.NoSecretKey => "You have no secret key set for this current character. Open Settings -> Service Settings and set a secret key for the current character. You can reuse the same secret key for multiple characters.",
|
||||||
ServerState.MultiChara => "Your Character Configuration has multiple characters configured with same name and world. You will not be able to connect until you fix this issue. Remove the duplicates from the configuration in Settings -> Service Settings -> Character Management and reconnect manually after.",
|
ServerState.MultiChara => "Your Character Configuration has multiple characters configured with same name and world. You will not be able to connect until you fix this issue. Remove the duplicates from the configuration in Settings -> Service Settings -> Character Management and reconnect manually after.",
|
||||||
ServerState.OAuthMisconfigured => "OAuth2 is enabled but not fully configured, verify in the Settings -> Service Settings that you have OAuth2 connected and, importantly, a UID assigned to your current character.",
|
ServerState.OAuthMisconfigured => "OAuth2 is enabled but not fully configured, verify in the Settings -> Service Settings that you have OAuth2 connected and, importantly, a UID assigned to your current character.",
|
||||||
ServerState.OAuthLoginTokenStale => "Your OAuth2 login token is stale and cannot be used to renew. Go to the Settings -> Service Settings and unlink then relink your OAuth2 configuration.",
|
ServerState.OAuthLoginTokenStale => "Your OAuth2 login token is stale and cannot be used to renew. Go to the Settings -> Service Settings and unlink then relink your OAuth2 configuration.",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using Dalamud.Interface;
|
using Dalamud.Bindings.ImGui;
|
||||||
|
using Dalamud.Interface;
|
||||||
using Dalamud.Interface.Utility.Raii;
|
using Dalamud.Interface.Utility.Raii;
|
||||||
using ImGuiNET;
|
|
||||||
using MareSynchronos.PlayerData.Pairs;
|
using MareSynchronos.PlayerData.Pairs;
|
||||||
using MareSynchronos.UI.Handlers;
|
using MareSynchronos.UI.Handlers;
|
||||||
using System.Collections.Immutable;
|
using System.Collections.Immutable;
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
using Dalamud.Interface;
|
using Dalamud.Bindings.ImGui;
|
||||||
|
using Dalamud.Interface;
|
||||||
using Dalamud.Interface.Colors;
|
using Dalamud.Interface.Colors;
|
||||||
using Dalamud.Interface.Utility;
|
using Dalamud.Interface.Utility;
|
||||||
using Dalamud.Interface.Utility.Raii;
|
using Dalamud.Interface.Utility.Raii;
|
||||||
using ImGuiNET;
|
|
||||||
using MareSynchronos.API.Data.Extensions;
|
using MareSynchronos.API.Data.Extensions;
|
||||||
using MareSynchronos.API.Dto.Group;
|
using MareSynchronos.API.Dto.Group;
|
||||||
using MareSynchronos.PlayerData.Pairs;
|
using MareSynchronos.PlayerData.Pairs;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using Dalamud.Interface;
|
using Dalamud.Bindings.ImGui;
|
||||||
|
using Dalamud.Interface;
|
||||||
using Dalamud.Interface.Utility.Raii;
|
using Dalamud.Interface.Utility.Raii;
|
||||||
using ImGuiNET;
|
|
||||||
using MareSynchronos.API.Data.Extensions;
|
using MareSynchronos.API.Data.Extensions;
|
||||||
using MareSynchronos.PlayerData.Pairs;
|
using MareSynchronos.PlayerData.Pairs;
|
||||||
using MareSynchronos.UI.Handlers;
|
using MareSynchronos.UI.Handlers;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using Dalamud.Interface;
|
using Dalamud.Bindings.ImGui;
|
||||||
|
using Dalamud.Interface;
|
||||||
using Dalamud.Interface.Utility.Raii;
|
using Dalamud.Interface.Utility.Raii;
|
||||||
using ImGuiNET;
|
|
||||||
using MareSynchronos.UI.Handlers;
|
using MareSynchronos.UI.Handlers;
|
||||||
using System.Collections.Immutable;
|
using System.Collections.Immutable;
|
||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
using Dalamud.Interface;
|
using Dalamud.Bindings.ImGui;
|
||||||
|
using Dalamud.Interface;
|
||||||
using Dalamud.Interface.Colors;
|
using Dalamud.Interface.Colors;
|
||||||
using Dalamud.Interface.Utility;
|
using Dalamud.Interface.Utility;
|
||||||
using Dalamud.Interface.Utility.Raii;
|
using Dalamud.Interface.Utility.Raii;
|
||||||
using ImGuiNET;
|
|
||||||
using MareSynchronos.API.Data.Extensions;
|
using MareSynchronos.API.Data.Extensions;
|
||||||
using MareSynchronos.API.Dto.Group;
|
using MareSynchronos.API.Dto.Group;
|
||||||
using MareSynchronos.API.Dto.User;
|
using MareSynchronos.API.Dto.User;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
using Dalamud.Interface;
|
using Dalamud.Bindings.ImGui;
|
||||||
using ImGuiNET;
|
using Dalamud.Interface;
|
||||||
using MareSynchronos.API.Dto.Group;
|
using MareSynchronos.API.Dto.Group;
|
||||||
using MareSynchronos.PlayerData.Pairs;
|
using MareSynchronos.PlayerData.Pairs;
|
||||||
using MareSynchronos.Services.Mediator;
|
using MareSynchronos.Services.Mediator;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
using Dalamud.Interface.Utility;
|
using Dalamud.Bindings.ImGui;
|
||||||
using ImGuiNET;
|
using Dalamud.Interface.Utility;
|
||||||
using MareSynchronos.Services.ServerConfiguration;
|
using MareSynchronos.Services.ServerConfiguration;
|
||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
using Dalamud.Interface;
|
using Dalamud.Bindings.ImGui;
|
||||||
|
using Dalamud.Interface;
|
||||||
using Dalamud.Interface.Utility;
|
using Dalamud.Interface.Utility;
|
||||||
using Dalamud.Interface.Utility.Raii;
|
using Dalamud.Interface.Utility.Raii;
|
||||||
using ImGuiNET;
|
|
||||||
using MareSynchronos.Services;
|
using MareSynchronos.Services;
|
||||||
using MareSynchronos.Services.Mediator;
|
using MareSynchronos.Services.Mediator;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
using Dalamud.Interface.Utility;
|
using Dalamud.Bindings.ImGui;
|
||||||
using ImGuiNET;
|
using Dalamud.Interface.Utility;
|
||||||
using MareSynchronos.PlayerData.Pairs;
|
using MareSynchronos.PlayerData.Pairs;
|
||||||
using MareSynchronos.UI.Handlers;
|
using MareSynchronos.UI.Handlers;
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
using Dalamud.Interface;
|
using Dalamud.Bindings.ImGui;
|
||||||
|
using Dalamud.Interface;
|
||||||
using Dalamud.Interface.Utility;
|
using Dalamud.Interface.Utility;
|
||||||
using Dalamud.Interface.Utility.Raii;
|
using Dalamud.Interface.Utility.Raii;
|
||||||
using Dalamud.Utility;
|
using Dalamud.Utility;
|
||||||
using ImGuiNET;
|
|
||||||
using MareSynchronos.PlayerData.Pairs;
|
using MareSynchronos.PlayerData.Pairs;
|
||||||
using MareSynchronos.UI.Handlers;
|
using MareSynchronos.UI.Handlers;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using Dalamud.Interface;
|
using Dalamud.Bindings.ImGui;
|
||||||
|
using Dalamud.Interface;
|
||||||
using Dalamud.Interface.Utility;
|
using Dalamud.Interface.Utility;
|
||||||
using ImGuiNET;
|
|
||||||
using MareSynchronos.API.Data.Extensions;
|
using MareSynchronos.API.Data.Extensions;
|
||||||
using MareSynchronos.API.Dto.Group;
|
using MareSynchronos.API.Dto.Group;
|
||||||
using MareSynchronos.Services;
|
using MareSynchronos.Services;
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
using Dalamud.Interface;
|
using Dalamud.Bindings.ImGui;
|
||||||
|
using Dalamud.Interface;
|
||||||
using Dalamud.Interface.Colors;
|
using Dalamud.Interface.Colors;
|
||||||
using Dalamud.Interface.Utility;
|
using Dalamud.Interface.Utility;
|
||||||
using Dalamud.Interface.Utility.Raii;
|
using Dalamud.Interface.Utility.Raii;
|
||||||
using ImGuiNET;
|
|
||||||
using MareSynchronos.API.Data.Enum;
|
using MareSynchronos.API.Data.Enum;
|
||||||
using MareSynchronos.FileCache;
|
using MareSynchronos.FileCache;
|
||||||
using MareSynchronos.Interop.Ipc;
|
using MareSynchronos.Interop.Ipc;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
using Dalamud.Interface.Colors;
|
using Dalamud.Bindings.ImGui;
|
||||||
using ImGuiNET;
|
using Dalamud.Interface.Colors;
|
||||||
using MareSynchronos.MareConfiguration;
|
using MareSynchronos.MareConfiguration;
|
||||||
using MareSynchronos.PlayerData.Handlers;
|
using MareSynchronos.PlayerData.Handlers;
|
||||||
using MareSynchronos.Services;
|
using MareSynchronos.Services;
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ public sealed class DtrEntry : IDisposable, IHostedService
|
|||||||
{
|
{
|
||||||
_logger.LogTrace("Creating new DtrBar entry");
|
_logger.LogTrace("Creating new DtrBar entry");
|
||||||
var entry = _dtrBar.Get("Mare Synchronos");
|
var entry = _dtrBar.Get("Mare Synchronos");
|
||||||
entry.OnClick = () => _mareMediator.Publish(new UiToggleMessage(typeof(CompactUi)));
|
entry.OnClick = _ => _mareMediator.Publish(new UiToggleMessage(typeof(CompactUi)));
|
||||||
|
|
||||||
return entry;
|
return entry;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
using Dalamud.Interface;
|
using Dalamud.Bindings.ImGui;
|
||||||
|
using Dalamud.Interface;
|
||||||
using Dalamud.Interface.Colors;
|
using Dalamud.Interface.Colors;
|
||||||
using Dalamud.Interface.ImGuiFileDialog;
|
using Dalamud.Interface.ImGuiFileDialog;
|
||||||
using Dalamud.Interface.Textures.TextureWraps;
|
using Dalamud.Interface.Textures.TextureWraps;
|
||||||
using Dalamud.Interface.Utility;
|
using Dalamud.Interface.Utility;
|
||||||
using ImGuiNET;
|
|
||||||
using MareSynchronos.API.Data;
|
using MareSynchronos.API.Data;
|
||||||
using MareSynchronos.API.Dto.User;
|
using MareSynchronos.API.Dto.User;
|
||||||
using MareSynchronos.Services;
|
using MareSynchronos.Services;
|
||||||
@@ -86,14 +86,14 @@ public class EditProfileUi : WindowMediatorSubscriberBase
|
|||||||
|
|
||||||
if (_pfpTextureWrap != null)
|
if (_pfpTextureWrap != null)
|
||||||
{
|
{
|
||||||
ImGui.Image(_pfpTextureWrap.ImGuiHandle, ImGuiHelpers.ScaledVector2(_pfpTextureWrap.Width, _pfpTextureWrap.Height));
|
ImGui.Image(_pfpTextureWrap.Handle, ImGuiHelpers.ScaledVector2(_pfpTextureWrap.Width, _pfpTextureWrap.Height));
|
||||||
}
|
}
|
||||||
|
|
||||||
var spacing = ImGui.GetStyle().ItemSpacing.X;
|
var spacing = ImGui.GetStyle().ItemSpacing.X;
|
||||||
ImGuiHelpers.ScaledRelativeSameLine(256, spacing);
|
ImGuiHelpers.ScaledRelativeSameLine(256, spacing);
|
||||||
using (_uiSharedService.GameFont.Push())
|
using (_uiSharedService.GameFont.Push())
|
||||||
{
|
{
|
||||||
var descriptionTextSize = ImGui.CalcTextSize(profile.Description, 256f);
|
var descriptionTextSize = ImGui.CalcTextSize(profile.Description, wrapWidth: 256f);
|
||||||
var childFrame = ImGuiHelpers.ScaledVector2(256 + ImGui.GetStyle().WindowPadding.X + ImGui.GetStyle().WindowBorderSize, 256);
|
var childFrame = ImGuiHelpers.ScaledVector2(256 + ImGui.GetStyle().WindowPadding.X + ImGui.GetStyle().WindowBorderSize, 256);
|
||||||
if (descriptionTextSize.Y > childFrame.Y)
|
if (descriptionTextSize.Y > childFrame.Y)
|
||||||
{
|
{
|
||||||
@@ -191,7 +191,7 @@ public class EditProfileUi : WindowMediatorSubscriberBase
|
|||||||
|
|
||||||
using (_uiSharedService.GameFont.Push())
|
using (_uiSharedService.GameFont.Push())
|
||||||
{
|
{
|
||||||
var descriptionTextSizeLocal = ImGui.CalcTextSize(_descriptionText, 256f);
|
var descriptionTextSizeLocal = ImGui.CalcTextSize(_descriptionText, wrapWidth: 256f);
|
||||||
var childFrameLocal = ImGuiHelpers.ScaledVector2(256 + ImGui.GetStyle().WindowPadding.X + ImGui.GetStyle().WindowBorderSize, 200);
|
var childFrameLocal = ImGuiHelpers.ScaledVector2(256 + ImGui.GetStyle().WindowPadding.X + ImGui.GetStyle().WindowBorderSize, 200);
|
||||||
if (descriptionTextSizeLocal.Y > childFrameLocal.Y)
|
if (descriptionTextSizeLocal.Y > childFrameLocal.Y)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
using Dalamud.Interface;
|
using Dalamud.Bindings.ImGui;
|
||||||
|
using Dalamud.Interface;
|
||||||
using Dalamud.Interface.Colors;
|
using Dalamud.Interface.Colors;
|
||||||
using Dalamud.Interface.Utility.Raii;
|
using Dalamud.Interface.Utility.Raii;
|
||||||
using ImGuiNET;
|
|
||||||
using MareSynchronos.Services;
|
using MareSynchronos.Services;
|
||||||
using MareSynchronos.Services.Events;
|
using MareSynchronos.Services.Events;
|
||||||
using MareSynchronos.Services.Mediator;
|
using MareSynchronos.Services.Mediator;
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
using Dalamud.Interface;
|
using Dalamud.Bindings.ImGui;
|
||||||
|
using Dalamud.Interface;
|
||||||
using Dalamud.Interface.Utility.Raii;
|
using Dalamud.Interface.Utility.Raii;
|
||||||
using ImGuiNET;
|
|
||||||
using ImGuiScene;
|
|
||||||
using MareSynchronos.API.Dto.Group;
|
using MareSynchronos.API.Dto.Group;
|
||||||
using MareSynchronos.MareConfiguration;
|
using MareSynchronos.MareConfiguration;
|
||||||
using MareSynchronos.PlayerData.Pairs;
|
using MareSynchronos.PlayerData.Pairs;
|
||||||
@@ -22,7 +21,6 @@ public class IdDisplayHandler
|
|||||||
private string _lastMouseOverUid = string.Empty;
|
private string _lastMouseOverUid = string.Empty;
|
||||||
private bool _popupShown = false;
|
private bool _popupShown = false;
|
||||||
private DateTime? _popupTime;
|
private DateTime? _popupTime;
|
||||||
private TextureWrap? _textureWrap;
|
|
||||||
|
|
||||||
public IdDisplayHandler(MareMediator mediator, ServerConfigurationManager serverManager, MareConfigService mareConfigService)
|
public IdDisplayHandler(MareMediator mediator, ServerConfigurationManager serverManager, MareConfigService mareConfigService)
|
||||||
{
|
{
|
||||||
@@ -125,8 +123,6 @@ public class IdDisplayHandler
|
|||||||
_mediator.Publish(new ProfilePopoutToggle(Pair: null));
|
_mediator.Publish(new ProfilePopoutToggle(Pair: null));
|
||||||
_lastMouseOverUid = string.Empty;
|
_lastMouseOverUid = string.Empty;
|
||||||
_popupShown = false;
|
_popupShown = false;
|
||||||
_textureWrap?.Dispose();
|
|
||||||
_textureWrap = null;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
using Dalamud.Interface.Colors;
|
using Dalamud.Bindings.ImGui;
|
||||||
|
using Dalamud.Interface.Colors;
|
||||||
using Dalamud.Interface.Utility;
|
using Dalamud.Interface.Utility;
|
||||||
using Dalamud.Interface.Utility.Raii;
|
using Dalamud.Interface.Utility.Raii;
|
||||||
using Dalamud.Utility;
|
using Dalamud.Utility;
|
||||||
using ImGuiNET;
|
|
||||||
using MareSynchronos.FileCache;
|
using MareSynchronos.FileCache;
|
||||||
using MareSynchronos.Localization;
|
using MareSynchronos.Localization;
|
||||||
using MareSynchronos.MareConfiguration;
|
using MareSynchronos.MareConfiguration;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
using Dalamud.Interface.Colors;
|
using Dalamud.Bindings.ImGui;
|
||||||
|
using Dalamud.Interface.Colors;
|
||||||
using Dalamud.Interface.Utility;
|
using Dalamud.Interface.Utility;
|
||||||
using Dalamud.Interface.Utility.Raii;
|
using Dalamud.Interface.Utility.Raii;
|
||||||
using ImGuiNET;
|
|
||||||
using MareSynchronos.API.Data.Enum;
|
using MareSynchronos.API.Data.Enum;
|
||||||
using MareSynchronos.API.Data.Extensions;
|
using MareSynchronos.API.Data.Extensions;
|
||||||
using MareSynchronos.API.Dto;
|
using MareSynchronos.API.Dto;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
using Dalamud.Interface.Utility;
|
using Dalamud.Bindings.ImGui;
|
||||||
|
using Dalamud.Interface.Utility;
|
||||||
using Dalamud.Interface.Utility.Raii;
|
using Dalamud.Interface.Utility.Raii;
|
||||||
using ImGuiNET;
|
|
||||||
using MareSynchronos.API.Data.Enum;
|
using MareSynchronos.API.Data.Enum;
|
||||||
using MareSynchronos.API.Data.Extensions;
|
using MareSynchronos.API.Data.Extensions;
|
||||||
using MareSynchronos.PlayerData.Pairs;
|
using MareSynchronos.PlayerData.Pairs;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
using Dalamud.Interface.Colors;
|
using Dalamud.Bindings.ImGui;
|
||||||
|
using Dalamud.Interface.Colors;
|
||||||
using Dalamud.Interface.Textures.TextureWraps;
|
using Dalamud.Interface.Textures.TextureWraps;
|
||||||
using Dalamud.Interface.Utility;
|
using Dalamud.Interface.Utility;
|
||||||
using ImGuiNET;
|
|
||||||
using MareSynchronos.API.Data.Extensions;
|
using MareSynchronos.API.Data.Extensions;
|
||||||
using MareSynchronos.MareConfiguration;
|
using MareSynchronos.MareConfiguration;
|
||||||
using MareSynchronos.PlayerData.Pairs;
|
using MareSynchronos.PlayerData.Pairs;
|
||||||
@@ -159,12 +159,12 @@ public class PopoutProfileUi : WindowMediatorSubscriberBase
|
|||||||
var font = _uiSharedService.GameFont.Push();
|
var font = _uiSharedService.GameFont.Push();
|
||||||
var remaining = ImGui.GetWindowContentRegionMax().Y - ImGui.GetCursorPosY();
|
var remaining = ImGui.GetWindowContentRegionMax().Y - ImGui.GetCursorPosY();
|
||||||
var descText = mareProfile.Description;
|
var descText = mareProfile.Description;
|
||||||
var textSize = ImGui.CalcTextSize(descText, 256f * ImGuiHelpers.GlobalScale);
|
var textSize = ImGui.CalcTextSize(descText, wrapWidth: 256f * ImGuiHelpers.GlobalScale);
|
||||||
bool trimmed = textSize.Y > remaining;
|
bool trimmed = textSize.Y > remaining;
|
||||||
while (textSize.Y > remaining && descText.Contains(' '))
|
while (textSize.Y > remaining && descText.Contains(' '))
|
||||||
{
|
{
|
||||||
descText = descText[..descText.LastIndexOf(' ')].TrimEnd();
|
descText = descText[..descText.LastIndexOf(' ')].TrimEnd();
|
||||||
textSize = ImGui.CalcTextSize(descText + $"...{Environment.NewLine}[Open Full Profile for complete description]", 256f * ImGuiHelpers.GlobalScale);
|
textSize = ImGui.CalcTextSize(descText + $"...{Environment.NewLine}[Open Full Profile for complete description]", wrapWidth: 256f * ImGuiHelpers.GlobalScale);
|
||||||
}
|
}
|
||||||
UiSharedService.TextWrapped(trimmed ? descText + $"...{Environment.NewLine}[Open Full Profile for complete description]" : mareProfile.Description);
|
UiSharedService.TextWrapped(trimmed ? descText + $"...{Environment.NewLine}[Open Full Profile for complete description]" : mareProfile.Description);
|
||||||
font.Dispose();
|
font.Dispose();
|
||||||
@@ -176,12 +176,12 @@ public class PopoutProfileUi : WindowMediatorSubscriberBase
|
|||||||
var newHeight = _textureWrap.Height * stretchFactor;
|
var newHeight = _textureWrap.Height * stretchFactor;
|
||||||
var remainingWidth = (256f * ImGuiHelpers.GlobalScale - newWidth) / 2f;
|
var remainingWidth = (256f * ImGuiHelpers.GlobalScale - newWidth) / 2f;
|
||||||
var remainingHeight = (256f * ImGuiHelpers.GlobalScale - newHeight) / 2f;
|
var remainingHeight = (256f * ImGuiHelpers.GlobalScale - newHeight) / 2f;
|
||||||
drawList.AddImage(_textureWrap.ImGuiHandle, new Vector2(rectMin.X + padding + remainingWidth, rectMin.Y + spacing.Y + imagePos.Y + remainingHeight),
|
drawList.AddImage(_textureWrap.Handle, new Vector2(rectMin.X + padding + remainingWidth, rectMin.Y + spacing.Y + imagePos.Y + remainingHeight),
|
||||||
new Vector2(rectMin.X + padding + remainingWidth + newWidth, rectMin.Y + spacing.Y + imagePos.Y + remainingHeight + newHeight));
|
new Vector2(rectMin.X + padding + remainingWidth + newWidth, rectMin.Y + spacing.Y + imagePos.Y + remainingHeight + newHeight));
|
||||||
if (_supporterTextureWrap != null)
|
if (_supporterTextureWrap != null)
|
||||||
{
|
{
|
||||||
const float iconSize = 38;
|
const float iconSize = 38;
|
||||||
drawList.AddImage(_supporterTextureWrap.ImGuiHandle,
|
drawList.AddImage(_supporterTextureWrap.Handle,
|
||||||
new Vector2(rectMax.X - iconSize - spacing.X, rectMin.Y + (textPos / 2) - (iconSize / 2)),
|
new Vector2(rectMax.X - iconSize - spacing.X, rectMin.Y + (textPos / 2) - (iconSize / 2)),
|
||||||
new Vector2(rectMax.X - spacing.X, rectMin.Y + iconSize + (textPos / 2) - (iconSize / 2)));
|
new Vector2(rectMax.X - spacing.X, rectMin.Y + iconSize + (textPos / 2) - (iconSize / 2)));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
using Dalamud.Interface;
|
using Dalamud.Bindings.ImGui;
|
||||||
|
using Dalamud.Interface;
|
||||||
using Dalamud.Interface.Colors;
|
using Dalamud.Interface.Colors;
|
||||||
using Dalamud.Interface.Utility;
|
using Dalamud.Interface.Utility;
|
||||||
using Dalamud.Interface.Utility.Raii;
|
using Dalamud.Interface.Utility.Raii;
|
||||||
using Dalamud.Utility;
|
using Dalamud.Utility;
|
||||||
using ImGuiNET;
|
|
||||||
using MareSynchronos.API.Data;
|
using MareSynchronos.API.Data;
|
||||||
using MareSynchronos.API.Data.Comparer;
|
using MareSynchronos.API.Data.Comparer;
|
||||||
using MareSynchronos.API.Routes;
|
using MareSynchronos.API.Routes;
|
||||||
@@ -895,6 +895,7 @@ public class SettingsUi : WindowMediatorSubscriberBase
|
|||||||
var dtrColorsNotConnected = _configService.Current.DtrColorsNotConnected;
|
var dtrColorsNotConnected = _configService.Current.DtrColorsNotConnected;
|
||||||
var dtrColorsPairsInRange = _configService.Current.DtrColorsPairsInRange;
|
var dtrColorsPairsInRange = _configService.Current.DtrColorsPairsInRange;
|
||||||
var preferNotesInsteadOfName = _configService.Current.PreferNotesOverNamesForVisible;
|
var preferNotesInsteadOfName = _configService.Current.PreferNotesOverNamesForVisible;
|
||||||
|
var useFocusTarget = _configService.Current.UseFocusTarget;
|
||||||
var groupUpSyncshells = _configService.Current.GroupUpSyncshells;
|
var groupUpSyncshells = _configService.Current.GroupUpSyncshells;
|
||||||
var groupInVisible = _configService.Current.ShowSyncshellUsersInVisible;
|
var groupInVisible = _configService.Current.ShowSyncshellUsersInVisible;
|
||||||
var syncshellOfflineSeparate = _configService.Current.ShowSyncshellOfflineUsersSeparately;
|
var syncshellOfflineSeparate = _configService.Current.ShowSyncshellOfflineUsersSeparately;
|
||||||
@@ -1025,6 +1026,12 @@ public class SettingsUi : WindowMediatorSubscriberBase
|
|||||||
if (!_configService.Current.ShowCharacterNameInsteadOfNotesForVisible) ImGui.EndDisabled();
|
if (!_configService.Current.ShowCharacterNameInsteadOfNotesForVisible) ImGui.EndDisabled();
|
||||||
ImGui.Unindent();
|
ImGui.Unindent();
|
||||||
|
|
||||||
|
if (ImGui.Checkbox("Set visible pairs as focus targets when clicking the eye", ref useFocusTarget))
|
||||||
|
{
|
||||||
|
_configService.Current.UseFocusTarget = useFocusTarget;
|
||||||
|
_configService.Save();
|
||||||
|
}
|
||||||
|
|
||||||
if (ImGui.Checkbox("Show Mare Profiles on Hover", ref showProfiles))
|
if (ImGui.Checkbox("Show Mare Profiles on Hover", ref showProfiles))
|
||||||
{
|
{
|
||||||
Mediator.Publish(new ClearProfileDataMessage());
|
Mediator.Publish(new ClearProfileDataMessage());
|
||||||
@@ -1729,9 +1736,15 @@ public class SettingsUi : WindowMediatorSubscriberBase
|
|||||||
if (useOauth)
|
if (useOauth)
|
||||||
{
|
{
|
||||||
_uiShared.DrawOAuth(selectedServer);
|
_uiShared.DrawOAuth(selectedServer);
|
||||||
|
if (string.IsNullOrEmpty(_serverConfigurationManager.GetDiscordUserFromToken(selectedServer)))
|
||||||
|
{
|
||||||
|
ImGuiHelpers.ScaledDummy(10f);
|
||||||
|
UiSharedService.ColorTextWrapped("You have enabled OAuth2 but it is not linked. Press the buttons Check, then Authenticate to link properly.", ImGuiColors.DalamudRed);
|
||||||
|
}
|
||||||
if (!string.IsNullOrEmpty(_serverConfigurationManager.GetDiscordUserFromToken(selectedServer))
|
if (!string.IsNullOrEmpty(_serverConfigurationManager.GetDiscordUserFromToken(selectedServer))
|
||||||
&& selectedServer.Authentications.TrueForAll(u => string.IsNullOrEmpty(u.UID)))
|
&& selectedServer.Authentications.TrueForAll(u => string.IsNullOrEmpty(u.UID)))
|
||||||
{
|
{
|
||||||
|
ImGuiHelpers.ScaledDummy(10f);
|
||||||
UiSharedService.ColorTextWrapped("You have enabled OAuth2 but no characters configured. Set the correct UIDs for your characters in \"Character Management\".",
|
UiSharedService.ColorTextWrapped("You have enabled OAuth2 but no characters configured. Set the correct UIDs for your characters in \"Character Management\".",
|
||||||
ImGuiColors.DalamudRed);
|
ImGuiColors.DalamudRed);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
using Dalamud.Interface.Colors;
|
using Dalamud.Bindings.ImGui;
|
||||||
|
using Dalamud.Interface.Colors;
|
||||||
using Dalamud.Interface.Textures.TextureWraps;
|
using Dalamud.Interface.Textures.TextureWraps;
|
||||||
using Dalamud.Interface.Utility;
|
using Dalamud.Interface.Utility;
|
||||||
using ImGuiNET;
|
|
||||||
using MareSynchronos.API.Data.Extensions;
|
using MareSynchronos.API.Data.Extensions;
|
||||||
using MareSynchronos.PlayerData.Pairs;
|
using MareSynchronos.PlayerData.Pairs;
|
||||||
using MareSynchronos.Services;
|
using MareSynchronos.Services;
|
||||||
@@ -86,7 +86,7 @@ public class StandaloneProfileUi : WindowMediatorSubscriberBase
|
|||||||
ImGuiHelpers.ScaledDummy(new Vector2(256, 256 + spacing.Y));
|
ImGuiHelpers.ScaledDummy(new Vector2(256, 256 + spacing.Y));
|
||||||
var postDummy = ImGui.GetCursorPosY();
|
var postDummy = ImGui.GetCursorPosY();
|
||||||
ImGui.SameLine();
|
ImGui.SameLine();
|
||||||
var descriptionTextSize = ImGui.CalcTextSize(mareProfile.Description, 256f);
|
var descriptionTextSize = ImGui.CalcTextSize(mareProfile.Description, wrapWidth: 256f);
|
||||||
var descriptionChildHeight = rectMax.Y - pos.Y - rectMin.Y - spacing.Y * 2;
|
var descriptionChildHeight = rectMax.Y - pos.Y - rectMin.Y - spacing.Y * 2;
|
||||||
if (descriptionTextSize.Y > descriptionChildHeight && !_adjustedForScrollBars)
|
if (descriptionTextSize.Y > descriptionChildHeight && !_adjustedForScrollBars)
|
||||||
{
|
{
|
||||||
@@ -158,12 +158,12 @@ public class StandaloneProfileUi : WindowMediatorSubscriberBase
|
|||||||
var newHeight = _textureWrap.Height * stretchFactor;
|
var newHeight = _textureWrap.Height * stretchFactor;
|
||||||
var remainingWidth = (256f * ImGuiHelpers.GlobalScale - newWidth) / 2f;
|
var remainingWidth = (256f * ImGuiHelpers.GlobalScale - newWidth) / 2f;
|
||||||
var remainingHeight = (256f * ImGuiHelpers.GlobalScale - newHeight) / 2f;
|
var remainingHeight = (256f * ImGuiHelpers.GlobalScale - newHeight) / 2f;
|
||||||
drawList.AddImage(_textureWrap.ImGuiHandle, new Vector2(rectMin.X + padding + remainingWidth, rectMin.Y + spacing.Y + pos.Y + remainingHeight),
|
drawList.AddImage(_textureWrap.Handle, new Vector2(rectMin.X + padding + remainingWidth, rectMin.Y + spacing.Y + pos.Y + remainingHeight),
|
||||||
new Vector2(rectMin.X + padding + remainingWidth + newWidth, rectMin.Y + spacing.Y + pos.Y + remainingHeight + newHeight));
|
new Vector2(rectMin.X + padding + remainingWidth + newWidth, rectMin.Y + spacing.Y + pos.Y + remainingHeight + newHeight));
|
||||||
if (_supporterTextureWrap != null)
|
if (_supporterTextureWrap != null)
|
||||||
{
|
{
|
||||||
const float iconSize = 38;
|
const float iconSize = 38;
|
||||||
drawList.AddImage(_supporterTextureWrap.ImGuiHandle,
|
drawList.AddImage(_supporterTextureWrap.Handle,
|
||||||
new Vector2(rectMax.X - iconSize - spacing.X, rectMin.Y + (textPos / 2) - (iconSize / 2)),
|
new Vector2(rectMax.X - iconSize - spacing.X, rectMin.Y + (textPos / 2) - (iconSize / 2)),
|
||||||
new Vector2(rectMax.X - spacing.X, rectMin.Y + iconSize + (textPos / 2) - (iconSize / 2)));
|
new Vector2(rectMax.X - spacing.X, rectMin.Y + iconSize + (textPos / 2) - (iconSize / 2)));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
using Dalamud.Interface;
|
using Dalamud.Bindings.ImGui;
|
||||||
|
using Dalamud.Interface;
|
||||||
using Dalamud.Interface.Colors;
|
using Dalamud.Interface.Colors;
|
||||||
using Dalamud.Interface.Utility;
|
using Dalamud.Interface.Utility;
|
||||||
using Dalamud.Interface.Utility.Raii;
|
using Dalamud.Interface.Utility.Raii;
|
||||||
using ImGuiNET;
|
|
||||||
using MareSynchronos.API.Data.Enum;
|
using MareSynchronos.API.Data.Enum;
|
||||||
using MareSynchronos.API.Data.Extensions;
|
using MareSynchronos.API.Data.Extensions;
|
||||||
using MareSynchronos.API.Dto.Group;
|
using MareSynchronos.API.Dto.Group;
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
using Dalamud.Interface;
|
using Dalamud.Bindings.ImGui;
|
||||||
|
using Dalamud.Interface;
|
||||||
using Dalamud.Interface.Utility;
|
using Dalamud.Interface.Utility;
|
||||||
using Dalamud.Interface.Utility.Raii;
|
using Dalamud.Interface.Utility.Raii;
|
||||||
using Dalamud.Utility;
|
using Dalamud.Utility;
|
||||||
using ImGuiNET;
|
|
||||||
using MareSynchronos.API.Data.Enum;
|
using MareSynchronos.API.Data.Enum;
|
||||||
using MareSynchronos.API.Data.Extensions;
|
using MareSynchronos.API.Data.Extensions;
|
||||||
using MareSynchronos.PlayerData.Pairs;
|
using MareSynchronos.PlayerData.Pairs;
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using Dalamud.Interface;
|
using Dalamud.Bindings.ImGui;
|
||||||
|
using Dalamud.Interface;
|
||||||
using Dalamud.Interface.Colors;
|
using Dalamud.Interface.Colors;
|
||||||
using Dalamud.Interface.GameFonts;
|
using Dalamud.Interface.GameFonts;
|
||||||
using Dalamud.Interface.ImGuiFileDialog;
|
using Dalamud.Interface.ImGuiFileDialog;
|
||||||
@@ -9,7 +10,6 @@ using Dalamud.Interface.Utility.Raii;
|
|||||||
using Dalamud.Plugin;
|
using Dalamud.Plugin;
|
||||||
using Dalamud.Plugin.Services;
|
using Dalamud.Plugin.Services;
|
||||||
using Dalamud.Utility;
|
using Dalamud.Utility;
|
||||||
using ImGuiNET;
|
|
||||||
using MareSynchronos.FileCache;
|
using MareSynchronos.FileCache;
|
||||||
using MareSynchronos.Interop.Ipc;
|
using MareSynchronos.Interop.Ipc;
|
||||||
using MareSynchronos.Localization;
|
using MareSynchronos.Localization;
|
||||||
@@ -231,7 +231,7 @@ public partial class UiSharedService : DisposableMediatorSubscriberBase
|
|||||||
public static void DrawGroupedCenteredColorText(string text, Vector4 color, float? maxWidth = null)
|
public static void DrawGroupedCenteredColorText(string text, Vector4 color, float? maxWidth = null)
|
||||||
{
|
{
|
||||||
var availWidth = ImGui.GetContentRegionAvail().X;
|
var availWidth = ImGui.GetContentRegionAvail().X;
|
||||||
var textWidth = ImGui.CalcTextSize(text, availWidth).X;
|
var textWidth = ImGui.CalcTextSize(text, wrapWidth: availWidth).X;
|
||||||
if (maxWidth != null && textWidth > maxWidth * ImGuiHelpers.GlobalScale) textWidth = maxWidth.Value * ImGuiHelpers.GlobalScale;
|
if (maxWidth != null && textWidth > maxWidth * ImGuiHelpers.GlobalScale) textWidth = maxWidth.Value * ImGuiHelpers.GlobalScale;
|
||||||
ImGui.SetCursorPosX(ImGui.GetCursorPosX() + (availWidth / 2f) - (textWidth / 2f));
|
ImGui.SetCursorPosX(ImGui.GetCursorPosX() + (availWidth / 2f) - (textWidth / 2f));
|
||||||
DrawGrouped(() =>
|
DrawGrouped(() =>
|
||||||
@@ -982,7 +982,7 @@ public partial class UiSharedService : DisposableMediatorSubscriberBase
|
|||||||
}
|
}
|
||||||
if (string.IsNullOrEmpty(selectedServer.OAuthToken) || tokenExpiry < DateTime.UtcNow)
|
if (string.IsNullOrEmpty(selectedServer.OAuthToken) || tokenExpiry < DateTime.UtcNow)
|
||||||
{
|
{
|
||||||
ColorTextWrapped("You have no OAuth token or the OAuth token is expired. Please use the Service Settings to (re)link your OAuth account.", ImGuiColors.DalamudRed);
|
ColorTextWrapped("You have no OAuth token or the OAuth token is expired. Please use the Service Configuration to link your OAuth2 account or refresh the token.", ImGuiColors.DalamudRed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,9 +4,9 @@
|
|||||||
"net9.0-windows7.0": {
|
"net9.0-windows7.0": {
|
||||||
"DalamudPackager": {
|
"DalamudPackager": {
|
||||||
"type": "Direct",
|
"type": "Direct",
|
||||||
"requested": "[12.0.0, )",
|
"requested": "[13.0.0, )",
|
||||||
"resolved": "12.0.0",
|
"resolved": "13.0.0",
|
||||||
"contentHash": "J5TJLV3f16T/E2H2P17ClWjtfEBPpq3yxvqW46eN36JCm6wR+EaoaYkqG9Rm5sHqs3/nK/vKjWWyvEs/jhKoXw=="
|
"contentHash": "Mb3cUDSK/vDPQ8gQIeuCw03EMYrej1B4J44a1AvIJ9C759p9XeqdU9Hg4WgOmlnlPe0G7ILTD32PKSUpkQNa8w=="
|
||||||
},
|
},
|
||||||
"DotNet.ReproducibleBuilds": {
|
"DotNet.ReproducibleBuilds": {
|
||||||
"type": "Direct",
|
"type": "Direct",
|
||||||
|
|||||||
Reference in New Issue
Block a user