refactor.

This commit is contained in:
2019-01-27 17:39:18 -06:00
parent 2788d9d349
commit 9d84b641db
15 changed files with 30 additions and 30 deletions

View File

@@ -0,0 +1,30 @@
using RecrownedAthenaeum.UI.Modular.Modules.Interactive;
using System;
namespace RecrownedAthenaeum.UI.SkinSystem.Definitions
{
/// <summary>
/// Definition for a button.
/// </summary>
public class ButtonSkinDefinition : ISkinDefinitionData
{
/// <summary>
/// Names for the regions in the texture atlas respectively.
/// </summary>
public string upRegion, downRegion, disabledRegion, selectedRegion;
///<inheritDoc/>
public Type UIModuleType { get { return typeof(Button); } }
/// <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)
{
this.downRegion = downRegion;
this.upRegion = upRegion;
}
}
}

View File

@@ -0,0 +1,15 @@
using System;
namespace RecrownedAthenaeum.UI.SkinSystem.Definitions
{
/// <summary>
/// A definition containing the data for the skin system. Should be in data transfer object model.
/// </summary>
public interface ISkinDefinitionData
{
/// <summary>
/// The module type this definition is definining.
/// </summary>
Type UIModuleType { get; }
}
}

View File

@@ -0,0 +1,31 @@
using RecrownedAthenaeum.UI.Modular.Modules.Interactive;
using System;
namespace RecrownedAthenaeum.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>
/// The type of module that will be using this definition.
/// </summary>
public new Type UIModuleType => typeof(TextButton);
/// <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)
{
}
}
}

View File

@@ -0,0 +1,16 @@
using System;
using static System.Net.Mime.MediaTypeNames;
namespace RecrownedAthenaeum.UI.SkinSystem.Definitions
{
class TextSkinDefinition : ISkinDefinitionData
{
public string color;
public Type UIModuleType { get { return typeof(Text); } }
public TextSkinDefinition(string color)
{
this.color = color;
}
}
}