mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-02-16 12:57:44 +01:00
Move ShowTextureSaveMenuAsync to its own class
This commit is contained in:
parent
0d7c0a0375
commit
6d8102dc79
4 changed files with 170 additions and 133 deletions
|
|
@ -5,6 +5,7 @@ using System.Threading.Tasks;
|
|||
using Dalamud.Interface.Colors;
|
||||
using Dalamud.Interface.Textures.Internal;
|
||||
using Dalamud.Interface.Utility;
|
||||
using Dalamud.Interface.Utility.Internal;
|
||||
|
||||
using ImGuiNET;
|
||||
|
||||
|
|
@ -170,7 +171,7 @@ public class IconBrowserWidget : IDataWindowWidget
|
|||
|
||||
if (ImGui.IsItemClicked(ImGuiMouseButton.Right))
|
||||
{
|
||||
_ = Service<DalamudInterface>.Get().ShowTextureSaveMenuAsync(
|
||||
_ = Service<DevTextureSaveMenu>.Get().ShowTextureSaveMenuAsync(
|
||||
this.DisplayName,
|
||||
iconId.ToString(),
|
||||
Task.FromResult(texture.CreateWrapSharingLowLevelResource()));
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ using Dalamud.Interface.ImGuiNotification.Internal;
|
|||
using Dalamud.Interface.Textures;
|
||||
using Dalamud.Interface.Textures.Internal.SharedImmediateTextures;
|
||||
using Dalamud.Interface.Utility;
|
||||
using Dalamud.Interface.Utility.Internal;
|
||||
using Dalamud.Plugin.Services;
|
||||
using Dalamud.Storage.Assets;
|
||||
using Dalamud.Utility;
|
||||
|
|
@ -249,7 +250,7 @@ internal class TexWidget : IDataWindowWidget
|
|||
ImGui.SameLine();
|
||||
if (ImGui.Button("Save"))
|
||||
{
|
||||
_ = Service<DalamudInterface>.Get().ShowTextureSaveMenuAsync(
|
||||
_ = Service<DevTextureSaveMenu>.Get().ShowTextureSaveMenuAsync(
|
||||
this.DisplayName,
|
||||
$"Texture {t.Id}",
|
||||
t.CreateNewTextureWrapReference(this.textureManager));
|
||||
|
|
@ -458,7 +459,7 @@ internal class TexWidget : IDataWindowWidget
|
|||
ImGui.TableNextColumn();
|
||||
if (ImGuiComponents.IconButton(FontAwesomeIcon.Save))
|
||||
{
|
||||
_ = Service<DalamudInterface>.Get().ShowTextureSaveMenuAsync(
|
||||
_ = Service<DevTextureSaveMenu>.Get().ShowTextureSaveMenuAsync(
|
||||
this.DisplayName,
|
||||
$"{wrap.ImGuiHandle:X16}",
|
||||
Task.FromResult(wrap.CreateWrapSharingLowLevelResource()));
|
||||
|
|
@ -585,7 +586,7 @@ internal class TexWidget : IDataWindowWidget
|
|||
if (ImGuiComponents.IconButton(FontAwesomeIcon.Save))
|
||||
{
|
||||
var name = Path.ChangeExtension(Path.GetFileName(texture.SourcePathForDebug), null);
|
||||
_ = Service<DalamudInterface>.Get().ShowTextureSaveMenuAsync(
|
||||
_ = Service<DevTextureSaveMenu>.Get().ShowTextureSaveMenuAsync(
|
||||
this.DisplayName,
|
||||
name,
|
||||
texture.RentAsync());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue