Updated to Risa's changes
This commit is contained in:
@@ -96,7 +96,7 @@ public class StateMonitoringTab
|
||||
{
|
||||
foreach (var kvPair in _objectManager)
|
||||
{
|
||||
var show = ImGui.CollapsingHeader($"{kvPair.Key} ({kvPair.Value.Objects.Count} objects)###object-{kvPair.Key}");
|
||||
var show = ImGui.CollapsingHeader($"{kvPair.Key} ({kvPair.Value.Objects.Count} objects [{kvPair.Value.Objects.Count(x => x.IsRenderedByGame())} rendered])###object-{kvPair.Key}");
|
||||
|
||||
if (!show)
|
||||
continue;
|
||||
@@ -124,7 +124,7 @@ public class StateMonitoringTab
|
||||
ImGui.Text($"Count: {kvPair.Value.Objects.Count}");
|
||||
foreach (var item in kvPair.Value.Objects)
|
||||
{
|
||||
ImGui.Text($"[{item.Index}] - {item}, valid: {item.Valid}");
|
||||
ImGui.Text($"[{item.Index}] - {item}, valid: {item.Valid}, rendered: {item.IsRenderedByGame()}");
|
||||
}
|
||||
|
||||
ImGui.Spacing();
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
using Dalamud.Interface;
|
||||
using CustomizePlus.Configuration.Data;
|
||||
using CustomizePlus.Game.Services;
|
||||
using CustomizePlus.GameData.Extensions;
|
||||
using CustomizePlus.Profiles;
|
||||
using CustomizePlus.Profiles.Data;
|
||||
using CustomizePlus.Profiles.Events;
|
||||
using Dalamud.Interface;
|
||||
using Dalamud.Plugin.Services;
|
||||
using Dalamud.Bindings.ImGui;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.FileSystem.Selector;
|
||||
using OtterGui.Filesystem;
|
||||
using OtterGui.Log;
|
||||
using OtterGui;
|
||||
using System;
|
||||
using static CustomizePlus.UI.Windows.MainWindow.Tabs.Profiles.ProfileFileSystemSelector;
|
||||
using OtterGui.Classes;
|
||||
using OtterGui.Filesystem;
|
||||
using OtterGui.FileSystem.Selector;
|
||||
using OtterGui.Log;
|
||||
using OtterGui.Raii;
|
||||
using OtterGui.Text;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Numerics;
|
||||
using System.Reflection;
|
||||
using CustomizePlus.Profiles;
|
||||
using CustomizePlus.Configuration.Data;
|
||||
using CustomizePlus.Profiles.Data;
|
||||
using CustomizePlus.Game.Services;
|
||||
using CustomizePlus.Profiles.Events;
|
||||
using CustomizePlus.GameData.Extensions;
|
||||
using System.Linq;
|
||||
using OtterGui.Text;
|
||||
using static CustomizePlus.UI.Windows.MainWindow.Tabs.Profiles.ProfileFileSystemSelector;
|
||||
|
||||
namespace CustomizePlus.UI.Windows.MainWindow.Tabs.Profiles;
|
||||
|
||||
@@ -48,18 +48,27 @@ public class ProfileFileSystemSelector : FileSystemSelector<Profile, ProfileStat
|
||||
public ColorId Color;
|
||||
}
|
||||
|
||||
|
||||
protected override float CurrentWidth
|
||||
=> _configuration.UISettings.CurrentProfileSelectorWidth * ImUtf8.GlobalScale;
|
||||
|
||||
protected override float MinimumAbsoluteRemainder
|
||||
=> 670 * ImUtf8.GlobalScale;
|
||||
=> 470 * ImUtf8.GlobalScale;
|
||||
|
||||
protected override float MinimumScaling
|
||||
=> _configuration.UISettings.ProfileSelectorMinimumScale;
|
||||
|
||||
protected override float MaximumScaling
|
||||
=> _configuration.UISettings.ProfileSelectorMaximumScale;
|
||||
|
||||
protected override void SetSize(Vector2 size)
|
||||
{
|
||||
base.SetSize(size);
|
||||
var adaptedSize = MathF.Round(size.X / ImUtf8.GlobalScale);
|
||||
if (adaptedSize == _configuration.UISettings.CurrentProfileSelectorWidth)
|
||||
return;
|
||||
|
||||
_configuration.UISettings.CurrentProfileSelectorWidth = adaptedSize;
|
||||
_configuration.Save();
|
||||
}
|
||||
|
||||
public ProfileFileSystemSelector(
|
||||
|
||||
@@ -20,7 +20,6 @@ using CustomizePlus.GameData.Extensions;
|
||||
using CustomizePlus.Core.Extensions;
|
||||
using Dalamud.Interface.Components;
|
||||
using OtterGui.Extensions;
|
||||
using OtterGui.Text;
|
||||
|
||||
namespace CustomizePlus.UI.Windows.MainWindow.Tabs.Profiles;
|
||||
|
||||
@@ -68,7 +67,7 @@ public class ProfilePanel
|
||||
|
||||
public void Draw()
|
||||
{
|
||||
using var group = ImUtf8.Group();
|
||||
using var group = ImRaii.Group();
|
||||
if (_selector.SelectedPaths.Count > 1)
|
||||
{
|
||||
DrawMultiSelection();
|
||||
@@ -194,7 +193,7 @@ public class ProfilePanel
|
||||
{
|
||||
using (var table = ImRaii.Table("BasicSettings", 2))
|
||||
{
|
||||
ImGui.TableSetupColumn("BasicCol1", ImGuiTableColumnFlags.WidthFixed, 200);
|
||||
ImGui.TableSetupColumn("BasicCol1", ImGuiTableColumnFlags.WidthFixed, ImGui.CalcTextSize("lorem ipsum dolor").X);
|
||||
ImGui.TableSetupColumn("BasicCol2", ImGuiTableColumnFlags.WidthStretch);
|
||||
|
||||
ImGuiUtil.DrawFrameColumn("Profile Name");
|
||||
@@ -506,7 +505,7 @@ public class ProfilePanel
|
||||
if (source)
|
||||
{
|
||||
ImGui.TextUnformatted($"Moving template #{index + 1:D2}...");
|
||||
if (ImGui.SetDragDropPayload(dragDropLabel, ReadOnlySpan<byte>.Empty, 0))
|
||||
if (ImGui.SetDragDropPayload(dragDropLabel, null, 0))
|
||||
{
|
||||
_dragIndex = index;
|
||||
}
|
||||
|
||||
@@ -368,10 +368,12 @@ public class SettingsTab
|
||||
xPos -= ImGui.GetStyle().ScrollbarSize + ImGui.GetStyle().FramePadding.X;
|
||||
|
||||
ImGui.SetCursorPos(new Vector2(xPos, 0));
|
||||
DrawUrlButton("Join Discord for Support", "https://discord.gg/KvGJCCnG8t", DiscordColor, width);
|
||||
DrawUrlButton("Join Discord for Support", "https://discord.gg/KvGJCCnG8t", DiscordColor, width,
|
||||
"Join Discord server run by community volunteers who can help you with your questions. Opens https://discord.gg/KvGJCCnG8t in your web browser.");
|
||||
|
||||
ImGui.SetCursorPos(new Vector2(xPos, ImGui.GetFrameHeightWithSpacing()));
|
||||
DrawUrlButton("Support developer using Ko-fi", "https://ko-fi.com/risadev", DonateColor, width);
|
||||
DrawUrlButton("Support developer using Ko-fi", "https://ko-fi.com/risadev", DonateColor, width,
|
||||
"Any donations made are voluntary and treated as a token of gratitude for work done on Customize+. Opens https://ko-fi.com/risadev in your web browser.");
|
||||
|
||||
ImGui.SetCursorPos(new Vector2(xPos, 2 * ImGui.GetFrameHeightWithSpacing()));
|
||||
if (ImGui.Button("Copy Support Info to Clipboard"))
|
||||
@@ -387,7 +389,7 @@ public class SettingsTab
|
||||
}
|
||||
|
||||
/// <summary> Draw a button to open some url. </summary>
|
||||
private void DrawUrlButton(string text, string url, uint buttonColor, float width)
|
||||
private void DrawUrlButton(string text, string url, uint buttonColor, float width, string? description = null)
|
||||
{
|
||||
using var color = ImRaii.PushColor(ImGuiCol.Button, buttonColor);
|
||||
if (ImGui.Button(text, new Vector2(width, 0)))
|
||||
@@ -404,7 +406,7 @@ public class SettingsTab
|
||||
_messageService.NotificationMessage($"Unable to open url {url}.", NotificationType.Error, false);
|
||||
}
|
||||
|
||||
ImGuiUtil.HoverTooltip($"Open {url}");
|
||||
ImGuiUtil.HoverTooltip(description ?? $"Open {url}");
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
@@ -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