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

◆ OpenVirtualKeyboard()

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

Definition at line 77 of file IngameFancyUI.cs.

78 {
80 ClearChat();
82 string labelText = "";
83 switch (keyboardContext)
84 {
85 case 1:
86 Main.editSign = true;
87 labelText = Language.GetTextValue("UI.EnterMessage");
88 break;
89 case 2:
90 {
91 labelText = Language.GetTextValue("UI.EnterNewName");
92 Player player = Main.player[Main.myPlayer];
93 Main.npcChatText = Main.chest[player.chest].name;
94 Tile tile = Main.tile[player.chestX, player.chestY];
95 if (tile.type == 21)
96 {
97 Main.defaultChestName = Lang.chestType[tile.frameX / 36].Value;
98 }
99 else if (tile.type == 467 && tile.frameX / 36 == 4)
100 {
101 Main.defaultChestName = Lang.GetItemNameValue(3988);
102 }
103 else if (tile.type == 467)
104 {
105 Main.defaultChestName = Lang.chestType2[tile.frameX / 36].Value;
106 }
107 else if (tile.type == 88)
108 {
109 Main.defaultChestName = Lang.dresserType[tile.frameX / 54].Value;
110 }
111 if (tile.type >= TileID.Count && (TileID.Sets.BasicChest[tile.type] || TileID.Sets.BasicDresser[tile.type]))
112 {
113 Main.defaultChestName = TileLoader.DefaultContainerName(tile.type, tile.TileFrameX, tile.TileFrameY);
114 }
115 if (Main.npcChatText == "")
116 {
117 Main.npcChatText = Main.defaultChestName;
118 }
119 Main.editChest = true;
120 break;
121 }
122 }
123 Main.clrInput();
125 {
126 return;
127 }
128 Main.inFancyUI = true;
129 switch (keyboardContext)
130 {
131 case 1:
132 Main.InGameUI.SetState(new UIVirtualKeyboard(labelText, Main.npcChatText, delegate
133 {
134 Main.SubmitSignText();
135 Close();
136 }, delegate
137 {
138 Main.InputTextSignCancel();
139 Close();
140 }, keyboardContext));
141 break;
142 case 2:
143 Main.InGameUI.SetState(new UIVirtualKeyboard(labelText, Main.npcChatText, delegate
144 {
145 ChestUI.RenameChestSubmit(Main.player[Main.myPlayer]);
146 Close();
147 }, delegate
148 {
149 ChestUI.RenameChestCancel();
150 Close();
151 }, keyboardContext));
152 break;
153 }
155 }
static SlotId PlaySound(in SoundStyle? style, Vector2? position=null, SoundUpdateCallback? updateCallback=null)
Attempts to play a sound style with the provided sound style (if it's not null), and returns a valid ...
static bool[] BasicDresser
Definition TileID.cs:294
static bool[] BasicChest
Definition TileID.cs:290
static readonly ushort Count
Definition TileID.cs:1928
static string GetTextValue(string key)
Retrieves the text value for a specified localization key. The text returned will be for the currentl...
Definition Language.cs:35
Contains methods to access or retrieve localization values. The Localization Guideteaches more about ...
Definition Language.cs:12
static string DefaultContainerName(int type, int frameX, int frameY)
Returns the default name for a modded chest or dresser with the provided FrameX and FrameY values.
This serves as the central class from which tile-related functions are supported and carried out.
Definition TileLoader.cs:23
static void GoToDefaultPage(int specialFlag=0)
static bool CanShowVirtualKeyboard(int context)

References Terraria.ID.TileID.Sets.BasicChest, Terraria.ID.TileID.Sets.BasicDresser, 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.ID.TileID.Count, Terraria.UI.IngameFancyUI.CoverNextFrame(), Terraria.Main.defaultChestName, Terraria.ModLoader.TileLoader.DefaultContainerName(), 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, Terraria.Tile.TileFrameX, Terraria.Tile.TileFrameY, and Terraria.Tile.type.

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function: