changes in how skin system works.

This commit is contained in:
2019-01-29 16:22:14 -06:00
parent 359f3381bf
commit 32f9ff11fb
10 changed files with 44 additions and 62 deletions

View File

@@ -6,16 +6,13 @@ namespace RecrownedAthenaeum.UI.SkinSystem.Definitions
/// <summary>
/// Definition for a button.
/// </summary>
public class ButtonSkinDefinition : ISkinDefinitionData
public class ButtonSkinDefinition : SkinDefinitionData
{
/// <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>
@@ -23,8 +20,10 @@ namespace RecrownedAthenaeum.UI.SkinSystem.Definitions
/// <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

@@ -1,15 +0,0 @@
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,20 @@
using System;
namespace RecrownedAthenaeum.UI.SkinSystem.Definitions
{
/// <summary>
/// A definition containing the data for the skin system. Needs to follow data transfer object model.
/// </summary>
public 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

@@ -13,11 +13,6 @@ namespace RecrownedAthenaeum.UI.SkinSystem.Definitions
/// </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>
@@ -25,7 +20,7 @@ namespace RecrownedAthenaeum.UI.SkinSystem.Definitions
/// <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

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