private void changeNameBoxOnCharacterCustomizer() { object l = new CharacterCustomization(null, null, null, false); object nameBox = new StardewValley.Menus.TextBox(null, null, Game1.smoothFont, Color.White); object text = new string(new char[5] { 'a', 'b', 'c', 'd', 'e' }); l = (StardewValley.Menus.CharacterCustomization)Game1.activeClickableMenu.GetType().GetField("subMenu", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(Game1.activeClickableMenu); Log.AsyncM(l); if (l == null) { Log.AsyncC("cry"); } nameBox = (TextBox)l.GetType().GetField("nameBox", BindingFlags.NonPublic | BindingFlags.Instance).GetValue(l); if (nameBox == null) { Log.AsyncM("BLARG"); } Log.AsyncG(nameBox); text = (string)nameBox.GetType().GetField("_text", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(nameBox); if ((text as string) == "") { Log.AsyncM("WTF"); } nameBox.GetType().GetField("_text", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(nameBox, "f**k"); }
private void TextBoxEnter(StardewValley.Menus.TextBox sender) { if (sender.Text.Length < MinLength) { return; } if (_doneEnter != null) { _doneEnter(sender.Text); _textBox.Selected = false; } }
/// <summary> /// Initialize the buttons for the menu. /// </summary> private void initializeButtons() { this.leftButton = new AnimatedButton(new StardustCore.Animations.AnimatedSprite("Left Button", new Vector2(this.xPositionOnScreen, this.yPositionOnScreen), new StardustCore.Animations.AnimationManager(TextureManager.GetExtendedTexture(ModCore.Manifest, "InventoryMenu", "PreviousPageButton"), new StardustCore.Animations.Animation(0, 0, 32, 32)), Color.White), new Rectangle(0, 0, 32, 32), 2f); this.rightButton = new AnimatedButton(new StardustCore.Animations.AnimatedSprite("Right Button", new Vector2(this.xPositionOnScreen + this.width, this.yPositionOnScreen), new StardustCore.Animations.AnimationManager(TextureManager.GetExtendedTexture(ModCore.Manifest, "InventoryMenu", "NextPageButton"), new StardustCore.Animations.Animation(0, 0, 32, 32)), Color.White), new Rectangle(0, 0, 32, 32), 2f); this.searchBox = new TextBox((Texture2D)null, (Texture2D)null, Game1.dialogueFont, Game1.textColor); this.searchBox.X = this.xPositionOnScreen + this.width + 96; this.searchBox.Y = this.yPositionOnScreen; this.searchBox.Width = 256; this.searchBox.Height = 192; Game1.keyboardDispatcher.Subscriber = (IKeyboardSubscriber)this.searchBox; this.searchBox.Selected = false; }
private void TextBoxEnter(StardewValley.Menus.TextBox sender) { if (sender.Text.Length < MinLength) { return; } if (doneEnter != null) { doneEnter(sender.Text); TextBox.Selected = false; } else { Game1.exitActiveMenu(); } }
public InventoryMenu(int xPos, int yPos, int width, int height, int Rows, int Collumns, bool showCloseButton, IList <Item> Inventory, int maxCapacity, Color BackgroundColor) : base(xPos, yPos, width, height, showCloseButton) { //Amount to display is the lower cap per page. // this.backgroundColor = BackgroundColor == null ? Color.White : BackgroundColor; this.items = Inventory; this.pages = new Dictionary <int, InventoryMenuPage>(); this.capacity = maxCapacity; this.rows = Rows; this.collumns = Collumns; this.populateClickableItems(this.rows, this.collumns, xPos + this.xOffset, yPos + this.yOffset); this.searchBox = new TextBox((Texture2D)null, (Texture2D)null, Game1.dialogueFont, Game1.textColor); this.searchBox.X = this.xPositionOnScreen; this.searchBox.Y = this.yPositionOnScreen; this.searchBox.Width = 256; this.searchBox.Height = 192; Game1.keyboardDispatcher.Subscriber = (IKeyboardSubscriber)this.searchBox; this.searchBox.Selected = false; this.nextPage = new AnimatedButton(new StardustCore.Animations.AnimatedSprite("Next Page", new Vector2(128 + (this.searchBox.X + this.searchBox.Width), this.searchBox.Y), new AnimationManager(TextureManager.GetExtendedTexture(ModCore.Manifest, "InventoryMenu", "NextPageButton"), new Animation(0, 0, 32, 32)), Color.White), new Rectangle(0, 0, 32, 32), 2f); this.previousPage = new AnimatedButton(new StardustCore.Animations.AnimatedSprite("Previous Page", new Vector2(64 + (this.searchBox.X + this.searchBox.Width), this.searchBox.Y), new AnimationManager(TextureManager.GetExtendedTexture(ModCore.Manifest, "InventoryMenu", "PreviousPageButton"), new Animation(0, 0, 32, 32)), Color.White), new Rectangle(0, 0, 32, 32), 2f); }
public static void showTextEntry(StardewValley.Menus.TextBox text_box) { }