IME implementation

This commit is contained in:
Raymond 2021-08-11 08:57:27 -04:00
parent ee44e6885a
commit 3e3757d30c
10 changed files with 1131 additions and 2 deletions

View file

@ -9,6 +9,7 @@ using Dalamud.Data;
using Dalamud.Game;
using Dalamud.Game.ClientState;
using Dalamud.Game.Command;
using Dalamud.Game.Gui.Internal;
using Dalamud.Game.Internal;
using Dalamud.Game.Network.Internal;
using Dalamud.Game.Text.SeStringHandling;
@ -100,6 +101,11 @@ namespace Dalamud
/// </summary>
internal InterfaceManager InterfaceManager { get; private set; }
/// <summary>
/// Gets the Input Method subsystem.
/// </summary>
internal DalamudIME IME { get; private set; }
/// <summary>
/// Gets ClientState subsystem.
/// </summary>
@ -293,6 +299,16 @@ namespace Dalamud
}
}
try
{
this.IME = new DalamudIME(this);
Log.Information("[T2] IME OK!");
}
catch (Exception e)
{
Log.Information(e, "Could not init IME.");
}
this.Data = new DataManager(this.StartInfo.Language, this.InterfaceManager);
try
{
@ -415,6 +431,11 @@ namespace Dalamud
{
this.hasDisposedPlugins = true;
// this must be done before unloading interface manager, in order to do rebuild
// the correct cascaded WndProc (IME -> RawDX11Scene -> Game). Otherwise the game
// will not receive any windows messages
this.IME?.Dispose();
// this must be done before unloading plugins, or it can cause a race condition
// due to rendering happening on another thread, where a plugin might receive
// a render call after it has been disposed, which can crash if it attempts to