Préparation traduction en => fr Part1

This commit is contained in:
2025-09-21 11:27:19 +02:00
parent 78089a9fc7
commit 17aa6e247c
10 changed files with 616 additions and 98 deletions

View File

@@ -9,6 +9,7 @@ using MareSynchronos.API.Data;
using MareSynchronos.API.Data.Comparer;
using MareSynchronos.FileCache;
using MareSynchronos.Interop.Ipc;
using MareSynchronos.Localization;
using MareSynchronos.MareConfiguration;
using MareSynchronos.MareConfiguration.Models;
using MareSynchronos.PlayerData.Handlers;
@@ -134,6 +135,11 @@ public class SettingsUi : WindowMediatorSubscriberBase
base.OnClose();
}
private string L(string key, string fallback, params object[] args)
{
return _uiShared.Localize(key, fallback, args);
}
private void DrawBlockedTransfers()
{
_lastTab = "BlockedTransfers";
@@ -171,13 +177,13 @@ public class SettingsUi : WindowMediatorSubscriberBase
private void DrawCurrentTransfers()
{
_lastTab = "Transfers";
_uiShared.BigText("Transfer Settings");
_uiShared.BigText(L("Settings.Transfers.Heading", "Transfer Settings"));
int maxParallelDownloads = _configService.Current.ParallelDownloads;
int downloadSpeedLimit = _configService.Current.DownloadSpeedLimitInBytes;
ImGui.AlignTextToFramePadding();
ImGui.TextUnformatted("Global Download Speed Limit");
ImGui.TextUnformatted(L("Settings.Transfers.GlobalLimit.Label", "Global Download Speed Limit"));
ImGui.SameLine();
ImGui.SetNextItemWidth(100 * ImGuiHelpers.GlobalScale);
if (ImGui.InputInt("###speedlimit", ref downloadSpeedLimit))
@@ -191,9 +197,9 @@ public class SettingsUi : WindowMediatorSubscriberBase
_uiShared.DrawCombo("###speed", [DownloadSpeeds.Bps, DownloadSpeeds.KBps, DownloadSpeeds.MBps],
(s) => s switch
{
DownloadSpeeds.Bps => "Byte/s",
DownloadSpeeds.KBps => "KB/s",
DownloadSpeeds.MBps => "MB/s",
DownloadSpeeds.Bps => L("Settings.Transfers.GlobalLimit.Unit.BytePerSec", "Byte/s"),
DownloadSpeeds.KBps => L("Settings.Transfers.GlobalLimit.Unit.KiloBytePerSec", "KB/s"),
DownloadSpeeds.MBps => L("Settings.Transfers.GlobalLimit.Unit.MegaBytePerSec", "MB/s"),
_ => throw new NotSupportedException()
}, (s) =>
{
@@ -203,19 +209,19 @@ public class SettingsUi : WindowMediatorSubscriberBase
}, _configService.Current.DownloadSpeedType);
ImGui.SameLine();
ImGui.AlignTextToFramePadding();
ImGui.TextUnformatted("0 = No limit/infinite");
ImGui.TextUnformatted(L("Settings.Transfers.GlobalLimit.Hint", "0 = No limit/infinite"));
ImGui.SetNextItemWidth(250 * ImGuiHelpers.GlobalScale);
if (ImGui.SliderInt("Maximum Parallel Downloads", ref maxParallelDownloads, 1, 10))
if (ImGui.SliderInt(L("Settings.Transfers.MaxParallelDownloads", "Maximum Parallel Downloads"), ref maxParallelDownloads, 1, 10))
{
_configService.Current.ParallelDownloads = maxParallelDownloads;
_configService.Save();
}
ImGui.Separator();
_uiShared.BigText("AutoDetect");
_uiShared.BigText(L("Settings.Transfers.AutoDetect.Heading", "AutoDetect"));
bool enableDiscovery = _configService.Current.EnableAutoDetectDiscovery;
if (ImGui.Checkbox("Enable Nearby detection (beta)", ref enableDiscovery))
if (ImGui.Checkbox(L("Settings.Transfers.AutoDetect.EnableNearby", "Enable Nearby detection (beta)"), ref enableDiscovery))
{
_configService.Current.EnableAutoDetectDiscovery = enableDiscovery;
_configService.Save();
@@ -236,7 +242,7 @@ public class SettingsUi : WindowMediatorSubscriberBase
using (ImRaii.Disabled(!enableDiscovery))
{
bool allowRequests = _configService.Current.AllowAutoDetectPairRequests;
if (ImGui.Checkbox("Allow pair requests", ref allowRequests))
if (ImGui.Checkbox(L("Settings.Transfers.AutoDetect.AllowRequests", "Allow pair requests"), ref allowRequests))
{
_configService.Current.AllowAutoDetectPairRequests = allowRequests;
_configService.Save();
@@ -246,8 +252,10 @@ public class SettingsUi : WindowMediatorSubscriberBase
// user-facing info toast
Mediator.Publish(new NotificationMessage(
"Nearby Detection",
allowRequests ? "Pair requests enabled: others can invite you." : "Pair requests disabled: others cannot invite you.",
L("Settings.Transfers.AutoDetect.Notification.Title", "Nearby Detection"),
allowRequests
? L("Settings.Transfers.AutoDetect.Notification.Enabled", "Pair requests enabled: others can invite you.")
: L("Settings.Transfers.AutoDetect.Notification.Disabled", "Pair requests disabled: others cannot invite you."),
NotificationType.Info,
default));
}
@@ -259,7 +267,7 @@ public class SettingsUi : WindowMediatorSubscriberBase
ImGui.Indent();
int maxMeters = _configService.Current.AutoDetectMaxDistanceMeters;
ImGui.SetNextItemWidth(200 * ImGuiHelpers.GlobalScale);
if (ImGui.SliderInt("Max distance (meters)", ref maxMeters, 5, 100))
if (ImGui.SliderInt(L("Settings.Transfers.AutoDetect.MaxDistance", "Max distance (meters)"), ref maxMeters, 5, 100))
{
_configService.Current.AutoDetectMaxDistanceMeters = maxMeters;
_configService.Save();
@@ -268,23 +276,20 @@ public class SettingsUi : WindowMediatorSubscriberBase
}
ImGui.Separator();
_uiShared.BigText("Transfer UI");
_uiShared.BigText(L("Settings.Transfers.UI.Heading", "Transfer UI"));
bool showTransferWindow = _configService.Current.ShowTransferWindow;
if (ImGui.Checkbox("Show separate transfer window", ref showTransferWindow))
if (ImGui.Checkbox(L("Settings.Transfers.UI.ShowWindow", "Show separate transfer window"), ref showTransferWindow))
{
_configService.Current.ShowTransferWindow = showTransferWindow;
_configService.Save();
}
_uiShared.DrawHelpText($"The download window will show the current progress of outstanding downloads.{Environment.NewLine}{Environment.NewLine}" +
$"What do W/Q/P/D stand for?{Environment.NewLine}W = Waiting for Slot (see Maximum Parallel Downloads){Environment.NewLine}" +
$"Q = Queued on Server, waiting for queue ready signal{Environment.NewLine}" +
$"P = Processing download (aka downloading){Environment.NewLine}" +
$"D = Decompressing download");
_uiShared.DrawHelpText(L("Settings.Transfers.UI.ShowWindow.Description",
"The download window will show the current progress of outstanding downloads.\n\nWhat do W/Q/P/D stand for?\nW = Waiting for Slot (see Maximum Parallel Downloads)\nQ = Queued on Server, waiting for queue ready signal\nP = Processing download (aka downloading)\nD = Decompressing download"));
if (!_configService.Current.ShowTransferWindow) ImGui.BeginDisabled();
ImGui.Indent();
bool editTransferWindowPosition = _uiShared.EditTrackerPosition;
if (ImGui.Checkbox("Edit Transfer Window position", ref editTransferWindowPosition))
if (ImGui.Checkbox(L("Settings.Transfers.UI.EditWindowPosition", "Edit Transfer Window position"), ref editTransferWindowPosition))
{
_uiShared.EditTrackerPosition = editTransferWindowPosition;
}
@@ -292,60 +297,60 @@ public class SettingsUi : WindowMediatorSubscriberBase
if (!_configService.Current.ShowTransferWindow) ImGui.EndDisabled();
bool showTransferBars = _configService.Current.ShowTransferBars;
if (ImGui.Checkbox("Show transfer bars rendered below players", ref showTransferBars))
if (ImGui.Checkbox(L("Settings.Transfers.UI.ShowTransferBars", "Show transfer bars rendered below players"), ref showTransferBars))
{
_configService.Current.ShowTransferBars = showTransferBars;
_configService.Save();
}
_uiShared.DrawHelpText("This will render a progress bar during the download at the feet of the player you are downloading from.");
_uiShared.DrawHelpText(L("Settings.Transfers.UI.ShowTransferBars.Description", "This will render a progress bar during the download at the feet of the player you are downloading from."));
if (!showTransferBars) ImGui.BeginDisabled();
ImGui.Indent();
bool transferBarShowText = _configService.Current.TransferBarsShowText;
if (ImGui.Checkbox("Show Download Text", ref transferBarShowText))
if (ImGui.Checkbox(L("Settings.Transfers.UI.ShowDownloadText", "Show Download Text"), ref transferBarShowText))
{
_configService.Current.TransferBarsShowText = transferBarShowText;
_configService.Save();
}
_uiShared.DrawHelpText("Shows download text (amount of MiB downloaded) in the transfer bars");
_uiShared.DrawHelpText(L("Settings.Transfers.UI.ShowDownloadText.Description", "Shows download text (amount of MiB downloaded) in the transfer bars"));
int transferBarWidth = _configService.Current.TransferBarsWidth;
ImGui.SetNextItemWidth(250 * ImGuiHelpers.GlobalScale);
if (ImGui.SliderInt("Transfer Bar Width", ref transferBarWidth, 0, 500))
if (ImGui.SliderInt(L("Settings.Transfers.UI.BarWidth", "Transfer Bar Width"), ref transferBarWidth, 0, 500))
{
if (transferBarWidth < 10)
transferBarWidth = 10;
_configService.Current.TransferBarsWidth = transferBarWidth;
_configService.Save();
}
_uiShared.DrawHelpText("Width of the displayed transfer bars (will never be less wide than the displayed text)");
_uiShared.DrawHelpText(L("Settings.Transfers.UI.BarWidth.Description", "Width of the displayed transfer bars (will never be less wide than the displayed text)"));
int transferBarHeight = _configService.Current.TransferBarsHeight;
ImGui.SetNextItemWidth(250 * ImGuiHelpers.GlobalScale);
if (ImGui.SliderInt("Transfer Bar Height", ref transferBarHeight, 0, 50))
if (ImGui.SliderInt(L("Settings.Transfers.UI.BarHeight", "Transfer Bar Height"), ref transferBarHeight, 0, 50))
{
if (transferBarHeight < 2)
transferBarHeight = 2;
_configService.Current.TransferBarsHeight = transferBarHeight;
_configService.Save();
}
_uiShared.DrawHelpText("Height of the displayed transfer bars (will never be less tall than the displayed text)");
_uiShared.DrawHelpText(L("Settings.Transfers.UI.BarHeight.Description", "Height of the displayed transfer bars (will never be less tall than the displayed text)"));
bool showUploading = _configService.Current.ShowUploading;
if (ImGui.Checkbox("Show 'Uploading' text below players that are currently uploading", ref showUploading))
if (ImGui.Checkbox(L("Settings.Transfers.UI.ShowUploading", "Show 'Uploading' text below players that are currently uploading"), ref showUploading))
{
_configService.Current.ShowUploading = showUploading;
_configService.Save();
}
_uiShared.DrawHelpText("This will render an 'Uploading' text at the feet of the player that is in progress of uploading data.");
_uiShared.DrawHelpText(L("Settings.Transfers.UI.ShowUploading.Description", "This will render an 'Uploading' text at the feet of the player that is in progress of uploading data."));
ImGui.Unindent();
if (!showUploading) ImGui.BeginDisabled();
ImGui.Indent();
bool showUploadingBigText = _configService.Current.ShowUploadingBigText;
if (ImGui.Checkbox("Large font for 'Uploading' text", ref showUploadingBigText))
if (ImGui.Checkbox(L("Settings.Transfers.UI.ShowUploadingBigText", "Large font for 'Uploading' text"), ref showUploadingBigText))
{
_configService.Current.ShowUploadingBigText = showUploadingBigText;
_configService.Save();
}
_uiShared.DrawHelpText("This will render an 'Uploading' text in a larger font.");
_uiShared.DrawHelpText(L("Settings.Transfers.UI.ShowUploadingBigText.Description", "This will render an 'Uploading' text in a larger font."));
ImGui.Unindent();
@@ -970,12 +975,30 @@ public class SettingsUi : WindowMediatorSubscriberBase
_lastTab = "General";
_uiShared.BigText("Notes");
if (_uiShared.IconTextButton(FontAwesomeIcon.StickyNote, "Export all your user notes to clipboard"))
_uiShared.BigText(L("Settings.General.LocalizationHeading", "Localization"));
ImGui.SetNextItemWidth(250 * ImGuiHelpers.GlobalScale);
_uiShared.DrawCombo(
L("Settings.General.Language", "Language") + "###settings-language",
LocalizationService.SupportedLanguages,
lang => _uiShared.Localization.GetLanguageDisplayName(lang),
selectedLanguage =>
{
if (selectedLanguage == _configService.Current.Language) return;
_configService.Current.Language = selectedLanguage;
_configService.Save();
_uiShared.Localization.ReloadAll();
},
_configService.Current.Language);
_uiShared.DrawHelpText(L("Settings.General.Language.Description", "Select the plugin language. Any missing translations will be shown in English."));
ImGui.Separator();
_uiShared.BigText(L("Settings.General.NotesHeading", "Notes"));
if (_uiShared.IconTextButton(FontAwesomeIcon.StickyNote, L("Settings.General.Notes.Export", "Export all your user notes to clipboard")))
{
ImGui.SetClipboardText(UiSharedService.GetNotes(_pairManager.DirectPairs.UnionBy(_pairManager.GroupPairs.SelectMany(p => p.Value), p => p.UserData, UserDataComparer.Instance).ToList()));
}
if (_uiShared.IconTextButton(FontAwesomeIcon.FileImport, "Import notes from clipboard"))
if (_uiShared.IconTextButton(FontAwesomeIcon.FileImport, L("Settings.General.Notes.Import", "Import notes from clipboard")))
{
_notesSuccessfullyApplied = null;
var notes = ImGui.GetClipboardText();
@@ -983,28 +1006,28 @@ public class SettingsUi : WindowMediatorSubscriberBase
}
ImGui.SameLine();
ImGui.Checkbox("Overwrite existing notes", ref _overwriteExistingLabels);
_uiShared.DrawHelpText("If this option is selected all already existing notes for UIDs will be overwritten by the imported notes.");
ImGui.Checkbox(L("Settings.General.Notes.Overwrite", "Overwrite existing notes"), ref _overwriteExistingLabels);
_uiShared.DrawHelpText(L("Settings.General.Notes.Overwrite.Description", "If this option is selected all already existing notes for UIDs will be overwritten by the imported notes."));
if (_notesSuccessfullyApplied.HasValue && _notesSuccessfullyApplied.Value)
{
UiSharedService.ColorTextWrapped("User Notes successfully imported", UiSharedService.AccentColor);
UiSharedService.ColorTextWrapped(L("Settings.General.Notes.Import.Success", "User Notes successfully imported"), UiSharedService.AccentColor);
}
else if (_notesSuccessfullyApplied.HasValue && !_notesSuccessfullyApplied.Value)
{
UiSharedService.ColorTextWrapped("Attempt to import notes from clipboard failed. Check formatting and try again", ImGuiColors.DalamudRed);
UiSharedService.ColorTextWrapped(L("Settings.General.Notes.Import.Failure", "Attempt to import notes from clipboard failed. Check formatting and try again"), ImGuiColors.DalamudRed);
}
var openPopupOnAddition = _configService.Current.OpenPopupOnAdd;
if (ImGui.Checkbox("Open Notes Popup on user addition", ref openPopupOnAddition))
if (ImGui.Checkbox(L("Settings.General.Notes.OpenPopup", "Open Notes Popup on user addition"), ref openPopupOnAddition))
{
_configService.Current.OpenPopupOnAdd = openPopupOnAddition;
_configService.Save();
}
_uiShared.DrawHelpText("This will open a popup that allows you to set the notes for a user after successfully adding them to your individual pairs.");
_uiShared.DrawHelpText(L("Settings.General.Notes.OpenPopup.Description", "This will open a popup that allows you to set the notes for a user after successfully adding them to your individual pairs."));
ImGui.Separator();
_uiShared.BigText("UI");
_uiShared.BigText(L("Settings.UI.Heading", "UI"));
var showCharacterNames = _configService.Current.ShowCharacterNames;
var showVisibleSeparate = _configService.Current.ShowVisibleUsersSeparately;
var showOfflineSeparate = _configService.Current.ShowOfflineUsersSeparately;
@@ -1021,30 +1044,30 @@ public class SettingsUi : WindowMediatorSubscriberBase
var dtrColorsNotConnected = _configService.Current.DtrColorsNotConnected;
var dtrColorsPairsInRange = _configService.Current.DtrColorsPairsInRange;
if (ImGui.Checkbox("Enable Game Right Click Menu Entries", ref enableRightClickMenu))
if (ImGui.Checkbox(L("Settings.UI.EnableRightClick", "Enable Game Right Click Menu Entries"), ref enableRightClickMenu))
{
_configService.Current.EnableRightClickMenus = enableRightClickMenu;
_configService.Save();
}
_uiShared.DrawHelpText("This will add Umbra related right click menu entries in the game UI on paired players.");
_uiShared.DrawHelpText(L("Settings.UI.EnableRightClick.Description", "This will add Umbra related right click menu entries in the game UI on paired players."));
if (ImGui.Checkbox("Display status and visible pair count in Server Info Bar", ref enableDtrEntry))
if (ImGui.Checkbox(L("Settings.UI.EnableDtrEntry", "Display status and visible pair count in Server Info Bar"), ref enableDtrEntry))
{
_configService.Current.EnableDtrEntry = enableDtrEntry;
_configService.Save();
}
_uiShared.DrawHelpText("This will add Umbra connection status and visible pair count in the Server Info Bar.\nYou can further configure this through your Dalamud Settings.");
_uiShared.DrawHelpText(L("Settings.UI.EnableDtrEntry.Description", "This will add Umbra connection status and visible pair count in the Server Info Bar.\nYou can further configure this through your Dalamud Settings."));
using (ImRaii.Disabled(!enableDtrEntry))
{
using var indent = ImRaii.PushIndent();
if (ImGui.Checkbox("Show visible character's UID in tooltip", ref showUidInDtrTooltip))
if (ImGui.Checkbox(L("Settings.UI.Dtr.ShowUid", "Show visible character's UID in tooltip"), ref showUidInDtrTooltip))
{
_configService.Current.ShowUidInDtrTooltip = showUidInDtrTooltip;
_configService.Save();
}
if (ImGui.Checkbox("Prefer notes over player names in tooltip", ref preferNoteInDtrTooltip))
if (ImGui.Checkbox(L("Settings.UI.Dtr.PreferNotes", "Prefer notes over player names in tooltip"), ref preferNoteInDtrTooltip))
{
_configService.Current.PreferNoteInDtrTooltip = preferNoteInDtrTooltip;
_configService.Save();
@@ -1052,7 +1075,7 @@ public class SettingsUi : WindowMediatorSubscriberBase
DrawDtrStyleCombo();
if (ImGui.Checkbox("Color-code the Server Info Bar entry according to status", ref useColorsInDtr))
if (ImGui.Checkbox(L("Settings.UI.Dtr.UseColors", "Color-code the Server Info Bar entry according to status"), ref useColorsInDtr))
{
_configService.Current.UseColorsInDtr = useColorsInDtr;
_configService.Save();
@@ -1061,21 +1084,21 @@ public class SettingsUi : WindowMediatorSubscriberBase
using (ImRaii.Disabled(!useColorsInDtr))
{
using var indent2 = ImRaii.PushIndent();
if (InputDtrColors("Default", ref dtrColorsDefault))
if (InputDtrColors(L("Settings.UI.Dtr.ColorDefault", "Default"), ref dtrColorsDefault))
{
_configService.Current.DtrColorsDefault = dtrColorsDefault;
_configService.Save();
}
ImGui.SameLine();
if (InputDtrColors("Not Connected", ref dtrColorsNotConnected))
if (InputDtrColors(L("Settings.UI.Dtr.ColorNotConnected", "Not Connected"), ref dtrColorsNotConnected))
{
_configService.Current.DtrColorsNotConnected = dtrColorsNotConnected;
_configService.Save();
}
ImGui.SameLine();
if (InputDtrColors("Pairs in Range", ref dtrColorsPairsInRange))
if (InputDtrColors(L("Settings.UI.Dtr.ColorPairsInRange", "Pairs in Range"), ref dtrColorsPairsInRange))
{
_configService.Current.DtrColorsPairsInRange = dtrColorsPairsInRange;
_configService.Save();
@@ -1086,7 +1109,7 @@ public class SettingsUi : WindowMediatorSubscriberBase
var useNameColors = _configService.Current.UseNameColors;
var nameColors = _configService.Current.NameColors;
var autoPausedNameColors = _configService.Current.BlockedNameColors;
if (ImGui.Checkbox("Color nameplates of paired players", ref useNameColors))
if (ImGui.Checkbox(L("Settings.UI.NameColors.Enable", "Color nameplates of paired players"), ref useNameColors))
{
_configService.Current.UseNameColors = useNameColors;
_configService.Save();
@@ -1096,7 +1119,7 @@ public class SettingsUi : WindowMediatorSubscriberBase
using (ImRaii.Disabled(!useNameColors))
{
using var indent = ImRaii.PushIndent();
if (InputDtrColors("Character Name Color", ref nameColors))
if (InputDtrColors(L("Settings.UI.NameColors.Character", "Character Name Color"), ref nameColors))
{
_configService.Current.NameColors = nameColors;
_configService.Save();
@@ -1105,7 +1128,7 @@ public class SettingsUi : WindowMediatorSubscriberBase
ImGui.SameLine();
if (InputDtrColors("Blocked Character Color", ref autoPausedNameColors))
if (InputDtrColors(L("Settings.UI.NameColors.Blocked", "Blocked Character Color"), ref autoPausedNameColors))
{
_configService.Current.BlockedNameColors = autoPausedNameColors;
_configService.Save();
@@ -1113,59 +1136,59 @@ public class SettingsUi : WindowMediatorSubscriberBase
}
}
if (ImGui.Checkbox("Show separate Visible group", ref showVisibleSeparate))
if (ImGui.Checkbox(L("Settings.UI.VisibleGroup", "Show separate Visible group"), ref showVisibleSeparate))
{
_configService.Current.ShowVisibleUsersSeparately = showVisibleSeparate;
_configService.Save();
}
_uiShared.DrawHelpText("This will show all currently visible users in a special 'Visible' group in the main UI.");
_uiShared.DrawHelpText(L("Settings.UI.VisibleGroup.Description", "This will show all currently visible users in a special 'Visible' group in the main UI."));
if (ImGui.Checkbox("Show separate Offline group", ref showOfflineSeparate))
if (ImGui.Checkbox(L("Settings.UI.OfflineGroup", "Show separate Offline group"), ref showOfflineSeparate))
{
_configService.Current.ShowOfflineUsersSeparately = showOfflineSeparate;
_configService.Save();
}
_uiShared.DrawHelpText("This will show all currently offline users in a special 'Offline' group in the main UI.");
_uiShared.DrawHelpText(L("Settings.UI.OfflineGroup.Description", "This will show all currently offline users in a special 'Offline' group in the main UI."));
if (ImGui.Checkbox("Show player names", ref showCharacterNames))
if (ImGui.Checkbox(L("Settings.UI.ShowPlayerNames", "Show player names"), ref showCharacterNames))
{
_configService.Current.ShowCharacterNames = showCharacterNames;
_configService.Save();
}
_uiShared.DrawHelpText("This will show character names instead of UIDs when possible");
_uiShared.DrawHelpText(L("Settings.UI.ShowPlayerNames.Description", "This will show character names instead of UIDs when possible"));
if (ImGui.Checkbox("Show Profiles on Hover", ref showProfiles))
if (ImGui.Checkbox(L("Settings.UI.Profiles.Show", "Show Profiles on Hover"), ref showProfiles))
{
Mediator.Publish(new ClearProfileDataMessage());
_configService.Current.ProfilesShow = showProfiles;
_configService.Save();
}
_uiShared.DrawHelpText("This will show the configured user profile after a set delay");
_uiShared.DrawHelpText(L("Settings.UI.Profiles.Show.Description", "This will show the configured user profile after a set delay"));
ImGui.Indent();
if (!showProfiles) ImGui.BeginDisabled();
if (ImGui.Checkbox("Popout profiles on the right", ref profileOnRight))
if (ImGui.Checkbox(L("Settings.UI.Profiles.PopoutRight", "Popout profiles on the right"), ref profileOnRight))
{
_configService.Current.ProfilePopoutRight = profileOnRight;
_configService.Save();
Mediator.Publish(new CompactUiChange(Vector2.Zero, Vector2.Zero));
}
_uiShared.DrawHelpText("Will show profiles on the right side of the main UI");
_uiShared.DrawHelpText(L("Settings.UI.Profiles.PopoutRight.Description", "Will show profiles on the right side of the main UI"));
ImGui.SetNextItemWidth(250 * ImGuiHelpers.GlobalScale);
if (ImGui.SliderFloat("Hover Delay", ref profileDelay, 1, 10))
if (ImGui.SliderFloat(L("Settings.UI.Profiles.HoverDelay", "Hover Delay"), ref profileDelay, 1, 10))
{
_configService.Current.ProfileDelay = profileDelay;
_configService.Save();
}
_uiShared.DrawHelpText("Delay until the profile should be displayed");
_uiShared.DrawHelpText(L("Settings.UI.Profiles.HoverDelay.Description", "Delay until the profile should be displayed"));
if (!showProfiles) ImGui.EndDisabled();
ImGui.Unindent();
if (ImGui.Checkbox("Show profiles marked as NSFW", ref showNsfwProfiles))
if (ImGui.Checkbox(L("Settings.UI.Profiles.ShowNsfw", "Show profiles marked as NSFW"), ref showNsfwProfiles))
{
Mediator.Publish(new ClearProfileDataMessage());
_configService.Current.ProfilesAllowNsfw = showNsfwProfiles;
_configService.Save();
}
_uiShared.DrawHelpText("Will show profiles that have the NSFW tag enabled");
_uiShared.DrawHelpText(L("Settings.UI.Profiles.ShowNsfw.Description", "Will show profiles that have the NSFW tag enabled"));
ImGui.Separator();
@@ -1176,72 +1199,69 @@ public class SettingsUi : WindowMediatorSubscriberBase
_uiShared.BigText("Notifications");
ImGui.SetNextItemWidth(250 * ImGuiHelpers.GlobalScale);
_uiShared.DrawCombo("Info Notification Display##settingsUi", (NotificationLocation[])Enum.GetValues(typeof(NotificationLocation)), (i) => i.ToString(),
_uiShared.DrawCombo(L("Settings.Notifications.InfoDisplay", "Info Notification Display") + "##settingsUi",
(NotificationLocation[])Enum.GetValues(typeof(NotificationLocation)),
i => L($"Settings.Notifications.Location.{i}", i.ToString()),
(i) =>
{
_configService.Current.InfoNotification = i;
_configService.Save();
}, _configService.Current.InfoNotification);
_uiShared.DrawHelpText("The location where \"Info\" notifications will display."
+ Environment.NewLine + "'Nowhere' will not show any Info notifications"
+ Environment.NewLine + "'Chat' will print Info notifications in chat"
+ Environment.NewLine + "'Toast' will show Warning toast notifications in the bottom right corner"
+ Environment.NewLine + "'Both' will show chat as well as the toast notification");
_uiShared.DrawHelpText(L("Settings.Notifications.InfoDisplay.Description",
"The location where \"Info\" notifications will display.\n'Nowhere' will not show any Info notifications\n'Chat' will print Info notifications in chat\n'Toast' will show Warning toast notifications in the bottom right corner\n'Both' will show chat as well as the toast notification"));
ImGui.SetNextItemWidth(250 * ImGuiHelpers.GlobalScale);
_uiShared.DrawCombo("Warning Notification Display##settingsUi", (NotificationLocation[])Enum.GetValues(typeof(NotificationLocation)), (i) => i.ToString(),
_uiShared.DrawCombo(L("Settings.Notifications.WarningDisplay", "Warning Notification Display") + "##settingsUi",
(NotificationLocation[])Enum.GetValues(typeof(NotificationLocation)),
i => L($"Settings.Notifications.Location.{i}", i.ToString()),
(i) =>
{
_configService.Current.WarningNotification = i;
_configService.Save();
}, _configService.Current.WarningNotification);
_uiShared.DrawHelpText("The location where \"Warning\" notifications will display."
+ Environment.NewLine + "'Nowhere' will not show any Warning notifications"
+ Environment.NewLine + "'Chat' will print Warning notifications in chat"
+ Environment.NewLine + "'Toast' will show Warning toast notifications in the bottom right corner"
+ Environment.NewLine + "'Both' will show chat as well as the toast notification");
_uiShared.DrawHelpText(L("Settings.Notifications.WarningDisplay.Description",
"The location where \"Warning\" notifications will display.\n'Nowhere' will not show any Warning notifications\n'Chat' will print Warning notifications in chat\n'Toast' will show Warning toast notifications in the bottom right corner\n'Both' will show chat as well as the toast notification"));
ImGui.SetNextItemWidth(250 * ImGuiHelpers.GlobalScale);
_uiShared.DrawCombo("Error Notification Display##settingsUi", (NotificationLocation[])Enum.GetValues(typeof(NotificationLocation)), (i) => i.ToString(),
_uiShared.DrawCombo(L("Settings.Notifications.ErrorDisplay", "Error Notification Display") + "##settingsUi",
(NotificationLocation[])Enum.GetValues(typeof(NotificationLocation)),
i => L($"Settings.Notifications.Location.{i}", i.ToString()),
(i) =>
{
_configService.Current.ErrorNotification = i;
_configService.Save();
}, _configService.Current.ErrorNotification);
_uiShared.DrawHelpText("The location where \"Error\" notifications will display."
+ Environment.NewLine + "'Nowhere' will not show any Error notifications"
+ Environment.NewLine + "'Chat' will print Error notifications in chat"
+ Environment.NewLine + "'Toast' will show Error toast notifications in the bottom right corner"
+ Environment.NewLine + "'Both' will show chat as well as the toast notification");
_uiShared.DrawHelpText(L("Settings.Notifications.ErrorDisplay.Description",
"The location where \"Error\" notifications will display.\n'Nowhere' will not show any Error notifications\n'Chat' will print Error notifications in chat\n'Toast' will show Error toast notifications in the bottom right corner\n'Both' will show chat as well as the toast notification"));
if (ImGui.Checkbox("Disable optional plugin warnings", ref disableOptionalPluginWarnings))
if (ImGui.Checkbox(L("Settings.Notifications.DisableOptionalWarnings", "Disable optional plugin warnings"), ref disableOptionalPluginWarnings))
{
_configService.Current.DisableOptionalPluginWarnings = disableOptionalPluginWarnings;
_configService.Save();
}
_uiShared.DrawHelpText("Enabling this will not show any \"Warning\" labeled messages for missing optional plugins.");
if (ImGui.Checkbox("Enable online notifications", ref onlineNotifs))
_uiShared.DrawHelpText(L("Settings.Notifications.DisableOptionalWarnings.Description", "Enabling this will not show any \"Warning\" labeled messages for missing optional plugins."));
if (ImGui.Checkbox(L("Settings.Notifications.EnableOnlineNotifications", "Enable online notifications"), ref onlineNotifs))
{
_configService.Current.ShowOnlineNotifications = onlineNotifs;
_configService.Save();
}
_uiShared.DrawHelpText("Enabling this will show a small notification (type: Info) in the bottom right corner when pairs go online.");
_uiShared.DrawHelpText(L("Settings.Notifications.EnableOnlineNotifications.Description", "Enabling this will show a small notification (type: Info) in the bottom right corner when pairs go online."));
using (ImRaii.Disabled(!onlineNotifs))
{
using var indent = ImRaii.PushIndent();
if (ImGui.Checkbox("Notify only for individual pairs", ref onlineNotifsPairsOnly))
if (ImGui.Checkbox(L("Settings.Notifications.IndividualPairsOnly", "Notify only for individual pairs"), ref onlineNotifsPairsOnly))
{
_configService.Current.ShowOnlineNotificationsOnlyForIndividualPairs = onlineNotifsPairsOnly;
_configService.Save();
}
_uiShared.DrawHelpText("Enabling this will only show online notifications (type: Info) for individual pairs.");
if (ImGui.Checkbox("Notify only for named pairs", ref onlineNotifsNamedOnly))
_uiShared.DrawHelpText(L("Settings.Notifications.IndividualPairsOnly.Description", "Enabling this will only show online notifications (type: Info) for individual pairs."));
if (ImGui.Checkbox(L("Settings.Notifications.NamedPairsOnly", "Notify only for named pairs"), ref onlineNotifsNamedOnly))
{
_configService.Current.ShowOnlineNotificationsOnlyForNamedPairs = onlineNotifsNamedOnly;
_configService.Save();
}
_uiShared.DrawHelpText("Enabling this will only show online notifications (type: Info) for pairs where you have set an individual note.");
_uiShared.DrawHelpText(L("Settings.Notifications.NamedPairsOnly.Description", "Enabling this will only show online notifications (type: Info) for pairs where you have set an individual note."));
}
}