refactor.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
@@ -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; }
|
||||
}
|
||||
}
|
@@ -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)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user