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,8 +23,13 @@ namespace RecrownedAthenaeum.UI.Skin
{ {
get get
{ {
if (mainSkin.CursorTexture != null) return mainSkin.CursorTexture; try
return alternateSkin.CursorTexture; {
return mainSkin.CursorTexture;
} catch (NullReferenceException)
{
return alternateSkin.CursorTexture;
}
} }
} }

View File

@ -76,7 +76,7 @@ namespace RecrownedAthenaeum.UI.Skin
public ISkin loadedSkin { get { return mergedSkin.mainSkin; } private set { mergedSkin.mainSkin = value; } } public ISkin loadedSkin { get { return mergedSkin.mainSkin; } private set { mergedSkin.mainSkin = value; } }
/// <summary> /// <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> /// </summary>
public ISkin BaseSkin { get { return mergedSkin.alternateSkin; } set { mergedSkin.alternateSkin = value; } } public ISkin BaseSkin { get { return mergedSkin.alternateSkin; } set { mergedSkin.alternateSkin = value; } }