mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
Fix scoped in and mark experimental (#1990)
This commit is contained in:
parent
afe44e4ca8
commit
c721069b08
4 changed files with 18 additions and 29 deletions
|
|
@ -229,7 +229,7 @@ internal unsafe class SeStringRenderer : IInternalDisposableService
|
|||
/// <returns>Interaction result of the rendered text.</returns>
|
||||
public SeStringDrawResult CompileAndDrawWrapped(
|
||||
string text,
|
||||
in SeStringDrawParams drawParams = default,
|
||||
scoped in SeStringDrawParams drawParams = default,
|
||||
ImGuiId imGuiId = default,
|
||||
ImGuiButtonFlags buttonFlags = ImGuiButtonFlags.MouseButtonDefault) =>
|
||||
this.Draw(this.CompileAndCache(text).AsSpan(), drawParams, imGuiId, buttonFlags);
|
||||
|
|
@ -241,8 +241,8 @@ internal unsafe class SeStringRenderer : IInternalDisposableService
|
|||
/// <param name="buttonFlags">Button flags to use on link interaction.</param>
|
||||
/// <returns>Interaction result of the rendered text.</returns>
|
||||
public SeStringDrawResult Draw(
|
||||
in Utf8String utf8String,
|
||||
in SeStringDrawParams drawParams = default,
|
||||
scoped in Utf8String utf8String,
|
||||
scoped in SeStringDrawParams drawParams = default,
|
||||
ImGuiId imGuiId = default,
|
||||
ImGuiButtonFlags buttonFlags = ImGuiButtonFlags.MouseButtonDefault) =>
|
||||
this.Draw(utf8String.AsSpan(), drawParams, imGuiId, buttonFlags);
|
||||
|
|
@ -255,7 +255,7 @@ internal unsafe class SeStringRenderer : IInternalDisposableService
|
|||
/// <returns>Interaction result of the rendered text.</returns>
|
||||
public SeStringDrawResult Draw(
|
||||
ReadOnlySeStringSpan sss,
|
||||
in SeStringDrawParams drawParams = default,
|
||||
scoped in SeStringDrawParams drawParams = default,
|
||||
ImGuiId imGuiId = default,
|
||||
ImGuiButtonFlags buttonFlags = ImGuiButtonFlags.MouseButtonDefault)
|
||||
{
|
||||
|
|
@ -889,7 +889,7 @@ internal unsafe class SeStringRenderer : IInternalDisposableService
|
|||
/// <param name="gfdEntry">GFD entry to determine the size.</param>
|
||||
/// <param name="useHq">Whether to draw the HQ texture.</param>
|
||||
/// <returns>Determined size of the GFD entry when drawn.</returns>
|
||||
public readonly Vector2 CalculateGfdEntrySize(in GfdFile.GfdEntry gfdEntry, out bool useHq)
|
||||
public readonly Vector2 CalculateGfdEntrySize(scoped in GfdFile.GfdEntry gfdEntry, out bool useHq)
|
||||
{
|
||||
useHq = this.Params.FontSize > 20;
|
||||
var targetHeight = useHq ? this.Params.FontSize : 20;
|
||||
|
|
@ -911,7 +911,11 @@ internal unsafe class SeStringRenderer : IInternalDisposableService
|
|||
/// <param name="dyItalic">Transformation for <paramref name="g"/> that will push top and bottom pixels to
|
||||
/// apply faux italicization.</param>
|
||||
/// <param name="color">Color of the glyph.</param>
|
||||
public readonly void Draw(Vector2 offset, in ImGuiHelpers.ImFontGlyphReal g, Vector2 dyItalic, uint color) =>
|
||||
public readonly void Draw(
|
||||
Vector2 offset,
|
||||
scoped in ImGuiHelpers.ImFontGlyphReal g,
|
||||
Vector2 dyItalic,
|
||||
uint color) =>
|
||||
this.Draw(
|
||||
offset + new Vector2(
|
||||
0,
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@ using Lumina.Text.ReadOnly;
|
|||
|
||||
namespace Dalamud.Interface.Internal.Windows.Data.Widgets;
|
||||
|
||||
#pragma warning disable SeStringRenderer
|
||||
|
||||
/// <summary>
|
||||
/// Widget for displaying AtkArrayData.
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@ using Lumina.Text.ReadOnly;
|
|||
|
||||
namespace Dalamud.Interface.Internal.Windows.Data.Widgets;
|
||||
|
||||
#pragma warning disable SeStringRenderer
|
||||
|
||||
/// <summary>
|
||||
/// Widget for displaying Addon Data.
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -180,27 +180,6 @@ public static class ImGuiHelpers
|
|||
if (ImGui.IsItemClicked()) ImGui.SetClipboardText($"{textCopy}");
|
||||
}
|
||||
|
||||
/// <summary>Draws a SeString.</summary>
|
||||
/// <param name="sss">SeString to draw.</param>
|
||||
/// <param name="wrapWidth">Wrapping width. If a non-positive number is provided, then the remainder of the width
|
||||
/// will be used.</param>
|
||||
/// <remarks>This function is experimental. Report any issues to GitHub issues or to Discord #dalamud-dev channel.
|
||||
/// The function definition is stable; only in the next API version a function may be removed.</remarks>
|
||||
public static void SeStringWrapped(ReadOnlySpan<byte> sss, float wrapWidth = 0) =>
|
||||
Service<SeStringRenderer>.Get().Draw(sss, new() { WrapWidth = wrapWidth > 0 ? wrapWidth : null });
|
||||
|
||||
/// <summary>Creates and caches a SeString from a text macro representation, and then draws it.</summary>
|
||||
/// <param name="text">SeString text macro representation.
|
||||
/// Newline characters will be normalized to <see cref="NewLinePayload"/>.</param>
|
||||
/// <param name="wrapWidth">Wrapping width. If a non-positive number is provided, then the remainder of the width
|
||||
/// will be used.</param>
|
||||
/// <remarks>This function is experimental. Report any issues to GitHub issues or to Discord #dalamud-dev channel.
|
||||
/// The function definition is stable; only in the next API version a function may be removed.</remarks>
|
||||
public static void CompileSeStringWrapped(string text, float wrapWidth = 0) =>
|
||||
Service<SeStringRenderer>.Get().CompileAndDrawWrapped(
|
||||
text,
|
||||
new() { WrapWidth = wrapWidth > 0 ? wrapWidth : null });
|
||||
|
||||
/// <summary>Draws a SeString.</summary>
|
||||
/// <param name="sss">SeString to draw.</param>
|
||||
/// <param name="style">Initial rendering style.</param>
|
||||
|
|
@ -209,9 +188,10 @@ public static class ImGuiHelpers
|
|||
/// <returns>Interaction result of the rendered text.</returns>
|
||||
/// <remarks>This function is experimental. Report any issues to GitHub issues or to Discord #dalamud-dev channel.
|
||||
/// The function definition is stable; only in the next API version a function may be removed.</remarks>
|
||||
[Experimental("SeStringRenderer")]
|
||||
public static SeStringDrawResult SeStringWrapped(
|
||||
ReadOnlySpan<byte> sss,
|
||||
in SeStringDrawParams style = default,
|
||||
scoped in SeStringDrawParams style = default,
|
||||
ImGuiId imGuiId = default,
|
||||
ImGuiButtonFlags buttonFlags = ImGuiButtonFlags.MouseButtonDefault) =>
|
||||
Service<SeStringRenderer>.Get().Draw(sss, style, imGuiId, buttonFlags);
|
||||
|
|
@ -225,9 +205,10 @@ public static class ImGuiHelpers
|
|||
/// <returns>Interaction result of the rendered text.</returns>
|
||||
/// <remarks>This function is experimental. Report any issues to GitHub issues or to Discord #dalamud-dev channel.
|
||||
/// The function definition is stable; only in the next API version a function may be removed.</remarks>
|
||||
[Experimental("SeStringRenderer")]
|
||||
public static SeStringDrawResult CompileSeStringWrapped(
|
||||
string text,
|
||||
in SeStringDrawParams style,
|
||||
scoped in SeStringDrawParams style,
|
||||
ImGuiId imGuiId = default,
|
||||
ImGuiButtonFlags buttonFlags = ImGuiButtonFlags.MouseButtonDefault) =>
|
||||
Service<SeStringRenderer>.Get().CompileAndDrawWrapped(text, style, imGuiId, buttonFlags);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue