FINALY !!!
This commit is contained in:
@@ -60,7 +60,7 @@ public class CompactUi : WindowMediatorSubscriberBase
|
||||
public CompactUi(ILogger<CompactUi> logger, UiSharedService uiShared, MareConfigService configService, ApiController apiController, PairManager pairManager, ChatService chatService,
|
||||
ServerConfigurationManager serverManager, MareMediator mediator, FileUploadManager fileTransferManager, UidDisplayHandler uidDisplayHandler, CharaDataManager charaDataManager,
|
||||
PerformanceCollectorService performanceCollectorService)
|
||||
: base(logger, mediator, "###UmbraSyncMainUI", performanceCollectorService)
|
||||
: base(logger, mediator, "###UmbraSyncSyncMainUI", performanceCollectorService)
|
||||
{
|
||||
_uiSharedService = uiShared;
|
||||
_configService = configService;
|
||||
@@ -80,11 +80,11 @@ public class CompactUi : WindowMediatorSubscriberBase
|
||||
#if DEBUG
|
||||
string dev = "Dev Build";
|
||||
var ver = Assembly.GetExecutingAssembly().GetName().Version!;
|
||||
WindowName = $"Umbra Sync {dev} ({ver.Major}.{ver.Minor}.{ver.Build})###UmbraSyncMainUIDev";
|
||||
WindowName = $"UmbraSync {dev} ({ver.Major}.{ver.Minor}.{ver.Build})###UmbraSyncSyncMainUIDev";
|
||||
Toggle();
|
||||
#else
|
||||
var ver = Assembly.GetExecutingAssembly().GetName().Version!;
|
||||
WindowName = "Umbra Sync " + ver.Major + "." + ver.Minor + "." + ver.Build + "###UmbraSyncMainUI";
|
||||
WindowName = "UmbraSync " + ver.Major + "." + ver.Minor + "." + ver.Build + "###UmbraSyncSyncMainUI";
|
||||
#endif
|
||||
Mediator.Subscribe<SwitchToMainUiMessage>(this, (_) => IsOpen = true);
|
||||
Mediator.Subscribe<SwitchToIntroUiMessage>(this, (_) => IsOpen = false);
|
||||
@@ -104,10 +104,7 @@ public class CompactUi : WindowMediatorSubscriberBase
|
||||
|
||||
protected override void DrawInternal()
|
||||
{
|
||||
if (_serverManager.CurrentApiUrl.Equals(ApiController.UmbraServiceUri, StringComparison.Ordinal))
|
||||
UiSharedService.AccentColor = new(0.4275f, 0.6863f, 1f, 1f);
|
||||
else
|
||||
UiSharedService.AccentColor = new Vector4(0.6f, 0.4f, 0.8f, 1f);
|
||||
UiSharedService.AccentColor = new Vector4(0.2f, 0.6f, 1f, 1f); // custom blue
|
||||
ImGui.SetCursorPosY(ImGui.GetCursorPosY() - ImGui.GetStyle().WindowPadding.Y - 1f * ImGuiHelpers.GlobalScale + ImGui.GetStyle().ItemSpacing.Y);
|
||||
WindowContentWidth = UiSharedService.GetWindowContentRegionWidth();
|
||||
if (!_apiController.IsCurrentVersion)
|
||||
@@ -121,8 +118,8 @@ public class CompactUi : WindowMediatorSubscriberBase
|
||||
ImGui.AlignTextToFramePadding();
|
||||
ImGui.TextColored(ImGuiColors.DalamudRed, unsupported);
|
||||
}
|
||||
UiSharedService.ColorTextWrapped($"Your Umbra installation is out of date, the current version is {ver.Major}.{ver.Minor}.{ver.Build}. " +
|
||||
$"It is highly recommended to keep Umbra up to date. Open /xlplugins and update the plugin.", ImGuiColors.DalamudRed);
|
||||
UiSharedService.ColorTextWrapped($"Your UmbraSync installation is out of date, the current version is {ver.Major}.{ver.Minor}.{ver.Build}. " +
|
||||
$"It is highly recommended to keep UmbraSync up to date. Open /xlplugins and update the plugin.", ImGuiColors.DalamudRed);
|
||||
}
|
||||
|
||||
using (ImRaii.PushId("header")) DrawUIDHeader();
|
||||
@@ -387,7 +384,7 @@ public class CompactUi : WindowMediatorSubscriberBase
|
||||
{
|
||||
ImGui.SetCursorPosX((ImGui.GetWindowContentRegionMin().X + UiSharedService.GetWindowContentRegionWidth()) / 2 - (userSize.X + textSize.X) / 2 - ImGui.GetStyle().ItemSpacing.X / 2);
|
||||
if (!printShard) ImGui.AlignTextToFramePadding();
|
||||
ImGui.TextColored(new Vector4(0.6f, 0.4f, 0.8f, 1f), userCount);
|
||||
ImGui.TextColored(ImGuiColors.ParsedBlue, userCount);
|
||||
ImGui.SameLine();
|
||||
if (!printShard) ImGui.AlignTextToFramePadding();
|
||||
ImGui.TextUnformatted("Users Online");
|
||||
@@ -410,7 +407,7 @@ public class CompactUi : WindowMediatorSubscriberBase
|
||||
{
|
||||
ImGui.SetCursorPosY(ImGui.GetCursorPosY() - ((userSize.Y + textSize.Y) / 2 + shardTextSize.Y) / 2 - ImGui.GetStyle().ItemSpacing.Y + buttonSize.Y / 2);
|
||||
}
|
||||
var color = !_serverManager.CurrentServer!.FullPause ? new Vector4(0.6f, 0.4f, 0.8f, 1f) : ImGuiColors.DalamudRed;
|
||||
var color = UiSharedService.GetBoolColor(!_serverManager.CurrentServer!.FullPause);
|
||||
var connectedIcon = !_serverManager.CurrentServer.FullPause ? FontAwesomeIcon.Link : FontAwesomeIcon.Unlink;
|
||||
|
||||
if (_apiController.ServerState is ServerState.Connected)
|
||||
@@ -525,7 +522,7 @@ public class CompactUi : WindowMediatorSubscriberBase
|
||||
{
|
||||
Mediator.Publish(new OpenSettingsUiMessage());
|
||||
}
|
||||
UiSharedService.AttachToolTip("Open the Umbra Settings");
|
||||
UiSharedService.AttachToolTip("Open the UmbraSync Settings");
|
||||
|
||||
ImGui.SameLine(); //Important to draw the uidText consistently
|
||||
ImGui.SetCursorPos(originalPos);
|
||||
@@ -595,7 +592,7 @@ public class CompactUi : WindowMediatorSubscriberBase
|
||||
{
|
||||
ServerState.Connecting => ImGuiColors.DalamudYellow,
|
||||
ServerState.Reconnecting => ImGuiColors.DalamudRed,
|
||||
ServerState.Connected => UiSharedService.AccentColor,
|
||||
ServerState.Connected => new Vector4(0.2f, 0.6f, 1f, 1f), // custom blue
|
||||
ServerState.Disconnected => ImGuiColors.DalamudYellow,
|
||||
ServerState.Disconnecting => ImGuiColors.DalamudYellow,
|
||||
ServerState.Unauthorized => ImGuiColors.DalamudRed,
|
||||
|
||||
@@ -163,13 +163,13 @@ public class DownloadUi : WindowMediatorSubscriberBase
|
||||
UiSharedService.Color(0, 0, 0, transparency), 1);
|
||||
drawList.AddRectFilled(dlBarStart with { X = dlBarStart.X - dlBarBorder, Y = dlBarStart.Y - dlBarBorder },
|
||||
dlBarEnd with { X = dlBarEnd.X + dlBarBorder, Y = dlBarEnd.Y + dlBarBorder },
|
||||
UiSharedService.Color(200, 170, 230, transparency), 1);
|
||||
UiSharedService.Color(220, 220, 255, transparency), 1);
|
||||
drawList.AddRectFilled(dlBarStart, dlBarEnd,
|
||||
UiSharedService.Color(0, 0, 0, transparency), 1);
|
||||
var dlProgressPercent = transferredBytes / (double)totalBytes;
|
||||
drawList.AddRectFilled(dlBarStart,
|
||||
dlBarEnd with { X = dlBarStart.X + (float)(dlProgressPercent * dlBarWidth) },
|
||||
UiSharedService.Color(153, 102, 204, transparency), 1);
|
||||
UiSharedService.Color(100, 100, 255, transparency), 1);
|
||||
|
||||
if (_configService.Current.TransferBarsShowText)
|
||||
{
|
||||
@@ -198,7 +198,7 @@ public class DownloadUi : WindowMediatorSubscriberBase
|
||||
var drawList = ImGui.GetBackgroundDrawList();
|
||||
UiSharedService.DrawOutlinedFont(drawList, uploadText,
|
||||
screenPos with { X = screenPos.X - textSize.X / 2f - 1, Y = screenPos.Y - textSize.Y / 2f - 1 },
|
||||
UiSharedService.Color(153, 102, 204, transparency),
|
||||
UiSharedService.Color(255, 255, 0, transparency),
|
||||
UiSharedService.Color(0, 0, 0, transparency), 2);
|
||||
}
|
||||
catch
|
||||
|
||||
@@ -106,9 +106,8 @@ public partial class IntroUi : WindowMediatorSubscriberBase
|
||||
{
|
||||
if (_uiShared.IsInGpose) return;
|
||||
|
||||
if ((!_configService.Current.AcceptedAgreement || _configService.Current.AcceptedTOSVersion != _configService.Current.ExpectedTOSVersion) && !_readFirstPage)
|
||||
if (!_configService.Current.AcceptedAgreement && !_readFirstPage)
|
||||
{
|
||||
// TODO: The UI bugs hard if this page *isn't* shown before the new TOS. There's probably a way around it.
|
||||
_uiShared.BigText("Welcome to Umbra");
|
||||
ImGui.Separator();
|
||||
UiSharedService.TextWrapped("Umbra is a plugin that will replicate your full current character state including all Penumbra mods to other paired users. " +
|
||||
@@ -126,7 +125,7 @@ public partial class IntroUi : WindowMediatorSubscriberBase
|
||||
#if !DEBUG
|
||||
_timeoutTask = Task.Run(async () =>
|
||||
{
|
||||
for (int i = 45; i > 0; i--)
|
||||
for (int i = 10; i > 0; i--)
|
||||
{
|
||||
_timeoutLabel = $"'I agree' button will be available in {i}s";
|
||||
await Task.Delay(TimeSpan.FromSeconds(1)).ConfigureAwait(false);
|
||||
@@ -137,7 +136,7 @@ public partial class IntroUi : WindowMediatorSubscriberBase
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else if ((!_configService.Current.AcceptedAgreement || _configService.Current.AcceptedTOSVersion != _configService.Current.ExpectedTOSVersion) && _readFirstPage)
|
||||
else if (!_configService.Current.AcceptedAgreement && _readFirstPage)
|
||||
{
|
||||
using (_uiShared.UidFont.Push())
|
||||
{
|
||||
@@ -152,7 +151,6 @@ public partial class IntroUi : WindowMediatorSubscriberBase
|
||||
UiSharedService.ColorText(readThis, ImGuiColors.DalamudRed);
|
||||
ImGui.SetWindowFontScale(1.0f);
|
||||
ImGui.Separator();
|
||||
|
||||
UiSharedService.TextWrapped("""
|
||||
To use Umbra, you must be over the age of 18, or 21 in some jurisdictions.
|
||||
""");
|
||||
@@ -172,7 +170,10 @@ public partial class IntroUi : WindowMediatorSubscriberBase
|
||||
Mod files that are saved on the service will remain on the service as long as there are requests for the files from clients. After a period of not being used, the mod files will be automatically deleted.
|
||||
""");
|
||||
UiSharedService.TextWrapped("""
|
||||
Umbra is operated from servers located in the European Union and Switzerland. You agree not to upload any content to the service that violates EU and CH law; and more specifically, German law for EU.
|
||||
Accounts that are inactive for ninety (90) days will be deleted for privacy reasons.
|
||||
""");
|
||||
UiSharedService.TextWrapped("""
|
||||
Umbra is operated from servers located in the European Union. You agree not to upload any content to the service that violates EU law; and more specifically, German law.
|
||||
""");
|
||||
UiSharedService.TextWrapped("""
|
||||
You may delete your account at any time from within the Settings panel of the plugin. Any mods unique to you will then be removed from the server within 14 days.
|
||||
@@ -187,7 +188,6 @@ public partial class IntroUi : WindowMediatorSubscriberBase
|
||||
if (ImGui.Button("I agree##toSetup"))
|
||||
{
|
||||
_configService.Current.AcceptedAgreement = true;
|
||||
_configService.Current.AcceptedTOSVersion = _configService.Current.ExpectedTOSVersion;
|
||||
_configService.Save();
|
||||
}
|
||||
}
|
||||
@@ -196,7 +196,7 @@ public partial class IntroUi : WindowMediatorSubscriberBase
|
||||
UiSharedService.TextWrapped(_timeoutLabel);
|
||||
}
|
||||
}
|
||||
else if ((!_configService.Current.AcceptedAgreement || _configService.Current.AcceptedTOSVersion != _configService.Current.ExpectedTOSVersion)
|
||||
else if (_configService.Current.AcceptedAgreement
|
||||
&& (string.IsNullOrEmpty(_configService.Current.CacheFolder)
|
||||
|| !_configService.Current.InitialScanComplete
|
||||
|| !Directory.Exists(_configService.Current.CacheFolder)))
|
||||
|
||||
@@ -851,16 +851,6 @@ public partial class UiSharedService : DisposableMediatorSubscriberBase
|
||||
ImGui.TextColored(ImGuiColors.DalamudRed, "You need to install both Penumbra and Glamourer and keep them up to date to use Umbra.");
|
||||
return false;
|
||||
}
|
||||
else if (NoSnapService.AnyLoaded)
|
||||
{
|
||||
IconText(FontAwesomeIcon.ExclamationTriangle, ImGuiColors.DalamudYellow);
|
||||
ImGui.SameLine();
|
||||
var cursorX = ImGui.GetCursorPosX();
|
||||
ImGui.TextColored(ImGuiColors.DalamudYellow, "Synced player appearances will not apply until incompatible plugins are disabled:");
|
||||
ImGui.SetCursorPosX(cursorX + 16.0f);
|
||||
ImGui.TextColored(ImGuiColors.DalamudYellow, NoSnapService.ActivePlugins);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user