mirror of
https://github.com/Caraxi/mare.client.git
synced 2025-12-12 20:27:22 +01:00
preliminary api10 update
This commit is contained in:
parent
8c56c91374
commit
b9cf7eb6fa
34 changed files with 163 additions and 137 deletions
|
|
@ -16,7 +16,7 @@ public sealed class DtrEntry : IDisposable, IHostedService
|
|||
private readonly CancellationTokenSource _cancellationTokenSource = new();
|
||||
private readonly ConfigurationServiceBase<MareConfig> _configService;
|
||||
private readonly IDtrBar _dtrBar;
|
||||
private readonly Lazy<DtrBarEntry> _entry;
|
||||
private readonly Lazy<IDtrBarEntry> _entry;
|
||||
private readonly ILogger<DtrEntry> _logger;
|
||||
private readonly MareMediator _mareMediator;
|
||||
private readonly PairManager _pairManager;
|
||||
|
|
@ -40,7 +40,7 @@ public sealed class DtrEntry : IDisposable, IHostedService
|
|||
{
|
||||
_logger.LogDebug("Disposing DtrEntry");
|
||||
Clear();
|
||||
_entry.Value.Dispose();
|
||||
_entry.Value.Remove();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -78,7 +78,7 @@ public sealed class DtrEntry : IDisposable, IHostedService
|
|||
_entry.Value.Shown = false;
|
||||
}
|
||||
|
||||
private DtrBarEntry CreateEntry()
|
||||
private IDtrBarEntry CreateEntry()
|
||||
{
|
||||
_logger.LogTrace("Creating new DtrBar entry");
|
||||
var entry = _dtrBar.Get("Mare Synchronos");
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
using Dalamud.Interface.Colors;
|
||||
using Dalamud.Interface.ImGuiFileDialog;
|
||||
using Dalamud.Interface.Internal;
|
||||
using Dalamud.Interface.Textures.TextureWraps;
|
||||
using Dalamud.Interface.Utility;
|
||||
using ImGuiNET;
|
||||
using MareSynchronos.API.Data;
|
||||
|
|
@ -20,7 +21,6 @@ public class EditProfileUi : WindowMediatorSubscriberBase
|
|||
private readonly ApiController _apiController;
|
||||
private readonly FileDialogManager _fileDialogManager;
|
||||
private readonly MareProfileManager _mareProfileManager;
|
||||
private readonly UiBuilder _uiBuilder;
|
||||
private readonly UiSharedService _uiSharedService;
|
||||
private bool _adjustedForScollBarsLocalProfile = false;
|
||||
private bool _adjustedForScollBarsOnlineProfile = false;
|
||||
|
|
@ -32,9 +32,8 @@ public class EditProfileUi : WindowMediatorSubscriberBase
|
|||
private bool _wasOpen;
|
||||
|
||||
public EditProfileUi(ILogger<EditProfileUi> logger, MareMediator mediator,
|
||||
ApiController apiController, UiBuilder uiBuilder, UiSharedService uiSharedService,
|
||||
FileDialogManager fileDialogManager, MareProfileManager mareProfileManager,
|
||||
PerformanceCollectorService performanceCollectorService)
|
||||
ApiController apiController, UiSharedService uiSharedService, FileDialogManager fileDialogManager,
|
||||
MareProfileManager mareProfileManager, PerformanceCollectorService performanceCollectorService)
|
||||
: base(logger, mediator, "Mare Synchronos Edit Profile###MareSynchronosEditProfileUI", performanceCollectorService)
|
||||
{
|
||||
IsOpen = false;
|
||||
|
|
@ -44,7 +43,6 @@ public class EditProfileUi : WindowMediatorSubscriberBase
|
|||
MaximumSize = new(768, 2000)
|
||||
};
|
||||
_apiController = apiController;
|
||||
_uiBuilder = uiBuilder;
|
||||
_uiSharedService = uiSharedService;
|
||||
_fileDialogManager = fileDialogManager;
|
||||
_mareProfileManager = mareProfileManager;
|
||||
|
|
@ -78,7 +76,7 @@ public class EditProfileUi : WindowMediatorSubscriberBase
|
|||
{
|
||||
_profileImage = profile.ImageData.Value;
|
||||
_pfpTextureWrap?.Dispose();
|
||||
_pfpTextureWrap = _uiBuilder.LoadImage(_profileImage);
|
||||
_pfpTextureWrap = _uiSharedService.LoadImage(_profileImage);
|
||||
}
|
||||
|
||||
if (!string.Equals(_profileDescription, profile.Description, StringComparison.OrdinalIgnoreCase))
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
using Dalamud.Interface.Colors;
|
||||
using Dalamud.Interface.Internal;
|
||||
|
||||
using Dalamud.Interface.Textures.TextureWraps;
|
||||
using Dalamud.Interface.Utility;
|
||||
using ImGuiNET;
|
||||
using MareSynchronos.API.Data.Extensions;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
using Dalamud.Interface.Colors;
|
||||
using Dalamud.Interface.Internal;
|
||||
|
||||
using Dalamud.Interface.Textures.TextureWraps;
|
||||
using Dalamud.Interface.Utility;
|
||||
using ImGuiNET;
|
||||
using MareSynchronos.API.Data.Extensions;
|
||||
|
|
|
|||
|
|
@ -5,9 +5,12 @@ using Dalamud.Interface.GameFonts;
|
|||
using Dalamud.Interface.ImGuiFileDialog;
|
||||
using Dalamud.Interface.Internal;
|
||||
using Dalamud.Interface.ManagedFontAtlas;
|
||||
using Dalamud.Interface.Textures;
|
||||
using Dalamud.Interface.Textures.TextureWraps;
|
||||
using Dalamud.Interface.Utility;
|
||||
using Dalamud.Interface.Utility.Raii;
|
||||
using Dalamud.Plugin;
|
||||
using Dalamud.Plugin.Services;
|
||||
using Dalamud.Utility;
|
||||
using ImGuiNET;
|
||||
using MareSynchronos.FileCache;
|
||||
|
|
@ -51,7 +54,8 @@ public partial class UiSharedService : DisposableMediatorSubscriberBase
|
|||
private readonly DalamudUtilService _dalamudUtil;
|
||||
private readonly IpcManager _ipcManager;
|
||||
private readonly Dalamud.Localization _localization;
|
||||
private readonly DalamudPluginInterface _pluginInterface;
|
||||
private readonly IDalamudPluginInterface _pluginInterface;
|
||||
private readonly ITextureProvider _textureProvider;
|
||||
private readonly Dictionary<string, object> _selectedComboItems = new(StringComparer.Ordinal);
|
||||
private readonly ServerConfigurationManager _serverConfigurationManager;
|
||||
private bool _cacheDirectoryHasOtherFilesThanCache = false;
|
||||
|
|
@ -79,7 +83,9 @@ public partial class UiSharedService : DisposableMediatorSubscriberBase
|
|||
|
||||
public UiSharedService(ILogger<UiSharedService> logger, IpcManager ipcManager, ApiController apiController,
|
||||
CacheMonitor cacheMonitor, FileDialogManager fileDialogManager,
|
||||
MareConfigService configService, DalamudUtilService dalamudUtil, DalamudPluginInterface pluginInterface, Dalamud.Localization localization,
|
||||
MareConfigService configService, DalamudUtilService dalamudUtil, IDalamudPluginInterface pluginInterface,
|
||||
ITextureProvider textureProvider,
|
||||
Dalamud.Localization localization,
|
||||
ServerConfigurationManager serverManager, MareMediator mediator) : base(logger, mediator)
|
||||
{
|
||||
_ipcManager = ipcManager;
|
||||
|
|
@ -89,6 +95,7 @@ public partial class UiSharedService : DisposableMediatorSubscriberBase
|
|||
_configService = configService;
|
||||
_dalamudUtil = dalamudUtil;
|
||||
_pluginInterface = pluginInterface;
|
||||
_textureProvider = textureProvider;
|
||||
_localization = localization;
|
||||
_serverConfigurationManager = serverManager;
|
||||
_localization.SetupWithLangCode("en");
|
||||
|
|
@ -800,7 +807,7 @@ public partial class UiSharedService : DisposableMediatorSubscriberBase
|
|||
|
||||
public IDalamudTextureWrap LoadImage(byte[] imageData)
|
||||
{
|
||||
return _pluginInterface.UiBuilder.LoadImage(imageData);
|
||||
return _textureProvider.CreateFromImageAsync(imageData).Result;
|
||||
}
|
||||
|
||||
public void LoadLocalization(string languageCode)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue