Added better exception throwing for missing regions for skins by adding a required option for regions.

This commit is contained in:
2019-03-07 23:43:25 -06:00
parent 59771b00a8
commit ebe22fa9dc
5 changed files with 22 additions and 14 deletions

View File

@@ -39,8 +39,9 @@ namespace RecrownedAthenaeum.UI.SkinSystem
/// Returns a <see cref="TextureAtlas.Region"/> with given name of region.
/// </summary>
/// <param name="name">Name of region.</param>
/// <returns>The region corresponding to the name.</returns>
TextureAtlas.Region GetTextureAtlasRegion(string name);
/// <param name="required">Whether or not the region is required. If true, it will throw an error if the region does not exist while if false, will return null if the region does not exist.</param>
/// <returns>The region corresponding to the name and may return null depending on if the region exists, and is required.</returns>
TextureAtlas.Region GetTextureAtlasRegion(string name, bool required = false);
/// <summary>
/// Returns the proper definition for the given parameters or throws exception in the case the requested definition does not exist.