diff --git a/RecrownedAthenaeum/UI/Modular/Modules/Interactive/Button.cs b/RecrownedAthenaeum/UI/Modular/Modules/Interactive/Button.cs index 2f5e4b2..5a1ffcc 100644 --- a/RecrownedAthenaeum/UI/Modular/Modules/Interactive/Button.cs +++ b/RecrownedAthenaeum/UI/Modular/Modules/Interactive/Button.cs @@ -9,7 +9,8 @@ namespace RecrownedAthenaeum.UI.Modular.Modules.Interactive /// /// Function to be called when button is clicked. /// - public delegate void Clicked(); + /// The button that was clicked. + public delegate void Clicked(Button button); /// /// A very primitive button containing all the basic functions. @@ -130,7 +131,7 @@ namespace RecrownedAthenaeum.UI.Modular.Modules.Interactive internal void OnClick() { - Listeners?.Invoke(); + Listeners?.Invoke(this); } } diff --git a/RecrownedAthenaeum/UI/Modular/Modules/Interactive/TextButton.cs b/RecrownedAthenaeum/UI/Modular/Modules/Interactive/TextButton.cs index a1417e3..e4d91f7 100644 --- a/RecrownedAthenaeum/UI/Modular/Modules/Interactive/TextButton.cs +++ b/RecrownedAthenaeum/UI/Modular/Modules/Interactive/TextButton.cs @@ -10,7 +10,10 @@ namespace RecrownedAthenaeum.UI.Modular.Modules.Interactive /// public class TextButton : Button { - private Text text; + /// + /// The text that is used to display the string. + /// + public readonly Text text; /// /// The color the font should be rendered in. @@ -28,10 +31,8 @@ namespace RecrownedAthenaeum.UI.Modular.Modules.Interactive /// What to draw as button is selected. public TextButton(string text, SpriteFont font, ISpecialDrawable down, ISpecialDrawable up, ISpecialDrawable disabled = null, ISpecialDrawable selected = null) : base(down, up, disabled, selected) { - this.text = new Text(font, text) - { - autoScale = true - }; + this.text = new Text(font, text); + this.text.autoScale = true; } ///