From 69d8e59e8bf1ceaf0547df5f932ab690ca0ee724 Mon Sep 17 00:00:00 2001 From: Recrown Date: Sun, 27 Jan 2019 14:57:35 -0600 Subject: [PATCH] changed skin merge system to completely using try and catch, as well as minor documentation change. --- RecrownedAthenaeum/UI/Skin/MergedSkin.cs | 9 +++++++-- RecrownedAthenaeum/UI/Skin/SkinManager.cs | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/RecrownedAthenaeum/UI/Skin/MergedSkin.cs b/RecrownedAthenaeum/UI/Skin/MergedSkin.cs index 99cfd56..b333335 100644 --- a/RecrownedAthenaeum/UI/Skin/MergedSkin.cs +++ b/RecrownedAthenaeum/UI/Skin/MergedSkin.cs @@ -23,8 +23,13 @@ namespace RecrownedAthenaeum.UI.Skin { get { - if (mainSkin.CursorTexture != null) return mainSkin.CursorTexture; - return alternateSkin.CursorTexture; + try + { + return mainSkin.CursorTexture; + } catch (NullReferenceException) + { + return alternateSkin.CursorTexture; + } } } diff --git a/RecrownedAthenaeum/UI/Skin/SkinManager.cs b/RecrownedAthenaeum/UI/Skin/SkinManager.cs index 0531552..5eada23 100644 --- a/RecrownedAthenaeum/UI/Skin/SkinManager.cs +++ b/RecrownedAthenaeum/UI/Skin/SkinManager.cs @@ -76,7 +76,7 @@ namespace RecrownedAthenaeum.UI.Skin public ISkin loadedSkin { get { return mergedSkin.mainSkin; } private set { mergedSkin.mainSkin = value; } } /// - /// 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. /// public ISkin BaseSkin { get { return mergedSkin.alternateSkin; } set { mergedSkin.alternateSkin = value; } }