changed skin merge system to completely using try and catch, as well as minor documentation change.

This commit is contained in:
Harrison Deng 2019-01-27 14:57:35 -06:00
parent 067defc8c6
commit 69d8e59e8b
2 changed files with 8 additions and 3 deletions

View File

@ -23,10 +23,15 @@ namespace RecrownedAthenaeum.UI.Skin
{
get
{
if (mainSkin.CursorTexture != null) return mainSkin.CursorTexture;
try
{
return mainSkin.CursorTexture;
} catch (NullReferenceException)
{
return alternateSkin.CursorTexture;
}
}
}
public void Draw(string regionName, string color, SpriteBatch batch, Rectangle destination, float rotation = 0, Vector2 origin = default(Vector2))
{

View File

@ -76,7 +76,7 @@ namespace RecrownedAthenaeum.UI.Skin
public ISkin loadedSkin { get { return mergedSkin.mainSkin; } private set { mergedSkin.mainSkin = value; } }
/// <summary>
/// The fallback skin in case the selected skin doesn't cover a specific definition or color.
/// The default skin in case the selected skin doesn't cover a specific definition or color.
/// </summary>
public ISkin BaseSkin { get { return mergedSkin.alternateSkin; } set { mergedSkin.alternateSkin = value; } }