diff --git a/RhythmBullet/RhythmBullet.csproj b/RhythmBullet/RhythmBullet.csproj index 398dffe..851a6f7 100644 --- a/RhythmBullet/RhythmBullet.csproj +++ b/RhythmBullet/RhythmBullet.csproj @@ -49,14 +49,17 @@ + + + - - + + diff --git a/RhythmBullet/Zer01HD/Utilities/ContentSystem/ContentSystem.cs b/RhythmBullet/Zer01HD/Utilities/ContentSystem/ContentSystem.cs index d416723..6a9d4b5 100644 --- a/RhythmBullet/Zer01HD/Utilities/ContentSystem/ContentSystem.cs +++ b/RhythmBullet/Zer01HD/Utilities/ContentSystem/ContentSystem.cs @@ -11,11 +11,11 @@ using System.Threading.Tasks; namespace RhythmBullet.Zer01HD.Utilities.ContentSystem { - public delegate void ContentUpdate(String fileName, float completed); + public delegate void ContentSystemUpdate(String fileName, float completed); public class ContentSystem { - public event ContentUpdate UpdateEvent; + public event ContentSystemUpdate ContentSystemListeners; Thread thread; readonly ContentManager contentManager; readonly Queue queue; @@ -44,7 +44,6 @@ namespace RhythmBullet.Zer01HD.Utilities.ContentSystem Debug.WriteLine("Loaded asset: " + assetName); } - public T Get(string assetName) { lock (queue) @@ -150,7 +149,7 @@ namespace RhythmBullet.Zer01HD.Utilities.ContentSystem protected virtual void OnProgress(string fileName, float progress) { - UpdateEvent?.Invoke(fileName, progress); + ContentSystemListeners?.Invoke(fileName, progress); } public float Progress diff --git a/RhythmBullet/Zer01HD/Utilities/UI/Book/Page.cs b/RhythmBullet/Zer01HD/Utilities/UI/Book/Page.cs index ea67815..a3bb50d 100644 --- a/RhythmBullet/Zer01HD/Utilities/UI/Book/Page.cs +++ b/RhythmBullet/Zer01HD/Utilities/UI/Book/Page.cs @@ -8,7 +8,7 @@ using System.Threading.Tasks; namespace RhythmBullet.Zer01HD.UI.Book { - class Page : ModuleGroup + class Page : UIModuleGroup { private readonly int pageX, pageY; diff --git a/RhythmBullet/Zer01HD/Utilities/UI/Interactive/BasicButton.cs b/RhythmBullet/Zer01HD/Utilities/UI/Interactive/BasicButton.cs index 2e963af..9337c9d 100644 --- a/RhythmBullet/Zer01HD/Utilities/UI/Interactive/BasicButton.cs +++ b/RhythmBullet/Zer01HD/Utilities/UI/Interactive/BasicButton.cs @@ -1,4 +1,7 @@ -using System; +using Microsoft.Xna.Framework.Input; +using RhythmBullet.Zer01HD.UI.Modular; +using RhythmBullet.Zer01HD.Utilities.Input; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -6,8 +9,40 @@ using System.Threading.Tasks; namespace RhythmBullet.Zer01HD.Utilities.UI.Interactive { - class BasicButton + public delegate bool Clicked(); + + public class BasicButton : UIModuleGroup { - + public event Clicked Listeners; + public BasicButton() + { + + } + + + + public sealed override bool MouseStateChanged(MouseState state) + { + if (InputUtilities.MouseWithinBoundries(Bounds)) + { + if (InputUtilities.MouseClicked()) + { + OnClick(); + } + Highlighted = true; + } else + { + Highlighted = false; + } + + return base.MouseStateChanged(state); + } + + protected void OnClick() + { + Listeners?.Invoke(); + } + + public bool Highlighted { get; private set; } } }