public static void OpenVirtualKeyboard(int keyboardContext)
        {
            IngameFancyUI.CoverNextFrame();
            Main.PlaySound(12, -1, -1, 1, 1f, 0.0f);
            var labelText = "";

            switch (keyboardContext)
            {
            case 1:
                Main.editSign = true;
                labelText     = Language.GetTextValue("UI.EnterMessage");
                break;

            case 2:
                labelText = Language.GetTextValue("UI.EnterNewName");
                var player = Main.player[Main.myPlayer];
                Main.npcChatText = Main.chest[player.chest].name;
                if (Main.tile[player.chestX, player.chestY].type == (ushort)21)
                {
                    Main.defaultChestName =
                        Lang.chestType[(int)Main.tile[player.chestX, player.chestY].frameX / 36].Value;
                }
                if (Main.tile[player.chestX, player.chestY].type == (ushort)467)
                {
                    Main.defaultChestName =
                        Lang.chestType2[(int)Main.tile[player.chestX, player.chestY].frameX / 36].Value;
                }
                if (Main.tile[player.chestX, player.chestY].type == (ushort)88)
                {
                    Main.defaultChestName =
                        Lang.dresserType[(int)Main.tile[player.chestX, player.chestY].frameX / 54].Value;
                }
                if (Main.npcChatText == "")
                {
                    Main.npcChatText = Main.defaultChestName;
                }
                Main.editChest = true;
                break;
            }

            Main.clrInput();
            if (!IngameFancyUI.CanShowVirtualKeyboard(keyboardContext))
            {
                return;
            }
            Main.inFancyUI = true;
            switch (keyboardContext)
            {
            case 1:
                Main.InGameUI.SetState((UIState) new UIVirtualKeyboard(labelText, Main.npcChatText,
                                                                       (UIVirtualKeyboard.KeyboardSubmitEvent)(s =>
                {
                    Main.SubmitSignText();
                    IngameFancyUI.Close();
                }), (Action)(() =>
                {
                    Main.InputTextSignCancel();
                    IngameFancyUI.Close();
                }), keyboardContext, false));
                break;

            case 2:
                Main.InGameUI.SetState((UIState) new UIVirtualKeyboard(labelText, Main.npcChatText,
                                                                       (UIVirtualKeyboard.KeyboardSubmitEvent)(s =>
                {
                    ChestUI.RenameChestSubmit(Main.player[Main.myPlayer]);
                    IngameFancyUI.Close();
                }), (Action)(() =>
                {
                    ChestUI.RenameChestCancel();
                    IngameFancyUI.Close();
                }), keyboardContext, false));
                break;
            }

            UILinkPointNavigator.GoToDefaultPage(1);
        }
Example #2
0
        public static void OpenVirtualKeyboard(int keyboardContext)
        {
            IngameFancyUI.CoverNextFrame();
            Main.PlaySound(12, -1, -1, 1, 1f, 0.0f);
            string str = "";

            if (keyboardContext != 1)
            {
                if (keyboardContext == 2)
                {
                    str = Language.GetTextValue("UI.EnterNewName");
                    Player player = Main.player[Main.myPlayer];
                    Main.npcChatText = Main.chest[player.chest].name;
                    if ((int)Main.tile[player.chestX, player.chestY].type == 21)
                    {
                        Main.defaultChestName = Lang.chestType[(int)Main.tile[player.chestX, player.chestY].frameX / 36].Value;
                    }
                    if ((int)Main.tile[player.chestX, player.chestY].type == 467)
                    {
                        Main.defaultChestName = Lang.chestType2[(int)Main.tile[player.chestX, player.chestY].frameX / 36].Value;
                    }
                    if ((int)Main.tile[player.chestX, player.chestY].type == 88)
                    {
                        Main.defaultChestName = Lang.dresserType[(int)Main.tile[player.chestX, player.chestY].frameX / 54].Value;
                    }
                    if (Main.npcChatText == "")
                    {
                        Main.npcChatText = Main.defaultChestName;
                    }
                    Main.editChest = true;
                }
            }
            else
            {
                Main.editSign = true;
                str           = Language.GetTextValue("UI.EnterMessage");
            }
            Main.clrInput();
            if (!IngameFancyUI.CanShowVirtualKeyboard(keyboardContext))
            {
                return;
            }
            Main.inFancyUI = true;
            if (keyboardContext != 1)
            {
                if (keyboardContext == 2)
                {
                    UserInterface inGameUi    = Main.InGameUI;
                    string        labelText   = str;
                    string        npcChatText = Main.npcChatText;
                    UIVirtualKeyboard.KeyboardSubmitEvent keyboardSubmitEvent = (UIVirtualKeyboard.KeyboardSubmitEvent)(s =>
                    {
                        ChestUI.RenameChestSubmit(Main.player[Main.myPlayer]);
                        IngameFancyUI.Close();
                    });
                    int inputMode = keyboardContext;
                    int num       = 0;
                    UIVirtualKeyboard.KeyboardSubmitEvent submitAction;
                    UIVirtualKeyboard uiVirtualKeyboard = new UIVirtualKeyboard(labelText, npcChatText, submitAction, (Action)(() =>
                    {
                        ChestUI.RenameChestCancel();
                        IngameFancyUI.Close();
                    }), inputMode, num != 0);
                    inGameUi.SetState((UIState)uiVirtualKeyboard);
                }
            }
            else
            {
                UserInterface inGameUi    = Main.InGameUI;
                string        labelText   = str;
                string        npcChatText = Main.npcChatText;
                UIVirtualKeyboard.KeyboardSubmitEvent keyboardSubmitEvent = (UIVirtualKeyboard.KeyboardSubmitEvent)(s =>
                {
                    Main.SubmitSignText();
                    IngameFancyUI.Close();
                });
                int inputMode = keyboardContext;
                int num       = 0;
                UIVirtualKeyboard.KeyboardSubmitEvent submitAction;
                UIVirtualKeyboard uiVirtualKeyboard = new UIVirtualKeyboard(labelText, npcChatText, submitAction, (Action)(() =>
                {
                    Main.InputTextSignCancel();
                    IngameFancyUI.Close();
                }), inputMode, num != 0);
                inGameUi.SetState((UIState)uiVirtualKeyboard);
            }
            UILinkPointNavigator.GoToDefaultPage(1);
        }
Example #3
0
        public static void OpenVirtualKeyboard(int keyboardContext)
        {
            IngameFancyUI.CoverNextFrame();
            Main.PlaySound(12, -1, -1, 1, 1f, 0.0f);
            string str = "";

            switch (keyboardContext)
            {
            case 1:
                Main.editSign = true;
                str           = Language.GetTextValue("UI.EnterMessage");
                break;

            case 2:
                str = Language.GetTextValue("UI.EnterNewName");
                Player player = Main.player[Main.myPlayer];
                Main.npcChatText = Main.chest[player.chest].name;
                if ((int)Main.tile[player.chestX, player.chestY].type == 21)
                {
                    Main.defaultChestName = Lang.chestType[(int)Main.tile[player.chestX, player.chestY].frameX / 36].Value;
                }
                if ((int)Main.tile[player.chestX, player.chestY].type == 467)
                {
                    Main.defaultChestName = Lang.chestType2[(int)Main.tile[player.chestX, player.chestY].frameX / 36].Value;
                }
                if ((int)Main.tile[player.chestX, player.chestY].type == 88)
                {
                    Main.defaultChestName = Lang.dresserType[(int)Main.tile[player.chestX, player.chestY].frameX / 54].Value;
                }
                if (Main.npcChatText == "")
                {
                    Main.npcChatText = Main.defaultChestName;
                }
                Main.editChest = true;
                break;
            }
            Main.clrInput();
            if (!IngameFancyUI.CanShowVirtualKeyboard(keyboardContext))
            {
                return;
            }
            Main.inFancyUI = true;
            switch (keyboardContext)
            {
            case 1:
                UserInterface inGameUi1    = Main.InGameUI;
                string        labelText1   = str;
                string        npcChatText1 = Main.npcChatText;
                UIVirtualKeyboard.KeyboardSubmitEvent submitAction1 = (UIVirtualKeyboard.KeyboardSubmitEvent)(s =>
                {
                    Main.SubmitSignText();
                    IngameFancyUI.Close();
                });
                // ISSUE: reference to a compiler-generated field
                if (IngameFancyUI.CS\u0024\u003C\u003E9__CachedAnonymousMethodDelegate5 == null)
                {
                    // ISSUE: reference to a compiler-generated field
                    // ISSUE: method pointer
                    IngameFancyUI.CS\u0024\u003C\u003E9__CachedAnonymousMethodDelegate5 = new Action((object)null, __methodptr(\u003COpenVirtualKeyboard\u003Eb__1));
                }
                // ISSUE: reference to a compiler-generated field
                Action            anonymousMethodDelegate5 = IngameFancyUI.CS\u0024\u003C\u003E9__CachedAnonymousMethodDelegate5;
                int               inputMode1         = keyboardContext;
                int               num1               = 0;
                UIVirtualKeyboard uiVirtualKeyboard1 = new UIVirtualKeyboard(labelText1, npcChatText1, submitAction1, anonymousMethodDelegate5, inputMode1, num1 != 0);
                inGameUi1.SetState((UIState)uiVirtualKeyboard1);
                break;

            case 2:
                UserInterface inGameUi2    = Main.InGameUI;
                string        labelText2   = str;
                string        npcChatText2 = Main.npcChatText;
                UIVirtualKeyboard.KeyboardSubmitEvent submitAction2 = (UIVirtualKeyboard.KeyboardSubmitEvent)(s =>
                {
                    ChestUI.RenameChestSubmit(Main.player[Main.myPlayer]);
                    IngameFancyUI.Close();
                });
                // ISSUE: reference to a compiler-generated field
                if (IngameFancyUI.CS\u0024\u003C\u003E9__CachedAnonymousMethodDelegate7 == null)
                {
                    // ISSUE: reference to a compiler-generated field
                    // ISSUE: method pointer
                    IngameFancyUI.CS\u0024\u003C\u003E9__CachedAnonymousMethodDelegate7 = new Action((object)null, __methodptr(\u003COpenVirtualKeyboard\u003Eb__3));
                }
                // ISSUE: reference to a compiler-generated field
                Action            anonymousMethodDelegate7 = IngameFancyUI.CS\u0024\u003C\u003E9__CachedAnonymousMethodDelegate7;
                int               inputMode2         = keyboardContext;
                int               num2               = 0;
                UIVirtualKeyboard uiVirtualKeyboard2 = new UIVirtualKeyboard(labelText2, npcChatText2, submitAction2, anonymousMethodDelegate7, inputMode2, num2 != 0);
                inGameUi2.SetState((UIState)uiVirtualKeyboard2);
                break;
            }
            UILinkPointNavigator.GoToDefaultPage(1);
        }
Example #4
0
        public static void OpenVirtualKeyboard(int keyboardContext)
        {
            CoverNextFrame();
            ClearChat();
            SoundEngine.PlaySound(12);
            string labelText = "";

            switch (keyboardContext)
            {
            case 1:
                Main.editSign = true;
                labelText     = Language.GetTextValue("UI.EnterMessage");
                break;

            case 2:
            {
                labelText = Language.GetTextValue("UI.EnterNewName");
                Player player = Main.player[Main.myPlayer];
                Main.npcChatText = Main.chest[player.chest].name;
                Tile tile = Main.tile[player.chestX, player.chestY];
                if (tile.type == 21)
                {
                    Main.defaultChestName = Lang.chestType[tile.frameX / 36].Value;
                }
                else if (tile.type == 467 && tile.frameX / 36 == 4)
                {
                    Main.defaultChestName = Lang.GetItemNameValue(3988);
                }
                else if (tile.type == 467)
                {
                    Main.defaultChestName = Lang.chestType2[tile.frameX / 36].Value;
                }
                else if (tile.type == 88)
                {
                    Main.defaultChestName = Lang.dresserType[tile.frameX / 54].Value;
                }
                if (Main.npcChatText == "")
                {
                    Main.npcChatText = Main.defaultChestName;
                }
                Main.editChest = true;
                break;
            }
            }
            Main.clrInput();
            if (CanShowVirtualKeyboard(keyboardContext))
            {
                Main.inFancyUI = true;
                switch (keyboardContext)
                {
                case 1:
                    Main.InGameUI.SetState(new UIVirtualKeyboard(labelText, Main.npcChatText, delegate
                    {
                        Main.SubmitSignText();
                        Close();
                    }, delegate
                    {
                        Main.InputTextSignCancel();
                        Close();
                    }, keyboardContext));
                    break;

                case 2:
                    Main.InGameUI.SetState(new UIVirtualKeyboard(labelText, Main.npcChatText, delegate
                    {
                        ChestUI.RenameChestSubmit(Main.player[Main.myPlayer]);
                        Close();
                    }, delegate
                    {
                        ChestUI.RenameChestCancel();
                        Close();
                    }, keyboardContext));
                    break;
                }
                UILinkPointNavigator.GoToDefaultPage(1);
            }
        }
Example #5
0
        // Token: 0x06000BBC RID: 3004 RVA: 0x003CF118 File Offset: 0x003CD318
        public static void OpenVirtualKeyboard(int keyboardContext)
        {
            IngameFancyUI.CoverNextFrame();
            Main.PlaySound(12, -1, -1, 1, 1f, 0f);
            string text = "";

            if (keyboardContext != 1)
            {
                if (keyboardContext == 2)
                {
                    text = Language.GetTextValue("UI.EnterNewName");
                    Player player = Main.player[Main.myPlayer];
                    Main.npcChatText = Main.chest[player.chest].name;
                    if (Main.tile[player.chestX, player.chestY].type == 21)
                    {
                        Main.defaultChestName = Lang.chestType[(int)(Main.tile[player.chestX, player.chestY].frameX / 36)].Value;
                    }
                    if (Main.tile[player.chestX, player.chestY].type == 467)
                    {
                        Main.defaultChestName = Lang.chestType2[(int)(Main.tile[player.chestX, player.chestY].frameX / 36)].Value;
                    }
                    if (Main.tile[player.chestX, player.chestY].type == 88)
                    {
                        Main.defaultChestName = Lang.dresserType[(int)(Main.tile[player.chestX, player.chestY].frameX / 54)].Value;
                    }
                    if (Main.npcChatText == "")
                    {
                        Main.npcChatText = Main.defaultChestName;
                    }
                    Main.editChest = true;
                }
            }
            else
            {
                Main.editSign = true;
                text          = Language.GetTextValue("UI.EnterMessage");
            }
            Main.clrInput();
            if (!IngameFancyUI.CanShowVirtualKeyboard(keyboardContext))
            {
                return;
            }
            Main.inFancyUI = true;
            if (keyboardContext != 1)
            {
                if (keyboardContext == 2)
                {
                    UserInterface arg_243_0 = Main.InGameUI;
                    string        arg_23E_0 = text;
                    string        arg_23E_1 = Main.npcChatText;
                    arg_243_0.SetState(new UIVirtualKeyboard(arg_23E_0, arg_23E_1, (s) => {
                        ChestUI.RenameChestSubmit(Main.player[Main.myPlayer]);
                        IngameFancyUI.Close();
                    }, () => {
                        ChestUI.RenameChestCancel();
                        IngameFancyUI.Close();
                    }, keyboardContext, false));
                }
            }
            else
            {
                UserInterface arg_1EC_0 = Main.InGameUI;
                string        arg_1E7_0 = text;
                string        arg_1E7_1 = Main.npcChatText;
                arg_1EC_0.SetState(new UIVirtualKeyboard(arg_1E7_0, arg_1E7_1, (s) => {
                    Main.SubmitSignText();
                    IngameFancyUI.Close();
                }, () => {
                    Main.InputTextSignCancel();
                    IngameFancyUI.Close();
                }, keyboardContext, false));
            }
            UILinkPointNavigator.GoToDefaultPage(1);
        }