Replaced color usage with OpenTK's implementation.

This commit is contained in:
2019-12-28 15:41:06 -06:00
parent c9ad922341
commit 005d66840d
31 changed files with 155 additions and 139 deletions

View File

@@ -0,0 +1,28 @@
using RecrownedAthenaeum.Graphics.UI.Modular.Modules.Interactive;
namespace RecrownedAthenaeum.Graphics.UI.SkinSystem.Definitions
{
/// <summary>
/// Skin definition for a button.
/// </summary>
public class ButtonSkinDefinition : SkinDefinitionData
{
/// <summary>
/// Names for the regions in the texture atlas respectively.
/// </summary>
public string upRegion, downRegion, disabledRegion, selectedRegion;
/// <summary>
/// Constructs the definition with minimum requirements.
/// </summary>
/// <param name="downRegion">Name of region specifying the texture shown for when the button is pressed down.</param>
/// <param name="upRegion">Name of region specifying the texture shown for when the button is not pressed.</param>
public ButtonSkinDefinition(string downRegion, string upRegion)
{
UIModuleType = typeof(Button);
this.downRegion = downRegion;
this.upRegion = upRegion;
}
}
}

View File

@@ -0,0 +1,20 @@
using System;
namespace RecrownedAthenaeum.Graphics.UI.SkinSystem.Definitions
{
/// <summary>
/// A definition containing the data for the skin system. Needs to follow data transfer object model.
/// </summary>
public abstract class SkinDefinitionData
{
/// <summary>
/// The full name of the UI module this definition defines.
/// </summary>
public string uiModuleTypeFullName;
/// <summary>
/// Sets the module type by setting <see cref="uiModuleTypeFullName"/>.
/// </summary>
public Type UIModuleType { set { uiModuleTypeFullName = value.FullName; } }
}
}

View File

@@ -0,0 +1,25 @@
using RecrownedAthenaeum.Graphics.UI.Modular.Modules.Interactive;
namespace RecrownedAthenaeum.Graphics.UI.SkinSystem.Definitions
{
/// <summary>
/// Definition for a text button for a skin theme.
/// </summary>
public class TextButtonSkinDefinition : ButtonSkinDefinition
{
/// <summary>
/// Name of color from the skin to use for the font.
/// </summary>
public string fontColor;
/// <summary>
/// Creates this definition with the most minimal requirements.
/// </summary>
/// <param name="downRegion">Texture region from skin that represents when the button is pressed down.</param>
/// <param name="upRegion">The texture region that represents when the button is not pressed.</param>
public TextButtonSkinDefinition(string downRegion, string upRegion) : base(downRegion, upRegion)
{
UIModuleType = typeof(TextButton);
}
}
}

View File

@@ -0,0 +1,32 @@
using RecrownedAthenaeum.Graphics.UI.Modular.Modules;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RecrownedAthenaeum.Graphics.UI.SkinSystem.Definitions
{
/// <summary>
/// Skin definition of a scroll module.
/// </summary>
public class UIScrollableSkinDefinition : SkinDefinitionData
{
/// <summary>
/// Name of the region that specifies the texture needed.
/// </summary>
public string horizontalBar, verticalBar, horizontalBarTrack, verticalBarTrack, background;
/// <summary>
/// Instantiates the definition with the minimum requirements.
/// </summary>
/// <param name="horizontalBar">Name of the region used by the skin that defines what the horizontal scroll bar looks like.</param>
/// <param name="verticalBar">Name of the region used by the skin that defines what the vertical scroll bar looks like.</param>
public UIScrollableSkinDefinition(string horizontalBar, string verticalBar)
{
this.horizontalBar = horizontalBar;
this.verticalBar = verticalBar;
UIModuleType = typeof(UIScrollable);
}
}
}