MCDO fixes 2
implement RestoreThenUpload for charadata cleanup, actually show success/failure actually sort chara data list lmao add shared character data sets display to main ui (partial) increase size of mcdo table slightly fix selecting last new entry
This commit is contained in:
@@ -47,6 +47,19 @@ internal sealed partial class CharaDataHubUi : WindowMediatorSubscriberBase
|
||||
private bool _openMcdOnlineOnNextRun = false;
|
||||
private bool _readExport;
|
||||
private string _selectedDtoId = string.Empty;
|
||||
private string SelectedDtoId
|
||||
{
|
||||
get => _selectedDtoId;
|
||||
set
|
||||
{
|
||||
if (!string.Equals(_selectedDtoId, value, StringComparison.Ordinal))
|
||||
{
|
||||
_charaDataManager.UploadTask = null;
|
||||
_selectedDtoId = value;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
private string _selectedSpecificUserIndividual = string.Empty;
|
||||
private string _selectedSpecificGroupIndividual = string.Empty;
|
||||
private string _sharedWithYouDescriptionFilter = string.Empty;
|
||||
@@ -76,8 +89,17 @@ internal sealed partial class CharaDataHubUi : WindowMediatorSubscriberBase
|
||||
_fileDialogManager = fileDialogManager;
|
||||
_pairManager = pairManager;
|
||||
Mediator.Subscribe<GposeStartMessage>(this, (_) => IsOpen |= _configService.Current.OpenMareHubOnGposeStart);
|
||||
Mediator.Subscribe<OpenCharaDataHubWithFilterMessage>(this, (msg) =>
|
||||
{
|
||||
IsOpen = true;
|
||||
_openDataApplicationShared = true;
|
||||
_sharedWithYouOwnerFilter = msg.UserData.AliasOrUID;
|
||||
UpdateFilteredItems();
|
||||
});
|
||||
}
|
||||
|
||||
private bool _openDataApplicationShared = false;
|
||||
|
||||
public string CharaName(string name)
|
||||
{
|
||||
if (_abbreviateCharaName)
|
||||
@@ -98,7 +120,7 @@ internal sealed partial class CharaDataHubUi : WindowMediatorSubscriberBase
|
||||
}
|
||||
|
||||
_closalCts.Cancel();
|
||||
_selectedDtoId = string.Empty;
|
||||
SelectedDtoId = string.Empty;
|
||||
_filteredDict = null;
|
||||
_sharedWithYouOwnerFilter = string.Empty;
|
||||
_importCode = string.Empty;
|
||||
@@ -180,7 +202,7 @@ internal sealed partial class CharaDataHubUi : WindowMediatorSubscriberBase
|
||||
_isHandlingSelf = _charaDataManager.HandledCharaData.Any(c => c.IsSelf);
|
||||
if (_isHandlingSelf) _openMcdOnlineOnNextRun = false;
|
||||
|
||||
using (var applicationTabItem = ImRaii.TabItem("Data Application"))
|
||||
using (var applicationTabItem = ImRaii.TabItem("Data Application", _openDataApplicationShared ? ImGuiTabItemFlags.SetSelected : ImGuiTabItemFlags.None))
|
||||
{
|
||||
if (applicationTabItem)
|
||||
{
|
||||
@@ -216,7 +238,7 @@ internal sealed partial class CharaDataHubUi : WindowMediatorSubscriberBase
|
||||
}
|
||||
}
|
||||
|
||||
using (var gposeTabItem = ImRaii.TabItem("Apply Data"))
|
||||
using (var gposeTabItem = ImRaii.TabItem("Apply Data", _openDataApplicationShared ? ImGuiTabItemFlags.SetSelected : ImGuiTabItemFlags.None))
|
||||
{
|
||||
if (gposeTabItem)
|
||||
{
|
||||
@@ -677,7 +699,7 @@ internal sealed partial class CharaDataHubUi : WindowMediatorSubscriberBase
|
||||
}
|
||||
}
|
||||
|
||||
using (var sharedWithYouTabItem = ImRaii.TabItem("Shared With You"))
|
||||
using (var sharedWithYouTabItem = ImRaii.TabItem("Shared With You", _openDataApplicationShared ? ImGuiTabItemFlags.SetSelected : ImGuiTabItemFlags.None))
|
||||
{
|
||||
using var id = ImRaii.PushId("sharedWithYouTab");
|
||||
if (sharedWithYouTabItem)
|
||||
@@ -691,8 +713,12 @@ internal sealed partial class CharaDataHubUi : WindowMediatorSubscriberBase
|
||||
|
||||
DrawUpdateSharedDataButton();
|
||||
|
||||
|
||||
UiSharedService.DrawTree("Filters", () =>
|
||||
int activeFilters = 0;
|
||||
if (!string.IsNullOrEmpty(_sharedWithYouOwnerFilter)) activeFilters++;
|
||||
if (!string.IsNullOrEmpty(_sharedWithYouDescriptionFilter)) activeFilters++;
|
||||
if (_sharedWithYouDownloadableFilter) activeFilters++;
|
||||
string filtersText = activeFilters == 0 ? "Filters" : $"Filters ({activeFilters} active)";
|
||||
UiSharedService.DrawTree($"{filtersText}##filters", () =>
|
||||
{
|
||||
var filterWidth = ImGui.GetWindowContentRegionMax().X - ImGui.GetWindowContentRegionMin().X;
|
||||
ImGui.SetNextItemWidth(filterWidth);
|
||||
@@ -731,6 +757,9 @@ internal sealed partial class CharaDataHubUi : WindowMediatorSubscriberBase
|
||||
ImGuiHelpers.ScaledDummy(5);
|
||||
foreach (var entry in _filteredDict ?? [])
|
||||
{
|
||||
bool isFilteredAndHasToBeOpened = entry.Key.Contains(_sharedWithYouOwnerFilter) && _openDataApplicationShared;
|
||||
if (isFilteredAndHasToBeOpened)
|
||||
ImGui.SetNextItemOpen(isFilteredAndHasToBeOpened);
|
||||
UiSharedService.DrawTree($"{entry.Key} - [{entry.Value.Count} Character Data Sets]##{entry.Key}", () =>
|
||||
{
|
||||
foreach (var data in entry.Value)
|
||||
@@ -739,6 +768,8 @@ internal sealed partial class CharaDataHubUi : WindowMediatorSubscriberBase
|
||||
}
|
||||
ImGuiHelpers.ScaledDummy(5);
|
||||
});
|
||||
if (isFilteredAndHasToBeOpened)
|
||||
_openDataApplicationShared = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -912,7 +943,7 @@ internal sealed partial class CharaDataHubUi : WindowMediatorSubscriberBase
|
||||
{
|
||||
if (_uiSharedService.IconTextButton(FontAwesomeIcon.Edit, "Open in MCD Online Editor"))
|
||||
{
|
||||
_selectedDtoId = data.Id;
|
||||
SelectedDtoId = data.Id;
|
||||
_openMcdOnlineOnNextRun = true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user