private void BuildSpaceBarArea(UIPanel mainPanel) { Action createTheseTwo = delegate { bool flag = CanRestore(); int x = (flag ? 4 : 5); bool edittingSign = _edittingSign; int num = ((flag && edittingSign) ? 2 : 3); UITextPanel <object> uITextPanel = CreateKeyboardButton(Language.GetText("UI.SpaceButton"), 2, 4, (_edittingSign || (_edittingChest && flag)) ? num : 6); uITextPanel.OnClick += delegate { SoundEngine.PlaySound(12); _textBox.Write(" "); ValidateText(); }; mainPanel.Append(uITextPanel); _spacebarButton = uITextPanel; if (edittingSign) { UITextPanel <object> uITextPanel2 = CreateKeyboardButton(Language.GetText("UI.EnterButton"), x, 4, num); uITextPanel2.OnClick += delegate { SoundEngine.PlaySound(12); _textBox.Write("\n"); ValidateText(); }; mainPanel.Append(uITextPanel2); _enterButton = uITextPanel2; } }; createTheseTwo(); if (CanRestore()) { UITextPanel <object> restoreBar = CreateKeyboardButton(Language.GetText("UI.RestoreButton"), 6, 4, 2); restoreBar.OnClick += delegate { SoundEngine.PlaySound(12); RestoreCancelledInput(_keyboardContext); ValidateText(); restoreBar.Remove(); _enterButton.Remove(); _spacebarButton.Remove(); createTheseTwo(); }; mainPanel.Append(restoreBar); _restoreButton = restoreBar; } }