mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-30 20:33:40 +01:00
Redo SeStringRenderer deprecations
This commit is contained in:
parent
fecba89710
commit
a1409096fd
2 changed files with 5 additions and 13 deletions
|
|
@ -162,8 +162,7 @@ internal class SeStringRenderer : IServiceType
|
||||||
if (drawParams.Font.HasValue)
|
if (drawParams.Font.HasValue)
|
||||||
font = drawParams.Font.Value;
|
font = drawParams.Font.Value;
|
||||||
|
|
||||||
// API14: Remove commented out code
|
if (ThreadSafety.IsMainThread && drawParams.TargetDrawList is null && font is null)
|
||||||
if (ThreadSafety.IsMainThread /* && drawParams.TargetDrawList is null */ && font is null)
|
|
||||||
font = ImGui.GetFont();
|
font = ImGui.GetFont();
|
||||||
if (font is null)
|
if (font is null)
|
||||||
throw new ArgumentException("Specified font is empty.");
|
throw new ArgumentException("Specified font is empty.");
|
||||||
|
|
|
||||||
|
|
@ -66,17 +66,10 @@ public unsafe ref struct SeStringDrawState : IDisposable
|
||||||
this.drawList = ssdp.TargetDrawList.Value;
|
this.drawList = ssdp.TargetDrawList.Value;
|
||||||
this.ScreenOffset = ssdp.ScreenOffset ?? Vector2.Zero;
|
this.ScreenOffset = ssdp.ScreenOffset ?? Vector2.Zero;
|
||||||
|
|
||||||
// API14: Remove, always throw
|
this.ScreenOffset = ssdp.ScreenOffset ?? throw new ArgumentException(
|
||||||
if (ThreadSafety.IsMainThread)
|
$"{nameof(ssdp.ScreenOffset)} must be set when specifying a target draw list, as it cannot be fetched from the ImGui state. (GetCursorScreenPos?)");
|
||||||
{
|
this.FontSize = ssdp.FontSize ?? throw new ArgumentException(
|
||||||
this.ScreenOffset = ssdp.ScreenOffset ?? ImGui.GetCursorScreenPos();
|
$"{nameof(ssdp.FontSize)} must be set when specifying a target draw list, as it cannot be fetched from the ImGui state.");
|
||||||
this.FontSize = ssdp.FontSize ?? ImGui.GetFontSize();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
throw new ArgumentException(
|
|
||||||
$"{nameof(ssdp.FontSize)} must be set when specifying a target draw list, as it cannot be fetched from the ImGui state.");
|
|
||||||
}
|
|
||||||
|
|
||||||
// this.FontSize = ssdp.FontSize ?? throw new ArgumentException(
|
// this.FontSize = ssdp.FontSize ?? throw new ArgumentException(
|
||||||
// $"{nameof(ssdp.FontSize)} must be set when specifying a target draw list, as it cannot be fetched from the ImGui state.");
|
// $"{nameof(ssdp.FontSize)} must be set when specifying a target draw list, as it cannot be fetched from the ImGui state.");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue