Ejemplo n.º 1
0
        public UIVirtualKeyboard(string labelText, string startingText, UIVirtualKeyboard.KeyboardSubmitEvent submitAction, Action cancelAction, int inputMode = 0, bool allowEmpty = false)
        {
            this._keyboardContext              = inputMode;
            this._allowEmpty                   = allowEmpty;
            UIVirtualKeyboard.OffsetDown       = 0;
            this._lastOffsetDown               = 0;
            this._edittingSign                 = this._keyboardContext == 1;
            this._edittingChest                = this._keyboardContext == 2;
            UIVirtualKeyboard._currentInstance = this;
            this._submitAction                 = submitAction;
            this._cancelAction                 = cancelAction;
            this._textureShift                 = TextureManager.Load("Images/UI/VK_Shift");
            this._textureBackspace             = TextureManager.Load("Images/UI/VK_Backspace");
            this.Top.Pixels = (float)this._lastOffsetDown;
            float     num1     = (float)(-5000 * this._edittingSign.ToInt());
            float     maxValue = (float)byte.MaxValue;
            float     num2     = 0.0f;
            float     num3     = 516f;
            UIElement element  = new UIElement();

            element.Width.Pixels  = (float)((double)num3 + 8.0 + 16.0);
            element.Top.Precent   = num2;
            element.Top.Pixels    = maxValue;
            element.Height.Pixels = 266f;
            element.HAlign        = 0.5f;
            element.SetPadding(0.0f);
            this.outerLayer1 = element;
            UIElement uiElement = new UIElement();

            uiElement.Width.Pixels  = (float)((double)num3 + 8.0 + 16.0);
            uiElement.Top.Precent   = num2;
            uiElement.Top.Pixels    = maxValue;
            uiElement.Height.Pixels = 266f;
            uiElement.HAlign        = 0.5f;
            uiElement.SetPadding(0.0f);
            this.outerLayer2 = uiElement;
            UIPanel mainPanel = new UIPanel();

            mainPanel.Width.Precent   = 1f;
            mainPanel.Height.Pixels   = 225f;
            mainPanel.BackgroundColor = new Color(23, 33, 69) * 0.7f;
            element.Append((UIElement)mainPanel);
            float num4 = -79f;

            this._textBox = new UITextBox("", 0.78f, true);
            this._textBox.BackgroundColor = Color.Transparent;
            this._textBox.BorderColor     = Color.Transparent;
            this._textBox.HAlign          = 0.5f;
            this._textBox.Width.Pixels    = num3;
            this._textBox.Top.Pixels      = (float)((double)num4 + (double)maxValue - 10.0) + num1;
            this._textBox.Top.Precent     = num2;
            this._textBox.Height.Pixels   = 37f;
            this.Append((UIElement)this._textBox);
            for (int x = 0; x < 10; ++x)
            {
                for (int y = 0; y < 4; ++y)
                {
                    UITextPanel <object> keyboardButton = this.CreateKeyboardButton((object)"1234567890qwertyuiopasdfghjkl'zxcvbnm,.?"[y * 10 + x].ToString(), x, y, 1, true);
                    keyboardButton.OnClick += new UIElement.MouseEvent(this.TypeText);
                    mainPanel.Append((UIElement)keyboardButton);
                }
            }
            this._shiftButton                 = this.CreateKeyboardButton((object)"", 0, 4, 1, false);
            this._shiftButton.PaddingLeft     = 0.0f;
            this._shiftButton.PaddingRight    = 0.0f;
            this._shiftButton.PaddingBottom   = this._shiftButton.PaddingTop = 0.0f;
            this._shiftButton.BackgroundColor = new Color(63, 82, 151) * 0.7f;
            this._shiftButton.BorderColor     = this._internalBorderColor * 0.7f;
            this._shiftButton.OnMouseOver    += (UIElement.MouseEvent)((evt, listeningElement) =>
            {
                this._shiftButton.BorderColor = this._internalBorderColorSelected;
                if (this._keyState == UIVirtualKeyboard.KeyState.Shift)
                {
                    return;
                }
                this._shiftButton.BackgroundColor = new Color(73, 94, 171);
            });
            this._shiftButton.OnMouseOut += (UIElement.MouseEvent)((evt, listeningElement) =>
            {
                this._shiftButton.BorderColor = this._internalBorderColor * 0.7f;
                if (this._keyState == UIVirtualKeyboard.KeyState.Shift)
                {
                    return;
                }
                this._shiftButton.BackgroundColor = new Color(63, 82, 151) * 0.7f;
            });
            this._shiftButton.OnClick += (UIElement.MouseEvent)((evt, listeningElement) =>
            {
                Main.PlaySound(12, -1, -1, 1, 1f, 0.0f);
                this.SetKeyState(this._keyState == UIVirtualKeyboard.KeyState.Shift ? UIVirtualKeyboard.KeyState.Default : UIVirtualKeyboard.KeyState.Shift);
            });
            UIImage uiImage1 = new UIImage(this._textureShift);

            uiImage1.HAlign     = 0.5f;
            uiImage1.VAlign     = 0.5f;
            uiImage1.ImageScale = 0.85f;
            this._shiftButton.Append((UIElement)uiImage1);
            mainPanel.Append((UIElement)this._shiftButton);
            this._symbolButton                 = this.CreateKeyboardButton((object)"@%", 1, 4, 1, false);
            this._symbolButton.PaddingLeft     = 0.0f;
            this._symbolButton.PaddingRight    = 0.0f;
            this._symbolButton.BackgroundColor = new Color(63, 82, 151) * 0.7f;
            this._symbolButton.BorderColor     = this._internalBorderColor * 0.7f;
            this._symbolButton.OnMouseOver    += (UIElement.MouseEvent)((evt, listeningElement) =>
            {
                this._symbolButton.BorderColor = this._internalBorderColorSelected;
                if (this._keyState == UIVirtualKeyboard.KeyState.Symbol)
                {
                    return;
                }
                this._symbolButton.BackgroundColor = new Color(73, 94, 171);
            });
            this._symbolButton.OnMouseOut += (UIElement.MouseEvent)((evt, listeningElement) =>
            {
                this._symbolButton.BorderColor = this._internalBorderColor * 0.7f;
                if (this._keyState == UIVirtualKeyboard.KeyState.Symbol)
                {
                    return;
                }
                this._symbolButton.BackgroundColor = new Color(63, 82, 151) * 0.7f;
            });
            this._symbolButton.OnClick += (UIElement.MouseEvent)((evt, listeningElement) =>
            {
                Main.PlaySound(12, -1, -1, 1, 1f, 0.0f);
                this.SetKeyState(this._keyState == UIVirtualKeyboard.KeyState.Symbol ? UIVirtualKeyboard.KeyState.Default : UIVirtualKeyboard.KeyState.Symbol);
            });
            mainPanel.Append((UIElement)this._symbolButton);
            this.BuildSpaceBarArea(mainPanel);
            this._submitButton = new UITextPanel <LocalizedText>(this._edittingSign || this._edittingChest ? Language.GetText("UI.Save") : Language.GetText("UI.Submit"), 0.4f, true);
            this._submitButton.Height.Pixels = 37f;
            this._submitButton.Width.Precent = 0.4f;
            this._submitButton.HAlign        = 1f;
            this._submitButton.VAlign        = 1f;
            this._submitButton.PaddingLeft   = 0.0f;
            this._submitButton.PaddingRight  = 0.0f;
            this.ValidateText();
            this._submitButton.OnMouseOver += (UIElement.MouseEvent)((evt, listeningElement) => this.ValidateText());
            this._submitButton.OnMouseOut  += (UIElement.MouseEvent)((evt, listeningElement) => this.ValidateText());
            this._submitButton.OnClick     += (UIElement.MouseEvent)((evt, listeningElement) =>
            {
                string text = this.Text.Trim();
                if (text.Length <= 0 && !this._edittingSign && (!this._edittingChest && !this._allowEmpty))
                {
                    return;
                }
                Main.PlaySound(10, -1, -1, 1, 1f, 0.0f);
                this._submitAction(text);
            });
            element.Append((UIElement)this._submitButton);
            this._cancelButton = new UITextPanel <LocalizedText>(Language.GetText("UI.Cancel"), 0.4f, true);
            this.StyleKey <LocalizedText>(this._cancelButton, true);
            this._cancelButton.Height.Pixels = 37f;
            this._cancelButton.Width.Precent = 0.4f;
            this._cancelButton.VAlign        = 1f;
            this._cancelButton.OnClick      += (UIElement.MouseEvent)((evt, listeningElement) =>
            {
                Main.PlaySound(11, -1, -1, 1, 1f, 0.0f);
                this._cancelAction();
            });
            element.Append((UIElement)this._cancelButton);
            this._submitButton2               = new UITextPanel <LocalizedText>(this._edittingSign || this._edittingChest ? Language.GetText("UI.Save") : Language.GetText("UI.Submit"), 0.72f, true);
            this._submitButton2.TextColor     = Color.Silver;
            this._submitButton2.DrawPanel     = false;
            this._submitButton2.Height.Pixels = 60f;
            this._submitButton2.Width.Precent = 0.4f;
            this._submitButton2.HAlign        = 0.5f;
            this._submitButton2.VAlign        = 0.0f;
            this._submitButton2.OnMouseOver  += (UIElement.MouseEvent)((a, b) =>
            {
                ((UITextPanel <LocalizedText>)b).TextScale = 0.85f;
                ((UITextPanel <LocalizedText>)b).TextColor = Color.White;
            });
            this._submitButton2.OnMouseOut += (UIElement.MouseEvent)((a, b) =>
            {
                ((UITextPanel <LocalizedText>)b).TextScale = 0.72f;
                ((UITextPanel <LocalizedText>)b).TextColor = Color.Silver;
            });
            this._submitButton2.Top.Pixels   = 50f;
            this._submitButton2.PaddingLeft  = 0.0f;
            this._submitButton2.PaddingRight = 0.0f;
            this.ValidateText();
            this._submitButton2.OnMouseOver += (UIElement.MouseEvent)((evt, listeningElement) => this.ValidateText());
            this._submitButton2.OnMouseOut  += (UIElement.MouseEvent)((evt, listeningElement) => this.ValidateText());
            this._submitButton2.OnClick     += (UIElement.MouseEvent)((evt, listeningElement) =>
            {
                string text = this.Text.Trim();
                if (text.Length <= 0 && !this._edittingSign && (!this._edittingChest && !this._allowEmpty))
                {
                    return;
                }
                Main.PlaySound(10, -1, -1, 1, 1f, 0.0f);
                this._submitAction(text);
            });
            this.outerLayer2.Append((UIElement)this._submitButton2);
            this._cancelButton2              = new UITextPanel <LocalizedText>(Language.GetText("UI.Cancel"), 0.72f, true);
            this._cancelButton2.TextColor    = Color.Silver;
            this._cancelButton2.DrawPanel    = false;
            this._cancelButton2.OnMouseOver += (UIElement.MouseEvent)((a, b) =>
            {
                ((UITextPanel <LocalizedText>)b).TextScale = 0.85f;
                ((UITextPanel <LocalizedText>)b).TextColor = Color.White;
            });
            this._cancelButton2.OnMouseOut += (UIElement.MouseEvent)((a, b) =>
            {
                ((UITextPanel <LocalizedText>)b).TextScale = 0.72f;
                ((UITextPanel <LocalizedText>)b).TextColor = Color.Silver;
            });
            this._cancelButton2.Height.Pixels = 60f;
            this._cancelButton2.Width.Precent = 0.4f;
            this._cancelButton2.Top.Pixels    = 114f;
            this._cancelButton2.VAlign        = 0.0f;
            this._cancelButton2.HAlign        = 0.5f;
            this._cancelButton2.OnClick      += (UIElement.MouseEvent)((evt, listeningElement) =>
            {
                Main.PlaySound(11, -1, -1, 1, 1f, 0.0f);
                this._cancelAction();
            });
            this.outerLayer2.Append((UIElement)this._cancelButton2);
            UITextPanel <object> keyboardButton1 = this.CreateKeyboardButton((object)"", 8, 4, 2, true);

            keyboardButton1.OnClick += (UIElement.MouseEvent)((evt, listeningElement) =>
            {
                Main.PlaySound(12, -1, -1, 1, 1f, 0.0f);
                this._textBox.Backspace();
                this.ValidateText();
            });
            keyboardButton1.PaddingLeft   = 0.0f;
            keyboardButton1.PaddingRight  = 0.0f;
            keyboardButton1.PaddingBottom = keyboardButton1.PaddingTop = 0.0f;
            UIImage uiImage2 = new UIImage(this._textureBackspace);

            uiImage2.HAlign     = 0.5f;
            uiImage2.VAlign     = 0.5f;
            uiImage2.ImageScale = 0.92f;
            keyboardButton1.Append((UIElement)uiImage2);
            mainPanel.Append((UIElement)keyboardButton1);
            UIText uiText = new UIText(labelText, 0.75f, true);

            uiText.HAlign        = 0.5f;
            uiText.Width.Pixels  = num3;
            uiText.Top.Pixels    = (float)((double)num4 - 37.0 - 4.0) + maxValue + num1;
            uiText.Top.Precent   = num2;
            uiText.Height.Pixels = 37f;
            this.Append((UIElement)uiText);
            this._label = uiText;
            this.Append(element);
            this._textBox.SetTextMaxLength(this._edittingSign ? 99999 : 20);
            this.Text = startingText;
            if (this.Text.Length == 0)
            {
                this.SetKeyState(UIVirtualKeyboard.KeyState.Shift);
            }
            UIVirtualKeyboard.OffsetDown = 9999;
            this.UpdateOffsetDown();
        }
Ejemplo n.º 2
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);
        }
Ejemplo n.º 3
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);
        }
Ejemplo n.º 4
0
        // Token: 0x0600108C RID: 4236 RVA: 0x004033E4 File Offset: 0x004015E4
        public UIVirtualKeyboard(string labelText, string startingText, UIVirtualKeyboard.KeyboardSubmitEvent submitAction, Action cancelAction, int inputMode = 0, bool allowEmpty = false)
        {
            this._keyboardContext              = inputMode;
            this._allowEmpty                   = allowEmpty;
            UIVirtualKeyboard.OffsetDown       = 0;
            this._lastOffsetDown               = 0;
            this._edittingSign                 = (this._keyboardContext == 1);
            this._edittingChest                = (this._keyboardContext == 2);
            UIVirtualKeyboard._currentInstance = this;
            this._submitAction                 = submitAction;
            this._cancelAction                 = cancelAction;
            this._textureShift                 = TextureManager.Load("Images/UI/VK_Shift");
            this._textureBackspace             = TextureManager.Load("Images/UI/VK_Backspace");
            this.Top.Pixels = (float)this._lastOffsetDown;
            float     num       = (float)(-5000 * this._edittingSign.ToInt());
            float     num2      = 255f;
            float     precent   = 0f;
            float     num3      = 516f;
            UIElement uIElement = new UIElement();

            uIElement.Width.Pixels  = num3 + 8f + 16f;
            uIElement.Top.Precent   = precent;
            uIElement.Top.Pixels    = num2;
            uIElement.Height.Pixels = 266f;
            uIElement.HAlign        = 0.5f;
            uIElement.SetPadding(0f);
            this.outerLayer1 = uIElement;
            UIElement uIElement2 = new UIElement();

            uIElement2.Width.Pixels  = num3 + 8f + 16f;
            uIElement2.Top.Precent   = precent;
            uIElement2.Top.Pixels    = num2;
            uIElement2.Height.Pixels = 266f;
            uIElement2.HAlign        = 0.5f;
            uIElement2.SetPadding(0f);
            this.outerLayer2 = uIElement2;
            UIPanel uIPanel = new UIPanel();

            uIPanel.Width.Precent   = 1f;
            uIPanel.Height.Pixels   = 225f;
            uIPanel.BackgroundColor = new Color(23, 33, 69) * 0.7f;
            uIElement.Append(uIPanel);
            float num4 = -79f;

            this._textBox = new UITextBox("", 0.78f, true);
            this._textBox.BackgroundColor = Color.Transparent;
            this._textBox.BorderColor     = Color.Transparent;
            this._textBox.HAlign          = 0.5f;
            this._textBox.Width.Pixels    = num3;
            this._textBox.Top.Pixels      = num4 + num2 - 10f + num;
            this._textBox.Top.Precent     = precent;
            this._textBox.Height.Pixels   = 37f;
            base.Append(this._textBox);
            for (int i = 0; i < 10; i++)
            {
                for (int j = 0; j < 4; j++)
                {
                    int index = j * 10 + i;
                    UITextPanel <object> uITextPanel = this.CreateKeyboardButton("1234567890qwertyuiopasdfghjkl'zxcvbnm,.?"[index].ToString(), i, j, 1, true);
                    uITextPanel.OnClick += new UIElement.MouseEvent(this.TypeText);
                    uIPanel.Append(uITextPanel);
                }
            }
            this._shiftButton                 = this.CreateKeyboardButton("", 0, 4, 1, false);
            this._shiftButton.PaddingLeft     = 0f;
            this._shiftButton.PaddingRight    = 0f;
            this._shiftButton.PaddingBottom   = (this._shiftButton.PaddingTop = 0f);
            this._shiftButton.BackgroundColor = new Color(63, 82, 151) * 0.7f;
            this._shiftButton.BorderColor     = this._internalBorderColor * 0.7f;
            this._shiftButton.OnMouseOver    += delegate(UIMouseEvent evt, UIElement listeningElement)
            {
                this._shiftButton.BorderColor = this._internalBorderColorSelected;
                if (this._keyState != UIVirtualKeyboard.KeyState.Shift)
                {
                    this._shiftButton.BackgroundColor = new Color(73, 94, 171);
                }
            };
            this._shiftButton.OnMouseOut += delegate(UIMouseEvent evt, UIElement listeningElement)
            {
                this._shiftButton.BorderColor = this._internalBorderColor * 0.7f;
                if (this._keyState != UIVirtualKeyboard.KeyState.Shift)
                {
                    this._shiftButton.BackgroundColor = new Color(63, 82, 151) * 0.7f;
                }
            };
            this._shiftButton.OnClick += delegate(UIMouseEvent evt, UIElement listeningElement)
            {
                Main.PlaySound(12, -1, -1, 1, 1f, 0f);
                this.SetKeyState((this._keyState == UIVirtualKeyboard.KeyState.Shift) ? UIVirtualKeyboard.KeyState.Default : UIVirtualKeyboard.KeyState.Shift);
            };
            UIImage uIImage = new UIImage(this._textureShift);

            uIImage.HAlign     = 0.5f;
            uIImage.VAlign     = 0.5f;
            uIImage.ImageScale = 0.85f;
            this._shiftButton.Append(uIImage);
            uIPanel.Append(this._shiftButton);
            this._symbolButton                 = this.CreateKeyboardButton("@%", 1, 4, 1, false);
            this._symbolButton.PaddingLeft     = 0f;
            this._symbolButton.PaddingRight    = 0f;
            this._symbolButton.BackgroundColor = new Color(63, 82, 151) * 0.7f;
            this._symbolButton.BorderColor     = this._internalBorderColor * 0.7f;
            this._symbolButton.OnMouseOver    += delegate(UIMouseEvent evt, UIElement listeningElement)
            {
                this._symbolButton.BorderColor = this._internalBorderColorSelected;
                if (this._keyState != UIVirtualKeyboard.KeyState.Symbol)
                {
                    this._symbolButton.BackgroundColor = new Color(73, 94, 171);
                }
            };
            this._symbolButton.OnMouseOut += delegate(UIMouseEvent evt, UIElement listeningElement)
            {
                this._symbolButton.BorderColor = this._internalBorderColor * 0.7f;
                if (this._keyState != UIVirtualKeyboard.KeyState.Symbol)
                {
                    this._symbolButton.BackgroundColor = new Color(63, 82, 151) * 0.7f;
                }
            };
            this._symbolButton.OnClick += delegate(UIMouseEvent evt, UIElement listeningElement)
            {
                Main.PlaySound(12, -1, -1, 1, 1f, 0f);
                this.SetKeyState((this._keyState == UIVirtualKeyboard.KeyState.Symbol) ? UIVirtualKeyboard.KeyState.Default : UIVirtualKeyboard.KeyState.Symbol);
            };
            uIPanel.Append(this._symbolButton);
            this.BuildSpaceBarArea(uIPanel);
            this._submitButton = new UITextPanel <LocalizedText>((this._edittingSign || this._edittingChest) ? Language.GetText("UI.Save") : Language.GetText("UI.Submit"), 0.4f, true);
            this._submitButton.Height.Pixels = 37f;
            this._submitButton.Width.Precent = 0.4f;
            this._submitButton.HAlign        = 1f;
            this._submitButton.VAlign        = 1f;
            this._submitButton.PaddingLeft   = 0f;
            this._submitButton.PaddingRight  = 0f;
            this.ValidateText();
            this._submitButton.OnMouseOver += delegate(UIMouseEvent evt, UIElement listeningElement)
            {
                this.ValidateText();
            };
            this._submitButton.OnMouseOut += delegate(UIMouseEvent evt, UIElement listeningElement)
            {
                this.ValidateText();
            };
            this._submitButton.OnClick += delegate(UIMouseEvent evt, UIElement listeningElement)
            {
                string text = this.Text.Trim();
                if (text.Length > 0 || this._edittingSign || this._edittingChest || this._allowEmpty)
                {
                    Main.PlaySound(10, -1, -1, 1, 1f, 0f);
                    this._submitAction(text);
                }
            };
            uIElement.Append(this._submitButton);
            this._cancelButton = new UITextPanel <LocalizedText>(Language.GetText("UI.Cancel"), 0.4f, true);
            this.StyleKey <LocalizedText>(this._cancelButton, true);
            this._cancelButton.Height.Pixels = 37f;
            this._cancelButton.Width.Precent = 0.4f;
            this._cancelButton.VAlign        = 1f;
            this._cancelButton.OnClick      += delegate(UIMouseEvent evt, UIElement listeningElement)
            {
                Main.PlaySound(11, -1, -1, 1, 1f, 0f);
                this._cancelAction();
            };
            uIElement.Append(this._cancelButton);
            this._submitButton2               = new UITextPanel <LocalizedText>((this._edittingSign || this._edittingChest) ? Language.GetText("UI.Save") : Language.GetText("UI.Submit"), 0.72f, true);
            this._submitButton2.TextColor     = Color.Silver;
            this._submitButton2.DrawPanel     = false;
            this._submitButton2.Height.Pixels = 60f;
            this._submitButton2.Width.Precent = 0.4f;
            this._submitButton2.HAlign        = 0.5f;
            this._submitButton2.VAlign        = 0f;
            UIElement arg_750_0 = this._submitButton2;

            arg_750_0.OnMouseOver += (a, b) =>
            {
                ((UITextPanel <LocalizedText>)b).TextScale = 0.85f;
                ((UITextPanel <LocalizedText>)b).TextColor = Color.White;
            };
            UIElement arg_77A_0 = this._submitButton2;

            arg_77A_0.OnMouseOut += (a, b) =>
            {
                ((UITextPanel <LocalizedText>)b).TextScale = 0.72f;
                ((UITextPanel <LocalizedText>)b).TextColor = Color.Silver;
            };
            this._submitButton2.Top.Pixels   = 50f;
            this._submitButton2.PaddingLeft  = 0f;
            this._submitButton2.PaddingRight = 0f;
            this.ValidateText();
            this._submitButton2.OnMouseOver += delegate(UIMouseEvent evt, UIElement listeningElement)
            {
                this.ValidateText();
            };
            this._submitButton2.OnMouseOut += delegate(UIMouseEvent evt, UIElement listeningElement)
            {
                this.ValidateText();
            };
            this._submitButton2.OnClick += delegate(UIMouseEvent evt, UIElement listeningElement)
            {
                string text = this.Text.Trim();
                if (text.Length > 0 || this._edittingSign || this._edittingChest || this._allowEmpty)
                {
                    Main.PlaySound(10, -1, -1, 1, 1f, 0f);
                    this._submitAction(text);
                }
            };
            this.outerLayer2.Append(this._submitButton2);
            this._cancelButton2           = new UITextPanel <LocalizedText>(Language.GetText("UI.Cancel"), 0.72f, true);
            this._cancelButton2.TextColor = Color.Silver;
            this._cancelButton2.DrawPanel = false;
            UIElement arg_86C_0 = this._cancelButton2;

            arg_86C_0.OnMouseOver += (a, b) =>
            {
                ((UITextPanel <LocalizedText>)b).TextScale = 0.85f;
                ((UITextPanel <LocalizedText>)b).TextColor = Color.White;
            };
            UIElement arg_896_0 = this._cancelButton2;

            arg_896_0.OnMouseOut += (a, b) =>
            {
                ((UITextPanel <LocalizedText>)b).TextScale = 0.72f;
                ((UITextPanel <LocalizedText>)b).TextColor = Color.Silver;
            };
            this._cancelButton2.Height.Pixels = 60f;
            this._cancelButton2.Width.Precent = 0.4f;
            this._cancelButton2.Top.Pixels    = 114f;
            this._cancelButton2.VAlign        = 0f;
            this._cancelButton2.HAlign        = 0.5f;
            this._cancelButton2.OnClick      += delegate(UIMouseEvent evt, UIElement listeningElement)
            {
                Main.PlaySound(11, -1, -1, 1, 1f, 0f);
                this._cancelAction();
            };
            this.outerLayer2.Append(this._cancelButton2);
            UITextPanel <object> uITextPanel2 = this.CreateKeyboardButton("", 8, 4, 2, true);

            uITextPanel2.OnClick += delegate(UIMouseEvent evt, UIElement listeningElement)
            {
                Main.PlaySound(12, -1, -1, 1, 1f, 0f);
                this._textBox.Backspace();
                this.ValidateText();
            };
            uITextPanel2.PaddingLeft   = 0f;
            uITextPanel2.PaddingRight  = 0f;
            uITextPanel2.PaddingBottom = (uITextPanel2.PaddingTop = 0f);
            uITextPanel2.Append(new UIImage(this._textureBackspace)
            {
                HAlign     = 0.5f,
                VAlign     = 0.5f,
                ImageScale = 0.92f
            });
            uIPanel.Append(uITextPanel2);
            UIText uIText = new UIText(labelText, 0.75f, true);

            uIText.HAlign        = 0.5f;
            uIText.Width.Pixels  = num3;
            uIText.Top.Pixels    = num4 - 37f - 4f + num2 + num;
            uIText.Top.Precent   = precent;
            uIText.Height.Pixels = 37f;
            base.Append(uIText);
            this._label = uIText;
            base.Append(uIElement);
            this._textBox.SetTextMaxLength(this._edittingSign ? 99999 : 20);
            this.Text = startingText;
            if (this.Text.Length == 0)
            {
                this.SetKeyState(UIVirtualKeyboard.KeyState.Shift);
            }
            UIVirtualKeyboard.OffsetDown = 9999;
            this.UpdateOffsetDown();
        }