mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
Add additional warning to plugin config reset modal (#2005)
Co-authored-by: goat <16760685+goaaats@users.noreply.github.com>
This commit is contained in:
parent
74ab9191d3
commit
620a802755
1 changed files with 15 additions and 4 deletions
|
|
@ -98,6 +98,7 @@ internal class PluginInstallerWindow : Window, IDisposable
|
||||||
|
|
||||||
private bool deletePluginConfigWarningModalDrawing = true;
|
private bool deletePluginConfigWarningModalDrawing = true;
|
||||||
private bool deletePluginConfigWarningModalOnNextFrame = false;
|
private bool deletePluginConfigWarningModalOnNextFrame = false;
|
||||||
|
private bool deletePluginConfigWarningModalExplainTesting = false;
|
||||||
private string deletePluginConfigWarningModalPluginName = string.Empty;
|
private string deletePluginConfigWarningModalPluginName = string.Empty;
|
||||||
private TaskCompletionSource<bool>? deletePluginConfigWarningModalTaskCompletionSource;
|
private TaskCompletionSource<bool>? deletePluginConfigWarningModalTaskCompletionSource;
|
||||||
|
|
||||||
|
|
@ -732,7 +733,7 @@ internal class PluginInstallerWindow : Window, IDisposable
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DrawFooter()
|
private void DrawFooter()
|
||||||
{
|
{
|
||||||
var configuration = Service<DalamudConfiguration>.Get();
|
var configuration = Service<DalamudConfiguration>.Get();
|
||||||
|
|
@ -972,10 +973,11 @@ internal class PluginInstallerWindow : Window, IDisposable
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private Task<bool> ShowDeletePluginConfigWarningModal(string pluginName)
|
private Task<bool> ShowDeletePluginConfigWarningModal(string pluginName, bool explainTesting = false)
|
||||||
{
|
{
|
||||||
this.deletePluginConfigWarningModalOnNextFrame = true;
|
this.deletePluginConfigWarningModalOnNextFrame = true;
|
||||||
this.deletePluginConfigWarningModalPluginName = pluginName;
|
this.deletePluginConfigWarningModalPluginName = pluginName;
|
||||||
|
this.deletePluginConfigWarningModalExplainTesting = explainTesting;
|
||||||
this.deletePluginConfigWarningModalTaskCompletionSource = new TaskCompletionSource<bool>();
|
this.deletePluginConfigWarningModalTaskCompletionSource = new TaskCompletionSource<bool>();
|
||||||
return this.deletePluginConfigWarningModalTaskCompletionSource.Task;
|
return this.deletePluginConfigWarningModalTaskCompletionSource.Task;
|
||||||
}
|
}
|
||||||
|
|
@ -986,6 +988,13 @@ internal class PluginInstallerWindow : Window, IDisposable
|
||||||
|
|
||||||
if (ImGui.BeginPopupModal(modalTitle, ref this.deletePluginConfigWarningModalDrawing, ImGuiWindowFlags.AlwaysAutoResize | ImGuiWindowFlags.NoScrollbar))
|
if (ImGui.BeginPopupModal(modalTitle, ref this.deletePluginConfigWarningModalDrawing, ImGuiWindowFlags.AlwaysAutoResize | ImGuiWindowFlags.NoScrollbar))
|
||||||
{
|
{
|
||||||
|
if (this.deletePluginConfigWarningModalExplainTesting)
|
||||||
|
{
|
||||||
|
ImGui.PushStyleColor(ImGuiCol.Text, ImGuiColors.DalamudOrange);
|
||||||
|
ImGui.Text(Locs.DeletePluginConfigWarningModal_ExplainTesting());
|
||||||
|
ImGui.PopStyleColor();
|
||||||
|
}
|
||||||
|
|
||||||
ImGui.Text(Locs.DeletePluginConfigWarningModal_Body(this.deletePluginConfigWarningModalPluginName));
|
ImGui.Text(Locs.DeletePluginConfigWarningModal_Body(this.deletePluginConfigWarningModalPluginName));
|
||||||
ImGui.Spacing();
|
ImGui.Spacing();
|
||||||
|
|
||||||
|
|
@ -2898,7 +2907,7 @@ internal class PluginInstallerWindow : Window, IDisposable
|
||||||
|
|
||||||
if (ImGui.MenuItem(Locs.PluginContext_DeletePluginConfigReload))
|
if (ImGui.MenuItem(Locs.PluginContext_DeletePluginConfigReload))
|
||||||
{
|
{
|
||||||
this.ShowDeletePluginConfigWarningModal(plugin.Manifest.Name).ContinueWith(t =>
|
this.ShowDeletePluginConfigWarningModal(plugin.Manifest.Name, optIn != null).ContinueWith(t =>
|
||||||
{
|
{
|
||||||
var shouldDelete = t.Result;
|
var shouldDelete = t.Result;
|
||||||
|
|
||||||
|
|
@ -4263,7 +4272,9 @@ internal class PluginInstallerWindow : Window, IDisposable
|
||||||
|
|
||||||
public static string DeletePluginConfigWarningModal_Title => Loc.Localize("InstallerDeletePluginConfigWarning", "Warning###InstallerDeletePluginConfigWarning");
|
public static string DeletePluginConfigWarningModal_Title => Loc.Localize("InstallerDeletePluginConfigWarning", "Warning###InstallerDeletePluginConfigWarning");
|
||||||
|
|
||||||
public static string DeletePluginConfigWarningModal_Body(string pluginName) => Loc.Localize("InstallerDeletePluginConfigWarningBody", "Are you sure you want to delete all data and configuration for {0}?").Format(pluginName);
|
public static string DeletePluginConfigWarningModal_ExplainTesting() => Loc.Localize("InstallerDeletePluginConfigWarningExplainTesting", "Do not select this option if you are only trying to disable testing!");
|
||||||
|
|
||||||
|
public static string DeletePluginConfigWarningModal_Body(string pluginName) => Loc.Localize("InstallerDeletePluginConfigWarningBody", "Are you sure you want to delete all data and configuration for {0}?\nYou will lose all of your settings for this plugin.").Format(pluginName);
|
||||||
|
|
||||||
public static string DeletePluginConfirmWarningModal_Yes => Loc.Localize("InstallerDeletePluginConfigWarningYes", "Yes");
|
public static string DeletePluginConfirmWarningModal_Yes => Loc.Localize("InstallerDeletePluginConfigWarningYes", "Yes");
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue