mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-14 20:54:16 +01:00
upgrade cimgui, fix IME and image rendering
This commit is contained in:
parent
3f3f5f4b72
commit
55bfe9eeb0
2 changed files with 10 additions and 19 deletions
|
|
@ -37,9 +37,6 @@ namespace Dalamud.Interface.Internal;
|
||||||
[ServiceManager.EarlyLoadedService]
|
[ServiceManager.EarlyLoadedService]
|
||||||
internal sealed unsafe class DalamudIme : IInternalDisposableService
|
internal sealed unsafe class DalamudIme : IInternalDisposableService
|
||||||
{
|
{
|
||||||
private const int CImGuiStbTextCreateUndoOffset = 0xB57A0;
|
|
||||||
private const int CImGuiStbTextUndoOffset = 0xB59C0;
|
|
||||||
|
|
||||||
private const int ImePageSize = 9;
|
private const int ImePageSize = 9;
|
||||||
|
|
||||||
private static readonly Dictionary<int, string> WmNames =
|
private static readonly Dictionary<int, string> WmNames =
|
||||||
|
|
@ -69,11 +66,6 @@ internal sealed unsafe class DalamudIme : IInternalDisposableService
|
||||||
UnicodeRanges.HangulJamoExtendedB,
|
UnicodeRanges.HangulJamoExtendedB,
|
||||||
};
|
};
|
||||||
|
|
||||||
private static readonly delegate* unmanaged<ImGuiInputTextState*, StbTextEditState*, int, int, int, void>
|
|
||||||
StbTextMakeUndoReplace;
|
|
||||||
|
|
||||||
private static readonly delegate* unmanaged<ImGuiInputTextState*, StbTextEditState*, void> StbTextUndo;
|
|
||||||
|
|
||||||
[ServiceManager.ServiceDependency]
|
[ServiceManager.ServiceDependency]
|
||||||
private readonly DalamudConfiguration dalamudConfiguration = Service<DalamudConfiguration>.Get();
|
private readonly DalamudConfiguration dalamudConfiguration = Service<DalamudConfiguration>.Get();
|
||||||
|
|
||||||
|
|
@ -134,13 +126,6 @@ internal sealed unsafe class DalamudIme : IInternalDisposableService
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
StbTextMakeUndoReplace =
|
|
||||||
(delegate* unmanaged<ImGuiInputTextState*, StbTextEditState*, int, int, int, void>)
|
|
||||||
(cimgui + CImGuiStbTextCreateUndoOffset);
|
|
||||||
StbTextUndo =
|
|
||||||
(delegate* unmanaged<ImGuiInputTextState*, StbTextEditState*, void>)
|
|
||||||
(cimgui + CImGuiStbTextUndoOffset);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[ServiceManager.ServiceConstructor]
|
[ServiceManager.ServiceConstructor]
|
||||||
|
|
@ -1031,14 +1016,14 @@ internal sealed unsafe class DalamudIme : IInternalDisposableService
|
||||||
(s, e) = (e, s);
|
(s, e) = (e, s);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Undo() => StbTextUndo(this.ThisPtr, &this.ThisPtr->Stb);
|
public void Undo() => CustomNativeFunctions.igCustom_StbTextUndo(this.ThisPtr);
|
||||||
|
|
||||||
public bool MakeUndoReplace(int offset, int oldLength, int newLength)
|
public bool MakeUndoReplace(int offset, int oldLength, int newLength)
|
||||||
{
|
{
|
||||||
if (oldLength == 0 && newLength == 0)
|
if (oldLength == 0 && newLength == 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
StbTextMakeUndoReplace(this.ThisPtr, &this.ThisPtr->Stb, offset, oldLength, newLength);
|
CustomNativeFunctions.igCustom_StbTextMakeUndoReplace(this.ThisPtr, offset, oldLength, newLength);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1116,9 +1101,15 @@ internal sealed unsafe class DalamudIme : IInternalDisposableService
|
||||||
|
|
||||||
private static class CustomNativeFunctions
|
private static class CustomNativeFunctions
|
||||||
{
|
{
|
||||||
[DllImport("cimgui")]
|
|
||||||
#pragma warning disable SA1300
|
#pragma warning disable SA1300
|
||||||
|
[DllImport("cimgui")]
|
||||||
public static extern ImGuiInputTextState* igCustom_GetInputTextState();
|
public static extern ImGuiInputTextState* igCustom_GetInputTextState();
|
||||||
|
|
||||||
|
[DllImport("cimgui")]
|
||||||
|
public static extern void igCustom_StbTextMakeUndoReplace(ImGuiInputTextState* str, int where, int old_length, int new_length);
|
||||||
|
|
||||||
|
[DllImport("cimgui")]
|
||||||
|
public static extern void igCustom_StbTextUndo(ImGuiInputTextState* str);
|
||||||
#pragma warning restore SA1300
|
#pragma warning restore SA1300
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
Subproject commit fd2377934f2cc007982e21ab82e54b41955cb658
|
Subproject commit 7002b2884e9216d8bef3e792722d88abe31788f8
|
||||||
Loading…
Add table
Add a link
Reference in a new issue