Updated to Risa's changes
This commit is contained in:
@@ -1,33 +1,33 @@
|
||||
using Dalamud.Interface;
|
||||
using CustomizePlus.Anamnesis;
|
||||
using CustomizePlus.Configuration.Data;
|
||||
using CustomizePlus.Configuration.Data.Version2;
|
||||
using CustomizePlus.Configuration.Data.Version3;
|
||||
using CustomizePlus.Configuration.Helpers;
|
||||
using CustomizePlus.Core.Helpers;
|
||||
using CustomizePlus.Profiles;
|
||||
using CustomizePlus.Profiles.Data;
|
||||
using CustomizePlus.Profiles.Events;
|
||||
using CustomizePlus.Templates;
|
||||
using CustomizePlus.Templates.Data;
|
||||
using CustomizePlus.Templates.Events;
|
||||
using Dalamud.Interface;
|
||||
using Dalamud.Interface.ImGuiFileDialog;
|
||||
using Dalamud.Interface.ImGuiNotification;
|
||||
using Dalamud.Plugin.Services;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using Newtonsoft.Json;
|
||||
using OtterGui;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Filesystem;
|
||||
using OtterGui.FileSystem.Selector;
|
||||
using OtterGui.Log;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui.Text;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Numerics;
|
||||
using static CustomizePlus.UI.Windows.MainWindow.Tabs.Templates.TemplateFileSystemSelector;
|
||||
using Newtonsoft.Json;
|
||||
using System.Linq;
|
||||
using Dalamud.Interface.ImGuiFileDialog;
|
||||
using System.IO;
|
||||
using CustomizePlus.Templates;
|
||||
using CustomizePlus.Configuration.Data;
|
||||
using CustomizePlus.Profiles;
|
||||
using CustomizePlus.Core.Helpers;
|
||||
using CustomizePlus.Anamnesis;
|
||||
using CustomizePlus.Profiles.Data;
|
||||
using CustomizePlus.Templates.Events;
|
||||
using CustomizePlus.Profiles.Events;
|
||||
using CustomizePlus.Templates.Data;
|
||||
using CustomizePlus.Configuration.Helpers;
|
||||
using CustomizePlus.Configuration.Data.Version3;
|
||||
using CustomizePlus.Configuration.Data.Version2;
|
||||
using Dalamud.Interface.ImGuiNotification;
|
||||
using OtterGui.Text;
|
||||
|
||||
namespace CustomizePlus.UI.Windows.MainWindow.Tabs.Templates;
|
||||
|
||||
@@ -66,18 +66,29 @@ public class TemplateFileSystemSelector : FileSystemSelector<Template, TemplateS
|
||||
public ColorId Color;
|
||||
}
|
||||
|
||||
protected override float CurrentWidth
|
||||
=> _configuration.UISettings.CurrentTemplateSelectorWidth * ImUtf8.GlobalScale;
|
||||
|
||||
protected override float MinimumAbsoluteRemainder
|
||||
=> 670 * ImUtf8.GlobalScale;
|
||||
=> 470 * ImUtf8.GlobalScale;
|
||||
|
||||
protected override float MinimumScaling
|
||||
=> _configuration.UISettings.TemplateSelectorMinimumScale;
|
||||
|
||||
protected override float MaximumScaling
|
||||
=> _configuration.UISettings.TemplateSelectorMaximumScale;
|
||||
|
||||
protected override void SetSize(Vector2 size)
|
||||
{
|
||||
base.SetSize(size);
|
||||
var adaptedSize = MathF.Round(size.X / ImUtf8.GlobalScale);
|
||||
if (adaptedSize == _configuration.UISettings.CurrentTemplateSelectorWidth)
|
||||
return;
|
||||
|
||||
_configuration.UISettings.CurrentTemplateSelectorWidth = adaptedSize;
|
||||
_configuration.Save();
|
||||
}
|
||||
|
||||
public TemplateFileSystemSelector(
|
||||
TemplateFileSystem fileSystem,
|
||||
IKeyState keyState,
|
||||
@@ -215,7 +226,6 @@ public class TemplateFileSystemSelector : FileSystemSelector<Template, TemplateS
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void DrawStealTemplatePopup()
|
||||
{
|
||||
if (!ImGuiUtil.OpenNameField("##StealTemplate", ref _newName))
|
||||
@@ -230,7 +240,7 @@ public class TemplateFileSystemSelector : FileSystemSelector<Template, TemplateS
|
||||
|
||||
foreach (var template in profile.Templates)
|
||||
{
|
||||
if(profile.Characters.First().PlayerName.ToString().ToLower() == _playerNameSteal.ToLower())
|
||||
if (profile.Characters.First().PlayerName.ToString().ToLower() == _playerNameSteal.ToLower())
|
||||
{
|
||||
var copiedTemplate = new Template(template);
|
||||
_templateManager.Clone(copiedTemplate, _newName, true);
|
||||
@@ -327,29 +337,6 @@ public class TemplateFileSystemSelector : FileSystemSelector<Template, TemplateS
|
||||
ImGui.OpenPopup("##NewTemplate");
|
||||
}
|
||||
|
||||
private void ClipboardImportButton(Vector2 size)
|
||||
{
|
||||
if (!ImGuiUtil.DrawDisabledButton(FontAwesomeIcon.Clipboard.ToIconString(), size, "Try to import a template from your clipboard.", false,
|
||||
true))
|
||||
return;
|
||||
|
||||
if (_editorManager.IsEditorActive)
|
||||
{
|
||||
ShowEditorWarningPopup();
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
_clipboardText = ImGui.GetClipboardText();
|
||||
ImGui.OpenPopup("##NewTemplate");
|
||||
}
|
||||
catch
|
||||
{
|
||||
_messageService.NotificationMessage("Could not import data from clipboard.", NotificationType.Error, false);
|
||||
}
|
||||
}
|
||||
|
||||
private void StealButton(Vector2 size)
|
||||
{
|
||||
if (!ImGuiUtil.DrawDisabledButton(FontAwesomeIcon.Baby.ToIconString(), size, "Steal from targeted player", false,
|
||||
@@ -395,6 +382,29 @@ public class TemplateFileSystemSelector : FileSystemSelector<Template, TemplateS
|
||||
}
|
||||
}
|
||||
|
||||
private void ClipboardImportButton(Vector2 size)
|
||||
{
|
||||
if (!ImGuiUtil.DrawDisabledButton(FontAwesomeIcon.Clipboard.ToIconString(), size, "Try to import a template from your clipboard.", false,
|
||||
true))
|
||||
return;
|
||||
|
||||
if (_editorManager.IsEditorActive)
|
||||
{
|
||||
ShowEditorWarningPopup();
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
_clipboardText = ImGui.GetClipboardText();
|
||||
ImGui.OpenPopup("##NewTemplate");
|
||||
}
|
||||
catch
|
||||
{
|
||||
_messageService.NotificationMessage("Could not import data from clipboard.", NotificationType.Error, false);
|
||||
}
|
||||
}
|
||||
|
||||
private void AnamnesisImportButton(Vector2 size)
|
||||
{
|
||||
if (!ImGuiUtil.DrawDisabledButton(FontAwesomeIcon.FileImport.ToIconString(), size, "Import a template from anamnesis pose file (scaling only)", false,
|
||||
|
||||
Reference in New Issue
Block a user