Skip to content

Commit 9fa6cd3

Browse files
committed
Ensure borders on IME mode foreground icon
1 parent bda6392 commit 9fa6cd3

File tree

3 files changed

+59
-10
lines changed

3 files changed

+59
-10
lines changed

Dalamud/Game/Text/SeIconChar.cs

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -611,29 +611,51 @@ public enum SeIconChar
611611
QuestRepeatable = 0xE0BF,
612612

613613
/// <summary>
614-
/// The IME hiragana icon unicode character.
614+
/// The [あ] character indicating that the Japanese IME is in full-width Hiragana input mode.
615615
/// </summary>
616+
/// <remarks>
617+
/// Half-width Hiragana exists as a Windows API constant, but the feature is unused, or at least unexposed to the end user via the IME.
618+
/// </remarks>
616619
ImeHiragana = 0xE020,
617620

618621
/// <summary>
619-
/// The IME katakana icon unicode character.
622+
/// The [ア] character indicating that the Japanese IME is in full-width Katakana input mode.
620623
/// </summary>
621624
ImeKatakana = 0xE021,
622625

623626
/// <summary>
624-
/// The IME alphanumeric icon unicode character.
627+
/// The [A] character indicating that Japanese or Korean IME is in full-width Latin character input mode.
625628
/// </summary>
626629
ImeAlphanumeric = 0xE022,
627630

628631
/// <summary>
629-
/// The IME katakana half-width icon unicode character.
632+
/// The [_ア] character indicating that the Japanese IME is in half-width Katakana input mode.
630633
/// </summary>
631634
ImeKatakanaHalfWidth = 0xE023,
632635

633636
/// <summary>
634-
/// The IME alphanumeric half-width icon unicode character.
637+
/// The [_A] character indicating that Japanese or Korean IME is in half-width Latin character input mode.
635638
/// </summary>
636639
ImeAlphanumericHalfWidth = 0xE024,
640+
641+
/// <summary>
642+
/// The [가] character indicating that the Korean IME is in Hangul input mode.
643+
/// </summary>
644+
/// <remarks>
645+
/// Use <see cref="ImeAlphanumeric"/> and <see cref="ImeAlphanumericHalfWidth"/> for alphanumeric input mode,
646+
/// toggled via Alt+=.
647+
/// </remarks>
648+
ImeKoreanHangul = 0xE025,
649+
650+
/// <summary>
651+
/// The [中] character indicating that the Chinese IME is in Han character input mode.
652+
/// </summary>
653+
ImeChineseHan = 0xE026,
654+
655+
/// <summary>
656+
/// The [英] character indicating that the Chinese IME is in Latin character input mode.
657+
/// </summary>
658+
ImeChineseLatin = 0xE027,
637659

638660
/// <summary>
639661
/// The instance (1) icon unicode character.

Dalamud/Interface/Internal/DalamudIme.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
namespace Dalamud.Interface.Internal;
2020

2121
/// <summary>
22-
/// This class handles IME for non-English users.
22+
/// This class handles CJK IME.
2323
/// </summary>
2424
[ServiceManager.EarlyLoadedService]
2525
internal sealed unsafe class DalamudIme : IDisposable, IServiceType
@@ -251,7 +251,7 @@ private void UpdateInputLanguage(HIMC hImc)
251251
{
252252
case LANG.LANG_KOREAN:
253253
if (native)
254-
this.InputModeIcon = "\uE025";
254+
this.InputModeIcon = $"{(char)SeIconChar.ImeKoreanHangul}";
255255
else if (fullwidth)
256256
this.InputModeIcon = $"{(char)SeIconChar.ImeAlphanumeric}";
257257
else
@@ -274,11 +274,10 @@ private void UpdateInputLanguage(HIMC hImc)
274274
break;
275275

276276
case LANG.LANG_CHINESE:
277-
// TODO: does Chinese IME also need "open" check?
278277
if (native)
279-
this.InputModeIcon = "\uE026";
278+
this.InputModeIcon = $"{(char)SeIconChar.ImeChineseHan}";
280279
else
281-
this.InputModeIcon = "\uE027";
280+
this.InputModeIcon = $"{(char)SeIconChar.ImeChineseLatin}";
282281
break;
283282

284283
default:

Dalamud/Interface/Internal/Windows/DalamudImeWindow.cs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,20 @@ public override void PostDraw()
133133

134134
if (!expandUpward && drawIme)
135135
{
136+
for (var dx = -2; dx <= 2; dx++)
137+
{
138+
for (var dy = -2; dy <= 2; dy++)
139+
{
140+
if (dx != 0 || dy != 0)
141+
{
142+
drawList.AddText(
143+
cursor + new Vector2(dx, dy),
144+
ImGui.GetColorU32(ImGuiCol.WindowBg),
145+
ime.InputModeIcon);
146+
}
147+
}
148+
}
149+
136150
drawList.AddText(cursor, ImGui.GetColorU32(ImGuiCol.Text), ime.InputModeIcon);
137151
cursor.Y += candTextSize.Y + spaceY;
138152
}
@@ -179,6 +193,20 @@ public override void PostDraw()
179193

180194
if (expandUpward && drawIme)
181195
{
196+
for (var dx = -2; dx <= 2; dx++)
197+
{
198+
for (var dy = -2; dy <= 2; dy++)
199+
{
200+
if (dx != 0 || dy != 0)
201+
{
202+
drawList.AddText(
203+
cursor + new Vector2(dx, dy),
204+
ImGui.GetColorU32(ImGuiCol.WindowBg),
205+
ime.InputModeIcon);
206+
}
207+
}
208+
}
209+
182210
drawList.AddText(cursor, ImGui.GetColorU32(ImGuiCol.Text), ime.InputModeIcon);
183211
}
184212

0 commit comments

Comments
 (0)