[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,73 @@
|
||||
using Dalamud.Interface;
|
||||
using Dalamud.Interface.Colors;
|
||||
using Dalamud.Interface.ImGuiFileDialog;
|
||||
using Dalamud.Interface.Windowing;
|
||||
using ImGuiNET;
|
||||
using MareSynchronos.Export;
|
||||
using MareSynchronos.MareConfiguration;
|
||||
using MareSynchronos.Mediator;
|
||||
using MareSynchronos.Utils;
|
||||
using MareSynchronos.PlayerData.Export;
|
||||
using MareSynchronos.Services;
|
||||
using MareSynchronos.Services.Mediator;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace MareSynchronos.UI;
|
||||
|
||||
public class GposeUi : WindowMediatorSubscriberBase, IDisposable
|
||||
public class GposeUi : WindowMediatorSubscriberBase
|
||||
{
|
||||
private readonly WindowSystem _windowSystem;
|
||||
private readonly MareCharaFileManager _mareCharaFileManager;
|
||||
private readonly DalamudUtil _dalamudUtil;
|
||||
private readonly FileDialogManager _fileDialogManager;
|
||||
private readonly MareConfigService _configService;
|
||||
private readonly DalamudUtilService _dalamudUtil;
|
||||
private readonly FileDialogManager _fileDialogManager;
|
||||
private readonly MareCharaFileManager _mareCharaFileManager;
|
||||
|
||||
public GposeUi(ILogger<GposeUi> logger, WindowSystem windowSystem, MareCharaFileManager mareCharaFileManager,
|
||||
DalamudUtil dalamudUtil, FileDialogManager fileDialogManager, MareConfigService configService,
|
||||
public GposeUi(ILogger<GposeUi> logger, MareCharaFileManager mareCharaFileManager,
|
||||
DalamudUtilService dalamudUtil, FileDialogManager fileDialogManager, MareConfigService configService,
|
||||
MareMediator mediator) : base(logger, mediator, "Mare Synchronos Gpose Import UI###MareSynchronosGposeUI")
|
||||
{
|
||||
_windowSystem = windowSystem;
|
||||
_mareCharaFileManager = mareCharaFileManager;
|
||||
_dalamudUtil = dalamudUtil;
|
||||
_fileDialogManager = fileDialogManager;
|
||||
_configService = configService;
|
||||
|
||||
Mediator.Subscribe<GposeStartMessage>(this, (_) => StartGpose());
|
||||
Mediator.Subscribe<GposeEndMessage>(this, (_) => EndGpose());
|
||||
IsOpen = _dalamudUtil.IsInGpose;
|
||||
Flags = ImGuiWindowFlags.AlwaysAutoResize;
|
||||
_windowSystem.AddWindow(this);
|
||||
this.SizeConstraints = new()
|
||||
{
|
||||
MinimumSize = new(200, 200),
|
||||
MaximumSize = new(400, 400)
|
||||
};
|
||||
}
|
||||
|
||||
public override void Draw()
|
||||
{
|
||||
if (!_dalamudUtil.IsInGpose) IsOpen = false;
|
||||
|
||||
if (!_mareCharaFileManager.CurrentlyWorking)
|
||||
{
|
||||
if (UiSharedService.IconTextButton(FontAwesomeIcon.FolderOpen, "Load MCDF"))
|
||||
{
|
||||
_fileDialogManager.OpenFileDialog("Pick MCDF file", ".mcdf", (success, path) =>
|
||||
{
|
||||
if (!success) return;
|
||||
|
||||
Task.Run(() => _mareCharaFileManager.LoadMareCharaFile(path));
|
||||
});
|
||||
}
|
||||
UiSharedService.AttachToolTip("Applies it to the currently selected GPose actor");
|
||||
if (_mareCharaFileManager.LoadedCharaFile != null)
|
||||
{
|
||||
UiSharedService.TextWrapped("Loaded file: " + _mareCharaFileManager.LoadedCharaFile.FilePath);
|
||||
UiSharedService.TextWrapped("File Description: " + _mareCharaFileManager.LoadedCharaFile.CharaFileData.Description);
|
||||
if (UiSharedService.IconTextButton(FontAwesomeIcon.Check, "Apply loaded MCDF"))
|
||||
{
|
||||
Task.Run(async () => await _mareCharaFileManager.ApplyMareCharaFile(_dalamudUtil.GposeTargetGameObject).ConfigureAwait(false));
|
||||
}
|
||||
UiSharedService.AttachToolTip("Applies it to the currently selected GPose actor");
|
||||
UiSharedService.ColorTextWrapped("Warning: redrawing or changing the character will revert all applied mods.", ImGuiColors.DalamudYellow);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
UiSharedService.ColorTextWrapped("Loading Character...", ImGuiColors.DalamudYellow);
|
||||
}
|
||||
UiSharedService.TextWrapped("Hint: You can disable the automatic loading of this window in the Mare settings and open it manually with /mare gpose");
|
||||
}
|
||||
|
||||
private void EndGpose()
|
||||
@@ -45,45 +80,4 @@ public class GposeUi : WindowMediatorSubscriberBase, IDisposable
|
||||
{
|
||||
IsOpen = _configService.Current.OpenGposeImportOnGposeStart;
|
||||
}
|
||||
|
||||
public override void Dispose()
|
||||
{
|
||||
base.Dispose();
|
||||
_windowSystem.RemoveWindow(this);
|
||||
}
|
||||
|
||||
public override void Draw()
|
||||
{
|
||||
if (!_dalamudUtil.IsInGpose) IsOpen = false;
|
||||
|
||||
if (!_mareCharaFileManager.CurrentlyWorking)
|
||||
{
|
||||
if (UiShared.IconTextButton(FontAwesomeIcon.FolderOpen, "Load MCDF"))
|
||||
{
|
||||
_fileDialogManager.OpenFileDialog("Pick MCDF file", ".mcdf", (success, path) =>
|
||||
{
|
||||
if (!success) return;
|
||||
|
||||
Task.Run(() => _mareCharaFileManager.LoadMareCharaFile(path));
|
||||
});
|
||||
}
|
||||
UiShared.AttachToolTip("Applies it to the currently selected GPose actor");
|
||||
if (_mareCharaFileManager.LoadedCharaFile != null)
|
||||
{
|
||||
UiShared.TextWrapped("Loaded file: " + _mareCharaFileManager.LoadedCharaFile.FilePath);
|
||||
UiShared.TextWrapped("File Description: " + _mareCharaFileManager.LoadedCharaFile.CharaFileData.Description);
|
||||
if (UiShared.IconTextButton(FontAwesomeIcon.Check, "Apply loaded MCDF"))
|
||||
{
|
||||
Task.Run(async () => await _mareCharaFileManager.ApplyMareCharaFile(_dalamudUtil.GposeTargetGameObject).ConfigureAwait(false));
|
||||
}
|
||||
UiShared.AttachToolTip("Applies it to the currently selected GPose actor");
|
||||
UiShared.ColorTextWrapped("Warning: redrawing or changing the character will revert all applied mods.", ImGuiColors.DalamudYellow);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
UiShared.ColorTextWrapped("Loading Character...", ImGuiColors.DalamudYellow);
|
||||
}
|
||||
UiShared.TextWrapped("Hint: You can disable the automatic loading of this window in the Mare settings and open it manually with /mare gpose");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user