private void BuildSpaceBarArea(UIPanel mainPanel) { Action createTheseTwo = (Action)(() => { bool flag = this.CanRestore(); int x = flag ? 4 : 5; bool edittingSign = this._edittingSign; int width = flag & edittingSign ? 2 : 3; UITextPanel <object> keyboardButton1 = this.CreateKeyboardButton((object)Language.GetText("UI.SpaceButton"), 2, 4, this._edittingSign || this._edittingChest & flag ? width : 6, true); keyboardButton1.OnClick += (UIElement.MouseEvent)((evt, listeningElement) => { Main.PlaySound(12, -1, -1, 1, 1f, 0.0f); this._textBox.Write(" "); this.ValidateText(); }); mainPanel.Append((UIElement)keyboardButton1); this._spacebarButton = keyboardButton1; if (!edittingSign) { return; } UITextPanel <object> keyboardButton2 = this.CreateKeyboardButton((object)Language.GetText("UI.EnterButton"), x, 4, width, true); keyboardButton2.OnClick += (UIElement.MouseEvent)((evt, listeningElement) => { Main.PlaySound(12, -1, -1, 1, 1f, 0.0f); this._textBox.Write("\n"); this.ValidateText(); }); mainPanel.Append((UIElement)keyboardButton2); this._enterButton = keyboardButton2; }); createTheseTwo(); if (!this.CanRestore()) { return; } UITextPanel <object> restoreBar = this.CreateKeyboardButton((object)Language.GetText("UI.RestoreButton"), 6, 4, 2, true); restoreBar.OnClick += (UIElement.MouseEvent)((evt, listeningElement) => { Main.PlaySound(12, -1, -1, 1, 1f, 0.0f); this.RestoreCancelledInput(this._keyboardContext); this.ValidateText(); restoreBar.Remove(); this._enterButton.Remove(); this._spacebarButton.Remove(); createTheseTwo(); }); mainPanel.Append((UIElement)restoreBar); this._restoreButton = restoreBar; }
public override void OnActivate() { uITextPanel.SetText("Mod Info: " + modDisplayName, 0.8f, true); modInfo.SetText(info); if (url.Equals("")) { modHomepageButton.Remove(); } else { uIElement.Append(modHomepageButton); } }
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; } }
// Token: 0x0600108D RID: 4237 RVA: 0x00403E6C File Offset: 0x0040206C private void BuildSpaceBarArea(UIPanel mainPanel) { Action createTheseTwo = delegate { bool flag = this.CanRestore(); int x = flag ? 4 : 5; bool edittingSign = this._edittingSign; int num = (flag & edittingSign) ? 2 : 3; UITextPanel <object> uITextPanel = this.CreateKeyboardButton(Language.GetText("UI.SpaceButton"), 2, 4, (this._edittingSign || (this._edittingChest & flag)) ? num : 6, true); uITextPanel.OnClick += (evt, listeningElement) => { Main.PlaySound(12, -1, -1, 1, 1f, 0.0f); this._textBox.Write(" "); this.ValidateText(); }; mainPanel.Append(uITextPanel); this._spacebarButton = uITextPanel; if (edittingSign) { UITextPanel <object> uITextPanel2 = this.CreateKeyboardButton(Language.GetText("UI.EnterButton"), x, 4, num, true); uITextPanel2.OnClick += (evt, listeningElement) => { Main.PlaySound(12, -1, -1, 1, 1f, 0.0f); this._textBox.Write(string.Concat((object)'\n')); this.ValidateText(); }; mainPanel.Append(uITextPanel2); this._enterButton = uITextPanel2; } }; createTheseTwo(); if (this.CanRestore()) { UITextPanel <object> restoreBar = this.CreateKeyboardButton(Language.GetText("UI.RestoreButton"), 6, 4, 2, true); restoreBar.OnClick += delegate(UIMouseEvent evt, UIElement listeningElement) { Main.PlaySound(12, -1, -1, 1, 1f, 0f); this.RestoreCancelledInput(this._keyboardContext); this.ValidateText(); restoreBar.Remove(); this._enterButton.Remove(); this._spacebarButton.Remove(); createTheseTwo(); }; mainPanel.Append(restoreBar); this._restoreButton = restoreBar; } }
public override void OnActivate() { uITextPanel.SetText(Language.GetTextValue("tModLoader.ModInfoHeader") + modDisplayName, 0.8f, true); modInfo.SetText(info); if (url.Equals("")) { modHomepageButton.Remove(); } else { uIElement.Append(modHomepageButton); } if (localMod != null) { uIElement.Append(deleteButton); uIElement.Append(extractButton); } else { deleteButton.Remove(); extractButton.Remove(); } }