mirror of
https://github.com/xivdev/Penumbra.git
synced 2025-12-12 18:27:24 +01:00
Add key-check for file deletion in advanced editing.
This commit is contained in:
parent
768016a897
commit
e02de6de5a
1 changed files with 10 additions and 4 deletions
|
|
@ -287,14 +287,20 @@ public partial class ModEditWindow
|
||||||
|
|
||||||
|
|
||||||
ImGui.SameLine();
|
ImGui.SameLine();
|
||||||
if (ImGui.Button("Delete Selected Files"))
|
var active = _config.DeleteModModifier.IsActive();
|
||||||
|
var tt =
|
||||||
|
"Delete all selected files entirely from your filesystem, but not their file associations in the mod.\n!!!This can not be reverted!!!";
|
||||||
|
if (_selectedFiles.Count == 0)
|
||||||
|
tt += "\n\nNo files selected.";
|
||||||
|
else if (!active)
|
||||||
|
tt += $"\n\nHold {_config.DeleteModModifier.ToString()} to delete.";
|
||||||
|
|
||||||
|
if (ImGuiUtil.DrawDisabledButton("Delete Selected Files", Vector2.Zero, tt, _selectedFiles.Count == 0 || !active))
|
||||||
_editor.FileEditor.DeleteFiles(_editor.Mod!, _editor.Option!, _editor.Files.Available.Where(_selectedFiles.Contains));
|
_editor.FileEditor.DeleteFiles(_editor.Mod!, _editor.Option!, _editor.Files.Available.Where(_selectedFiles.Contains));
|
||||||
|
|
||||||
ImGuiUtil.HoverTooltip(
|
|
||||||
"Delete all selected files entirely from your filesystem, but not their file associations in the mod, if there are any.\n!!!This can not be reverted!!!");
|
|
||||||
ImGui.SameLine();
|
ImGui.SameLine();
|
||||||
var changes = _editor.FileEditor.Changes;
|
var changes = _editor.FileEditor.Changes;
|
||||||
var tt = changes ? "Apply the current file setup to the currently selected option." : "No changes made.";
|
tt = changes ? "Apply the current file setup to the currently selected option." : "No changes made.";
|
||||||
if (ImGuiUtil.DrawDisabledButton("Apply Changes", Vector2.Zero, tt, !changes))
|
if (ImGuiUtil.DrawDisabledButton("Apply Changes", Vector2.Zero, tt, !changes))
|
||||||
{
|
{
|
||||||
var failedFiles = _editor.FileEditor.Apply(_editor.Mod!, (SubMod)_editor.Option!);
|
var failedFiles = _editor.FileEditor.Apply(_editor.Mod!, (SubMod)_editor.Option!);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue