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

◆ OpenVirtualKeyboard()

static void Terraria.UI.IngameFancyUI.OpenVirtualKeyboard ( int keyboardContext)
inlinestatic

Definition at line 75 of file IngameFancyUI.cs.

76 {
78 ClearChat();
80 string labelText = "";
81 switch (keyboardContext)
82 {
83 case 1:
84 Main.editSign = true;
85 labelText = Language.GetTextValue("UI.EnterMessage");
86 break;
87 case 2:
88 {
89 labelText = Language.GetTextValue("UI.EnterNewName");
90 Player player = Main.player[Main.myPlayer];
91 Main.npcChatText = Main.chest[player.chest].name;
92 Tile tile = Main.tile[player.chestX, player.chestY];
93 if (tile.type == 21)
94 {
95 Main.defaultChestName = Lang.chestType[tile.frameX / 36].Value;
96 }
97 else if (tile.type == 467 && tile.frameX / 36 == 4)
98 {
99 Main.defaultChestName = Lang.GetItemNameValue(3988);
100 }
101 else if (tile.type == 467)
102 {
103 Main.defaultChestName = Lang.chestType2[tile.frameX / 36].Value;
104 }
105 else if (tile.type == 88)
106 {
107 Main.defaultChestName = Lang.dresserType[tile.frameX / 54].Value;
108 }
109 if (Main.npcChatText == "")
110 {
111 Main.npcChatText = Main.defaultChestName;
112 }
113 Main.editChest = true;
114 break;
115 }
116 }
117 Main.clrInput();
118 if (!CanShowVirtualKeyboard(keyboardContext))
119 {
120 return;
121 }
122 Main.inFancyUI = true;
123 switch (keyboardContext)
124 {
125 case 1:
126 Main.InGameUI.SetState(new UIVirtualKeyboard(labelText, Main.npcChatText, delegate
127 {
128 Main.SubmitSignText();
129 Close();
130 }, delegate
131 {
132 Main.InputTextSignCancel();
133 Close();
134 }, keyboardContext));
135 break;
136 case 2:
137 Main.InGameUI.SetState(new UIVirtualKeyboard(labelText, Main.npcChatText, delegate
138 {
139 ChestUI.RenameChestSubmit(Main.player[Main.myPlayer]);
140 Close();
141 }, delegate
142 {
143 ChestUI.RenameChestCancel();
144 Close();
145 }, keyboardContext));
146 break;
147 }
149 }
static void PlaySound(int type, Vector2 position, int style=1)
static string GetTextValue(string key)
Definition Language.cs:15
static void GoToDefaultPage(int specialFlag=0)
static bool CanShowVirtualKeyboard(int context)

References Terraria.UI.IngameFancyUI.CanShowVirtualKeyboard(), Terraria.Main.chest, Terraria.Player.chest, Terraria.Lang.chestType, Terraria.Lang.chestType2, Terraria.Player.chestX, Terraria.Player.chestY, Terraria.UI.IngameFancyUI.ClearChat(), Terraria.Main.clrInput(), Terraria.UI.IngameFancyUI.CoverNextFrame(), Terraria.Main.defaultChestName, Terraria.Lang.dresserType, Terraria.Tile.frameX, Terraria.Lang.GetItemNameValue(), Terraria.Localization.Language.GetTextValue(), Terraria.UI.Gamepad.UILinkPointNavigator.GoToDefaultPage(), Terraria.Main.InGameUI, Terraria.Main.myPlayer, Terraria.Main.npcChatText, Terraria.Main.player, Terraria.Audio.SoundEngine.PlaySound(), Terraria.Main.tile, and Terraria.Tile.type.

Referenced by Terraria.Main.GUIChatDrawInner(), and Terraria.UI.ChestUI.RenameChest().