Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ DrawWindowsIMEPanel()

void Terraria.Main.DrawWindowsIMEPanel ( Vector2 position,
float xAnchor = 0f )
inline

Definition at line 37575 of file Main.cs.

37576 {
37578 {
37579 return;
37580 }
37582 for (uint num = 0u; num < Platform.Get<IImeService>().CandidateCount; num++)
37583 {
37584 string candidate = Platform.Get<IImeService>().GetCandidate(num);
37585 list.Add(candidate);
37586 }
37587 if (list.Count == 0)
37588 {
37589 return;
37590 }
37591 uint selectedCandidate = Platform.Get<IImeService>().SelectedCandidate;
37593 float num2 = 0.85f;
37594 float num3 = 14f;
37595 float num4 = 0f;
37596 int num5 = 32;
37597 num4 += num3;
37598 string text = "{0,2}: {1}";
37599 string text2 = " ";
37600 for (int i = 0; i < list.Count; i++)
37601 {
37602 int num6 = i + 1;
37603 string text3 = text;
37604 if (i < list.Count - 1)
37605 {
37606 text3 += text2;
37607 }
37608 num4 += value.MeasureString(string.Format(text3, num6, list[i])).X * num2;
37609 num4 += num3;
37610 }
37611 Vector2 vector = new Vector2(num4 * (0f - xAnchor), 0f);
37612 Utils.DrawSettings2Panel(spriteBatch, position + vector + new Vector2(0f, -num5), num4, new Microsoft.Xna.Framework.Color(63, 65, 151, 255) * 0.785f);
37613 Vector2 pos = position + new Vector2(10f, -num5 / 2) + vector;
37614 for (uint num7 = 0u; num7 < list.Count; num7++)
37615 {
37617 if (num7 == selectedCandidate)
37618 {
37620 }
37621 uint num8 = num7 + 1;
37622 string text4 = text;
37623 if (num7 < list.Count - 1)
37624 {
37625 text4 += text2;
37626 }
37627 string text5 = string.Format(text4, num8, list[(int)num7]);
37628 Vector2 vector2 = value.MeasureString(text5) * num2;
37629 Utils.DrawBorderString(spriteBatch, text5, pos, color, num2, 0f, 0.4f);
37630 pos.X += vector2.X + num3;
37631 }
37632 }
static Asset< DynamicSpriteFont > MouseText
Definition FontAssets.cs:10
static SpriteBatch spriteBatch
Definition Main.cs:974

References System.Collections.Generic.Dictionary< TKey, TValue >.Count, Terraria.Utils.DrawBorderString(), Terraria.Utils.DrawSettings2Panel(), System.Format, Microsoft.Xna.Framework.Color.Gray, System.Text.RegularExpressions.i, ReLogic.Localization.IME.IImeService.IsCandidateListVisible, System.list, Terraria.GameContent.FontAssets.MouseText, Terraria.Main.spriteBatch, System.text, System.value, Microsoft.Xna.Framework.Graphics.Vector2, Microsoft.Xna.Framework.Color.White, and System.X.

Referenced by Terraria.Main.DrawPlayerChat().